org.xsocket.stream
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 conection will be detected
- the connection breaks or the client disconnects improperly and the underlying SocketChannel
doesn`t detect the broken connection. In this case the
onDisconnect
method
will only be called after a connection or idle timeout (see ITimeoutHandler
)
onDisconnect
boolean onDisconnect(INonBlockingConnection connection)
throws java.io.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:
java.io.IOException
- If some I/O error occurs.