|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ITimeoutHandler
Handles timeout. The timeouts will be defined by the server. To modify the timeouts
the proper server methods has to be called. E.g.
... IMultithreadedServer server = new MultithreadedServer(new MyHandler()); server.setIdleTimeoutSec(60); StreamUtils.start(server); ... class MyHandler implements ITimeoutHandler { public boolean onConnectionTimeout(INonBlockingConnection connection) throws IOException { ... connection.close(); return true; // true -> event has been handled } public boolean onIdleTimeout(INonBlockingConnection connection) throws IOException { ... connection.close(); return true; // true -> event has been handled } }
Method Summary | |
---|---|
boolean |
onConnectionTimeout(INonBlockingConnection connection)
handles the connection timeout. |
boolean |
onIdleTimeout(INonBlockingConnection connection)
handles the idle timeout. |
Method Detail |
---|
boolean onIdleTimeout(INonBlockingConnection connection) throws java.io.IOException
connection
- the underlying connection
java.io.IOException
- if an error occurs. Throwing this exception causes that the underlying connection will be closed.boolean onConnectionTimeout(INonBlockingConnection connection) throws java.io.IOException
connection
- the underlying connection
java.io.IOException
- if an error occurs. Throwing this exception causes that the underlying connection will be closed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |