fang2.network
Class HttpServerSocket

java.lang.Object
  extended by java.net.ServerSocket
      extended by fang2.network.HttpServerSocket

public class HttpServerSocket
extends ServerSocket


Constructor Summary
HttpServerSocket()
           
HttpServerSocket(int port)
           
HttpServerSocket(int port, int backlog)
           
HttpServerSocket(int port, int backlog, InetAddress bindAddr)
           
 
Method Summary
 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

HttpServerSocket

public HttpServerSocket()
                 throws IOException
Throws:
IOException

HttpServerSocket

public HttpServerSocket(int port,
                        int backlog,
                        InetAddress bindAddr)
                 throws IOException
Throws:
IOException

HttpServerSocket

public HttpServerSocket(int port,
                        int backlog)
                 throws IOException
Throws:
IOException

HttpServerSocket

public HttpServerSocket(int port)
                 throws IOException
Throws:
IOException
Method Detail

accept

public Socket accept()
              throws IOException
Description copied from class: ServerSocket
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.

Overrides:
accept in class ServerSocket
Returns:
the new Socket
Throws:
IOException - if an I/O error occurs when waiting for a connection.
SocketTimeoutException - if a timeout was previously set with setSoTimeout and the timeout has been reached.
See Also:
SecurityManager.checkAccept(java.lang.String, int)