public class SocketFactoryImpl extends SocketFactory
1. SO_KEEPALIVE - is keepalive enabled? 2. OOBINLINE - is out of band in-line enabled? 3. SO_REUSEADDR - should the address be reused? 4. TCP_NODELAY - should data buffering for tcp be used? 5. SO_RCVBUF - size of receive buffer 6. SO_SNDBUF - size of send buffer 7. SO_TIMEOUT - read timeout (millisecs) 8. SO_CONNECT_TIMEOUT - connect timeout (millisecs) 9. SO_LINGER - is lingering enabled? 10. LINGER - amount of time to linger (seconds)
| Modifier and Type | Field and Description |
|---|---|
static int |
LINGER
amount of time to linger
|
static boolean |
OOBINLINE
is out of band in-line enabled
|
static int |
SO_CONNECT_TIMEOUT
connect timeout in milliseconds
|
static boolean |
SO_KEEPALIVE
should keep alives be sent
|
static boolean |
SO_LINGER
enabling lingering with 0-timeout will cause the socket to be
closed forcefully upon execution of close()
|
static int |
SO_RCVBUF
size of receiving buffer
|
static boolean |
SO_REUSEADDR
should the address be reused
|
static int |
SO_SNDBUF
size of sending buffer iff needed
|
static int |
SO_TIMEOUT
read timeout in milliseconds
|
static boolean |
TCP_NODELAY
do not buffer send(s) iff true
|
| Constructor and Description |
|---|
SocketFactoryImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected Socket |
applySettings(Socket s)
Applies the current settings to the given socket.
|
Socket |
createSocket() |
Socket |
createSocket(InetAddress host,
int port) |
Socket |
createSocket(InetAddress host,
int port,
InetAddress local,
int localPort) |
Socket |
createSocket(String host,
int port) |
Socket |
createSocket(String host,
int port,
InetAddress local,
int localPort) |
static SocketFactory |
getDefault() |
public static final boolean SO_KEEPALIVE
public static final boolean OOBINLINE
public static final boolean SO_REUSEADDR
public static final boolean TCP_NODELAY
public static final int SO_RCVBUF
public static final int SO_SNDBUF
public static final int SO_TIMEOUT
public static final int SO_CONNECT_TIMEOUT
public static final boolean SO_LINGER
public static final int LINGER
public Socket createSocket() throws IOException
createSocket in class SocketFactoryIOExceptionprotected Socket applySettings(Socket s)
s - Socket to apply the settings topublic Socket createSocket(String host, int port) throws IOException
createSocket in class SocketFactoryIOExceptionpublic Socket createSocket(InetAddress host, int port) throws IOException
createSocket in class SocketFactoryIOExceptionpublic Socket createSocket(String host, int port, InetAddress local, int localPort) throws IOException
createSocket in class SocketFactoryIOExceptionpublic Socket createSocket(InetAddress host, int port, InetAddress local, int localPort) throws IOException
createSocket in class SocketFactoryIOExceptionpublic static SocketFactory getDefault()
SocketFactory.getDefault()Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.