| Package | Description | 
|---|---|
| java.net | Provides the classes for implementing networking applications. | 
| java.nio.channels | Defines channels, which represent connections to entities that are capable of
 performing I/O operations, such as files and sockets; defines selectors, for
 multiplexed, non-blocking I/O operations. | 
| Modifier and Type | Field and Description | 
|---|---|
| static SocketOption<NetworkInterface> | StandardSocketOptions. IP_MULTICAST_IFThe network interface for Internet Protocol (IP) multicast datagrams. | 
| static SocketOption<Boolean> | StandardSocketOptions. IP_MULTICAST_LOOPLoopback for Internet Protocol (IP) multicast datagrams. | 
| static SocketOption<Integer> | StandardSocketOptions. IP_MULTICAST_TTLThe time-to-live for Internet Protocol (IP) multicast datagrams. | 
| static SocketOption<Integer> | StandardSocketOptions. IP_TOSThe Type of Service (ToS) octet in the Internet Protocol (IP) header. | 
| static SocketOption<Boolean> | StandardSocketOptions. SO_BROADCASTAllow transmission of broadcast datagrams. | 
| static SocketOption<Boolean> | StandardSocketOptions. SO_KEEPALIVEKeep connection alive. | 
| static SocketOption<Integer> | StandardSocketOptions. SO_LINGERLinger on close if data is present. | 
| static SocketOption<Integer> | StandardSocketOptions. SO_RCVBUFThe size of the socket receive buffer. | 
| static SocketOption<Boolean> | StandardSocketOptions. SO_REUSEADDRRe-use address. | 
| static SocketOption<Integer> | StandardSocketOptions. SO_SNDBUFThe size of the socket send buffer. | 
| static SocketOption<Boolean> | StandardSocketOptions. TCP_NODELAYDisable the Nagle algorithm. | 
| Modifier and Type | Method and Description | 
|---|---|
| Set<SocketOption<?>> | NetworkChannel. supportedOptions()Returns a set of the socket options supported by this channel. | 
| Modifier and Type | Method and Description | 
|---|---|
| <T> T | NetworkChannel. getOption(SocketOption<T> name)Returns the value of a socket option. | 
| abstract <T> AsynchronousSocketChannel | AsynchronousSocketChannel. setOption(SocketOption<T> name,
         T value) | 
| abstract <T> AsynchronousServerSocketChannel | AsynchronousServerSocketChannel. setOption(SocketOption<T> name,
         T value) | 
| abstract <T> DatagramChannel | DatagramChannel. setOption(SocketOption<T> name,
         T value) | 
| abstract <T> ServerSocketChannel | ServerSocketChannel. setOption(SocketOption<T> name,
         T value) | 
| <T> NetworkChannel | NetworkChannel. setOption(SocketOption<T> name,
         T value)Sets the value of a socket option. | 
| abstract <T> SocketChannel | SocketChannel. setOption(SocketOption<T> name,
         T value) | 
 Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2025, Oracle and/or its affiliates.  All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.