Class ServerSocketEndpointConfig
- All Implemented Interfaces:
NamedConfig
- Direct Known Subclasses:
RestServerEndpointConfig
- Since:
- 3.12
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Default value of port number.static final int
Default port auto-increment count.Fields inherited from class com.hazelcast.config.EndpointConfig
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
getPort()
Returns the port the Hazelcast member will try to bind on.int
Returns the maximum number of ports allowed to try to bind on.int
hashCode()
boolean
Checks if a Hazelcast member is allowed find a free port by incrementing the port number when it encounters an occupied port.boolean
setInterfaces
(InterfacesConfig interfaces) setOutboundPortDefinitions
(Collection<String> outboundPortDefs) setOutboundPorts
(Collection<Integer> outboundPorts) setPort
(int port) Sets the port the Hazelcast member will try to bind on.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.setPortCount
(int portCount) The maximum number of ports allowed to use.setProtocolType
(com.hazelcast.instance.ProtocolType protocolType) setPublicAddress
(String publicAddress) Overrides the public address of a member.setReuseAddress
(boolean reuseAddress) Sets the reuse address.setSocketBufferDirect
(boolean socketBufferDirect) setSocketConnectTimeoutSeconds
(int socketConnectTimeoutSeconds) setSocketInterceptorConfig
(SocketInterceptorConfig socketInterceptorConfig) Sets theSocketInterceptorConfig
.setSocketKeepAlive
(boolean socketKeepAlive) 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.setSocketKeepIdleSeconds
(int socketKeepIdleSeconds) Set the number of seconds a connection needs to be idle before TCP begins sending out keep-alive probes.setSocketKeepIntervalSeconds
(int socketKeepIntervalSeconds) Set the number of seconds between keep-alive probes.setSocketLingerSeconds
(int socketLingerSeconds) setSocketRcvBufferSizeKb
(int socketRcvBufferSizeKb) setSocketSendBufferSizeKb
(int socketSendBufferSizeKb) setSocketTcpNoDelay
(boolean socketTcpNoDelay) setSSLConfig
(SSLConfig sslConfig) Sets theSSLConfig
. null value indicates that no SSLConfig should be used.setSymmetricEncryptionConfig
(SymmetricEncryptionConfig symmetricEncryptionConfig) Sets theSymmetricEncryptionConfig
.setTpcSocketConfig
(TpcSocketConfig tpcSocketConfig) Sets the TpcSocketConfig.toString()
Methods inherited from class com.hazelcast.config.EndpointConfig
addOutboundPort, addOutboundPortDefinition, getInterfaces, getName, getOutboundPortDefinitions, getOutboundPorts, getProtocolType, getQualifier, getSocketConnectTimeoutSeconds, getSocketInterceptorConfig, getSocketKeepCount, getSocketKeepIdleSeconds, getSocketKeepIntervalSeconds, getSocketLingerSeconds, getSocketRcvBufferSizeKb, getSocketSendBufferSizeKb, getSSLConfig, getSymmetricEncryptionConfig, getTpcSocketConfig, isSocketBufferDirect, isSocketKeepAlive, isSocketTcpNoDelay
-
Field Details
-
DEFAULT_PORT
public static final int DEFAULT_PORTDefault value of port number.- See Also:
-
PORT_AUTO_INCREMENT
public static final int PORT_AUTO_INCREMENTDefault port auto-increment count.- See Also:
-
-
Constructor Details
-
ServerSocketEndpointConfig
public ServerSocketEndpointConfig()
-
-
Method Details
-
getPublicAddress
-
setPublicAddress
Overrides the public address of a member. Behind a NAT, two endpoints may not be able to see/access each other. If both nodes set their public addresses to their defined addresses on NAT, then that way they can communicate with each other. It should be set in the format “host IP address:port number”. -
getPort
public int getPort()Returns the port the Hazelcast member will try to bind on. A port number of 0 will let the system pick up an ephemeral port.- Returns:
- the port the Hazelcast member will try to bind on
- See Also:
-
setPort
Sets the port the Hazelcast member will try to bind on.A valid port value is between 0 and 65535. A port number of 0 will let the system pick up an ephemeral port.
- Parameters:
port
- the port the Hazelcast member will try to bind on- Returns:
- NetworkConfig the updated NetworkConfig
- See Also:
-
getPortCount
public int getPortCount()Returns the maximum number of ports allowed to try to bind on.- Returns:
- the maximum number of ports allowed to try to bind on
- See Also:
-
setPortCount
The maximum number of ports allowed to use.- Parameters:
portCount
- the maximum number of ports allowed to use- Returns:
- this configuration
- See Also:
-
isPortAutoIncrement
public boolean isPortAutoIncrement()Checks if a Hazelcast member is allowed find a free port by incrementing the port number when it encounters an occupied port.- Returns:
- the portAutoIncrement
- See Also:
-
setPortAutoIncrement
Sets if a Hazelcast member is allowed to find a free port by incrementing the port number when it encounters an occupied port.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 trysetPortCount(int)
.- Parameters:
portAutoIncrement
- the portAutoIncrement to set- Returns:
- the updated NetworkConfig
- See Also:
-
isReuseAddress
public boolean isReuseAddress() -
setReuseAddress
Sets the reuse address.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
- http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6421091
- http://www.hsc.fr/ressources/articles/win_net_srv/multiple_bindings.html
-
setProtocolType
@PrivateApi public ServerSocketEndpointConfig setProtocolType(com.hazelcast.instance.ProtocolType protocolType) - Overrides:
setProtocolType
in classEndpointConfig
-
setName
- Specified by:
setName
in interfaceNamedConfig
- Overrides:
setName
in classEndpointConfig
-
setOutboundPortDefinitions
- Overrides:
setOutboundPortDefinitions
in classEndpointConfig
-
setOutboundPorts
- Overrides:
setOutboundPorts
in classEndpointConfig
-
setInterfaces
- Overrides:
setInterfaces
in classEndpointConfig
- Parameters:
interfaces
- the interfaces to set
-
setSocketBufferDirect
- Overrides:
setSocketBufferDirect
in classEndpointConfig
-
setSocketKeepAlive
- Overrides:
setSocketKeepAlive
in classEndpointConfig
-
setSocketTcpNoDelay
- Overrides:
setSocketTcpNoDelay
in classEndpointConfig
-
setSocketSendBufferSizeKb
- Overrides:
setSocketSendBufferSizeKb
in classEndpointConfig
-
setSocketRcvBufferSizeKb
- Overrides:
setSocketRcvBufferSizeKb
in classEndpointConfig
-
setSocketLingerSeconds
- Overrides:
setSocketLingerSeconds
in classEndpointConfig
-
setSocketConnectTimeoutSeconds
- Overrides:
setSocketConnectTimeoutSeconds
in classEndpointConfig
-
setSocketInterceptorConfig
public ServerSocketEndpointConfig setSocketInterceptorConfig(SocketInterceptorConfig socketInterceptorConfig) Description copied from class:EndpointConfig
Sets theSocketInterceptorConfig
. The value can benull
if no socket interception is needed.- Overrides:
setSocketInterceptorConfig
in classEndpointConfig
- Parameters:
socketInterceptorConfig
- the SocketInterceptorConfig to set- Returns:
- the updated NetworkConfig
-
setSSLConfig
Description copied from class:EndpointConfig
Sets theSSLConfig
. null value indicates that no SSLConfig should be used.- Overrides:
setSSLConfig
in classEndpointConfig
- Parameters:
sslConfig
- the SSLConfig- Returns:
- the updated NetworkConfig
- See Also:
-
setTpcSocketConfig
@Beta @Nonnull public ServerSocketEndpointConfig setTpcSocketConfig(@Nonnull TpcSocketConfig tpcSocketConfig) Description copied from class:EndpointConfig
Sets the TpcSocketConfig. Can't return null.- Overrides:
setTpcSocketConfig
in classEndpointConfig
- Parameters:
tpcSocketConfig
- Tpc socket config to set- Returns:
- this endpoint config
- See Also:
-
setSymmetricEncryptionConfig
public ServerSocketEndpointConfig setSymmetricEncryptionConfig(SymmetricEncryptionConfig symmetricEncryptionConfig) Description copied from class:EndpointConfig
Sets theSymmetricEncryptionConfig
. The value can benull
if no symmetric encryption should be used.- Overrides:
setSymmetricEncryptionConfig
in classEndpointConfig
- Parameters:
symmetricEncryptionConfig
- the SymmetricEncryptionConfig to set- Returns:
- the updated NetworkConfig
- See Also:
-
setSocketKeepIdleSeconds
Description copied from class:EndpointConfig
Set the number of seconds a connection needs to be idle before TCP begins sending out keep-alive probes. Valid values are 1 to 32767. This option is only applicable whenkeep alive is true
. Requires a recent JDK 8, JDK 11 or greater version that includes the required JDK support.- Overrides:
setSocketKeepIdleSeconds
in classEndpointConfig
- See Also:
-
setSocketKeepIntervalSeconds
Description copied from class:EndpointConfig
Set the number of seconds between keep-alive probes. Notice that this is the number of seconds between probes after the initialkeep-alive idle time
has passed. Valid values are 1 to 32767. This option is only applicable whenkeep alive is true
. Requires a recent JDK 8, JDK 11 or greater version that includes the required JDK support.- Overrides:
setSocketKeepIntervalSeconds
in classEndpointConfig
- See Also:
-
setSocketKeepCount
Description copied from class:EndpointConfig
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. Valid values are 1 to 127. This option is only applicable whenkeep alive is true
. Requires a recent JDK 8, JDK 11 or greater version that includes the required JDK support.- Overrides:
setSocketKeepCount
in classEndpointConfig
- See Also:
-
toString
-
equals
- Overrides:
equals
in classEndpointConfig
-
hashCode
public int hashCode()- Overrides:
hashCode
in classEndpointConfig
-