Function keepAlive

Synopsis

#include <src/uvw/tcp.h>

bool keepAlive(bool enable=false, Time time=Time{0})

Description

Enables/Disables TCP keep-alive.

Parameters

enable - True to enable it, false otherwise.

time - Initial delay in seconds (use std::chrono::duration<unsigned int>).

Returns
True in case of success, false otherwise.

Source

Lines 31-33 in src/uvw/tcp.cpp. Line 85 in src/uvw/tcp.h.

UVW_INLINE bool TCPHandle::keepAlive(bool enable, TCPHandle::Time time) {
    return (0 == uv_tcp_keepalive(get(), enable, time.count()));
}





Add Discussion as Guest

Log in