class SSLSocketChannel extends SocketChannel
| Constructor and Description |
|---|
SSLSocketChannel(SSLSocket socket)Create a new SSLSocketChannel wrapping the given SSL socket. |
| Modifier and Type | Method and Description |
|---|---|
SocketChannel | bind(SocketAddress local)Bind is not supported by this wrapper. |
boolean | connect(SocketAddress remote)Connect is not supported by this wrapper. |
boolean | finishConnect()Finish connecting. |
SocketAddress | getLocalAddress()Get the local socket address of the underlying SSL socket. |
<T> T | getOption(SocketOption<T> name)Get the value of a socket option. |
SocketAddress | getRemoteAddress()Get the remote socket address of the underlying SSL socket. |
void | implCloseSelectableChannel()Close the underlying SSL socket. |
void | implConfigureBlocking(boolean block)Configure the blocking mode. |
boolean | isConnected()Check if the underlying SSL socket is connected. |
boolean | isConnectionPending()Check if a connection operation is pending. |
int | read(ByteBuffer src)Read bytes from the underlying SSL socket into the given buffer. |
long | read(ByteBuffer[] srcs,
int offset,
int length)Scatter read is not supported by this wrapper. |
<T> SocketChannel | setOption(SocketOption<T> name,
T value)Set a socket option. |
SocketChannel | shutdownInput()Shut down the input stream of the underlying SSL socket. |
SocketChannel | shutdownOutput()Shut down the output stream of the underlying SSL socket. |
Socket | socket()Return the underlying SSL socket. |
Set<SocketOption<?>> | supportedOptions()Get the set of supported socket options. |
int | write(ByteBuffer src)Write bytes from the given buffer to the underlying SSL socket. |
long | write(ByteBuffer[] srcs,
int offset,
int length)Gather write is not supported by this wrapper. |
blockingLock, configureBlocking, implCloseChannel, isBlocking, isRegistered, keyFor, provider, registerregisterbegin, close, end, isOpenpublic SSLSocketChannel(SSLSocket socket)
socket - the SSL socket to wrappublic SocketChannel bind(SocketAddress local)
bind in interface NetworkChannelbind in class SocketChannellocal - the socket address to bind to (ignored)UnsupportedOperationException - alwayspublic boolean connect(SocketAddress remote)
connect in class SocketChannelremote - the remote address to connect to (ignored)UnsupportedOperationException - alwayspublic boolean finishConnect()
finishConnect in class SocketChannelpublic SocketAddress getLocalAddress()
getLocalAddress in interface NetworkChannelgetLocalAddress in class SocketChannelpublic <T> T getOption(SocketOption<T> name)
T - the type of the socket option valuename - the socket option name (ignored)public SocketAddress getRemoteAddress()
getRemoteAddress in class SocketChannelpublic void implCloseSelectableChannel()
throws IOExceptionimplCloseSelectableChannel in class AbstractSelectableChannelIOException - if an I/O error occurs while closingpublic void implConfigureBlocking(boolean block)
throws IOExceptionimplConfigureBlocking in class AbstractSelectableChannelblock - true for blocking mode (accepted), false throwsIOException - if an I/O error occursUnsupportedOperationException - if block is falsepublic boolean isConnected()
isConnected in class SocketChannelpublic boolean isConnectionPending()
isConnectionPending in class SocketChannelpublic int read(ByteBuffer src) throws IOException
read in interface ReadableByteChannelread in class SocketChannelsrc - the buffer to read intoIOException - if an I/O error occursUnsupportedOperationException - if the buffer has no backing arraypublic long read(ByteBuffer[] srcs, int offset, int length)
read in interface ScatteringByteChannelread in class SocketChannelsrcs - the buffers to read into (ignored)offset - the offset in the buffer array (ignored)length - the number of buffers to use (ignored)UnsupportedOperationException - alwayspublic <T> SocketChannel setOption(SocketOption<T> name, T value)
setOption in interface NetworkChannelsetOption in class SocketChannelT - the type of the socket option valuename - the socket option name (ignored)value - the socket option value (ignored)public SocketChannel shutdownInput() throws IOException
shutdownInput in class SocketChannelIOException - if an I/O error occurspublic SocketChannel shutdownOutput() throws IOException
shutdownOutput in class SocketChannelIOException - if an I/O error occurspublic Socket socket()
socket in class SocketChannelpublic Set<SocketOption<?>> supportedOptions()
public int write(ByteBuffer src) throws IOException
write in interface WritableByteChannelwrite in class SocketChannelsrc - the buffer to write fromIOException - if an I/O error occursUnsupportedOperationException - if the buffer has no backing arraypublic long write(ByteBuffer[] srcs, int offset, int length)
write in interface GatheringByteChannelwrite in class SocketChannelsrcs - the buffers to write from (ignored)offset - the offset in the buffer array (ignored)length - the number of buffers to use (ignored)UnsupportedOperationException - always