java.net
public interface SocketOptions
SocketImpl and
DatagramSocketImpl to implement options
on sockets.
Since: 1.2
UNKNOWN: should be completely JDK 1.4 compatible
| Field Summary | |
|---|---|
| int | IP_MULTICAST_IF
Options id for the IP_MULTICAST_IF value |
| 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
Retrieve the local address to which the socket is bound. |
| int | SO_BROADCAST
Sets SO_BROADCAST for a socket |
| int | SO_KEEPALIVE
Option id for the SO_KEEPALIVE value |
| int | SO_LINGER
Option id for the SO_LINGER value |
| int | SO_OOBINLINE
Sets SO_OOBINLINE for a socket |
| int | SO_RCVBUF
Option id for the receive buffer size |
| int | SO_REUSEADDR
Sets the SO_REUSEADDR parameter on a socket |
| int | SO_SNDBUF
Option id for the send buffer size |
| int | SO_TIMEOUT
Option id for the SO_TIMEOUT value |
| int | TCP_NODELAY
Option id for the TCP_NODELAY value |
| Method Summary | |
|---|---|
| Object | getOption(int optionId)
Returns the current setting of the specified option. |
| void | setOption(int optionId, Object val)
Sets the specified option on a socket to the passed in object. |
Since: 1.4
Since: 1.4
Since: 1.4
Since: 1.4
Since: 1.3
Since: 1.4
Since: 1.2
Since: 1.2
Object returned will be an Integer for options
that have integer values. For options that are set to on or off, a
Boolean will be returned. The optionId
parameter is one of the defined constants in this interface.
Parameters: optionId The option identifier
Returns: The current value of the option
Throws: SocketException If an error occurs
Integer. For options that are set to on or off, the
value passed will be a Boolean. The optionId
parameter is one of the defined constants in this interface.
Parameters: optionId The identifier of the option val The value to set the option to
Throws: SocketException If an error occurs