public class SSLSocketChannel extends java.lang.Object implements WrappedByteChannel, java.nio.channels.ByteChannel
SSLEngine logic, which
is described by Oracle as "an advanced API, not appropriate for casual use", since
it requires the user to implement much of the communication establishment procedure himself.
More information about it can be found here: http://docs.oracle.com/javase/8/docs/technotes/guides/security/jsse/JSSERefGuide.html#SSLEngine
SSLSocketChannel implements the handshake protocol, required to establish a connection between two peers,
which is common for both client and server and provides the abstract read(ByteBuffer) and
write(ByteBuffer) (String)} methods, that need to be implemented by the specific SSL/TLS peer
that is going to extend this class.Modified by marci4 to allow the usage as a ByteChannel
Permission for usage recieved at May 25, 2017 by Alex Karnezis
| 构造器和说明 |
|---|
SSLSocketChannel(java.nio.channels.SocketChannel inputSocketChannel,
javax.net.ssl.SSLEngine inputEngine,
java.util.concurrent.ExecutorService inputExecutor,
java.nio.channels.SelectionKey key) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
boolean |
isBlocking()
This function returns the blocking state of the channel
|
boolean |
isNeedRead()
returns whether readMore should be called to fetch data which has been decoded but not yet been returned.
|
boolean |
isNeedWrite()
returns whether writeMore should be called write additional data.
|
boolean |
isOpen() |
int |
read(java.nio.ByteBuffer dst) |
int |
readMore(java.nio.ByteBuffer dst)
This function does not read data from the underlying channel at all.
|
int |
write(java.nio.ByteBuffer output) |
void |
writeMore()
Gets called when
WrappedByteChannel.isNeedWrite() ()} requires a additional rite |
public SSLSocketChannel(java.nio.channels.SocketChannel inputSocketChannel,
javax.net.ssl.SSLEngine inputEngine,
java.util.concurrent.ExecutorService inputExecutor,
java.nio.channels.SelectionKey key)
throws java.io.IOException
java.io.IOExceptionpublic int read(java.nio.ByteBuffer dst)
throws java.io.IOException
read 在接口中 java.nio.channels.ReadableByteChanneljava.io.IOExceptionpublic int write(java.nio.ByteBuffer output)
throws java.io.IOException
write 在接口中 java.nio.channels.WritableByteChanneljava.io.IOExceptionpublic boolean isNeedWrite()
WrappedByteChannelisNeedWrite 在接口中 WrappedByteChannelpublic void writeMore()
throws java.io.IOException
WrappedByteChannelWrappedByteChannel.isNeedWrite() ()} requires a additional ritewriteMore 在接口中 WrappedByteChanneljava.io.IOException - may be thrown due to an error while writingpublic boolean isNeedRead()
WrappedByteChannelisNeedRead 在接口中 WrappedByteChannelReadableByteChannel.read(ByteBuffer),
WrappedByteChannel.readMore(ByteBuffer)public int readMore(java.nio.ByteBuffer dst)
throws java.io.IOException
WrappedByteChannelReadableByteChannel.read(ByteBuffer).readMore 在接口中 WrappedByteChanneldst - the destiny of the readjava.io.IOException - when a error occurred during unwrappingpublic boolean isBlocking()
WrappedByteChannelisBlocking 在接口中 WrappedByteChannelpublic boolean isOpen()
isOpen 在接口中 java.nio.channels.Channelpublic void close()
throws java.io.IOException
close 在接口中 java.io.Closeableclose 在接口中 java.lang.AutoCloseableclose 在接口中 java.nio.channels.Channeljava.io.IOException