TcpSettings

Settings that affect a connected socket.

Used as a member in struct TcpMsgSessionSettings.


struct TcpSettings
{
    TcpSettings() :
        sendBufSize(-1),
        recBufSize(-1),
        enableNagle(false),
        enableKeepAlive(false),
        keepalivetime(2*3600*1000),
        keepaliveinterval(1*1000)
    {
    }

    ssize_t sendBufSize;
    ssize_t recBufSize;
    bool enableNagle;
    bool enableKeepAlive;
    int keepalivetime;
    int keepaliveinterval;
};


ssize_t sendBufSize

SO_SNDBUF setting. -1 means use the system default.

Default value : -1


ssize_t recBufSize

SO_RCVBUF setting. -1 means use the system default.

Default value : -1


bool enableNagle

If false then TCP_NODELAY option is set

Default value : false


bool enableKeepAlive

If true then SO_KEEPALIVE option is set

Default value : false


int keepalivetime

Time for next keep alive in millisec

Default value : 7200000 (2 hours)


int keepaliveinterval

Retranmission timeout in milliseconds if ACK not received Typically after 5 failures an error will be reported.

Default value : 1000 (1 second)