iaik.security.ssl
Class SSLServerSocket

java.lang.Object
  extended by java.net.ServerSocket
      extended by iaik.security.ssl.SSLServerSocket

public class SSLServerSocket
extends java.net.ServerSocket

This class implements SSL server sockets. A SSL server socket waits for requests to come in over the network and returns a new SSLSocket.


Constructor Summary
SSLServerSocket(int port, int backlog, java.net.InetAddress bindAddr, SSLServerContext context)
          Create a server with the specified port, listen backlog, local IP address to bind to, and SSLContext.
SSLServerSocket(int port, int backlog, SSLServerContext context)
          Creates a server socket with a specified SSLContext and binds it to the specified local port number.
SSLServerSocket(int port, SSLServerContext context)
          Creates a server socket on a specified port with a specified SSLContext.
 
Method Summary
 java.net.Socket accept()
          Listens for a connection to be made to this socket and accepts it.
 SSLServerContext getContext()
          Get the context of this SSLServerSocket.
 void setContext(SSLServerContext ssl_context)
          Set the context of this SSLServerSocket.
 
Methods inherited from class java.net.ServerSocket
bind, bind, close, getChannel, getInetAddress, getLocalPort, getLocalSocketAddress, getReceiveBufferSize, getReuseAddress, getSoTimeout, implAccept, isBound, isClosed, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSocketFactory, setSoTimeout, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SSLServerSocket

public SSLServerSocket(int port,
                       SSLServerContext context)
                throws java.io.IOException
Creates a server socket on a specified port with a specified SSLContext. A port of 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.

Parameters:
port - the port number, or 0 to use any free port
context - the SSLContext for new SSLSockets
Throws:
java.io.IOException

SSLServerSocket

public SSLServerSocket(int port,
                       int backlog,
                       SSLServerContext context)
                throws java.io.IOException
Creates a server socket with a specified SSLContext and binds it to the specified local port number. A port number of 0 creates a socket on any free port.

The maximum queue length for incoming connection indications (a request to connect) is set to the count parameter. If a connection indication arrives when the queue is full, the connection is refused.

Parameters:
port - the port number, or 0 to use any free port
backlog - the maximum length of the queue
context - the SSLContext for new SSLSockets
Throws:
java.io.IOException

SSLServerSocket

public SSLServerSocket(int port,
                       int backlog,
                       java.net.InetAddress bindAddr,
                       SSLServerContext context)
                throws java.io.IOException
Create a server with the specified port, listen backlog, local IP address to bind to, and SSLContext. The bindAddr argument can be used on a multi-homed host for a ServerSocket that will only accept connect requests to one of its addresses. If bindAddr is null, it will default accepting connections on any/all local addresses. The port must be between 0 and 65535, inclusive.

Parameters:
port - the port number, or 0 to use any free port
backlog - the maximum length of the queue
bindAddr - the local InetAddress the server will bind to
context - the SSLContext for new SSLSockets
Throws:
java.io.IOException
Method Detail

getContext

public SSLServerContext getContext()
Get the context of this SSLServerSocket.


setContext

public void setContext(SSLServerContext ssl_context)
Set the context of this SSLServerSocket. The new context will be active for all SSLSockets created by accept() calls that return after this call to setContext() was made. Nothing is changed for existing sockets.


accept

public java.net.Socket accept()
                       throws java.io.IOException
Listens for a connection to be made to this socket and accepts it. The method blocks until a connection is made and returns a SSLSocket initialized with the SSLContext defined in the constructor.

Overrides:
accept in class java.net.ServerSocket
Returns:
a new SSLSocket
Throws:
java.io.IOException

This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note).

iSaSiLk 6.0, (c) 2002 IAIK, (c) 2003 - 2015 SIC