Method: EventMachine::Connection#unbind
- Defined in:
- lib/em/connection.rb
#unbind ⇒ Object
called by the framework whenever a connection (either a server or client connection) is closed. The close can occur because your code intentionally closes it (using #close_connection and #close_connection_after_writing), because the remote peer closed the connection, or because of a network error. You may not assume that the network connection is still open and able to send or receive data when the callback to unbind is made. This is intended only to give you a chance to clean up associations your code may have made to the connection object while it was open.
If you want to detect which peer has closed the connection, you can override #close_connection in your protocol handler and set an @ivar.
212 213 |
# File 'lib/em/connection.rb', line 212 def unbind end |