public abstract class Socket extends Object implements ByteChannel
| Modifier and Type | Field and Description |
|---|---|
static int |
IPTOS_LOWDELAY |
static int |
IPTOS_MINCOST |
static int |
IPTOS_RELIABILITY |
static int |
IPTOS_THROUGHPUT |
static int |
MSG_DONTROUTE |
static int |
MSG_DONTWAIT |
static int |
MSG_MORE |
static int |
MSG_OOB |
static int |
MSG_PEEK |
static int |
MSG_TRUNC |
static int |
MSG_WAITALL |
static int |
SOL_IP |
static int |
SOL_IPV6 |
static int |
SOL_SOCKET |
static int |
SOL_TCP |
static int |
SOL_UDP |
| Constructor and Description |
|---|
Socket() |
| Modifier and Type | Method and Description |
|---|---|
abstract Socket |
accept() |
Socket |
acceptNonBlocking() |
abstract void |
bind(InetAddress address,
int port,
int backlog) |
void |
bind(String host,
int port,
int backlog) |
static Socket |
bindInet(InetAddress address,
int port,
int backlog) |
static Socket |
bindUnix(File unixPath,
int backlog) |
abstract void |
close() |
abstract void |
connect(InetAddress address,
int port) |
void |
connect(String host,
int port) |
static Socket |
connectInet(InetAddress address,
int port) |
static Socket |
connectUnix(File unixPath) |
static Socket |
create() |
static Socket |
createDatagramSocket() |
static Socket |
createServerSocket() |
static Socket |
fromFD(int fd) |
abstract boolean |
getDeferAccept() |
abstract boolean |
getKeepAlive() |
abstract InetSocketAddress |
getLocalAddress() |
abstract boolean |
getNoDelay() |
abstract byte[] |
getOption(int level,
int option) |
abstract int |
getRecvBuffer() |
abstract InetSocketAddress |
getRemoteAddress() |
abstract boolean |
getReuseAddr() |
abstract boolean |
getReusePort() |
abstract int |
getSendBuffer() |
abstract SslContext |
getSslContext() |
abstract <T> T |
getSslOption(SslOption<T> option) |
abstract boolean |
getTcpFastOpen() |
abstract int |
getTimeout() |
abstract int |
getTos() |
abstract boolean |
isBlocking() |
abstract boolean |
isOpen() |
abstract void |
listen(int backlog) |
int |
read(byte[] data,
int offset,
int count) |
abstract int |
read(byte[] data,
int offset,
int count,
int flags) |
abstract void |
readFully(byte[] data,
int offset,
int count) |
abstract int |
readRaw(long buf,
int count,
int flags) |
abstract InetSocketAddress |
recv(ByteBuffer buffer,
int flags) |
abstract int |
send(ByteBuffer data,
int flags,
InetAddress address,
int port) |
abstract long |
sendFile(RandomAccessFile file,
long offset,
long count) |
abstract void |
setBlocking(boolean blocking) |
abstract void |
setDeferAccept(boolean deferAccept) |
abstract void |
setKeepAlive(boolean keepAlive) |
abstract void |
setNoDelay(boolean noDelay) |
abstract boolean |
setOption(int level,
int option,
byte[] value) |
abstract void |
setRecvBuffer(int recvBuf) |
abstract void |
setReuseAddr(boolean reuseAddr,
boolean reusePort) |
abstract void |
setSendBuffer(int sendBuf) |
abstract void |
setTcpFastOpen(boolean tcpFastOpen) |
abstract void |
setTimeout(int timeout) |
abstract void |
setTos(int tos) |
abstract Socket |
sslUnwrap() |
abstract Socket |
sslWrap(SslContext context) |
int |
write(byte[] data,
int offset,
int count) |
abstract int |
write(byte[] data,
int offset,
int count,
int flags) |
abstract void |
writeFully(byte[] data,
int offset,
int count) |
abstract int |
writeRaw(long buf,
int count,
int flags) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadwritepublic static final int SOL_SOCKET
public static final int SOL_IP
public static final int SOL_IPV6
public static final int SOL_TCP
public static final int SOL_UDP
public static final int MSG_OOB
public static final int MSG_PEEK
public static final int MSG_DONTROUTE
public static final int MSG_TRUNC
public static final int MSG_DONTWAIT
public static final int MSG_WAITALL
public static final int MSG_MORE
public static final int IPTOS_MINCOST
public static final int IPTOS_RELIABILITY
public static final int IPTOS_THROUGHPUT
public static final int IPTOS_LOWDELAY
public abstract void close()
public abstract Socket accept() throws IOException
IOExceptionpublic abstract void connect(InetAddress address, int port) throws IOException
IOExceptionpublic abstract void bind(InetAddress address, int port, int backlog) throws IOException
IOExceptionpublic abstract void listen(int backlog)
throws IOException
IOExceptionpublic abstract int writeRaw(long buf,
int count,
int flags)
throws IOException
IOExceptionpublic abstract int write(byte[] data,
int offset,
int count,
int flags)
throws IOException
IOExceptionpublic abstract void writeFully(byte[] data,
int offset,
int count)
throws IOException
IOExceptionpublic abstract int send(ByteBuffer data, int flags, InetAddress address, int port) throws IOException
IOExceptionpublic abstract int readRaw(long buf,
int count,
int flags)
throws IOException
IOExceptionpublic abstract int read(byte[] data,
int offset,
int count,
int flags)
throws IOException
IOExceptionpublic abstract void readFully(byte[] data,
int offset,
int count)
throws IOException
IOExceptionpublic abstract InetSocketAddress recv(ByteBuffer buffer, int flags) throws IOException
IOExceptionpublic abstract long sendFile(RandomAccessFile file, long offset, long count) throws IOException
IOExceptionpublic abstract void setBlocking(boolean blocking)
public abstract boolean isBlocking()
public abstract void setTimeout(int timeout)
public abstract int getTimeout()
public abstract void setKeepAlive(boolean keepAlive)
public abstract boolean getKeepAlive()
public abstract void setNoDelay(boolean noDelay)
public abstract boolean getNoDelay()
public abstract void setTcpFastOpen(boolean tcpFastOpen)
public abstract boolean getTcpFastOpen()
public abstract void setDeferAccept(boolean deferAccept)
public abstract boolean getDeferAccept()
public abstract void setReuseAddr(boolean reuseAddr,
boolean reusePort)
public abstract boolean getReuseAddr()
public abstract boolean getReusePort()
public abstract void setRecvBuffer(int recvBuf)
public abstract int getRecvBuffer()
public abstract void setSendBuffer(int sendBuf)
public abstract int getSendBuffer()
public abstract void setTos(int tos)
public abstract int getTos()
public abstract byte[] getOption(int level,
int option)
public abstract boolean setOption(int level,
int option,
byte[] value)
public abstract InetSocketAddress getLocalAddress()
public abstract InetSocketAddress getRemoteAddress()
public abstract Socket sslWrap(SslContext context) throws IOException
IOExceptionpublic abstract Socket sslUnwrap()
public abstract SslContext getSslContext()
public abstract <T> T getSslOption(SslOption<T> option)
public Socket acceptNonBlocking() throws IOException
IOExceptionpublic void connect(String host, int port) throws IOException
IOExceptionpublic void bind(String host, int port, int backlog) throws IOException
IOExceptionpublic int write(byte[] data,
int offset,
int count)
throws IOException
IOExceptionpublic int read(byte[] data,
int offset,
int count)
throws IOException
IOExceptionpublic static Socket create() throws IOException
IOExceptionpublic static Socket createServerSocket() throws IOException
IOExceptionpublic static Socket createDatagramSocket() throws IOException
IOExceptionpublic static Socket connectInet(InetAddress address, int port) throws IOException
IOExceptionpublic static Socket bindInet(InetAddress address, int port, int backlog) throws IOException
IOExceptionpublic static Socket connectUnix(File unixPath) throws IOException
IOExceptionpublic static Socket bindUnix(File unixPath, int backlog) throws IOException
IOExceptionpublic static Socket fromFD(int fd) throws IOException
IOExceptionCopyright © 2019. All rights reserved.