public class SSLSocketChannel2 extends java.lang.Object implements java.nio.channels.ByteChannel, WrappedByteChannel
| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
bufferallocations
Should be used to count the buffer allocations.
|
protected static java.nio.ByteBuffer |
emptybuffer
This object is used to feed the
SSLEngine's wrap and unwrap methods during the handshake phase. |
protected java.util.concurrent.ExecutorService |
exec |
protected java.nio.ByteBuffer |
inCrypt
encrypted data incoming
|
protected java.nio.ByteBuffer |
inData
raw payload incomming
|
protected java.nio.ByteBuffer |
outCrypt
encrypted data outgoing
|
protected javax.net.ssl.SSLEngineResult |
readEngineResult |
protected java.nio.channels.SelectionKey |
selectionKey
used to set interestOP SelectionKey.OP_WRITE for the underlying channel
|
protected java.nio.channels.SocketChannel |
socketChannel
the underlying channel
|
protected javax.net.ssl.SSLEngine |
sslEngine |
protected java.util.List<java.util.concurrent.Future<?>> |
tasks |
protected javax.net.ssl.SSLEngineResult |
writeEngineResult |
| 构造器和说明 |
|---|
SSLSocketChannel2(java.nio.channels.SocketChannel channel,
javax.net.ssl.SSLEngine sslEngine,
java.util.concurrent.ExecutorService exec,
java.nio.channels.SelectionKey key) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
java.nio.channels.SelectableChannel |
configureBlocking(boolean b) |
boolean |
connect(java.net.SocketAddress remote) |
protected void |
consumeDelegatedTasks() |
protected void |
createBuffers(javax.net.ssl.SSLSession session) |
boolean |
finishConnect() |
boolean |
isBlocking() |
boolean |
isConnected() |
boolean |
isInboundDone() |
boolean |
isNeedRead() |
boolean |
isNeedWrite() |
boolean |
isOpen() |
int |
read(java.nio.ByteBuffer dst)
Blocks when in blocking mode until at least one byte has been decoded.
|
int |
readMore(java.nio.ByteBuffer dst) |
java.net.Socket |
socket() |
int |
write(java.nio.ByteBuffer src) |
void |
writeMore() |
protected static java.nio.ByteBuffer emptybuffer
SSLEngine's wrap and unwrap methods during the handshake phase.protected java.util.concurrent.ExecutorService exec
protected java.util.List<java.util.concurrent.Future<?>> tasks
protected java.nio.ByteBuffer inData
protected java.nio.ByteBuffer outCrypt
protected java.nio.ByteBuffer inCrypt
protected java.nio.channels.SocketChannel socketChannel
protected java.nio.channels.SelectionKey selectionKey
protected javax.net.ssl.SSLEngine sslEngine
protected javax.net.ssl.SSLEngineResult readEngineResult
protected javax.net.ssl.SSLEngineResult writeEngineResult
protected int bufferallocations
createBuffers(SSLSession) needs to be called.public SSLSocketChannel2(java.nio.channels.SocketChannel channel,
javax.net.ssl.SSLEngine sslEngine,
java.util.concurrent.ExecutorService exec,
java.nio.channels.SelectionKey key)
throws java.io.IOException
java.io.IOExceptionprotected void consumeDelegatedTasks()
protected void createBuffers(javax.net.ssl.SSLSession session)
public int write(java.nio.ByteBuffer src)
throws java.io.IOException
write 在接口中 java.nio.channels.WritableByteChanneljava.io.IOExceptionpublic int read(java.nio.ByteBuffer dst)
throws java.io.IOException
read 在接口中 java.nio.channels.ReadableByteChanneljava.io.IOExceptionpublic boolean isConnected()
public void close()
throws java.io.IOException
close 在接口中 java.io.Closeableclose 在接口中 java.lang.AutoCloseableclose 在接口中 java.nio.channels.Channeljava.io.IOExceptionpublic java.nio.channels.SelectableChannel configureBlocking(boolean b)
throws java.io.IOException
java.io.IOExceptionpublic boolean connect(java.net.SocketAddress remote)
throws java.io.IOException
java.io.IOExceptionpublic boolean finishConnect()
throws java.io.IOException
java.io.IOExceptionpublic java.net.Socket socket()
public boolean isInboundDone()
public boolean isOpen()
isOpen 在接口中 java.nio.channels.Channelpublic boolean isNeedWrite()
isNeedWrite 在接口中 WrappedByteChannelpublic void writeMore()
throws java.io.IOException
writeMore 在接口中 WrappedByteChanneljava.io.IOExceptionpublic boolean isNeedRead()
isNeedRead 在接口中 WrappedByteChannelpublic int readMore(java.nio.ByteBuffer dst)
throws javax.net.ssl.SSLException
readMore 在接口中 WrappedByteChanneljavax.net.ssl.SSLExceptionpublic boolean isBlocking()
isBlocking 在接口中 WrappedByteChannel