The name of each socket option defined by this
class is its field name.
In this release, the socket options defined here are used by network channels in the channels package.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| public static final SocketOption | IP_MULTICAST_IF
The network interface for Internet Protocol (IP) multicast datagrams. |
| public static final SocketOption | IP_MULTICAST_LOOP
Loopback for Internet Protocol (IP) multicast datagrams. |
| public static final SocketOption | IP_MULTICAST_TTL
The time-to-live for Internet Protocol (IP) multicast datagrams. |
| public static final SocketOption | IP_TOS
The Type of Service (ToS) octet in the Internet Protocol (IP) header. |
| public static final SocketOption | SO_BROADCAST
Allow transmission of broadcast datagrams. |
| public static final SocketOption | SO_KEEPALIVE
Keep connection alive. |
| public static final SocketOption | SO_LINGER
Linger on close if data is present. |
| public static final SocketOption | SO_RCVBUF
The size of the socket receive buffer. |
| public static final SocketOption | SO_REUSEADDR
Re-use address. |
| public static final SocketOption | SO_REUSEPORT
Re-use port. |
| public static final SocketOption | SO_SNDBUF
The size of the socket send buffer. |
| public static final SocketOption | TCP_NODELAY
Disable the Nagle algorithm. |
| Access | Constructor and Description |
|---|---|
| private |
| IP_MULTICAST_IF | back to summary |
|---|---|
| public static final SocketOption<NetworkInterface> IP_MULTICAST_IF The network interface for Internet Protocol (IP) multicast datagrams. The value of this socket option is a The initial/default value of this socket option may be
| |
| IP_MULTICAST_LOOP | back to summary |
|---|---|
| public static final SocketOption<Boolean> IP_MULTICAST_LOOP Loopback for Internet Protocol (IP) multicast datagrams. The value of this socket option is a The exact semantics of this socket options are system dependent.
In particular, it is system dependent whether the loopback applies to
multicast datagrams sent from the socket or received by the socket.
For The initial/default value of this socket option is
| |
| IP_MULTICAST_TTL | back to summary |
|---|---|
| public static final SocketOption<Integer> IP_MULTICAST_TTL The time-to-live for Internet Protocol (IP) multicast datagrams. The value of this socket option is an The initial/default value of the time-to-live setting is typically
| |
| IP_TOS | back to summary |
|---|---|
| public static final SocketOption<Integer> IP_TOS The Type of Service (ToS) octet in the Internet Protocol (IP) header. The value of this socket option is an The initial/default value of the TOS field in the ToS octet is
implementation specific but will typically be The behavior of this socket option on a stream-oriented socket, or an
| |
| SO_BROADCAST | back to summary |
|---|---|
| public static final SocketOption<Boolean> SO_BROADCAST Allow transmission of broadcast datagrams. The value of this socket option is a The initial value of this socket option is
| |
| SO_KEEPALIVE | back to summary |
|---|---|
| public static final SocketOption<Boolean> SO_KEEPALIVE Keep connection alive. The value of this socket option is a The initial value of this socket option is
| |
| SO_LINGER | back to summary |
|---|---|
| public static final SocketOption<Integer> SO_LINGER Linger on close if data is present. The value of this socket option is an This socket option is intended for use with sockets that are configured
in The initial value of this socket option is a negative value, meaning that the option is disabled. The option may be enabled, or the linger interval changed, at any time. The maximum value of the linger interval is system dependent. Setting the linger interval to a value that is greater than its maximum value causes the linger interval to be set to its maximum value.
| |
| SO_RCVBUF | back to summary |
|---|---|
| public static final SocketOption<Integer> SO_RCVBUF The size of the socket receive buffer. The value of this socket option is an For datagram-oriented sockets, the size of the receive buffer may limit the size of the datagrams that can be received. Whether datagrams larger than the buffer size can be received is system dependent. Increasing the socket receive buffer may be important for cases where datagrams arrive in bursts faster than they can be processed. In the case of stream-oriented sockets and the TCP/IP protocol, the size of the socket receive buffer may be used when advertising the size of the TCP receive window to the remote peer. The initial/default size of the socket receive buffer and the range of allowable values is system dependent although a negative size is not allowed. An attempt to set the socket receive buffer to larger than its maximum size causes it to be set to its maximum size. An implementation allows this socket option to be set before the socket is bound or connected. Whether an implementation allows the socket receive buffer to be changed after the socket is bound is system dependent.
| |
| SO_REUSEADDR | back to summary |
|---|---|
| public static final SocketOption<Boolean> SO_REUSEADDR Re-use address. The value of this socket option is a In the case of stream-oriented sockets, this socket option will usually determine whether the socket can be bound to a socket address when a previous connection involving that socket address is in the TIME_WAIT state. On implementations where the semantics differ, and the socket option is not required to be enabled in order to bind the socket when a previous connection is in this state, then the implementation may choose to ignore this option. For datagram-oriented sockets the socket option is used to allow multiple programs bind to the same address. This option should be enabled when the socket is to be used for Internet Protocol (IP) multicasting. An implementation allows this socket option to be set before the socket is bound or connected. Changing the value of this socket option after the socket is bound has no effect. The default value of this socket option is system dependent.
| |
| SO_REUSEPORT | back to summary |
|---|---|
| public static final SocketOption<Boolean> SO_REUSEPORT Re-use port. The value of this socket option is a In the case of stream-oriented sockets, this socket option usually allows multiple listening sockets to be bound to both same address and same port. For datagram-oriented sockets the socket option usually allows multiple UDP sockets to be bound to the same address and port. An implementation allows this socket option to be set before the socket is bound or connected. Changing the value of this socket option after the socket is bound has no effect.
| |
| SO_SNDBUF | back to summary |
|---|---|
| public static final SocketOption<Integer> SO_SNDBUF The size of the socket send buffer. The value of this socket option is an For datagram-oriented sockets, the size of the send buffer may limit the size of the datagrams that may be sent by the socket. Whether datagrams larger than the buffer size are sent or discarded is system dependent. The initial/default size of the socket send buffer and the range of allowable values is system dependent although a negative size is not allowed. An attempt to set the socket send buffer to larger than its maximum size causes it to be set to its maximum size. An implementation allows this socket option to be set before the socket is bound or connected. Whether an implementation allows the socket send buffer to be changed after the socket is bound is system dependent.
| |
| TCP_NODELAY | back to summary |
|---|---|
| public static final SocketOption<Boolean> TCP_NODELAY Disable the Nagle algorithm. The value of this socket option is a The default value of this socket option is
| |
| StandardSocketOptions | back to summary |
|---|---|
| private StandardSocketOptions() | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| name | back to summary |
|---|---|
| private final String name | |
| type | back to summary |
|---|---|
| private final Class<T> type | |
| StdSocketOption | back to summary |
|---|---|
| pack-priv StdSocketOption(String name, Class<T> type) | |
| name | back to summary |
|---|---|
| public String name() Implements java. Doc from java. Returns the name of the socket option.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| type | back to summary |
|---|---|
| public Class Implements java. Doc from java. Returns the type of the socket option value.
| |