Class: ShadowsocksRuby::Connections::TCP::DestinationConnection
- Inherits:
-
BackendConnection
- Object
- EventMachine::Connection
- Connection
- BackendConnection
- ShadowsocksRuby::Connections::TCP::DestinationConnection
- Defined in:
- lib/shadowsocks_ruby/connections/tcp/destination_connection.rb
Overview
A DestinationConnection’s job is relay data from destination to localbackend.
Constant Summary
Constants inherited from Connection
Instance Attribute Summary
Attributes inherited from BackendConnection
Attributes inherited from Connection
Instance Method Summary collapse
-
#process_hook ⇒ Object
This is Called by process loop.
Methods inherited from BackendConnection
#connection_completed, #initialize, #send_data
Methods inherited from Connection
#async_recv, #async_recv_until, #peer, #send_data, #unbind
Constructor Details
This class inherits a constructor from ShadowsocksRuby::Connections::BackendConnection
Instance Method Details
#process_hook ⇒ Object
This is Called by process loop
8 9 10 11 12 |
# File 'lib/shadowsocks_ruby/connections/tcp/destination_connection.rb', line 8 def process_hook #plexer.packet_protocol.tcp_send_to_localbackend(packet_protocol.tcp_receive_from_destination(-1)) data = packet_protocol.tcp_receive_from_destination(-1) plexer.packet_protocol.tcp_send_to_localbackend(data) end |