public class Nio2Channel extends Object implements AsynchronousByteChannel
| Modifier and Type | Field and Description |
|---|---|
protected SecureNio2Channel.ApplicationBufferHandler |
bufHandler |
protected static ByteBuffer |
emptyBuf |
protected AsynchronousSocketChannel |
sc |
protected SocketWrapper<Nio2Channel> |
socket |
| Constructor and Description |
|---|
Nio2Channel(SecureNio2Channel.ApplicationBufferHandler bufHandler) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this channel.
|
void |
close(boolean force) |
Future<Boolean> |
flush() |
int |
getBufferSize() |
SecureNio2Channel.ApplicationBufferHandler |
getBufHandler() |
AsynchronousSocketChannel |
getIOChannel() |
SocketWrapper<Nio2Channel> |
getSocket() |
int |
handshake()
Performs SSL handshake hence is a no-op for the non-secure
implementation.
|
boolean |
isClosing() |
boolean |
isHandshakeComplete() |
boolean |
isOpen()
Tells whether or not this channel is open.
|
Future<Integer> |
read(ByteBuffer dst) |
<A> void |
read(ByteBuffer dst,
A attachment,
CompletionHandler<Integer,? super A> handler) |
<A> void |
read(ByteBuffer dst,
long timeout,
TimeUnit unit,
A attachment,
CompletionHandler<Integer,? super A> handler) |
void |
reset(AsynchronousSocketChannel channel,
SocketWrapper<Nio2Channel> socket)
Reset the channel
|
String |
toString() |
Future<Integer> |
write(ByteBuffer src) |
<A> void |
write(ByteBuffer[] srcs,
int offset,
int length,
long timeout,
TimeUnit unit,
A attachment,
CompletionHandler<Long,? super A> handler) |
<A> void |
write(ByteBuffer src,
A attachment,
CompletionHandler<Integer,? super A> handler) |
<A> void |
write(ByteBuffer src,
long timeout,
TimeUnit unit,
A attachment,
CompletionHandler<Integer,? super A> handler) |
protected static ByteBuffer emptyBuf
protected AsynchronousSocketChannel sc
protected SocketWrapper<Nio2Channel> socket
protected SecureNio2Channel.ApplicationBufferHandler bufHandler
public Nio2Channel(SecureNio2Channel.ApplicationBufferHandler bufHandler)
public void reset(AsynchronousSocketChannel channel, SocketWrapper<Nio2Channel> socket) throws IOException
IOException - If a problem was encountered resetting the channelpublic SocketWrapper<Nio2Channel> getSocket()
public int getBufferSize()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface AsynchronousChannelclose in interface ChannelIOException - If an I/O error occurspublic void close(boolean force)
throws IOException
IOExceptionpublic boolean isOpen()
public SecureNio2Channel.ApplicationBufferHandler getBufHandler()
public AsynchronousSocketChannel getIOChannel()
public boolean isClosing()
public boolean isHandshakeComplete()
public int handshake()
throws IOException
IOExceptionpublic Future<Integer> read(ByteBuffer dst)
read in interface AsynchronousByteChannelpublic <A> void read(ByteBuffer dst, A attachment, CompletionHandler<Integer,? super A> handler)
read in interface AsynchronousByteChannelpublic <A> void read(ByteBuffer dst, long timeout, TimeUnit unit, A attachment, CompletionHandler<Integer,? super A> handler)
public Future<Integer> write(ByteBuffer src)
write in interface AsynchronousByteChannelpublic <A> void write(ByteBuffer src, A attachment, CompletionHandler<Integer,? super A> handler)
write in interface AsynchronousByteChannelpublic <A> void write(ByteBuffer src, long timeout, TimeUnit unit, A attachment, CompletionHandler<Integer,? super A> handler)
public <A> void write(ByteBuffer[] srcs, int offset, int length, long timeout, TimeUnit unit, A attachment, CompletionHandler<Long,? super A> handler)
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.