public class SocketDescriptor extends Object implements FileDescriptor
| Modifier and Type | Field and Description |
|---|---|
protected SocketChannel |
channel |
protected Selector |
readSelector |
protected Selector |
writeSelector |
| Constructor and Description |
|---|
SocketDescriptor() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
connect(SocketAddress remote) |
boolean |
finishConnect() |
SocketAddress |
getLocalAddress() |
SocketAddress |
getRemoteAddress() |
protected void |
implCloseSelectableChannel() |
protected void |
implConfigureBlocking(boolean block) |
boolean |
isConnected() |
boolean |
isConnectionPending() |
int |
read(byte[] buf,
int bufPtr,
int length) |
int |
read(ByteBuffer buf) |
long |
read(ByteBuffer[] buf,
int offset,
int length) |
int |
select(int interestOps,
Integer timeout) |
protected void |
setChannel(SocketChannel channel_) |
void |
shutdown() |
Socket |
socket() |
int |
write(byte[] buf,
int bufPtr,
int length) |
int |
write(ByteBuffer buf) |
long |
write(ByteBuffer[] buf,
int offset,
int length) |
protected SocketChannel channel
protected Selector writeSelector
protected Selector readSelector
public void shutdown()
throws IOException
IOExceptionpublic void close()
throws IOException
close in interface FileDescriptorIOExceptionpublic int read(byte[] buf,
int bufPtr,
int length)
throws Exception
read in interface FileDescriptorExceptionpublic int write(byte[] buf,
int bufPtr,
int length)
throws Exception
write in interface FileDescriptorExceptionpublic int select(int interestOps,
Integer timeout)
throws Exception
select in interface FileDescriptorExceptionpublic int write(ByteBuffer buf) throws Exception
Exceptionpublic long write(ByteBuffer[] buf, int offset, int length) throws IOException
IOExceptionpublic int read(ByteBuffer buf) throws IOException
IOExceptionpublic long read(ByteBuffer[] buf, int offset, int length) throws IOException
IOExceptionpublic Socket socket()
public SocketAddress getRemoteAddress() throws IOException
IOExceptionpublic SocketAddress getLocalAddress() throws IOException
IOExceptionpublic boolean isConnectionPending()
public boolean connect(SocketAddress remote) throws IOException
IOExceptionpublic boolean finishConnect()
throws IOException
IOExceptionpublic boolean isConnected()
protected void implConfigureBlocking(boolean block)
throws IOException
IOExceptionprotected void implCloseSelectableChannel()
throws IOException
IOExceptionprotected void setChannel(SocketChannel channel_)
Copyright © 2019. All rights reserved.