org.jboss.net.sockets
Class DefaultSocketFactory

java.lang.Object
  extended by javax.net.ServerSocketFactory
      extended by org.jboss.net.sockets.DefaultSocketFactory
All Implemented Interfaces:
Serializable, RMIServerSocketFactory

public class DefaultSocketFactory
extends ServerSocketFactory
implements RMIServerSocketFactory, Serializable

An implementation of RMIServerSocketFactory that supports backlog and bind address settings

Version:
$Revision: 1.3.6.4 $
Author:
Scott.Stark@jboss.org
See Also:
Serialized Form

Constructor Summary
DefaultSocketFactory()
          Create a socket factory that binds on any address with a default backlog of 200
DefaultSocketFactory(InetAddress bindAddress)
          Create a socket factory with the given bind address
DefaultSocketFactory(InetAddress bindAddress, int backlog)
          Create a socket factory with the given bind address and backlog
DefaultSocketFactory(int backlog)
          Create a socket factory with the given backlog
 
Method Summary
 ServerSocket createServerSocket(int port)
          Create a server socket on the specified port (port 0 indicates an anonymous port).
 ServerSocket createServerSocket(int port, int backlog)
           
 ServerSocket createServerSocket(int port, int backlog, InetAddress inetAddress)
           
 boolean equals(Object obj)
           
 String getBindAddress()
           
 int hashCode()
           
 void setBindAddress(String host)
           
 
Methods inherited from class javax.net.ServerSocketFactory
createServerSocket, getDefault
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSocketFactory

public DefaultSocketFactory()
Create a socket factory that binds on any address with a default backlog of 200


DefaultSocketFactory

public DefaultSocketFactory(InetAddress bindAddress)
Create a socket factory with the given bind address


DefaultSocketFactory

public DefaultSocketFactory(int backlog)
Create a socket factory with the given backlog


DefaultSocketFactory

public DefaultSocketFactory(InetAddress bindAddress,
                            int backlog)
Create a socket factory with the given bind address and backlog

Method Detail

getBindAddress

public String getBindAddress()

setBindAddress

public void setBindAddress(String host)
                    throws UnknownHostException
Throws:
UnknownHostException

createServerSocket

public ServerSocket createServerSocket(int port)
                                throws IOException
Create a server socket on the specified port (port 0 indicates an anonymous port).

Specified by:
createServerSocket in interface RMIServerSocketFactory
Specified by:
createServerSocket in class ServerSocketFactory
Parameters:
port - the port number
Returns:
the server socket on the specified port
Throws:
IOException - if an I/O error occurs during server socket creation
Since:
1.2

createServerSocket

public ServerSocket createServerSocket(int port,
                                       int backlog)
                                throws IOException
Specified by:
createServerSocket in class ServerSocketFactory
Parameters:
port - - the port to listen to
backlog - - how many connections are queued
Returns:
A ServerSocket
Throws:
IOException

createServerSocket

public ServerSocket createServerSocket(int port,
                                       int backlog,
                                       InetAddress inetAddress)
                                throws IOException
Specified by:
createServerSocket in class ServerSocketFactory
Parameters:
port - - the port to listen to
backlog - - how many connections are queued
inetAddress - - the network interface address to use
Returns:
Throws:
IOException

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.