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() |
void |
closeInbound()
Closes inbound.
|
void |
closeOutbound()
Closes outbound.
|
SelectableChannel |
configureBlocking(boolean block) |
boolean |
connect(SocketAddress socketAddress) |
boolean |
isBlocking() |
boolean |
isConnected() |
boolean |
isOpen() |
SelectionKey |
keyFor(Selector selector) |
int |
read(ByteBuffer dst) |
SelectionKey |
register(Selector selector,
int ops,
Object attachment) |
Socket |
socket() |
String |
toString() |
int |
write(ByteBuffer src) |
protected final SocketChannel socketChannel
public DefaultSocketChannelWrapper(SocketChannel socketChannel)
public boolean isBlocking()
isBlocking in interface SocketChannelWrapperAbstractInterruptibleChannel.isOpen()public Socket socket()
socket in interface SocketChannelWrapperSocketChannel.socket()public boolean isConnected()
isConnected in interface SocketChannelWrapper()public boolean connect(SocketAddress socketAddress) throws IOException
connect in interface SocketChannelWrapperIOExceptionSocketChannel.connect(java.net.SocketAddress)public int read(ByteBuffer dst) throws IOException
read in interface SocketChannelWrapperIOExceptionSocketChannel.read(ByteBuffer)public int write(ByteBuffer src) throws IOException
write in interface SocketChannelWrapperIOExceptionSocketChannel.write(ByteBuffer)public SelectableChannel configureBlocking(boolean block) throws IOException
configureBlocking in interface SocketChannelWrapperIOExceptionAbstractSelectableChannel.configureBlocking(boolean)public boolean isOpen()
isOpen in interface SocketChannelWrapperAbstractInterruptibleChannel.isOpen()public 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
close in interface SocketChannelWrapperclose in interface Closeableclose in interface AutoCloseableIOExceptionAbstractInterruptibleChannel.close()public SelectionKey keyFor(Selector selector)
keyFor in interface SocketChannelWrapperAbstractSelectableChannel.keyFor(Selector)public SelectionKey register(Selector selector, int ops, Object attachment) throws ClosedChannelException
register in interface SocketChannelWrapperClosedChannelExceptionAbstractSelectableChannel.register(Selector, int, Object)Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.