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
- #broadcast(data) ⇒ Object
- #close_connection(after_writing = false) ⇒ Object
- #close_connection_after_writing ⇒ Object
- #comm_inactivity_timeout=(seconds) ⇒ Object
- #get_peername ⇒ Object
-
#initialize(*args) ⇒ Connection
constructor
A new instance of Connection.
- #post_init ⇒ Object
- #receive_data(data) ⇒ Object
- #send_data(data) ⇒ Object
- #send_file_data(path) ⇒ 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
#broadcast(data) ⇒ Object
20 21 22 |
# File 'lib/em/connection.rb', line 20 def broadcast(data) @netty_handler.write(data, true) end |
#close_connection(after_writing = false) ⇒ Object
38 39 40 |
# File 'lib/em/connection.rb', line 38 def close_connection(after_writing=false) @netty_handler.close end |
#close_connection_after_writing ⇒ Object
42 43 44 |
# File 'lib/em/connection.rb', line 42 def close_connection_after_writing close_connection(true) end |
#comm_inactivity_timeout=(seconds) ⇒ Object
50 51 52 |
# File 'lib/em/connection.rb', line 50 def comm_inactivity_timeout=(seconds) @netty_handler.set_read_timeout(seconds) end |
#get_peername ⇒ Object
46 47 48 |
# File 'lib/em/connection.rb', line 46 def get_peername @netty_handler.peername end |
#post_init ⇒ Object
28 |
# File 'lib/em/connection.rb', line 28 def post_init; end |
#receive_data(data) ⇒ Object
34 35 36 |
# File 'lib/em/connection.rb', line 34 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 |
#send_file_data(path) ⇒ Object
24 25 26 |
# File 'lib/em/connection.rb', line 24 def send_file_data(path) @netty_handler.send_file(path) end |
#start_tls(args = {}) ⇒ Object
32 |
# File 'lib/em/connection.rb', line 32 def start_tls(args={}); end |
#unbind ⇒ Object
30 |
# File 'lib/em/connection.rb', line 30 def unbind; end |