org.xsocket.connection
Interface IDisconnectHandler
- All Superinterfaces:
- IHandler
- All Known Implementing Classes:
- HandlerChain
public interface IDisconnectHandler
- extends IHandler
Handles the disconnecting of connections.
The disconnecting of a connection occurs in three ways:
- the client initiates the disconnect by closing the connection. In this case the
onDisconnect method will be called immediately
- the connection breaks or the client disconnects improperly and the underlying SocketChannel
detects the broken connection. In this case the
onDisconnect method will be
called, when
the broken connection will be detected
- the connection breaks or the client disconnects improperly and the underlying SocketChannel
does not detect the broken connection. In this case the
onDisconnect method
will only be called after a connection or idle timeout (see IIdleTimeoutHandler, IConnectionTimeoutHandler)
onDisconnect
boolean onDisconnect(INonBlockingConnection connection)
throws IOException
- handles disconnecting of a connection
- Parameters:
connection - the closed connection
- Returns:
- true for positive result of handling, false for negative result of handling
- Throws:
IOException - If some I/O error occurs.