Hazelcast C++ Client
Public Member Functions | Static Public Attributes | List of all members
hazelcast::client::config::SocketOptions Class Reference

TCP Socket options. More...

#include <SocketOptions.h>

Public Member Functions

bool isTcpNoDelay () const
 TCP_NODELAY socket option. More...
 
SocketOptionssetTcpNoDelay (bool tcpNoDelay)
 Enable/disable TCP_NODELAY socket option. More...
 
bool isKeepAlive () const
 SO_KEEPALIVE socket option. More...
 
SocketOptionssetKeepAlive (bool keepAlive)
 Enable/disable SO_KEEPALIVE socket option. More...
 
bool isReuseAddress () const
 SO_REUSEADDR socket option. More...
 
SocketOptionssetReuseAddress (bool reuseAddress)
 Enable/disable the SO_REUSEADDR socket option. More...
 
int getLingerSeconds () const
 Gets SO_LINGER with the specified linger time in seconds. More...
 
SocketOptionssetLingerSeconds (int lingerSeconds)
 Enable/disable SO_LINGER with the specified linger time in seconds. More...
 
int getBufferSizeInBytes () const
 If set to 0 or less, then it is not set on the socket. More...
 
SocketOptionssetBufferSizeInBytes (int bufferSize)
 If set to 0 or less, then it is not set on the socket. More...
 

Static Public Attributes

static const int KILO_BYTE = 1024
 constant for kilobyte
 
static const int DEFAULT_BUFFER_SIZE_BYTE = 128 * KILO_BYTE
 default buffer size of Bytes
 

Detailed Description

TCP Socket options.

Member Function Documentation

◆ getBufferSizeInBytes()

int hazelcast::client::config::SocketOptions::getBufferSizeInBytes ( ) const

If set to 0 or less, then it is not set on the socket.

The default value is DEFAULT_BUFFER_SIZE_BYTE

Gets the SO_SNDBUF and SO_RCVBUF options value in bytes

Returns
bufferSize Number of bytes

◆ getLingerSeconds()

int hazelcast::client::config::SocketOptions::getLingerSeconds ( ) const

Gets SO_LINGER with the specified linger time in seconds.

Returns
lingerSeconds value in seconds

◆ isKeepAlive()

bool hazelcast::client::config::SocketOptions::isKeepAlive ( ) const

SO_KEEPALIVE socket option.

Returns
true if enabled

◆ isReuseAddress()

bool hazelcast::client::config::SocketOptions::isReuseAddress ( ) const

SO_REUSEADDR socket option.

Returns
true if enabled

◆ isTcpNoDelay()

bool hazelcast::client::config::SocketOptions::isTcpNoDelay ( ) const

TCP_NODELAY socket option.

Returns
true if enabled

◆ setBufferSizeInBytes()

SocketOptions & hazelcast::client::config::SocketOptions::setBufferSizeInBytes ( int  bufferSize)

If set to 0 or less, then it is not set on the socket.

The default value is DEFAULT_BUFFER_SIZE_BYTE

Sets the SO_SNDBUF and SO_RCVBUF options to the specified value in bytes

Parameters
bufferSizeNumber of bytes
Returns
SocketOptions configured

◆ setKeepAlive()

SocketOptions & hazelcast::client::config::SocketOptions::setKeepAlive ( bool  keepAlive)

Enable/disable SO_KEEPALIVE socket option.

Parameters
keepAliveenabled if true
Returns
SocketOptions configured

◆ setLingerSeconds()

SocketOptions & hazelcast::client::config::SocketOptions::setLingerSeconds ( int  lingerSeconds)

Enable/disable SO_LINGER with the specified linger time in seconds.

if set to a value of 0 or less then it is disabled.

Default value is 3.

Parameters
lingerSecondsvalue in seconds
Returns
SocketOptions configured

◆ setReuseAddress()

SocketOptions & hazelcast::client::config::SocketOptions::setReuseAddress ( bool  reuseAddress)

Enable/disable the SO_REUSEADDR socket option.

Parameters
reuseAddressenabled if true
Returns
SocketOptions configured

◆ setTcpNoDelay()

SocketOptions & hazelcast::client::config::SocketOptions::setTcpNoDelay ( bool  tcpNoDelay)

Enable/disable TCP_NODELAY socket option.

Parameters
tcpNoDelay

The documentation for this class was generated from the following files: