public interface DTLSServerSocket extends Closeable
Modifier and Type | Method and Description |
---|---|
DTLSSocket |
accept()
Listens for a connection to be made to this socket and accepts it.
|
InetAddress |
getLocalAddress()
Returns the local address of this server socket.
|
int |
getLocalPort()
Returns the port number on which this socket is listening.
|
DTLSSocket accept() throws IOException
A new Socket s
is created and, if there is a security manager, the security manager's checkAccept
method is called with s.getInetAddress().getHostAddress()
and s.getPort()
as its arguments to
ensure the operation is allowed. This could result in a SecurityException.
IOException
- if an I/O error occurs when waiting for a connection.SecurityException
- if a security manager exists and its checkAccept
method doesn't allow the operation.SocketTimeoutException
- if a timeout was previously set with setSoTimeout and the timeout has been reached.InetAddress getLocalAddress()
If the socket was bound prior to being closed
, then this method will continue to return the local
address after the socket is closed.
If there is a security manager set, its checkConnect
method is called with the local address and
-1
as its arguments to see if the operation is allowed. If the operation is not allowed, the
loopback
address is returned.
null
if the socket is unbound.int getLocalPort()
If the socket was bound prior to being closed
, then this method will continue to return the port
number after the socket is closed.