SocketOptions

public interface SocketOptions
Known Indirect Subclasses

Interface of methods to get/set socket options. This interface is implemented by: SocketImpl and DatagramSocketImpl. Subclasses of these should override the methods of this interface in order to support their own options.

The methods and constants which specify options in this interface are for implementation only. If you're not subclassing SocketImpl or DatagramSocketImpl, you won't use these directly. There are type-safe methods to get/set each of these options in Socket, ServerSocket, DatagramSocket and MulticastSocket.

Constant Summary

int IP_MULTICAST_IF Set which outgoing interface on which to send multicast packets.
int IP_MULTICAST_IF2 Same as above.
int IP_MULTICAST_LOOP This option enables or disables local loopback of multicast datagrams.
int IP_TOS This option sets the type-of-service or traffic class field in the IP header for a TCP or UDP socket.
int SO_BINDADDR Fetch the local address binding of a socket (this option cannot be "set" only "gotten", since sockets are bound at creation time, and so the locally bound address cannot be changed).
int SO_BROADCAST Sets SO_BROADCAST for a socket.
int SO_KEEPALIVE When the keepalive option is set for a TCP socket and no data has been exchanged across the socket in either direction for 2 hours (NOTE: the actual value is implementation dependent), TCP automatically sends a keepalive probe to the peer.
int SO_LINGER Specify a linger-on-close timeout.
int SO_OOBINLINE When the OOBINLINE option is set, any TCP urgent data received on the socket will be received through the socket input stream.
int SO_RCVBUF Set a hint the size of the underlying buffers used by the platform for incoming network I/O.
int SO_REUSEADDR Sets SO_REUSEADDR for a socket.
int SO_SNDBUF Set a hint the size of the underlying buffers used by the platform for outgoing network I/O.
int SO_TIMEOUT Set a timeout on blocking Socket operations:
 ServerSocket.accept();
 SocketInputStream.read();
 DatagramSocket.receive();
 

The option must be set prior to entering a blocking operation to take effect.

int