Package org.mozilla.jss.ssl.javax
Class JSSSocketChannel
java.lang.Object
java.nio.channels.spi.AbstractInterruptibleChannel
java.nio.channels.SelectableChannel
java.nio.channels.spi.AbstractSelectableChannel
java.nio.channels.SocketChannel
org.mozilla.jss.ssl.javax.JSSSocketChannel
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ByteChannel
,Channel
,GatheringByteChannel
,InterruptibleChannel
,NetworkChannel
,ReadableByteChannel
,ScatteringByteChannel
,WritableByteChannel
SSL-enabled SocketChannel following the javax.net.ssl.SSLSocket interface.
This class should never be constructed directly and instead only accessed
once a Socket is wrapped in a JSSSocket.
This class contains all low-level interactions with the underlying
SSLEngine and reading/writing to/from the underlying Socket.
-
Constructor Summary
ConstructorsConstructorDescriptionJSSSocketChannel
(JSSSocket sslSocket, Socket parentSocket, ReadableByteChannel readChannel, WritableByteChannel writeChannel, JSSEngine engine) JSSSocketChannel
(JSSSocket sslSocket, SocketChannel parent, Socket parentSocket, ReadableByteChannel readChannel, WritableByteChannel writeChannel, JSSEngine engine) JSSSocketChannel
(JSSSocket sslSocket, SocketChannel parent, JSSEngine engine) -
Method Summary
Modifier and TypeMethodDescriptionbind
(SocketAddress local) boolean
connect
(SocketAddress remote) boolean
<T> T
getOption
(SocketOption<T> name) void
void
implConfigureBlocking
(boolean block) boolean
boolean
int
read
(ByteBuffer dst) long
read
(ByteBuffer[] dsts, int offset, int length) void
setAutoClose
(boolean on) Set whether or not to close the underlying Socket when the SSLSocket or this channel is closed.void
setConsumedData
(InputStream consumed) Give data already consumed by a call to the underlying socket's read method to this Socket, allowing it to be read by the SSLEngine.<T> JSSSocketChannel
setOption
(SocketOption<T> name, T value) socket()
Set<SocketOption<?>>
int
write
(ByteBuffer src) long
write
(ByteBuffer[] srcs, int offset, int length) Methods inherited from class java.nio.channels.SocketChannel
open, open, open, read, validOps, write
Methods inherited from class java.nio.channels.spi.AbstractSelectableChannel
blockingLock, configureBlocking, implCloseChannel, isBlocking, isRegistered, keyFor, provider, register
Methods inherited from class java.nio.channels.SelectableChannel
register
Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, isOpen
-
Constructor Details
-
JSSSocketChannel
public JSSSocketChannel(JSSSocket sslSocket, SocketChannel parent, Socket parentSocket, ReadableByteChannel readChannel, WritableByteChannel writeChannel, JSSEngine engine) throws IOException - Throws:
IOException
-
JSSSocketChannel
public JSSSocketChannel(JSSSocket sslSocket, SocketChannel parent, JSSEngine engine) throws IOException - Throws:
IOException
-
JSSSocketChannel
public JSSSocketChannel(JSSSocket sslSocket, Socket parentSocket, ReadableByteChannel readChannel, WritableByteChannel writeChannel, JSSEngine engine) throws IOException - Throws:
IOException
-
-
Method Details
-
setConsumedData
Give data already consumed by a call to the underlying socket's read method to this Socket, allowing it to be read by the SSLEngine.- Throws:
IOException
-
setAutoClose
public void setAutoClose(boolean on) Set whether or not to close the underlying Socket when the SSLSocket or this channel is closed. -
finishConnect
- Specified by:
finishConnect
in classSocketChannel
- Throws:
IOException
-
read
- Specified by:
read
in interfaceReadableByteChannel
- Specified by:
read
in classSocketChannel
- Throws:
IOException
-
read
- Specified by:
read
in interfaceScatteringByteChannel
- Specified by:
read
in classSocketChannel
- Throws:
IOException
-
write
- Specified by:
write
in interfaceWritableByteChannel
- Specified by:
write
in classSocketChannel
- Throws:
IOException
-
write
- Specified by:
write
in interfaceGatheringByteChannel
- Specified by:
write
in classSocketChannel
- Throws:
IOException
-
implCloseSelectableChannel
- Specified by:
implCloseSelectableChannel
in classAbstractSelectableChannel
- Throws:
IOException
-
bind
- Specified by:
bind
in interfaceNetworkChannel
- Specified by:
bind
in classSocketChannel
- Throws:
IOException
-
connect
- Specified by:
connect
in classSocketChannel
- Throws:
IOException
-
getOption
- Throws:
IOException
-
supportedOptions
-
setOption
- Specified by:
setOption
in interfaceNetworkChannel
- Specified by:
setOption
in classSocketChannel
- Throws:
IOException
-
socket
- Specified by:
socket
in classSocketChannel
-
isConnected
public boolean isConnected()- Specified by:
isConnected
in classSocketChannel
-
isConnectionPending
public boolean isConnectionPending()- Specified by:
isConnectionPending
in classSocketChannel
-
getLocalAddress
- Specified by:
getLocalAddress
in interfaceNetworkChannel
- Specified by:
getLocalAddress
in classSocketChannel
- Throws:
IOException
-
getRemoteAddress
- Specified by:
getRemoteAddress
in classSocketChannel
- Throws:
IOException
-
shutdownInput
- Specified by:
shutdownInput
in classSocketChannel
- Throws:
IOException
-
shutdownOutput
- Specified by:
shutdownOutput
in classSocketChannel
- Throws:
IOException
-
implConfigureBlocking
- Specified by:
implConfigureBlocking
in classAbstractSelectableChannel
- Throws:
IOException
-