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, isSocketTcpNoDelay
public 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 information
public int getPortCount()
setPortCount(int)
,
for more information
public ServerSocketEndpointConfig setPortCount(int portCount)
portCount
- the maximum number of ports allowed to usefor more information
public 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 EndpointConfig
public ServerSocketEndpointConfig setName(String name)
setName
in interface NamedConfig
setName
in class EndpointConfig
public ServerSocketEndpointConfig setOutboundPortDefinitions(Collection<String> outboundPortDefs)
setOutboundPortDefinitions
in class EndpointConfig
public ServerSocketEndpointConfig setOutboundPorts(Collection<Integer> outboundPorts)
setOutboundPorts
in class EndpointConfig
public ServerSocketEndpointConfig setInterfaces(InterfacesConfig interfaces)
setInterfaces
in class EndpointConfig
interfaces
- the interfaces to setpublic ServerSocketEndpointConfig setSocketBufferDirect(boolean socketBufferDirect)
setSocketBufferDirect
in class EndpointConfig
public ServerSocketEndpointConfig setSocketKeepAlive(boolean socketKeepAlive)
setSocketKeepAlive
in class EndpointConfig
public ServerSocketEndpointConfig setSocketTcpNoDelay(boolean socketTcpNoDelay)
setSocketTcpNoDelay
in class EndpointConfig
public ServerSocketEndpointConfig setSocketSendBufferSizeKb(int socketSendBufferSizeKb)
setSocketSendBufferSizeKb
in class EndpointConfig
public ServerSocketEndpointConfig setSocketRcvBufferSizeKb(int socketRcvBufferSizeKb)
setSocketRcvBufferSizeKb
in class EndpointConfig
public EndpointConfig setSocketLingerSeconds(int socketLingerSeconds)
setSocketLingerSeconds
in class EndpointConfig
public ServerSocketEndpointConfig setSocketConnectTimeoutSeconds(int socketConnectTimeoutSeconds)
setSocketConnectTimeoutSeconds
in class EndpointConfig
public ServerSocketEndpointConfig setSocketInterceptorConfig(SocketInterceptorConfig socketInterceptorConfig)
EndpointConfig
SocketInterceptorConfig
. The value can be null
if no socket interception is needed.setSocketInterceptorConfig
in class EndpointConfig
socketInterceptorConfig
- the SocketInterceptorConfig to setpublic ServerSocketEndpointConfig setSSLConfig(SSLConfig sslConfig)
EndpointConfig
SSLConfig
. null value indicates that no SSLConfig should be used.setSSLConfig
in class EndpointConfig
sslConfig
- the SSLConfigEndpointConfig.getSSLConfig()
@Beta @Nonnull public ServerSocketEndpointConfig setTpcSocketConfig(@Nonnull TpcSocketConfig tpcSocketConfig)
EndpointConfig
setTpcSocketConfig
in class EndpointConfig
tpcSocketConfig
- Tpc socket config to setTpcConfig
public ServerSocketEndpointConfig setSymmetricEncryptionConfig(SymmetricEncryptionConfig symmetricEncryptionConfig)
EndpointConfig
SymmetricEncryptionConfig
. The value can be null
if no symmetric encryption should be used.setSymmetricEncryptionConfig
in class EndpointConfig
symmetricEncryptionConfig
- the SymmetricEncryptionConfig to setEndpointConfig.getSymmetricEncryptionConfig()
public ServerSocketEndpointConfig setSocketKeepIdleSeconds(int socketKeepIdleSeconds)
EndpointConfig
keep alive is true
.
Requires a recent JDK 8, JDK 11 or greater version that includes the required
JDK support.setSocketKeepIdleSeconds
in class EndpointConfig
public ServerSocketEndpointConfig setSocketKeepIntervalSeconds(int socketKeepIntervalSeconds)
EndpointConfig
keep-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 EndpointConfig
public ServerSocketEndpointConfig setSocketKeepCount(int socketKeepCount)
EndpointConfig
keep alive is true
.
Requires a recent JDK 8, JDK 11 or greater version that includes the required
JDK support.setSocketKeepCount
in class EndpointConfig
public boolean equals(Object o)
equals
in class EndpointConfig
public int hashCode()
hashCode
in class EndpointConfig
Copyright © 2023 Hazelcast, Inc.. All rights reserved.