public class DefaultSocketChannelWrapper extends Object implements SocketChannelWrapper
| Modifier and Type | Field and Description |
|---|---|
protected SocketChannel |
socketChannel |
| Constructor and Description |
|---|
DefaultSocketChannelWrapper(SocketChannel socketChannel) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes socket channel.
|
void |
closeInbound()
Closes inbound.
|
void |
closeOutbound()
Closes outbound.
|
SelectableChannel |
configureBlocking(boolean b) |
boolean |
connect(SocketAddress socketAddress) |
boolean |
isBlocking() |
boolean |
isConnected() |
boolean |
isOpen() |
SelectionKey |
keyFor(Selector selector) |
int |
read(ByteBuffer byteBuffer) |
SelectionKey |
register(Selector selector,
int ops,
Object attachment) |
Socket |
socket() |
String |
toString() |
int |
write(ByteBuffer byteBuffer) |
protected final SocketChannel socketChannel
public DefaultSocketChannelWrapper(SocketChannel socketChannel)
public boolean isBlocking()
isBlocking in interface SocketChannelWrapperpublic Socket socket()
socket in interface SocketChannelWrapperpublic boolean isConnected()
isConnected in interface SocketChannelWrapperpublic boolean connect(SocketAddress socketAddress) throws IOException
connect in interface SocketChannelWrapperIOExceptionpublic int read(ByteBuffer byteBuffer) throws IOException
read in interface SocketChannelWrapperIOExceptionpublic int write(ByteBuffer byteBuffer) throws IOException
write in interface SocketChannelWrapperIOExceptionpublic SelectableChannel configureBlocking(boolean b) throws IOException
configureBlocking in interface SocketChannelWrapperIOExceptionpublic boolean isOpen()
isOpen in interface SocketChannelWrapperpublic void closeInbound()
throws IOException
SocketChannelWrapperNot thread safe. Should be called in channel reader thread.
closeInbound in interface SocketChannelWrapperIOExceptionpublic void closeOutbound()
throws IOException
SocketChannelWrapperNot thread safe. Should be called in channel writer thread.
closeOutbound in interface SocketChannelWrapperIOExceptionpublic void close()
throws IOException
SocketChannelWrapperclose in interface SocketChannelWrapperclose in interface Closeableclose in interface AutoCloseableIOExceptionpublic SelectionKey keyFor(Selector selector)
keyFor in interface SocketChannelWrapperpublic SelectionKey register(Selector selector, int ops, Object attachment) throws ClosedChannelException
register in interface SocketChannelWrapperClosedChannelExceptionCopyright © 2015 Hazelcast, Inc.. All Rights Reserved.