Class: SSLGate::RawClient
- Inherits:
-
EM::Connection
- Object
- EM::Connection
- SSLGate::RawClient
- Defined in:
- lib/ssl_gate/raw_gate.rb
Instance Attribute Summary collapse
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
Instance Method Summary collapse
-
#initialize(q, parent) ⇒ RawClient
constructor
A new instance of RawClient.
- #receive_data(data) ⇒ Object
- #unbind ⇒ Object
Constructor Details
#initialize(q, parent) ⇒ RawClient
Returns a new instance of RawClient.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ssl_gate/raw_gate.rb', line 8 def initialize(q, parent) set_sock_opt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) # Nagle off @parent = parent @queue = q cb = proc do |msg| msg ? send_data(msg) : close_connection q.pop(&cb) end q.pop(&cb) end |
Instance Attribute Details
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
6 7 8 |
# File 'lib/ssl_gate/raw_gate.rb', line 6 def queue @queue end |
Instance Method Details
#receive_data(data) ⇒ Object
21 22 23 |
# File 'lib/ssl_gate/raw_gate.rb', line 21 def receive_data(data) @parent.send_data data end |
#unbind ⇒ Object
25 26 27 |
# File 'lib/ssl_gate/raw_gate.rb', line 25 def unbind @parent.close_connection end |