Package org.apache.calcite.runtime
Class SocketFactoryImpl
- java.lang.Object
-
- javax.net.SocketFactory
-
- org.apache.calcite.runtime.SocketFactoryImpl
-
- Direct Known Subclasses:
TrustAllSslSocketFactory
public class SocketFactoryImpl extends javax.net.SocketFactory
Extends the SocketFactory object with the main functionality being that the created sockets inherit a set of options whose values are set in the SocketFactoryImpl.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)
-
-
Field Summary
Fields Modifier and Type Field Description static int
LINGER
amount of time to lingerstatic boolean
OOBINLINE
is out of band in-line enabledstatic int
SO_CONNECT_TIMEOUT
connect timeout in millisecondsstatic boolean
SO_KEEPALIVE
should keep alives be sentstatic 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 bufferstatic boolean
SO_REUSEADDR
should the address be reusedstatic int
SO_SNDBUF
size of sending buffer iff neededstatic int
SO_TIMEOUT
read timeout in millisecondsstatic boolean
TCP_NODELAY
do not buffer send(s) iff true
-
Constructor Summary
Constructors Constructor Description SocketFactoryImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.net.Socket
applySettings(java.net.Socket s)
Applies the current settings to the given socket.java.net.Socket
createSocket()
java.net.Socket
createSocket(java.lang.String host, int port)
java.net.Socket
createSocket(java.lang.String host, int port, java.net.InetAddress local, int localPort)
java.net.Socket
createSocket(java.net.InetAddress host, int port)
java.net.Socket
createSocket(java.net.InetAddress host, int port, java.net.InetAddress local, int localPort)
static javax.net.SocketFactory
getDefault()
-
-
-
Field Detail
-
SO_KEEPALIVE
public static final boolean SO_KEEPALIVE
should keep alives be sent- See Also:
- Constant Field Values
-
OOBINLINE
public static final boolean OOBINLINE
is out of band in-line enabled- See Also:
- Constant Field Values
-
SO_REUSEADDR
public static final boolean SO_REUSEADDR
should the address be reused- See Also:
- Constant Field Values
-
TCP_NODELAY
public static final boolean TCP_NODELAY
do not buffer send(s) iff true- See Also:
- Constant Field Values
-
SO_RCVBUF
public static final int SO_RCVBUF
size of receiving buffer- See Also:
- Constant Field Values
-
SO_SNDBUF
public static final int SO_SNDBUF
size of sending buffer iff needed- See Also:
- Constant Field Values
-
SO_TIMEOUT
public static final int SO_TIMEOUT
read timeout in milliseconds- See Also:
- Constant Field Values
-
SO_CONNECT_TIMEOUT
public static final int SO_CONNECT_TIMEOUT
connect timeout in milliseconds- See Also:
- Constant Field Values
-
SO_LINGER
public static final boolean SO_LINGER
enabling lingering with 0-timeout will cause the socket to be closed forcefully upon execution of close()- See Also:
- Constant Field Values
-
LINGER
public static final int LINGER
amount of time to linger- See Also:
- Constant Field Values
-
-
Method Detail
-
createSocket
public java.net.Socket createSocket() throws java.io.IOException
- Overrides:
createSocket
in classjavax.net.SocketFactory
- Throws:
java.io.IOException
-
applySettings
protected java.net.Socket applySettings(java.net.Socket s)
Applies the current settings to the given socket.- Parameters:
s
- Socket to apply the settings to- Returns:
- Socket the input socket
-
createSocket
public java.net.Socket createSocket(java.lang.String host, int port) throws java.io.IOException
- Specified by:
createSocket
in classjavax.net.SocketFactory
- Throws:
java.io.IOException
-
createSocket
public java.net.Socket createSocket(java.net.InetAddress host, int port) throws java.io.IOException
- Specified by:
createSocket
in classjavax.net.SocketFactory
- Throws:
java.io.IOException
-
createSocket
public java.net.Socket createSocket(java.lang.String host, int port, java.net.InetAddress local, int localPort) throws java.io.IOException
- Specified by:
createSocket
in classjavax.net.SocketFactory
- Throws:
java.io.IOException
-
createSocket
public java.net.Socket createSocket(java.net.InetAddress host, int port, java.net.InetAddress local, int localPort) throws java.io.IOException
- Specified by:
createSocket
in classjavax.net.SocketFactory
- Throws:
java.io.IOException
-
getDefault
public static javax.net.SocketFactory getDefault()
- See Also:
SocketFactory.getDefault()
-
-