Package org.apache.calcite.runtime
Class SocketFactoryImpl
java.lang.Object
javax.net.SocketFactory
org.apache.calcite.runtime.SocketFactoryImpl
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
Modifier and TypeFieldDescriptionstatic final int
Amount of time to linger.static final boolean
Whether out-of-band in-line is enabled.static final int
Connect timeout in milliseconds.static final boolean
Whether keep-alives should be sent.static final boolean
Enabling lingering with 0-timeout will cause the socket to be closed forcefully upon execution ofclose()
.static final int
Size of receiving buffer.static final boolean
Whether the address should be reused.static final int
Size of sending buffer iff needed.static final int
Read timeout in milliseconds.static final boolean
Whether to not buffer send(s). -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Socket
Applies the current settings to the given socket.createSocket
(String host, int port) createSocket
(String host, int port, InetAddress local, int localPort) createSocket
(InetAddress host, int port) createSocket
(InetAddress host, int port, InetAddress local, int localPort) static SocketFactory
Returns a copy of the environment's default socket factory.
-
Field Details
-
SO_KEEPALIVE
public static final boolean SO_KEEPALIVEWhether keep-alives should be sent.- See Also:
-
OOBINLINE
public static final boolean OOBINLINEWhether out-of-band in-line is enabled.- See Also:
-
SO_REUSEADDR
public static final boolean SO_REUSEADDRWhether the address should be reused.- See Also:
-
TCP_NODELAY
public static final boolean TCP_NODELAYWhether to not buffer send(s).- See Also:
-
SO_RCVBUF
public static final int SO_RCVBUFSize of receiving buffer.- See Also:
-
SO_SNDBUF
public static final int SO_SNDBUFSize of sending buffer iff needed.- See Also:
-
SO_TIMEOUT
public static final int SO_TIMEOUTRead timeout in milliseconds.- See Also:
-
SO_CONNECT_TIMEOUT
public static final int SO_CONNECT_TIMEOUTConnect timeout in milliseconds.- See Also:
-
SO_LINGER
public static final boolean SO_LINGEREnabling lingering with 0-timeout will cause the socket to be closed forcefully upon execution ofclose()
.- See Also:
-
LINGER
public static final int LINGERAmount of time to linger.- See Also:
-
-
Constructor Details
-
SocketFactoryImpl
public SocketFactoryImpl()
-
-
Method Details
-
createSocket
- Overrides:
createSocket
in classSocketFactory
-
applySettings
Applies the current settings to the given socket.- Parameters:
s
- Socket to apply the settings to- Returns:
- Socket the input socket
-
createSocket
- Specified by:
createSocket
in classSocketFactory
- Throws:
IOException
-
createSocket
- Specified by:
createSocket
in classSocketFactory
- Throws:
IOException
-
createSocket
public Socket createSocket(String host, int port, InetAddress local, int localPort) throws IOException - Specified by:
createSocket
in classSocketFactory
- Throws:
IOException
-
createSocket
public Socket createSocket(InetAddress host, int port, InetAddress local, int localPort) throws IOException - Specified by:
createSocket
in classSocketFactory
- Throws:
IOException
-
getDefault
Returns a copy of the environment's default socket factory.- See Also:
-