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_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 |
---|---|
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() |
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.
|
void |
setPortCount(int portCount)
The maximum number of ports allowed to use.
|
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) |
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 . |
String |
toString() |
addOutboundPort, addOutboundPortDefinition, getInterfaces, getName, getOutboundPortDefinitions, getOutboundPorts, getProtocolType, getQualifier, getSocketConnectTimeoutSeconds, getSocketInterceptorConfig, getSocketLingerSeconds, getSocketRcvBufferSizeKb, getSocketSendBufferSizeKb, getSSLConfig, getSymmetricEncryptionConfig, 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)
port
- the port the Hazelcast member will try to bind ongetPort()
,
for more information
public int getPortCount()
setPortCount(int)
,
for more information
public void 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
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()
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()
Copyright © 2022 Hazelcast, Inc.. All Rights Reserved.