TCP Options
Overview
Many JSLEE services create and manage TCP connections to external identities. These connections can be managed with a common set of TCP options, given in a JSON object.
TCP/IP Connection management configuration is applied on a per-endpoint basis for any JSLEE application that uses TCP/IP for communication.
Within an endpoint configuration, TCP/IP options are configured within a tcp section of the endpoint configuration. This section and all its options are optional. Only options that are specifically required should be altered.
{
"tcp": {
"reuse-address": true,
"receive-buffer-size-bytes": 8196,
"send-buffer-size-bytes": 8196,
}
}
Client and Server Configuration
The following general TCP options are available for both client and server configurations:
Field | Type | Required? | Default | Description |
---|---|---|---|---|
reuse-address |
Boolean | No | true |
Whether to force the reuse of the TCP/IP address. When true, services can reuse the same TCP/IP address after restart. |
reuse-port |
Boolean | No | false |
Whether to force the reuse of the TCP port. When true, multiple server processes may use the same port. |
traffic-class |
Integer | No | -1 |
The TCP type of service. This must be set to an integer as supported by the Java TCP layer - see java.net.Socket. -1 sets no traffic class. |
send-buffer-size-bytes |
Integer | No | -1 |
The size in bytes for the buffer used for sending data over the TCP socket. -1 uses the operating system default. |
receive-buffer-size-bytes |
Integer | No | -1 |
The size in bytes for the buffer used for receiving data over the TCP socket. -1 uses the operating system default. |
connect-timeout-ms |
Integer | No | 60000 |
The number of milliseconds to wait for the remote endpoint to accept a connection attempt. |
idle-timeout-seconds |
Integer | No | 0 |
The number of seconds without any communication/traffic for a TCP/IP connection to be considered idle. 0 disables this check. |
use-pooled-buffers |
Boolean | No | false |
Within the Vert.X TCP layer, buffers are used and are created /destroyed as necessary. This parameter can be used to avoid this allocation & release cycle. |
enable-tcp-quick-ack |
Boolean | No | false |
Whether to enable TCP quick ACK. |
enable-tcp-keep-alive |
Boolean | No | false |
Whether to enable TCP keep alive. |
enable-tcp-no-delay |
Boolean | No | true |
Whether to enable TCP no-delay. This should not be used with TCP cork. |
enable-tcp-fast-open |
Boolean | No | false |
Whether to enable TCP fast open. |
enable-tcp-cork |
Boolean | No | false |
Whether to enable TCP CORK. Note that this should not be used with TCP no-delay. |
enable-ssl |
Boolean | No | false |
Whether to enable SSL security. |
tcp-so-linger-seconds |
Integer | No | -1 |
The number of seconds to use for TCP socket linger. -1 disables this functionality. |
Server Configuration
The following TCP options are available only for server connections (i.e. those listening for connections):
Field | Type | Required? | Default | Description |
---|---|---|---|---|
accept-backlog |
Integer | No | -1 |
The maximum number of outstanding connections for the server code at the TCP level. -1 disables this check. |