public class ReliableServerSocket
extends java.net.ServerSocket
ServerSocket| Constructor and Description |
|---|
ReliableServerSocket()
Creates an unbound RUDP server socket.
|
ReliableServerSocket(java.net.DatagramSocket sock,
int backlog)
Creates a RUDP server socket attached to the specified UDP socket, with
the specified backlog.
|
ReliableServerSocket(int port)
Creates a RUDP server socket, bound to the specified port.
|
ReliableServerSocket(int port,
int backlog)
Creates a RUDP server socket and binds it to the specified local port,
with the specified backlog.
|
ReliableServerSocket(int port,
int backlog,
java.net.InetAddress bindAddr)
Creates a RUDP server socket and binds it to the specified local port and
IP address, with the specified backlog.
|
| Modifier and Type | Method and Description |
|---|---|
java.net.Socket |
accept() |
void |
bind(java.net.SocketAddress endpoint) |
void |
bind(java.net.SocketAddress endpoint,
int backlog) |
void |
close() |
java.net.InetAddress |
getInetAddress() |
int |
getLocalPort() |
java.net.SocketAddress |
getLocalSocketAddress() |
int |
getSoTimeout() |
boolean |
isBound() |
boolean |
isClosed() |
void |
setSoTimeout(int timeout) |
public ReliableServerSocket()
throws java.io.IOException
java.io.IOException - if an I/O error occurs when opening the underlying UDP
socket.ServerSocket.ServerSocket()public ReliableServerSocket(int port)
throws java.io.IOException
0 creates a socket on any free port. The maximum queue
length for incoming connection indications (a request to connect) is set
to 50. If a connection indication arrives when the queue is
full, the connection is refused.port - the port number, or 0 to use any free port.java.io.IOException - if an I/O error occurs when opening the underlying UDP
socket.ServerSocket.ServerSocket(int)public ReliableServerSocket(int port,
int backlog)
throws java.io.IOException
0 creates a socket on
any free port.port - the port number, or 0 to use any free port.backlog - the listen backlog.java.io.IOException - if an I/O error occurs when opening the underlying UDP
socket.ServerSocket.ServerSocket(int, int)public ReliableServerSocket(int port,
int backlog,
java.net.InetAddress bindAddr)
throws java.io.IOException
0 creates a socket on any free port.port - the port number, or 0 to use any free port.backlog - the listen backlog.bindAddr - the local InetAddress the server will bind to.java.io.IOException - if an I/O error occurs when opening the underlying UDP
socket.ServerSocket.ServerSocket(int, int, InetAddress)public ReliableServerSocket(java.net.DatagramSocket sock,
int backlog)
throws java.io.IOException
sock - the underlying UDP socket.backlog - the listen backlog.java.io.IOException - if an I/O error occurs.public java.net.Socket accept()
throws java.io.IOException
accept in class java.net.ServerSocketjava.io.IOExceptionpublic void bind(java.net.SocketAddress endpoint)
throws java.io.IOException
bind in class java.net.ServerSocketjava.io.IOExceptionpublic void bind(java.net.SocketAddress endpoint,
int backlog)
throws java.io.IOException
bind in class java.net.ServerSocketjava.io.IOExceptionpublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.net.ServerSocketpublic java.net.InetAddress getInetAddress()
getInetAddress in class java.net.ServerSocketpublic int getLocalPort()
getLocalPort in class java.net.ServerSocketpublic java.net.SocketAddress getLocalSocketAddress()
getLocalSocketAddress in class java.net.ServerSocketpublic boolean isBound()
isBound in class java.net.ServerSocketpublic boolean isClosed()
isClosed in class java.net.ServerSocketpublic void setSoTimeout(int timeout)
setSoTimeout in class java.net.ServerSocketpublic int getSoTimeout()
getSoTimeout in class java.net.ServerSocket