Class: Shadowsocks::Listener
- Inherits:
-
Connection
- Object
- EventMachine::Connection
- Connection
- Shadowsocks::Listener
- Includes:
- Table
- Defined in:
- lib/shadowsocks/listener.rb
Direct Known Subclasses
Constant Summary
Constants inherited from Connection
Instance Attribute Summary collapse
-
#addr_to_send ⇒ Object
Returns the value of attribute addr_to_send.
-
#cached_pieces ⇒ Object
Returns the value of attribute cached_pieces.
-
#config ⇒ Object
Returns the value of attribute config.
-
#connector ⇒ Object
Returns the value of attribute connector.
-
#header_length ⇒ Object
Returns the value of attribute header_length.
-
#remote_addr ⇒ Object
Returns the value of attribute remote_addr.
-
#remote_port ⇒ Object
Returns the value of attribute remote_port.
-
#stage ⇒ Object
Returns the value of attribute stage.
-
#table ⇒ Object
Returns the value of attribute table.
Instance Method Summary collapse
Methods included from Table
#encrypt, #get_table, #merge, #merge_sort
Methods included from Ext
Instance Attribute Details
#addr_to_send ⇒ Object
Returns the value of attribute addr_to_send.
5 6 7 |
# File 'lib/shadowsocks/listener.rb', line 5 def addr_to_send @addr_to_send end |
#cached_pieces ⇒ Object
Returns the value of attribute cached_pieces.
5 6 7 |
# File 'lib/shadowsocks/listener.rb', line 5 def cached_pieces @cached_pieces end |
#config ⇒ Object
Returns the value of attribute config.
5 6 7 |
# File 'lib/shadowsocks/listener.rb', line 5 def config @config end |
#connector ⇒ Object
Returns the value of attribute connector.
5 6 7 |
# File 'lib/shadowsocks/listener.rb', line 5 def connector @connector end |
#header_length ⇒ Object
Returns the value of attribute header_length.
5 6 7 |
# File 'lib/shadowsocks/listener.rb', line 5 def header_length @header_length end |
#remote_addr ⇒ Object
Returns the value of attribute remote_addr.
5 6 7 |
# File 'lib/shadowsocks/listener.rb', line 5 def remote_addr @remote_addr end |
#remote_port ⇒ Object
Returns the value of attribute remote_port.
5 6 7 |
# File 'lib/shadowsocks/listener.rb', line 5 def remote_port @remote_port end |
#stage ⇒ Object
Returns the value of attribute stage.
5 6 7 |
# File 'lib/shadowsocks/listener.rb', line 5 def stage @stage end |
#table ⇒ Object
Returns the value of attribute table.
5 6 7 |
# File 'lib/shadowsocks/listener.rb', line 5 def table @table end |
Instance Method Details
#post_init ⇒ Object
13 14 15 16 17 |
# File 'lib/shadowsocks/listener.rb', line 13 def post_init @stage = 0 @cached_pieces = [] puts "A client has connected..." end |
#receive_data(data) ⇒ Object
8 9 10 11 |
# File 'lib/shadowsocks/listener.rb', line 8 def receive_data data data_handler data outbound_checker if connector end |
#remote ⇒ Object
24 25 26 |
# File 'lib/shadowsocks/listener.rb', line 24 def remote connector end |
#unbind ⇒ Object
19 20 21 22 |
# File 'lib/shadowsocks/listener.rb', line 19 def unbind puts "A client has left..." connection_cleanup end |