Component for accepting incoming TCP connections.
More...
#include <userver/components/tcp_acceptor_base.hpp>
Component for accepting incoming TCP connections.
Each accepted socket is processed in a new coroutine by ProcessSocket of the derived class.
Static options:
Name | Description | Default value |
port | port to listen on | - |
unix-socket | unix socket to listen on instead of listening on a port | '' |
task_processor | task processor to accept incoming connections | - |
backlog | max count of new connections pending acceptance | 1024 |
no_delay | whether to set the TCP_NODELAY option on incoming sockets | true |
sockets_task_processor | task processor to process accepted sockets | value of task_processor |
- See also
- TCP half-duplex server with static configs validation
- Examples
- samples/tcp_full_duplex_service/tcp_full_duplex_service.cpp, and samples/tcp_service/tcp_service.cpp.
Definition at line 41 of file tcp_acceptor_base.hpp.
◆ ProcessSocket()
Override this function to process incoming sockets.
- Warning
- The function is called concurrently from multiple threads on each new socket.
The documentation for this class was generated from the following file: