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
public final class SocketOptions extends CrtResource
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 Classes Modifier and Type Class Description static class
SocketOptions.SocketDomain
Socket communications domainstatic class
SocketOptions.SocketType
Socket type-
Nested classes/interfaces inherited from class software.amazon.awssdk.crt.CrtResource
CrtResource.ResourceInstance
-
-
Field Summary
Fields Modifier and Type Field Description int
connectTimeoutMs
Sets the number of milliseconds before a connection will be considered timed outSocketOptions.SocketDomain
domain
Sets the socket domainint
keepAliveIntervalSecs
Sets the number of seconds between TCP keepalive packets being sent to the peer 0 disables keepaliveint
keepAliveTimeoutSecs
Sets the number of seconds to wait for a keepalive response before considering the connection timed out 0 disables keepaliveSocketOptions.SocketType
type
Sets the socket type
-
Constructor Summary
Constructors Constructor Description SocketOptions()
Creates a new set of socket options
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canReleaseReferencesImmediately()
Determines whether a resource releases its dependencies at the same time the native handle is released or if it waits.long
getNativeHandle()
returns the native handle associated with this CRTResource.protected void
releaseNativeHandle()
Frees the native resources for this set of socket options-
Methods inherited from class software.amazon.awssdk.crt.CrtResource
acquireNativeHandle, addRef, addReferenceTo, close, collectNativeResource, collectNativeResources, decRef, getResourceLogDescription, isNull, logNativeResources, releaseReferences, removeReferenceTo, setDescription, swapReferenceTo, waitForNoResources
-
-
-
-
Field Detail
-
domain
public SocketOptions.SocketDomain domain
Sets the socket domain
-
type
public SocketOptions.SocketType type
Sets the socket type
-
connectTimeoutMs
public int connectTimeoutMs
Sets the number of milliseconds before a connection will be considered timed out
-
keepAliveIntervalSecs
public int keepAliveIntervalSecs
Sets the number of seconds between TCP keepalive packets being sent to the peer 0 disables keepalive
-
keepAliveTimeoutSecs
public int keepAliveTimeoutSecs
Sets the number of seconds to wait for a keepalive response before considering the connection timed out 0 disables keepalive
-
-
Method Detail
-
getNativeHandle
public long getNativeHandle()
Description copied from class:CrtResource
returns the native handle associated with this CRTResource.- Overrides:
getNativeHandle
in classCrtResource
- Returns:
- native address
-
canReleaseReferencesImmediately
protected boolean canReleaseReferencesImmediately()
Determines whether a resource releases its dependencies at the same time the native handle is released or if it waits. Resources that wait are responsible for calling releaseReferences() manually.- Specified by:
canReleaseReferencesImmediately
in classCrtResource
- Returns:
- true if this resource releases synchronously, false if this resource performs async shutdown
-
releaseNativeHandle
protected void releaseNativeHandle()
Frees the native resources for this set of socket options- Specified by:
releaseNativeHandle
in classCrtResource
-
-