SmartFrog 3.10.000

org.smartfrog.sfcore.security
Class SFServerSocket

java.lang.Object
  extended by java.net.ServerSocket
      extended by org.smartfrog.sfcore.security.SFServerSocket

public class SFServerSocket
extends java.net.ServerSocket

Extends ServerSocket so that it contains the security context, and configures properly the socket returned in the accept(), getting hold of the session...


Constructor Summary
SFServerSocket(int port, SFSecurityEnvironment secEnv)
          Class Constructor.
 
Method Summary
 java.net.Socket accept()
          Listens for a connection to be made to this socket and accepts it.
 
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

SFServerSocket

public SFServerSocket(int port,
                      SFSecurityEnvironment secEnv)
               throws java.io.IOException
Class Constructor.

Parameters:
port - The port number
secEnv - A security environment that handles the configuration of sockets.
Throws:
java.io.IOException - In case error while creating server socket
Method Detail

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.

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. We attach our custom socket to the SocketImpl returned by the accept and wrap around it the ssl socket.

Overrides:
accept in class java.net.ServerSocket
Returns:
the new Socket
Throws:
java.io.IOException - if an I/O error occurs when waiting for a connection.
See Also:
SecurityManager.checkAccept(java.lang.String, int)

SmartFrog CORE 3.10.000

(C) Copyright 1998-2006 Hewlett-Packard Development Company, LP