Function accept


#include <src/uvw/stream.h>

template <typename S>
void accept(S &ref)


Accepts incoming connections.

This call is used in conjunction with listen() to accept incoming connections. Call this function after receiving a ListenEvent event to accept the connection. Before calling this function, the submitted handle must be initialized.
An ErrorEvent event will be emitted in case of errors.

When the ListenEvent event is emitted it is guaranteed that this function will complete successfully the first time. If you attempt to use it more than once, it may fail.
It is suggested to only call this function once per ListenEvent event.

Both the handles must be running on the same loop.

ref - An initialized handle to be used to accept the connection.

Mentioned in


Lines 218-221 in src/uvw/stream.h.

template<typename S>
void accept(S &ref) {
    this->invoke(&uv_accept, this->template get<uv_stream_t>(), this->template get<uv_stream_t>(ref));

Add Discussion as Guest

Log in