Class: EventMachine::Connection
- Inherits:
-
Object
- Object
- EventMachine::Connection
- Defined in:
- lib/em/connection.rb
Instance Attribute Summary collapse
-
#netty_handler ⇒ Object
writeonly
Sets the attribute netty_handler.
Class Method Summary collapse
Instance Method Summary collapse
- #close_connection(after_writing = false) ⇒ Object
- #close_connection_after_writing ⇒ Object
- #get_peername ⇒ Object
-
#initialize(*args) ⇒ Connection
constructor
A new instance of Connection.
- #post_init ⇒ Object
- #receive_data(data) ⇒ Object
- #send_data(data) ⇒ Object
- #start_tls(args = {}) ⇒ Object
- #unbind ⇒ Object
Constructor Details
#initialize(*args) ⇒ Connection
Returns a new instance of Connection.
14 |
# File 'lib/em/connection.rb', line 14 def initialize(*args); end |
Instance Attribute Details
#netty_handler=(value) ⇒ Object (writeonly)
Sets the attribute netty_handler
5 6 7 |
# File 'lib/em/connection.rb', line 5 def netty_handler=(value) @netty_handler = value end |
Class Method Details
.new(*args) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/em/connection.rb', line 7 def self.new(*args) allocate.instance_eval do initialize(*args) self end end |
Instance Method Details
#close_connection(after_writing = false) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/em/connection.rb', line 30 def close_connection(after_writing=false) if after_writing @close_scheduled = true else @netty_handler.close end end |
#close_connection_after_writing ⇒ Object
38 39 40 |
# File 'lib/em/connection.rb', line 38 def close_connection_after_writing close_connection(true) end |
#get_peername ⇒ Object
42 43 44 |
# File 'lib/em/connection.rb', line 42 def get_peername @netty_handler.peername end |
#post_init ⇒ Object
20 |
# File 'lib/em/connection.rb', line 20 def post_init; end |
#receive_data(data) ⇒ Object
26 27 28 |
# File 'lib/em/connection.rb', line 26 def receive_data(data) puts 'Incoming data...' end |
#send_data(data) ⇒ Object
16 17 18 |
# File 'lib/em/connection.rb', line 16 def send_data(data) @netty_handler.write(data) end |
#start_tls(args = {}) ⇒ Object
24 |
# File 'lib/em/connection.rb', line 24 def start_tls(args={}); end |
#unbind ⇒ Object
22 |
# File 'lib/em/connection.rb', line 22 def unbind; end |