public abstract class SocketFactory extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DefaultFactory
The default implementation of the SocketFactory interface is for
JDK since 1.4.
|
private static SocketFactory |
factory |
private static String[] |
factoryClasses |
(package private) static org.objectweb.util.monolog.api.Logger |
logger |
Constructor and Description |
---|
SocketFactory() |
Modifier and Type | Method and Description |
---|---|
abstract Socket |
createSocket(InetAddress addr,
int port,
InetAddress localAddr,
int localPort,
int timeout)
Creates a socket and connects it to the specified remote host on the
specified remote port.
|
abstract Socket |
createSocket(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 |
getDefaultFactory()
Returns the SocketFactory singleton for the specified default class.
|
static SocketFactory |
getFactory(String sfcn)
Returns the SocketFactory singleton for the specified class.
|
static SocketFactory |
getSocketFactory()
Deprecated.
|
static org.objectweb.util.monolog.api.Logger logger
public static final String DefaultFactory
private static String[] factoryClasses
private static SocketFactory factory
public static SocketFactory getDefaultFactory()
public static SocketFactory getFactory(String sfcn)
sfcn
- The classname for SocketFactory class.public abstract Socket createSocket(InetAddress addr, int port, int timeout) throws IOException
addr
- the IP address.port
- the port number.timeout
- the timeout value to be used in milliseconds.IOException
- if an I/O error occurs when opening the socket.public abstract Socket createSocket(InetAddress addr, int port, InetAddress localAddr, int localPort, int timeout) throws IOException
addr
- the IP address of the remote hostport
- the remote portlocalAddr
- the local address the socket is bound tolocalPort
- the local port the socket is bound totimeout
- the timeout value to be used in milliseconds.IOException
- if an I/O error occurs when opening the socket.public static SocketFactory getSocketFactory() throws Exception
Exception
- Cannot find the factory class.Copyright © 2021 ScalAgent D.T.. All rights reserved.