org.xsocket.datagram
Interface IConnectedEndpoint

Package class diagram package 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();
  ...
 


Field Summary
 
Fields inherited from interface org.xsocket.datagram.IEndpoint
DEFAULT_HOST_ADDRESS, IP_MULTICAST_LOOP, IP_MULTICAST_TTL, IP_TOS, SO_BROADCAST, SO_RCVBUF, SO_REUSEADDR, SO_SNDBUF
 
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
 

Method Detail

getRemoteSocketAddress

java.net.SocketAddress getRemoteSocketAddress()
return the connected remote address or null if not connected

Returns:
the connected address