fr.dyade.aaa.common.net
Class SocketFactory14

java.lang.Object
  extended by fr.dyade.aaa.common.net.SocketFactory
      extended by fr.dyade.aaa.common.net.SocketFactory14

public class SocketFactory14
extends SocketFactory

This class implements the SocketFactory interface for JDK since 1.4.


Field Summary
(package private) static SocketFactory factory
          The SocketFactory singleton for this class.
 
Fields inherited from class fr.dyade.aaa.common.net.SocketFactory
DefaultFactory, logger
 
Constructor Summary
SocketFactory14()
           
 
Method Summary
 java.net.Socket createSocket(java.net.InetAddress addr, int port, java.net.InetAddress localAddr, int localPort, int timeout)
          Creates a socket and connects it to the specified remote host on the specified remote port.
 java.net.Socket createSocket(java.net.InetAddress addr, int port, int timeout)
          Creates a stream socket and connects it to the specified port number at the specified IP address.
static SocketFactory getFactory()
          Returns the SocketFactory singleton for this class.
 
Methods inherited from class fr.dyade.aaa.common.net.SocketFactory
getDefaultFactory, getFactory, getSocketFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factory

static SocketFactory factory
The SocketFactory singleton for this class.

Constructor Detail

SocketFactory14

public SocketFactory14()
Method Detail

getFactory

public static SocketFactory getFactory()
Returns the SocketFactory singleton for this class.

Returns:
The SocketFactory singleton for this class.

createSocket

public java.net.Socket createSocket(java.net.InetAddress addr,
                                    int port,
                                    int timeout)
                             throws java.io.IOException
Creates a stream socket and connects it to the specified port number at the specified IP address. Try to establish the connection to the server with a specified timeout value. A timeout of zero is interpreted as an infinite timeout. The connection will then block until established or an error occurs.

Specified by:
createSocket in class SocketFactory
Parameters:
addr - the IP address.
port - the port number.
timeout - the timeout value to be used in milliseconds.
Throws:
java.io.IOException

createSocket

public java.net.Socket createSocket(java.net.InetAddress addr,
                                    int port,
                                    java.net.InetAddress localAddr,
                                    int localPort,
                                    int timeout)
                             throws java.io.IOException
Creates a socket and connects it to the specified remote host on the specified remote port. The Socket will also bind() to the local address and port supplied. Try to establish the connection to the server with a specified timeout value. A timeout of zero is interpreted as an infinite timeout. The connection will then block until established or an error occurs.

Specified by:
createSocket in class SocketFactory
Parameters:
addr - the IP address of the remote host
port - the remote port
localAddr - the local address the socket is bound to
localPort - the local port the socket is bound to
timeout - the timeout value to be used in milliseconds.
Throws:
java.io.IOException


Copyright © 2010 ScalAgent D.T.. All Rights Reserved.