Class: EventMachine::Connection
- Inherits:
-
SimpleChannelUpstreamHandler
- Object
- SimpleChannelUpstreamHandler
- EventMachine::Connection
- Defined in:
- lib/em/connection.rb
Instance Method Summary collapse
- #close_connection(after_writing = false) ⇒ Object
- #close_connection_after_writing ⇒ Object
- #get_peername ⇒ Object
- #post_init ⇒ Object
- #receive_data(data) ⇒ Object
- #send_data(data) ⇒ Object
- #start_tls(args = {}) ⇒ Object
- #unbind ⇒ Object
Instance Method Details
#close_connection(after_writing = false) ⇒ Object
24 25 26 |
# File 'lib/em/connection.rb', line 24 def close_connection(after_writing=false) @channel.close end |
#close_connection_after_writing ⇒ Object
28 29 30 |
# File 'lib/em/connection.rb', line 28 def close_connection_after_writing close_connection(true) end |
#get_peername ⇒ Object
32 33 34 35 |
# File 'lib/em/connection.rb', line 32 def get_peername addr = @channel.getRemoteAddress [addr.getPort, addr.getHostString] end |
#post_init ⇒ Object
14 |
# File 'lib/em/connection.rb', line 14 def post_init; end |
#receive_data(data) ⇒ Object
20 21 22 |
# File 'lib/em/connection.rb', line 20 def receive_data(data) puts 'Incoming data...' end |
#send_data(data) ⇒ Object
9 10 11 12 |
# File 'lib/em/connection.rb', line 9 def send_data(data) buf = ChannelBuffers.copiedBuffer(data, "UTF-8") @channel.write(buf) end |
#start_tls(args = {}) ⇒ Object
18 |
# File 'lib/em/connection.rb', line 18 def start_tls(args={}); end |
#unbind ⇒ Object
16 |
# File 'lib/em/connection.rb', line 16 def unbind; end |