Class Overview
The extension of ServerSocket
which provides secure server sockets
based on protocols like SSL, TLS, or others.
Summary
Public Methods |
abstract
boolean
|
getEnableSessionCreation()
Returns whether new SSL sessions may be established for new connections.
|
abstract
String[]
|
getEnabledCipherSuites()
Returns the names of the enabled cipher suites to be used for new
connections.
|
abstract
String[]
|
getEnabledProtocols()
Returns the names of the enabled protocols to be used for new
connections.
|
abstract
boolean
|
getNeedClientAuth()
Returns whether server-mode connections will be configured to require
client authentication.
|
abstract
String[]
|
getSupportedCipherSuites()
Returns the names of the supported cipher suites.
|
abstract
String[]
|
getSupportedProtocols()
Returns the names of the supported protocols.
|
abstract
boolean
|
getUseClientMode()
Returns whether new connection will act in client mode when handshaking.
|
abstract
boolean
|
getWantClientAuth()
Returns whether server-mode connections will be configured to request
client authentication.
|
abstract
void
|
setEnableSessionCreation(boolean flag)
Sets whether new SSL sessions may be established for new connections.
|
abstract
void
|
setEnabledCipherSuites(String[] suites)
Sets the names of the cipher suites to be enabled for new connections.
|
abstract
void
|
setEnabledProtocols(String[] protocols)
Sets the names of the protocols to be enabled for new connections.
|
abstract
void
|
setNeedClientAuth(boolean need)
Sets whether server-mode connections will be configured to require client
authentication.
|
abstract
void
|
setUseClientMode(boolean mode)
Sets whether new connections should act in client mode when handshaking.
|
abstract
void
|
setWantClientAuth(boolean want)
Sets whether server-mode connections will be configured to request client
authentication.
|
[Expand]
Inherited Methods |
From class java.net.ServerSocket
Socket
|
accept()
Waits for an incoming request and blocks until the connection is opened.
|
void
|
bind(SocketAddress localAddr)
Binds this server socket to the given local socket address.
|
void
|
bind(SocketAddress localAddr, int backlog)
Binds this server socket to the given local socket address.
|
void
|
close()
Closes this server socket and its implementation.
|
ServerSocketChannel
|
getChannel()
Gets the related channel if this instance was created by a
ServerSocketChannel .
|
InetAddress
|
getInetAddress()
Gets the local IP address of this server socket or null if the
socket is unbound.
|
int
|
getLocalPort()
Gets the local port of this server socket or -1 if the socket is
unbound.
|
SocketAddress
|
getLocalSocketAddress()
Gets the local socket address of this server socket or null if
the socket is unbound.
|
int
|
getReceiveBufferSize()
Gets the value for the receive buffer size socket option SocketOptions.SO_RCVBUF .
|
boolean
|
getReuseAddress()
Gets the value of the socket option SocketOptions.SO_REUSEADDR .
|
synchronized
int
|
getSoTimeout()
Gets the timeout period of this server socket.
|
final
void
|
implAccept(Socket aSocket)
Invokes the server socket implementation to accept a connection on the
given socket aSocket .
|
boolean
|
isBound()
Returns whether this server socket is bound to a local address and port
or not.
|
boolean
|
isClosed()
Returns whether this server socket is closed or not.
|
void
|
setPerformancePreferences(int connectionTime, int latency, int bandwidth)
Sets performance preferences for connection time, latency and bandwidth.
|
void
|
setReceiveBufferSize(int size)
Sets the server socket receive buffer size SocketOptions.SO_RCVBUF .
|
void
|
setReuseAddress(boolean reuse)
Sets the value for the socket option SocketOptions.SO_REUSEADDR .
|
synchronized
void
|
setSoTimeout(int timeout)
Sets the timeout period of this server socket.
|
synchronized
static
void
|
setSocketFactory(SocketImplFactory aFactory)
Sets the server socket implementation factory of this instance.
|
String
|
toString()
Returns a textual representation of this server socket including the
address, port and the state.
|
|
From class java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Is called before the object's memory is being reclaimed by the VM.
|
final
Class<? extends Object>
|
getClass()
Returns the unique instance of Class which represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
|
Protected Constructors
protected
SSLServerSocket
()
Only to be used by subclasses.
Creates a TCP server socket with the default authentication context.
protected
SSLServerSocket
(int port)
Only to be used by subclasses.
Creates a TCP server socket on the specified port with the default
authentication context. The connection's default backlog size is 50
connections.
Parameters
port
| the port to listen on. |
protected
SSLServerSocket
(int port, int backlog)
Only to be used by subclasses.
Creates a TCP server socket on the specified port using the specified
backlog and the default authentication context.
Parameters
port
| the port to listen on. |
backlog
| the number of pending connections to queue. |
protected
SSLServerSocket
(int port, int backlog, InetAddress address)
Only to be used by subclasses.
Creates a TCP server socket on the specified port, using the specified
backlog, listening on the specified interface, and using the default
authentication context.
Parameters
port
| the port the listen on. |
backlog
| the number of pending connections to queue. |
address
| the address of the interface to accept connections on. |
Public Methods
public
abstract
boolean
getEnableSessionCreation
()
Returns whether new SSL sessions may be established for new connections.
Returns
true
if new SSL sessions may be established,
false
if existing SSL sessions must be reused.
public
abstract
String[]
getEnabledCipherSuites
()
Returns the names of the enabled cipher suites to be used for new
connections.
Returns
- the names of the enabled cipher suites to be used for new
connections.
public
abstract
String[]
getEnabledProtocols
()
Returns the names of the enabled protocols to be used for new
connections.
Returns
- the names of the enabled protocols to be used for new
connections.
public
abstract
boolean
getNeedClientAuth
()
Returns whether server-mode connections will be configured to require
client authentication.
Returns
true
if client authentication is required, false
if no client authentication is needed.
public
abstract
String[]
getSupportedCipherSuites
()
Returns the names of the supported cipher suites.
Returns
- the names of the supported cipher suites.
public
abstract
String[]
getSupportedProtocols
()
Returns the names of the supported protocols.
Returns
- the names of the supported protocols.
public
abstract
boolean
getUseClientMode
()
Returns whether new connection will act in client mode when handshaking.
Returns
true
if new connections will act in client mode when
handshaking, false
if not.
public
abstract
boolean
getWantClientAuth
()
Returns whether server-mode connections will be configured to request
client authentication.
Returns
true
is client authentication will be requested,
false
if no client authentication is needed.
public
abstract
void
setEnableSessionCreation
(boolean flag)
Sets whether new SSL sessions may be established for new connections.
Parameters
flag
| true if new SSL sessions may be established,
false if existing SSL sessions must be reused. |
public
abstract
void
setEnabledCipherSuites
(String[] suites)
Sets the names of the cipher suites to be enabled for new connections.
Only cipher suites returned by getSupportedCipherSuites() are
allowed.
Parameters
suites
| the names of the to be enabled cipher suites. |
public
abstract
void
setEnabledProtocols
(String[] protocols)
Sets the names of the protocols to be enabled for new connections. Only
protocols returned by getSupportedProtocols() are allowed.
Parameters
protocols
| the names of the to be enabled protocols. |
public
abstract
void
setNeedClientAuth
(boolean need)
Sets whether server-mode connections will be configured to require client
authentication. The client authentication is one of the following:
- authentication required
- authentication requested
- no authentication needed
This method overrides the setting of
setWantClientAuth(boolean).
Parameters
need
| true if client authentication is required,
false if no authentication is needed. |
public
abstract
void
setUseClientMode
(boolean mode)
Sets whether new connections should act in client mode when handshaking.
Parameters
mode
| true if new connections should act in client mode,
false if not. |
public
abstract
void
setWantClientAuth
(boolean want)
Sets whether server-mode connections will be configured to request client
authentication. The client authentication is one of the following:
- authentication required
- authentication requested
- no authentication needed
This method overrides the setting of
setNeedClientAuth(boolean).
Parameters
want
| true if client authentication should be requested,
false if no authentication is needed. |