public class SocketChannelWithTimeouts extends SocketChannel
| Modifier and Type | Field and Description |
|---|---|
protected SelectionKey |
channelKey |
protected Selector |
selector |
protected SocketChannel |
socketChannel |
| Modifier | Constructor and Description |
|---|---|
protected |
SocketChannelWithTimeouts() |
| Modifier and Type | Method and Description |
|---|---|
SocketChannel |
bind(SocketAddress socketAddress) |
boolean |
connect(SocketAddress remote) |
boolean |
finishConnect() |
SocketAddress |
getLocalAddress() |
<T> T |
getOption(SocketOption<T> socketOption) |
SocketAddress |
getRemoteAddress() |
protected void |
implCloseSelectableChannel() |
protected void |
implConfigureBlocking(boolean block) |
boolean |
isConnected() |
boolean |
isConnectionPending() |
static SocketChannel |
open() |
int |
read(ByteBuffer dst) |
long |
read(ByteBuffer[] dsts,
int offset,
int length) |
void |
setConnectTimeout(int t) |
<T> SocketChannel |
setOption(SocketOption<T> socketOption,
T t) |
void |
setReadTimeout(int t) |
SocketChannel |
shutdownInput() |
SocketChannel |
shutdownOutput() |
Socket |
socket() |
Set<SocketOption<?>> |
supportedOptions() |
int |
write(ByteBuffer src) |
long |
write(ByteBuffer[] srcs,
int offset,
int length) |
open, read, validOps, writeblockingLock, configureBlocking, implCloseChannel, isBlocking, isRegistered, keyFor, provider, registerregisterbegin, close, end, isOpenprotected SocketChannel socketChannel
protected Selector selector
protected SelectionKey channelKey
protected SocketChannelWithTimeouts()
throws IOException
IOExceptionpublic static SocketChannel open() throws IOException
IOExceptionpublic SocketChannel bind(SocketAddress socketAddress) throws IOException
bind in interface NetworkChannelbind in class SocketChannelIOExceptionpublic SocketAddress getLocalAddress() throws IOException
getLocalAddress in interface NetworkChannelgetLocalAddress in class SocketChannelIOExceptionpublic <T> SocketChannel setOption(SocketOption<T> socketOption, T t) throws IOException
setOption in interface NetworkChannelsetOption in class SocketChannelIOExceptionpublic <T> T getOption(SocketOption<T> socketOption) throws IOException
IOExceptionpublic Set<SocketOption<?>> supportedOptions()
public SocketChannel shutdownInput() throws IOException
shutdownInput in class SocketChannelIOExceptionpublic SocketChannel shutdownOutput() throws IOException
shutdownOutput in class SocketChannelIOExceptionpublic boolean connect(SocketAddress remote) throws IOException
connect in class SocketChannelIOExceptionpublic int read(ByteBuffer dst) throws IOException
read in interface ReadableByteChannelread in class SocketChannelIOExceptionpublic long read(ByteBuffer[] dsts, int offset, int length) throws IOException
read in interface ScatteringByteChannelread in class SocketChannelIOExceptionpublic int write(ByteBuffer src) throws IOException
write in interface WritableByteChannelwrite in class SocketChannelIOExceptionpublic long write(ByteBuffer[] srcs, int offset, int length) throws IOException
write in interface GatheringByteChannelwrite in class SocketChannelIOExceptionprotected void implCloseSelectableChannel()
throws IOException
implCloseSelectableChannel in class AbstractSelectableChannelIOExceptionprotected void implConfigureBlocking(boolean block)
throws IOException
implConfigureBlocking in class AbstractSelectableChannelIOExceptionpublic Socket socket()
socket in class SocketChannelpublic boolean isConnected()
isConnected in class SocketChannelpublic boolean isConnectionPending()
isConnectionPending in class SocketChannelpublic boolean finishConnect()
throws IOException
finishConnect in class SocketChannelIOExceptionpublic void setConnectTimeout(int t)
public void setReadTimeout(int t)
public SocketAddress getRemoteAddress() throws IOException
getRemoteAddress in class SocketChannelIOExceptionCopyright © 2016. All rights reserved.