Package software.amazon.awssdk.crt.io
Class SocketOptions
java.lang.Object
software.amazon.awssdk.crt.CrtResource
software.amazon.awssdk.crt.io.SocketOptions
- All Implemented Interfaces:
AutoCloseable
This class wraps the aws_socket_options from aws-c-io to provide
access to TCP/UDP socket configuration in the AWS Common Runtime.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSocket communications domainstatic enumSocket typeNested classes/interfaces inherited from class software.amazon.awssdk.crt.CrtResource
CrtResource.ResourceInstance -
Field Summary
FieldsModifier and TypeFieldDescriptionintSets the number of milliseconds before a connection will be considered timed outSets the socket domainbooleanIf true, enables periodic transmits of keepalive messages for detecting a disconnected peer.intSets the number of seconds between TCP keepalive packets being sent to the peer 0 disables keepaliveintSets the number of keep alive probes allowed to fail before the connection is considered lost.intSets the number of seconds to wait for a keepalive response before considering the connection timed out 0 disables keepaliveSets the socket type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongreturns the native handle associated with this CRTResource.voidsetTcpKeepAlive(int keepAliveTimeoutSecs, int keepAliveIntervalSecs) Enables TCP keepalive.voidsetTcpKeepAlive(int keepAliveTimeoutSecs, int keepAliveIntervalSecs, int keepAliveMaxFailedProbes) Enables TCP keepalive.Methods inherited from class software.amazon.awssdk.crt.CrtResource
addRef, addReferenceTo, close, collectNativeResource, collectNativeResources, decRef, getResourceLogDescription, isNull, logNativeResources, logNativeResources, removeReferenceTo, setDescription, waitForNoResources
-
Field Details
-
domain
Sets the socket domain -
type
Sets the socket type -
connectTimeoutMs
public int connectTimeoutMsSets the number of milliseconds before a connection will be considered timed out -
keepAliveIntervalSecs
public int keepAliveIntervalSecsSets the number of seconds between TCP keepalive packets being sent to the peer 0 disables keepalive -
keepAliveTimeoutSecs
public int keepAliveTimeoutSecsSets the number of seconds to wait for a keepalive response before considering the connection timed out 0 disables keepalive -
keepAliveMaxFailedProbes
public int keepAliveMaxFailedProbesSets the number of keep alive probes allowed to fail before the connection is considered lost. If zero, OS defaults are used. On Windows, this option is meaningless until Windows 10 1703. -
keepAlive
public boolean keepAliveIf true, enables periodic transmits of keepalive messages for detecting a disconnected peer.
-
-
Constructor Details
-
SocketOptions
public SocketOptions()Creates a new set of socket options
-
-
Method Details
-
setTcpKeepAlive
public void setTcpKeepAlive(int keepAliveTimeoutSecs, int keepAliveIntervalSecs) Enables TCP keepalive.- Parameters:
keepAliveTimeoutSecs- Sets the number of seconds to wait for a keepalive response before considering the connection timed out. 0 disables keepalive.keepAliveIntervalSecs- Sets the number of seconds between TCP keepalive packets being sent to the peer. 0 disables keepalive.
-
setTcpKeepAlive
public void setTcpKeepAlive(int keepAliveTimeoutSecs, int keepAliveIntervalSecs, int keepAliveMaxFailedProbes) Enables TCP keepalive.- Parameters:
keepAliveTimeoutSecs- Sets the number of seconds to wait for a keepalive response before considering the connection timed out. 0 disables keepalive.keepAliveIntervalSecs- Sets the number of seconds between TCP keepalive packets being sent to the peer. 0 disables keepalive.keepAliveMaxFailedProbes- Sets the number of keep alive probes allowed to fail before the connection is considered lost. If zero, OS defaults are used. On Windows, this option is meaningless until Windows 10 1703.
-
getNativeHandle
public long getNativeHandle()Description copied from class:CrtResourcereturns the native handle associated with this CRTResource.- Overrides:
getNativeHandlein classCrtResource- Returns:
- native address
-