org.xsocket.datagram
Interface IConnectedEndpoint
- All Superinterfaces:
- java.io.Closeable, IEndpoint
- All Known Implementing Classes:
- ConnectedEndpoint, MulticastEndpoint
public interface IConnectedEndpoint
- extends IEndpoint
An connected endpoint, which receives/sends data only from/to from the assigned connected endpoint. E.g.
...
IConnectedEndpoint endpoint = new ConnectedEndpoint(remoteHostname, remotePort, packageSize);
UserDatagram request = new UserDatagram(packageSize);
request.write("Hello peer, how are you?");
endpoint.send(request);
UserDatagram response = endpoint.receive(1000); // receive (timeout 1 sec)
endpoint.close();
...
Method Summary |
java.net.SocketAddress |
getRemoteSocketAddress()
return the connected remote address or null if not connected |
Methods inherited from interface org.xsocket.datagram.IEndpoint |
getDefaultEncoding, getId, getLocalAddress, getLocalPort, getLocalSocketAddress, getOption, getOptions, getReceiveSize, isOpen, receive, receive, send, setDefaultEncoding, setReceiveSize, setWorkerPool |
Methods inherited from interface java.io.Closeable |
close |
getRemoteSocketAddress
java.net.SocketAddress getRemoteSocketAddress()
- return the connected remote address or null if not connected
- Returns:
- the connected address