org.xsocket.stream
Interface IConnectHandler
- All Superinterfaces:
- IHandler
- All Known Implementing Classes:
- HandlerChain
public interface IConnectHandler
- extends IHandler
Handles new incomming connections.
E.g.
public final class BlackIpHandler implements IConnectHandler {
...
public boolean onConnect(INonBlockingConnection connection) throws IOException {
connection.setAutoflush(false);
connection.setFlushmode(FlushMode.ASYNC);
...
return true;
}
}
onConnect
boolean onConnect(INonBlockingConnection connection)
throws java.io.IOException
- handles a new incomming connection
- Returns:
- true for positive result of handling, false for negative result of handling
- Throws:
java.io.IOException
- If some other I/O error occurs. Throwing this exception causes that the underlying connection will be closed.