public class SocketFactory extends Object implements IClientSocketFactory, IServerSocketFactory
Modifier and Type | Field and Description |
---|---|
protected static SocketFactory |
defaultFactory |
protected static SocketFactory |
factory |
Constructor and Description |
---|
SocketFactory() |
Modifier and Type | Method and Description |
---|---|
ServerSocket |
createServerSocket(int port,
int backlog) |
ServerSocket |
createServerSocket(int port,
int backlog,
InetAddress bindAddress) |
Socket |
createSocket(String name,
int port,
int timeout) |
static SocketFactory |
getDefaultSocketFactory() |
static SocketFactory |
getSocketFactory() |
static void |
setSocketFactory(SocketFactory fact) |
protected static SocketFactory defaultFactory
protected static SocketFactory factory
public Socket createSocket(String name, int port, int timeout) throws IOException
createSocket
in interface IClientSocketFactory
IOException
public ServerSocket createServerSocket(int port, int backlog) throws IOException
createServerSocket
in interface IServerSocketFactory
IOException
public ServerSocket createServerSocket(int port, int backlog, InetAddress bindAddress) throws IOException
port
- portbacklog
- backlogbindAddress
- bindAddressIOException
- if server socket cannot be createdpublic static SocketFactory getSocketFactory()
public static SocketFactory getDefaultSocketFactory()
public static void setSocketFactory(SocketFactory fact)
Copyright © 2017. All rights reserved.