Function simultaneousAccepts

Synopsis

#include <src/uvw/tcp.h>

bool simultaneousAccepts(bool enable=true)

Description

Enables/Disables simultaneous asynchronous accept requests.

Enables/Disables simultaneous asynchronous accept requests that are queued by the operating system when listening for new TCP connections.
This setting is used to tune a TCP server for the desired performance. Having simultaneous accepts can significantly improve the rate of accepting connections (which is why it is enabled by default) but may lead to uneven load distribution in multi-process setups.

Parameters

enable - True to enable it, false otherwise.

Returns
True in case of success, false otherwise.

Source

Lines 36-38 in src/uvw/tcp.cpp. Line 101 in src/uvw/tcp.h.

UVW_INLINE bool TCPHandle::simultaneousAccepts(bool enable) {
    return (0 == uv_tcp_simultaneous_accepts(get(), enable));
}





Add Discussion as Guest

Log in