Handles connection timeout. The timeouts will be defined by the server. To modify the timeouts
the proper server methods has to be called. E.g.
...
IServer server = new Server(new MyHandler());
server.setConnectionTimeoutSec(60);
ConnectionUtils.start(server);
...
class MyHandler implements IConnectionTimeoutHandler {
public boolean onConnectionTimeout(INonBlockingConnection connection) throws IOException {
...
connection.close();
return true; // true -> event has been handled
}
}
author: grro@xsocket.org |