| Modifier and Type | Class and Description |
|---|---|
| private static class | DatagramChannelImpl.
Defines static methods to access AbstractSelectableChannel non-public members. |
| private static class | DatagramChannelImpl.
Defines static methods to get/set DatagramPacket fields and workaround DatagramPacket deficiencies. |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private InetSocketAddress | |
| private NativeSocketAddress | |
| private final Cleaner. | |
| private final ProtocolFamily | |
| private final FileDescriptor | |
| private final int | |
| private volatile boolean | |
| private InetSocketAddress | |
| private final boolean | |
| private boolean | |
| private InetSocketAddress | |
| private static final NativeDispatcher | |
| private static final JavaNioAccess | |
| private int | |
| private InetSocketAddress | |
| private Thread | |
| private final ReentrantLock | |
| private MembershipRegistry | |
| private InetSocketAddress | |
| private boolean | |
| private static final VarHandle | |
| private volatile DatagramSocket | |
| private NativeSocketAddress | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private int | |
| private final Object | |
| private final NativeSocketAddress | |
| private final ReentrantLock | |
| private Thread |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private SocketAddress | Returns: remote address if connectedtrue if configured blocking blocking, boolean true if the socket must be connected mustBeConnected)Marks the beginning of a read operation that might block. |
| private SocketAddress | Returns: remote address if connectedtrue if configured blocking blocking, boolean true if the socket must be connected mustBeConnected)Marks the beginning of a write operation that might block. |
| public DatagramChannel | bind(SocketAddress local)
Implements abstract java. Implements java. Binds the channel's socket to a local address. |
| private void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| private void | |
| private void | configureSocketNonBlockingIfVirtualThread()
Ensures that the socket is configured non-blocking when on a virtual thread. |
| public DatagramChannel | connect(SocketAddress sa)
Implements abstract java. Connects this channel's socket. |
| pack-priv DatagramChannel | connect(SocketAddress
the remote address to which this channel is to be connected sa, boolean true to check if the channel is already connected. check)Connects the channel's socket. |
| public DatagramChannel | disconnect()
Implements abstract java. Disconnects this channel's socket. |
| private static native void | |
| pack-priv void | |
| private void | endRead(boolean blocking, boolean completed)
Marks the end of a read operation that may have blocked. |
| private void | endWrite(boolean blocking, boolean completed)
Marks the end of a write operation that may have blocked. |
| private void | |
| private ProtocolFamily | familyFor(SocketOption<?> name)
Returns the protocol family to specify to set/getSocketOption for the given socket option. |
| pack-priv MembershipKey | findMembership(InetAddress group, NetworkInterface interf)
Finds an existing membership of a multicast group. |
| public FileDescriptor | |
| public int | |
| public SocketAddress | getLocalAddress()
Implements abstract java. Implements java. Returns the socket address that this channel's socket is bound to. |
| public <T> T | getOption(SocketOption<T> name)
Implements java. Returns the value of a socket option. |
| public SocketAddress | getRemoteAddress()
Implements abstract java. Returns the remote address to which this channel's socket is connected. |
| private void | |
| private void | |
| protected void | implCloseSelectableChannel()
Implements abstract java. Invoked by implCloseChannel to close the channel. |
| protected void | implConfigureBlocking(boolean block)
Implements abstract java. Adjusts this channel's blocking mode. |
| private MembershipKey | innerJoin(InetAddress group, NetworkInterface interf, InetAddress source)
Joins channel's socket to the given group/interface and optional source address. |
| public boolean | isConnected()
Implements abstract java. Tells whether or not this channel's socket is connected. |
| public MembershipKey | join(InetAddress group, NetworkInterface interf)
Implements java. Joins a multicast group to begin receiving all datagrams sent to the group, returning a membership key. |
| public MembershipKey | join(InetAddress group, NetworkInterface interf, InetAddress source)
Implements java. Joins a multicast group to begin receiving datagrams sent to the group from a given source address. |
| public void | |
| pack-priv InetSocketAddress | |
| private void | |
| public void | park(int event, long nanos)
Overrides default sun. Disables the current thread for scheduling purposes until this channel is ready for I/O, or asynchronously closed, for up to the specified waiting time. |
| public int | read(ByteBuffer buf)
Implements abstract java. Implements java. Reads a datagram from this channel. |
| public long | read(ByteBuffer[] dsts, int offset, int length)
Implements abstract java. Implements java. Reads a datagram from this channel. |
| public SocketAddress | receive(ByteBuffer dst)
Implements abstract java. Receives a datagram via this channel. |
| private int | receive(ByteBuffer dst, boolean
true if the channel is connected connected)Receives a datagram into the buffer. |
| private static native int | |
| private int | receiveIntoNativeBuffer(ByteBuffer bb, int rem, int pos, boolean connected)
Receives a datagram into a direct buffer. |
| private static Runnable | releaserFor(FileDescriptor fd, NativeSocketAddress... sockAddrs)
Returns an action to release the given file descriptor and socket addresses. |
| pack-priv InetSocketAddress | |
| private void | repairSocket(InetSocketAddress target)
"Repair" the channel's socket after a disconnect that didn't restore the local address. |
| public int | send(ByteBuffer src, SocketAddress target)
Implements abstract java. Sends a datagram via this channel. |
| private int | |
| private static native int | |
| private int | sendFromNativeBuffer(FileDescriptor fd, ByteBuffer bb, InetSocketAddress target)
Send a datagram contained in a direct buffer. |
| public <T> DatagramChannel | setOption(SocketOption<T> name, T value)
Implements abstract java. Implements java. Sets the value of a socket option. |
| public DatagramSocket | socket()
Implements abstract java. Retrieves a datagram socket associated with this channel. |
| private InetSocketAddress | sourceSocketAddress()
Return an InetSocketAddress to represent the source/sender socket address in sourceSockAddr. |
| public final Set | supportedOptions()
Implements java. Returns a set of the socket options supported by this channel. |
| private int | targetSocketAddress(InetSocketAddress isa)
Encodes the given InetSocketAddress into targetSockAddr, returning the length of the sockaddr structure (sizeof struct sockaddr or sockaddr6). |
| public boolean | translateAndSetReadyOps(int ops, SelectionKeyImpl ski)
Implements sun. Sets the specified ops if present in interestOps. |
| public boolean | translateAndUpdateReadyOps(int ops, SelectionKeyImpl ski)
Implements sun. Adds the specified ops if present in interestOps. |
| public int | translateInterestOps(int ops)
Implements sun. Translates an interest operation set into a native poll event set |
| public boolean | translateReadyOps(int ops, int initialOps, SelectionKeyImpl ski)
Translates native poll revent set into a ready operation set |
| private ByteBuffer | Returns: a direct buffer containing the datagram or null if channel is closedif the channel's socket is connected connected, int the maximum size of the datagram to receive len, long the timeout, should be Long.MAX_VALUE for untimed nanos)Attempt to receive a datagram. |
| private boolean | tryClose()
Closes the socket if there are no I/O operations in progress and the channel is not registered with a Selector. |
| private void | |
| private boolean | Returns: true if the blocking mode was adjustedAttempts to adjust the blocking mode if the channel is open. |
| pack-priv void | |
| public int | write(ByteBuffer buf)
Implements abstract java. Implements java. Writes a datagram to this channel. |
| public long | write(ByteBuffer[] srcs, int offset, int length)
Implements abstract java. Implements java. Writes a datagram to this channel. |