Class: MTUV::InboundConnection
- Inherits:
-
TcpConnection
- Object
- Connection
- TcpConnection
- MTUV::InboundConnection
- Defined in:
- lib/mt-uv-rays/connection.rb
Instance Attribute Summary
Attributes inherited from Connection
Instance Method Summary collapse
-
#initialize(tcp) ⇒ InboundConnection
constructor
A new instance of InboundConnection.
- #use_tls(args = {}) ⇒ Object
Methods inherited from TcpConnection
#close_connection, #keepalive, #on_close, #on_connect, #stream_file, #write
Methods inherited from Connection
#close_connection, #on_read, #pause, #paused?, #post_init, #resume
Constructor Details
#initialize(tcp) ⇒ InboundConnection
Returns a new instance of InboundConnection.
107 108 109 110 111 112 113 114 |
# File 'lib/mt-uv-rays/connection.rb', line 107 def initialize(tcp) super() @reactor = tcp.reactor @transport = tcp @transport.finally { on_close } @transport.progress { |*data| on_read(*data) } end |
Instance Method Details
#use_tls(args = {}) ⇒ Object
116 117 118 119 120 121 122 123 124 |
# File 'lib/mt-uv-rays/connection.rb', line 116 def use_tls(args = {}) args[:server] = true if @transport.connected @transport.start_tls(args) else @using_tls = args end end |