Function listen
Synopsis
#include <src/uvw/stream.h>
void listen(int backlog=DEFAULT_BACKLOG)
Description
Starts listening for incoming connections.
When a new incoming connection is received, a ListenEvent event is emitted.
An ErrorEvent event will be emitted in case of errors.
- Parameters
backlog
- Indicates the number of connections the kernel might queue, same as listen(2).
Mentioned in
- Getting Started / Code Example
- Getting Started / The event-based approach
Source
Lines 195-197 in src/uvw/stream.h.
void listen(int backlog = DEFAULT_BACKLOG) {
this->invoke(&uv_listen, this->template get<uv_stream_t>(), backlog, &listenCallback);
}