public class TlsAsynchronousSocketChannel
extends java.nio.channels.AsynchronousSocketChannel
implements java.nio.channels.CompletionHandler<java.lang.Integer,java.lang.Void>
Note: This implementation does not support attachments for reads. They are not used in AsyncMessageReader which this class is in direct support of.
| Constructor and Description |
|---|
TlsAsynchronousSocketChannel(java.nio.channels.AsynchronousSocketChannel in,
javax.net.ssl.SSLEngine sslEngine)
Create a new decrypting input stream.
|
| Modifier and Type | Method and Description |
|---|---|
java.nio.channels.AsynchronousSocketChannel |
bind(java.net.SocketAddress local) |
void |
close() |
void |
completed(java.lang.Integer result,
java.lang.Void attachment)
Completion handler for a read.
|
java.util.concurrent.Future<java.lang.Void> |
connect(java.net.SocketAddress remote) |
<A> void |
connect(java.net.SocketAddress remote,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Void,? super A> hdlr) |
void |
failed(java.lang.Throwable exc,
java.lang.Void attachment) |
java.net.SocketAddress |
getLocalAddress() |
<T> T |
getOption(java.net.SocketOption<T> name) |
java.net.SocketAddress |
getRemoteAddress() |
boolean |
isOpen() |
java.util.concurrent.Future<java.lang.Integer> |
read(java.nio.ByteBuffer dest)
Unused.
|
<A> void |
read(java.nio.ByteBuffer[] dsts,
int offset,
int length,
long timeout,
java.util.concurrent.TimeUnit unit,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Long,? super A> hdlr) |
<A> void |
read(java.nio.ByteBuffer dest,
long timeout,
java.util.concurrent.TimeUnit unit,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Integer,? super A> hdlr)
Main entry point from caller.
|
<T> java.nio.channels.AsynchronousSocketChannel |
setOption(java.net.SocketOption<T> name,
T value) |
java.nio.channels.AsynchronousSocketChannel |
shutdownInput() |
java.nio.channels.AsynchronousSocketChannel |
shutdownOutput() |
java.util.Set<java.net.SocketOption<?>> |
supportedOptions() |
java.util.concurrent.Future<java.lang.Integer> |
write(java.nio.ByteBuffer src)
Unused.
|
<A> void |
write(java.nio.ByteBuffer[] srcs,
int offset,
int length,
long timeout,
java.util.concurrent.TimeUnit unit,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Long,? super A> hdlr)
Handle a request to write an array of buffers to the channel.
|
<A> void |
write(java.nio.ByteBuffer src,
long timeout,
java.util.concurrent.TimeUnit unit,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Integer,? super A> hdlr) |
public TlsAsynchronousSocketChannel(java.nio.channels.AsynchronousSocketChannel in,
javax.net.ssl.SSLEngine sslEngine)
in - The underlying inputstream to read encrypted data from.sslEngine - A configured SSLEngine which has already completed the handshake.public void completed(java.lang.Integer result,
java.lang.Void attachment)
decryptAndDispatch().completed in interface java.nio.channels.CompletionHandler<java.lang.Integer,java.lang.Void>result - number of processed bytesattachment - Voidpublic void failed(java.lang.Throwable exc,
java.lang.Void attachment)
failed in interface java.nio.channels.CompletionHandler<java.lang.Integer,java.lang.Void>public <A> void read(java.nio.ByteBuffer dest,
long timeout,
java.util.concurrent.TimeUnit unit,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Integer,? super A> hdlr)
read in class java.nio.channels.AsynchronousSocketChannelpublic <A> void read(java.nio.ByteBuffer[] dsts,
int offset,
int length,
long timeout,
java.util.concurrent.TimeUnit unit,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Long,? super A> hdlr)
read in class java.nio.channels.AsynchronousSocketChannelpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface java.nio.channels.AsynchronousChannelclose in interface java.nio.channels.Channeljava.io.IOExceptionpublic boolean isOpen()
isOpen in interface java.nio.channels.Channelpublic java.util.concurrent.Future<java.lang.Integer> read(java.nio.ByteBuffer dest)
read in interface java.nio.channels.AsynchronousByteChannelread in class java.nio.channels.AsynchronousSocketChannelpublic java.util.concurrent.Future<java.lang.Integer> write(java.nio.ByteBuffer src)
write in interface java.nio.channels.AsynchronousByteChannelwrite in class java.nio.channels.AsynchronousSocketChannelpublic <A> void write(java.nio.ByteBuffer[] srcs,
int offset,
int length,
long timeout,
java.util.concurrent.TimeUnit unit,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Long,? super A> hdlr)
write in class java.nio.channels.AsynchronousSocketChannelsrcs - source buffers to writeoffset - offset into buffer arraylength - number of bufferstimeout - ignoredunit - ignoredattachment - ignoredhdlr - completion handler to be called when all buffers have been writtenpublic <A> void write(java.nio.ByteBuffer src,
long timeout,
java.util.concurrent.TimeUnit unit,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Integer,? super A> hdlr)
write in class java.nio.channels.AsynchronousSocketChannelpublic <T> T getOption(java.net.SocketOption<T> name)
throws java.io.IOException
getOption in interface java.nio.channels.NetworkChanneljava.io.IOExceptionpublic java.util.Set<java.net.SocketOption<?>> supportedOptions()
supportedOptions in interface java.nio.channels.NetworkChannelpublic java.nio.channels.AsynchronousSocketChannel bind(java.net.SocketAddress local)
throws java.io.IOException
bind in interface java.nio.channels.NetworkChannelbind in class java.nio.channels.AsynchronousSocketChanneljava.io.IOExceptionpublic <T> java.nio.channels.AsynchronousSocketChannel setOption(java.net.SocketOption<T> name,
T value)
throws java.io.IOException
setOption in interface java.nio.channels.NetworkChannelsetOption in class java.nio.channels.AsynchronousSocketChanneljava.io.IOExceptionpublic java.nio.channels.AsynchronousSocketChannel shutdownInput()
throws java.io.IOException
shutdownInput in class java.nio.channels.AsynchronousSocketChanneljava.io.IOExceptionpublic java.nio.channels.AsynchronousSocketChannel shutdownOutput()
throws java.io.IOException
shutdownOutput in class java.nio.channels.AsynchronousSocketChanneljava.io.IOExceptionpublic java.net.SocketAddress getRemoteAddress()
throws java.io.IOException
getRemoteAddress in class java.nio.channels.AsynchronousSocketChanneljava.io.IOExceptionpublic <A> void connect(java.net.SocketAddress remote,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Void,? super A> hdlr)
connect in class java.nio.channels.AsynchronousSocketChannelpublic java.util.concurrent.Future<java.lang.Void> connect(java.net.SocketAddress remote)
connect in class java.nio.channels.AsynchronousSocketChannelpublic java.net.SocketAddress getLocalAddress()
throws java.io.IOException
getLocalAddress in interface java.nio.channels.NetworkChannelgetLocalAddress in class java.nio.channels.AsynchronousSocketChanneljava.io.IOException