Class: TelnetQ::SocketQ
Constant Summary collapse
- VERB_NAMES =
{ 251 => :will, 252 => :wont, 253 => :do, 254 => :dont, }.freeze
- VERB_NUMS =
VERB_NAMES.invert.freeze
Instance Method Summary collapse
-
#initialize(connection, options = {}) ⇒ SocketQ
constructor
A new instance of SocketQ.
-
#received_raw_message(raw) ⇒ Object
Invoke this when a TELNET negotiation message is received.
Methods inherited from Base
#enabled?, #forbid, #inspect, #received_message, #request, #start
Constructor Details
#initialize(connection, options = {}) ⇒ SocketQ
Returns a new instance of SocketQ.
15 16 17 18 |
# File 'lib/telnet_q/socket_q.rb', line 15 def initialize(connection, ={}) @connection = connection super() end |
Instance Method Details
#received_raw_message(raw) ⇒ Object
Invoke this when a TELNET negotiation message is received.
Example usage:
sq = TelnetQ::SocketQ.new(connection, ...)
sq.received_raw_message("\377\375\000") # Remote party requesting that we enable binary transmission on our side
sq.received_raw_message("\377\373\000") # Remote party requesting that to enable binary transmission on his side.
26 27 28 29 |
# File 'lib/telnet_q/socket_q.rb', line 26 def (raw) verb, option = (raw) (verb, option) end |