#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.
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 |
Definition at line 41 of file tcp_acceptor_base.hpp.
Public Member Functions | |
TcpAcceptorBase (const ComponentConfig &, const ComponentContext &) | |
ComponentHealth | GetComponentHealth () const override |
void | OnLoadingCancelled () override |
Static Public Member Functions | |
static yaml_config::Schema | GetStaticConfigSchema () |
Protected Types | |
using | LoggableComponentBase = ComponentBase |
Legacy alias, use ComponentBase instead. | |
Protected Member Functions | |
virtual void | ProcessSocket (engine::io::Socket &&sock)=0 |
|
protectedinherited |
Legacy alias, use ComponentBase instead.
Definition at line 67 of file component_base.hpp.
|
inlineoverridevirtualinherited |
Override this function to inform the world of the state of your component.
Reimplemented from components::RawComponentBase.
Reimplemented in server::handlers::Restart.
Definition at line 35 of file component_base.hpp.
|
inlineoverridevirtualinherited |
Called once if the creation of any other component failed. If the current component expects some other component to take any action with the current component, this call is a signal that such action may never happen due to components loading was cancelled. Application components might not want to override it.
Reimplemented from components::RawComponentBase.
Definition at line 42 of file component_base.hpp.
|
protectedpure virtual |
Override this function to process incoming sockets.