Class JavaDatagramSocket
java.lang.Object
one.nio.net.Socket
one.nio.net.SelectableJavaSocket
one.nio.net.JavaDatagramSocket
- All Implemented Interfaces:
Closeable, AutoCloseable, ByteChannel, Channel, ReadableByteChannel, WritableByteChannel
-
Field Summary
FieldsFields inherited from class SelectableJavaSocket
POLL_READ, POLL_WRITEFields inherited from class Socket
AF_INET, AF_INET6, AF_UNIX, IPTOS_LOWDELAY, IPTOS_MINCOST, IPTOS_RELIABILITY, IPTOS_THROUGHPUT, MSG_DONTROUTE, MSG_DONTWAIT, MSG_MORE, MSG_OOB, MSG_PEEK, MSG_TRUNC, MSG_WAITALL, NO_PORT, SO_BROADCAST, SO_BSDCOMPAT, SO_DEBUG, SO_DONTROUTE, SO_ERROR, SO_KEEPALIVE, SO_LINGER, SO_NO_CHECK, SO_OOBINLINE, SO_PASSCRED, SO_PEERCRED, SO_PRIORITY, SO_RCVBUF, SO_RCVLOWAT, SO_RCVTIMEO, SO_REUSEADDR, SO_REUSEPORT, SO_SNDBUF, SO_SNDLOWAT, SO_SNDTIMEO, SO_TYPE, SOCK_DGRAM, SOCK_RAW, SOCK_RDM, SOCK_SEQPACKET, SOCK_STREAM, SOL_IP, SOL_IPV6, SOL_SOCKET, SOL_TCP, SOL_UDP, TCP_CONGESTION, TCP_CORK, TCP_DEFER_ACCEPT, TCP_INFO, TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_LINGER2, TCP_MAXSEG, TCP_NODELAY, TCP_QUICKACK, TCP_SYNCNT, TCP_USER_TIMEOUT, TCP_WINDOW_CLAMP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Socketaccept()final voidbind(InetAddress address, int port, int backlog) final voidclose()final voidconnect(InetAddress address, int port) booleanbooleanfinal InetSocketAddressbooleanfinal byte[]getOption(int level, int option) intfinal InetSocketAddressbooleanbooleanint<T> TgetSslOption(SslOption<T> option) booleanintintgetTos()booleanfinal booleanisOpen()final voidlisten(int backlog) final intread(byte[] data, int offset, int count, int flags) final intread(ByteBuffer dst) final voidreadFully(byte[] data, int offset, int count) final intreadRaw(long buf, int count, int flags) final InetSocketAddressrecv(ByteBuffer dst, int flags) intfinal intsend(ByteBuffer src, int flags, InetAddress address, int port) final longsendFile(RandomAccessFile file, long offset, long count) intfinal voidsetBlocking(boolean blocking) final voidsetDeferAccept(boolean deferAccept) final voidsetKeepAlive(boolean keepAlive) final voidsetNoDelay(boolean noDelay) final booleansetOption(int level, int option, byte[] value) final voidsetRecvBuffer(int recvBuf) final voidsetReuseAddr(boolean reuseAddr, boolean reusePort) final voidsetSendBuffer(int sendBuf) final voidsetTcpFastOpen(boolean tcpFastOpen) final voidsetTimeout(int timeout) final voidsetTos(int tos) sslWrap(SslContext context) final intwrite(byte[] data, int offset, int count, int flags) final intwrite(ByteBuffer src) final voidwriteFully(byte[] data, int offset, int count) final intwriteRaw(long buf, int count, int flags) Methods inherited from class SelectableJavaSocket
checkTimeoutMethods inherited from class Socket
acceptNonBlocking, bind, bindInet, bindUnix, connect, connectInet, connectUnix, create, createClientSocket, createClientSocket, createDatagramSocket, createServerSocket, createUnixSocket, fromFD, getNotsentLowat, getThinLinearTimeouts, handshake, read, send, setNotsentLowat, setThinLinearTimeouts, write
-
Field Details
-
ch
-
-
Constructor Details
-
JavaDatagramSocket
JavaDatagramSocket() throws IOException- Throws:
IOException
-
-
Method Details
-
isOpen
-
close
-
accept
-
connect
- Specified by:
connectin classSocket- Throws:
IOException
-
bind
- Specified by:
bindin classSocket- Throws:
IOException
-
listen
- Specified by:
listenin classSocket- Throws:
IOException
-
writeRaw
- Specified by:
writeRawin classSocket- Throws:
IOException
-
write
- Specified by:
writein classSocket- Throws:
IOException
-
writeFully
- Specified by:
writeFullyin classSocket- Throws:
IOException
-
send
- Specified by:
sendin classSocket- Throws:
IOException
-
readRaw
- Specified by:
readRawin classSocket- Throws:
IOException
-
read
- Specified by:
readin classSocket- Throws:
IOException
-
recv
- Specified by:
recvin classSocket- Throws:
IOException
-
readFully
- Specified by:
readFullyin classSocket- Throws:
IOException
-
sendFile
- Specified by:
sendFilein classSocket- Throws:
IOException
-
read
- Throws:
IOException
-
write
- Throws:
IOException
-
sendMsg
- Specified by:
sendMsgin classSocket- Throws:
IOException
-
recvMsg
- Specified by:
recvMsgin classSocket- Throws:
IOException
-
setBlocking
public final void setBlocking(boolean blocking) - Specified by:
setBlockingin classSocket
-
isBlocking
public boolean isBlocking()- Specified by:
isBlockingin classSocket
-
setTimeout
public final void setTimeout(int timeout) - Specified by:
setTimeoutin classSocket
-
getTimeout
public int getTimeout()- Specified by:
getTimeoutin classSocket
-
setKeepAlive
public final void setKeepAlive(boolean keepAlive) - Specified by:
setKeepAlivein classSocket
-
getKeepAlive
public boolean getKeepAlive()- Specified by:
getKeepAlivein classSocket
-
setNoDelay
public final void setNoDelay(boolean noDelay) - Specified by:
setNoDelayin classSocket
-
getNoDelay
public boolean getNoDelay()- Specified by:
getNoDelayin classSocket
-
setTcpFastOpen
public final void setTcpFastOpen(boolean tcpFastOpen) - Specified by:
setTcpFastOpenin classSocket
-
getTcpFastOpen
public boolean getTcpFastOpen()- Specified by:
getTcpFastOpenin classSocket
-
setDeferAccept
public final void setDeferAccept(boolean deferAccept) - Specified by:
setDeferAcceptin classSocket
-
getDeferAccept
public boolean getDeferAccept()- Specified by:
getDeferAcceptin classSocket
-
setReuseAddr
public final void setReuseAddr(boolean reuseAddr, boolean reusePort) - Specified by:
setReuseAddrin classSocket
-
getReuseAddr
public boolean getReuseAddr()- Specified by:
getReuseAddrin classSocket
-
getReusePort
public boolean getReusePort()- Specified by:
getReusePortin classSocket
-
setRecvBuffer
public final void setRecvBuffer(int recvBuf) - Specified by:
setRecvBufferin classSocket
-
getRecvBuffer
public int getRecvBuffer()- Specified by:
getRecvBufferin classSocket
-
setTos
-
getTos
-
setSendBuffer
public final void setSendBuffer(int sendBuf) - Specified by:
setSendBufferin classSocket
-
getSendBuffer
public int getSendBuffer()- Specified by:
getSendBufferin classSocket
-
getOption
-
setOption
-
getLocalAddress
- Specified by:
getLocalAddressin classSocket
-
getRemoteAddress
- Specified by:
getRemoteAddressin classSocket
-
sslWrap
-
sslUnwrap
-
getSslContext
- Specified by:
getSslContextin classSocket
-
getSslOption
- Specified by:
getSslOptionin classSocket
-
getSelectableChannel
- Specified by:
getSelectableChannelin classSelectableJavaSocket
-