org.xsocket.datagram
Interface IDatagramHandler
public interface IDatagramHandler
Endpoint handler, which will be used by receiving a datagram in a asynchronous manner. E.g.
class MyHandler implements IDatagramHandler {
public boolean onDatagram(IEndpoint localEndpoint) throws IOException {
UserDatagram datagram = localEndpoint.receive(); // get the datagram
...
return true; // true -> signal that this event has been handled
}
}
onDatagram
boolean onDatagram(IEndpoint localEndpoint)
throws java.io.IOException
- signals a incoming datagram
- Parameters:
localEndpoint
- the local endpoint
- Returns:
- true if the event has been handled
- Throws:
java.io.IOException
- If some other I/O error occurs