public class ServerSocketEndpointConfig extends EndpointConfig
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PORT
Default value of port number.
|
static int |
PORT_AUTO_INCREMENT
Default port auto-increment count.
|
DEFAULT_SOCKET_CONNECT_TIMEOUT_SECONDS, DEFAULT_SOCKET_KEEP_COUNT, DEFAULT_SOCKET_KEEP_IDLE_SECONDS, DEFAULT_SOCKET_KEEP_INTERVAL_SECONDS, DEFAULT_SOCKET_LINGER_SECONDS, DEFAULT_SOCKET_RECEIVE_BUFFER_SIZE_KB, DEFAULT_SOCKET_SEND_BUFFER_SIZE_KB, interfaces, name, protocolType, socketInterceptorConfig, sslConfig, symmetricEncryptionConfig| Constructor and Description |
|---|
ServerSocketEndpointConfig() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
int |
getPort()
Returns the port the Hazelcast member will try to bind on.
|
int |
getPortCount()
Returns the maximum number of ports allowed to try to bind on.
|
String |
getPublicAddress() |
int |
hashCode() |
boolean |
isPortAutoIncrement()
Checks if a Hazelcast member is allowed find a free port by incrementing the port number when it encounters
an occupied port.
|
boolean |
isReuseAddress() |
ServerSocketEndpointConfig |
setInterfaces(InterfacesConfig interfaces) |
ServerSocketEndpointConfig |
setName(String name) |
ServerSocketEndpointConfig |
setOutboundPortDefinitions(Collection<String> outboundPortDefs) |
ServerSocketEndpointConfig |
setOutboundPorts(Collection<Integer> outboundPorts) |
ServerSocketEndpointConfig |
setPort(int port)
Sets the port the Hazelcast member will try to bind on.
|
ServerSocketEndpointConfig |
setPortAutoIncrement(boolean portAutoIncrement)
Sets if a Hazelcast member is allowed to find a free port by incrementing the port number when it encounters
an occupied port.
|
ServerSocketEndpointConfig |
setPortCount(int portCount)
The maximum number of ports allowed to use.
|
ServerSocketEndpointConfig |
setProtocolType(com.hazelcast.instance.ProtocolType protocolType) |
ServerSocketEndpointConfig |
setPublicAddress(String publicAddress)
Overrides the public address of a member.
|
ServerSocketEndpointConfig |
setReuseAddress(boolean reuseAddress)
Sets the reuse address.
|
ServerSocketEndpointConfig |
setSocketBufferDirect(boolean socketBufferDirect) |
ServerSocketEndpointConfig |
setSocketConnectTimeoutSeconds(int socketConnectTimeoutSeconds) |
ServerSocketEndpointConfig |
setSocketInterceptorConfig(SocketInterceptorConfig socketInterceptorConfig)
Sets the
SocketInterceptorConfig. |
ServerSocketEndpointConfig |
setSocketKeepAlive(boolean socketKeepAlive) |
ServerSocketEndpointConfig |
setSocketKeepCount(int socketKeepCount)
Set the maximum number of TCP keep-alive probes to send before giving up and closing the connection if no
response is obtained from the other side.
|
ServerSocketEndpointConfig |
setSocketKeepIdleSeconds(int socketKeepIdleSeconds)
Set the number of seconds a connection needs to be idle before TCP begins sending out keep-alive probes.
|
ServerSocketEndpointConfig |
setSocketKeepIntervalSeconds(int socketKeepIntervalSeconds)
Set the number of seconds between keep-alive probes.
|
EndpointConfig |
setSocketLingerSeconds(int socketLingerSeconds) |
ServerSocketEndpointConfig |
setSocketRcvBufferSizeKb(int socketRcvBufferSizeKb) |
ServerSocketEndpointConfig |
setSocketSendBufferSizeKb(int socketSendBufferSizeKb) |
ServerSocketEndpointConfig |
setSocketTcpNoDelay(boolean socketTcpNoDelay) |
ServerSocketEndpointConfig |
setSSLConfig(SSLConfig sslConfig)
Sets the
SSLConfig. |
ServerSocketEndpointConfig |
setSymmetricEncryptionConfig(SymmetricEncryptionConfig symmetricEncryptionConfig)
Sets the
SymmetricEncryptionConfig. |
ServerSocketEndpointConfig |
setTpcSocketConfig(TpcSocketConfig tpcSocketConfig)
Sets the TpcSocketConfig.
|
String |
toString() |
addOutboundPort, addOutboundPortDefinition, getInterfaces, getName, getOutboundPortDefinitions, getOutboundPorts, getProtocolType, getQualifier, getSocketConnectTimeoutSeconds, getSocketInterceptorConfig, getSocketKeepCount, getSocketKeepIdleSeconds, getSocketKeepIntervalSeconds, getSocketLingerSeconds, getSocketRcvBufferSizeKb, getSocketSendBufferSizeKb, getSSLConfig, getSymmetricEncryptionConfig, getTpcSocketConfig, isSocketBufferDirect, isSocketKeepAlive, isSocketTcpNoDelaypublic static final int DEFAULT_PORT
public static final int PORT_AUTO_INCREMENT
public String getPublicAddress()
public ServerSocketEndpointConfig setPublicAddress(String publicAddress)
public int getPort()
setPort(int)public ServerSocketEndpointConfig setPort(int port)
A valid port value is between 0 and 65535. A port number of 0 will let the system pick up an ephemeral port.
port - the port the Hazelcast member will try to bind ongetPort(),
for more informationpublic int getPortCount()
setPortCount(int),
for more informationpublic ServerSocketEndpointConfig setPortCount(int portCount)
portCount - the maximum number of ports allowed to usefor more informationpublic boolean isPortAutoIncrement()
setPortAutoIncrement(boolean)public ServerSocketEndpointConfig setPortAutoIncrement(boolean portAutoIncrement)
If you explicitly want to control the port a Hazelcast member is going to use, you probably want to set
portAutoincrement to false. In this case, the Hazelcast member is going to try the port setPort(int)
and if the port is not free, the member will not start and throw an exception.
If this value is set to true, Hazelcast will start at the port specified by setPort(int) and will try
until it finds a free port, or until it runs out of ports to try setPortCount(int).
portAutoIncrement - the portAutoIncrement to setisPortAutoIncrement(),
setPortCount(int),
setPort(int)public boolean isReuseAddress()
public ServerSocketEndpointConfig setReuseAddress(boolean reuseAddress)
When should setReuseAddress(true) be used?
When the member is shutdown, the server socket port will be in TIME_WAIT state for the next 2 minutes or so. If you start the member right after shutting it down, you may not be able to bind to the same port because it is in TIME_WAIT state. if you set reuseAddress=true then TIME_WAIT will be ignored and you will be able to bind to the same port again.
This property should not be set to true on the Windows platform: see
@PrivateApi public ServerSocketEndpointConfig setProtocolType(com.hazelcast.instance.ProtocolType protocolType)
setProtocolType in class EndpointConfigpublic ServerSocketEndpointConfig setName(String name)
setName in interface NamedConfigsetName in class EndpointConfigpublic ServerSocketEndpointConfig setOutboundPortDefinitions(Collection<String> outboundPortDefs)
setOutboundPortDefinitions in class EndpointConfigpublic ServerSocketEndpointConfig setOutboundPorts(Collection<Integer> outboundPorts)
setOutboundPorts in class EndpointConfigpublic ServerSocketEndpointConfig setInterfaces(InterfacesConfig interfaces)
setInterfaces in class EndpointConfiginterfaces - the interfaces to setpublic ServerSocketEndpointConfig setSocketBufferDirect(boolean socketBufferDirect)
setSocketBufferDirect in class EndpointConfigpublic ServerSocketEndpointConfig setSocketKeepAlive(boolean socketKeepAlive)
setSocketKeepAlive in class EndpointConfigpublic ServerSocketEndpointConfig setSocketTcpNoDelay(boolean socketTcpNoDelay)
setSocketTcpNoDelay in class EndpointConfigpublic ServerSocketEndpointConfig setSocketSendBufferSizeKb(int socketSendBufferSizeKb)
setSocketSendBufferSizeKb in class EndpointConfigpublic ServerSocketEndpointConfig setSocketRcvBufferSizeKb(int socketRcvBufferSizeKb)
setSocketRcvBufferSizeKb in class EndpointConfigpublic EndpointConfig setSocketLingerSeconds(int socketLingerSeconds)
setSocketLingerSeconds in class EndpointConfigpublic ServerSocketEndpointConfig setSocketConnectTimeoutSeconds(int socketConnectTimeoutSeconds)
setSocketConnectTimeoutSeconds in class EndpointConfigpublic ServerSocketEndpointConfig setSocketInterceptorConfig(SocketInterceptorConfig socketInterceptorConfig)
EndpointConfigSocketInterceptorConfig. The value can be null if no socket interception is needed.setSocketInterceptorConfig in class EndpointConfigsocketInterceptorConfig - the SocketInterceptorConfig to setpublic ServerSocketEndpointConfig setSSLConfig(SSLConfig sslConfig)
EndpointConfigSSLConfig. null value indicates that no SSLConfig should be used.setSSLConfig in class EndpointConfigsslConfig - the SSLConfigEndpointConfig.getSSLConfig()@Beta @Nonnull public ServerSocketEndpointConfig setTpcSocketConfig(@Nonnull TpcSocketConfig tpcSocketConfig)
EndpointConfigsetTpcSocketConfig in class EndpointConfigtpcSocketConfig - Tpc socket config to setTpcConfigpublic ServerSocketEndpointConfig setSymmetricEncryptionConfig(SymmetricEncryptionConfig symmetricEncryptionConfig)
EndpointConfigSymmetricEncryptionConfig. The value can be null if no symmetric encryption should be used.setSymmetricEncryptionConfig in class EndpointConfigsymmetricEncryptionConfig - the SymmetricEncryptionConfig to setEndpointConfig.getSymmetricEncryptionConfig()public ServerSocketEndpointConfig setSocketKeepIdleSeconds(int socketKeepIdleSeconds)
EndpointConfigkeep alive is true.
Requires a recent JDK 8, JDK 11 or greater version that includes the required
JDK support.setSocketKeepIdleSeconds in class EndpointConfigpublic ServerSocketEndpointConfig setSocketKeepIntervalSeconds(int socketKeepIntervalSeconds)
EndpointConfigkeep-alive idle time has passed.
Valid values are 1 to 32767.
This option is only applicable when keep alive is true.
Requires a recent JDK 8, JDK 11 or greater version that includes the required
JDK support.setSocketKeepIntervalSeconds in class EndpointConfigpublic ServerSocketEndpointConfig setSocketKeepCount(int socketKeepCount)
EndpointConfigkeep alive is true.
Requires a recent JDK 8, JDK 11 or greater version that includes the required
JDK support.setSocketKeepCount in class EndpointConfigpublic boolean equals(Object o)
equals in class EndpointConfigpublic int hashCode()
hashCode in class EndpointConfigCopyright © 2024 Hazelcast, Inc.. All rights reserved.