Class: OtStatus::Query::Connection
- Inherits:
-
EventMachine::Connection
- Object
- EventMachine::Connection
- OtStatus::Query::Connection
- Defined in:
- lib/otstatus.rb
Constant Summary collapse
- QUERY =
[6.chr, 0.chr, 255.chr, 255.chr, 'info'].join
Instance Attribute Summary collapse
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
-
#initialize(query, connect_timeout, inactivity_timeout) ⇒ Connection
constructor
A new instance of Connection.
- #post_init ⇒ Object
- #receive_data(data) ⇒ Object
- #unbind ⇒ Object
Constructor Details
#initialize(query, connect_timeout, inactivity_timeout) ⇒ Connection
Returns a new instance of Connection.
36 37 38 39 40 |
# File 'lib/otstatus.rb', line 36 def initialize query, connect_timeout, inactivity_timeout @query = query self.pending_connect_timeout = connect_timeout self.comm_inactivity_timeout = inactivity_timeout end |
Instance Attribute Details
#query ⇒ Object (readonly)
Returns the value of attribute query.
34 35 36 |
# File 'lib/otstatus.rb', line 34 def query @query end |
Instance Method Details
#post_init ⇒ Object
42 43 44 45 |
# File 'lib/otstatus.rb', line 42 def post_init send_data QUERY @data = "" end |
#receive_data(data) ⇒ Object
47 48 49 50 |
# File 'lib/otstatus.rb', line 47 def receive_data data @data << data query.response = @data end |
#unbind ⇒ Object
52 53 54 |
# File 'lib/otstatus.rb', line 52 def unbind EventMachine::stop_event_loop end |