Modifier and Type | Class and Description |
---|---|
private static class |
Modifier and Type | Field and Description |
---|---|
private boolean | |
private final ProtocolFamily | |
private final FileDescriptor | |
private final int | |
private volatile boolean | |
private volatile boolean | |
private volatile boolean | |
private boolean | |
private SocketAddress | |
private static final NativeDispatcher | |
private long | |
private final ReentrantLock | |
private SocketAddress | |
private Socket | |
private static final int | |
private static final int | |
private static final int | |
private static final int | |
private static final int | |
private volatile int | |
private final Object | |
private final ReentrantLock | |
private long |
Access | Constructor and Description |
---|---|
pack-priv | |
pack-priv | |
pack-priv | SocketChannelImpl(SelectorProvider sp, ProtocolFamily family, FileDescriptor fd, SocketAddress remoteAddress)
|
Modifier and Type | Method and Description |
---|---|
pack-priv void | |
pack-priv int | |
pack-priv void | |
private void | beginConnect(boolean
true if configured blocking blocking, SocketAddress the remote address sa)Marks the beginning of a connect operation that might block. |
private void | beginFinishConnect(boolean blocking)
Marks the beginning of a finishConnect operation that might block. |
private void | |
private void | |
public SocketChannel | bind(SocketAddress
The address to bind the socket, or local)null to bind
the socket to an automatically assigned socket addressImplements abstract java. Implements java. Binds the channel's socket to a local address. |
pack-priv void | blockingConnect(SocketAddress remote, long nanos)
Attempts to establish a connection to the given socket address with a timeout. |
pack-priv int | blockingRead(byte[] b, int off, int len, long nanos)
Reads bytes from the socket into the given byte array. |
pack-priv void | blockingWriteFully(byte[] b, int off, int len)
Writes a sequence of bytes to the socket from the given byte array. |
private SocketAddress | |
private void | configureSocketNonBlockingIfVirtualThread()
Ensures that the socket is configured non-blocking when on a virtual thread. |
public boolean | connect(SocketAddress
The remote address to which this channel is to be connected remote)Implements abstract java. Connects this channel's socket. |
private void | endConnect(boolean blocking, boolean completed)
Marks the end of a connect operation that may have blocked. |
private void | endFinishConnect(boolean blocking, boolean completed)
Marks the end of a finishConnect operation that may have blocked. |
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 void | |
public boolean | finishConnect()
Implements abstract java. Finishes the process of connecting a socket channel. |
private boolean | |
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>
The socket option 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
If block)true then this channel will be placed in
blocking mode; if false then it will be placed
non-blocking modeImplements abstract java. Adjusts this channel's blocking mode. |
private int | |
private long | |
private int | |
private long | |
public boolean | isConnected()
Implements abstract java. Tells whether or not this channel's network socket is connected. |
public boolean | isConnectionPending()
Implements abstract java. Tells whether or not a connection operation is in progress on this channel. |
pack-priv boolean | |
pack-priv boolean | |
pack-priv boolean | |
pack-priv boolean | |
public void | |
pack-priv SocketAddress | |
private void | |
private SocketAddress | |
public int | read(ByteBuffer
The buffer into which bytes are to be transferred buf)Implements abstract java. Implements java. Reads a sequence of bytes from this channel into the given buffer. |
public long | read(ByteBuffer[]
The buffers into which bytes are to be transferred dsts, int The offset within the buffer array of the first buffer into
which bytes are to be transferred; must be non-negative and no
larger than offset, int dsts.length The maximum number of buffers to be accessed; must be
non-negative and no larger than
length)dsts.length - offset Implements abstract java. Implements java. Reads a sequence of bytes from this channel into a subsequence of the given buffers. |
pack-priv SocketAddress | |
pack-priv int | |
public <T> SocketChannel | setOption(SocketOption<T>
The socket option name, T The value of the socket option. A value of value)null may be
a valid value for some socket options.Implements abstract java. Implements java. Sets the value of a socket option. |
public SocketChannel | shutdownInput()
Implements abstract java. Shutdown the connection for reading without closing the channel. |
public SocketChannel | shutdownOutput()
Implements abstract java. Shutdown the connection for writing without closing the channel. |
public Socket | socket()
Implements abstract java. Retrieves a socket associated with this channel. |
public final Set | supportedOptions()
Implements java. Returns a set of the socket options supported by this channel. |
private void | |
private int | timedRead(byte[] b, int off, int len, long nanos)
Reads bytes from the socket into the given byte array with a timeout. |
public String | |
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 ops into a ready operation ops |
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. |
private int | tryRead(byte[] b, int off, int len)
Attempts to read bytes from the socket into the given byte array. |
private int | tryWrite(byte[] b, int off, int len)
Attempts to write a sequence of bytes to the socket from the given byte array. |
private SocketAddress | |
public int | write(ByteBuffer
The buffer from which bytes are to be retrieved buf)Implements abstract java. Implements java. Writes a sequence of bytes to this channel from the given buffer. |
public long | write(ByteBuffer[]
The buffers from which bytes are to be retrieved srcs, int The offset within the buffer array of the first buffer from
which bytes are to be retrieved; must be non-negative and no
larger than offset, int srcs.length The maximum number of buffers to be accessed; must be
non-negative and no larger than
length)srcs.length - offset Implements abstract java. Implements java. Writes a sequence of bytes to this channel from a subsequence of the given buffers. |