Class: Shadowsocks::Listener
- Inherits:
-
Connection
- Object
- EventMachine::Connection
- Connection
- Shadowsocks::Listener
- 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.
Attributes inherited from Connection
Instance Method Summary collapse
Instance Attribute Details
#addr_to_send ⇒ Object
Returns the value of attribute addr_to_send.
3 4 5 |
# File 'lib/shadowsocks/listener.rb', line 3 def addr_to_send @addr_to_send end |
#cached_pieces ⇒ Object
Returns the value of attribute cached_pieces.
3 4 5 |
# File 'lib/shadowsocks/listener.rb', line 3 def cached_pieces @cached_pieces end |
#config ⇒ Object
Returns the value of attribute config.
3 4 5 |
# File 'lib/shadowsocks/listener.rb', line 3 def config @config end |
#connector ⇒ Object
Returns the value of attribute connector.
3 4 5 |
# File 'lib/shadowsocks/listener.rb', line 3 def connector @connector end |
#header_length ⇒ Object
Returns the value of attribute header_length.
3 4 5 |
# File 'lib/shadowsocks/listener.rb', line 3 def header_length @header_length end |
#remote_addr ⇒ Object
Returns the value of attribute remote_addr.
3 4 5 |
# File 'lib/shadowsocks/listener.rb', line 3 def remote_addr @remote_addr end |
#remote_port ⇒ Object
Returns the value of attribute remote_port.
3 4 5 |
# File 'lib/shadowsocks/listener.rb', line 3 def remote_port @remote_port end |
#stage ⇒ Object
Returns the value of attribute stage.
3 4 5 |
# File 'lib/shadowsocks/listener.rb', line 3 def stage @stage end |
Instance Method Details
#post_init ⇒ Object
11 12 13 14 15 |
# File 'lib/shadowsocks/listener.rb', line 11 def post_init @stage = 0 @cached_pieces = [] puts "A client has connected..." end |
#receive_data(data) ⇒ Object
6 7 8 9 |
# File 'lib/shadowsocks/listener.rb', line 6 def receive_data data data_handler data outbound_checker if connector end |
#remote ⇒ Object
22 23 24 |
# File 'lib/shadowsocks/listener.rb', line 22 def remote connector end |
#unbind ⇒ Object
17 18 19 20 |
# File 'lib/shadowsocks/listener.rb', line 17 def unbind puts "A client has left..." connection_cleanup end |