OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::WS::Server::Listener Class Reference

#include <httpserv.hpp>

Inheritance diagram for openvpn::WS::Server::Listener:
[legend]
Collaboration diagram for openvpn::WS::Server::Listener:
[legend]

Classes

class  Client
 

Public Types

typedef RCPtr< ListenerPtr
 
- Public Types inherited from openvpn::ProxyListener
typedef RCPtr< ProxyListenerPtr
 
- Public Types inherited from openvpn::Acceptor::ListenerBase
typedef RCPtr< ListenerBasePtr
 

Public Member Functions

template<typename L >
 Listener (openvpn_io::io_context &io_context_arg, const Config::Ptr &config_arg, const L &listen_item_or_list, const Client::Factory::Ptr &client_factory_arg)
 
void start () override
 
void stop () override
 
template<typename CLIENT_INSTANCE , typename FUNC >
void walk (FUNC func) const
 

Private Types

typedef WS::HTTPBase< Client, Config, Status, HTTP::RequestType, ContentInfo, content_len_t, OPENVPN_HTTP_SERV_RCBase
 
typedef std::unordered_map< client_t, Client::PtrClientMap
 

Private Member Functions

void queue_accept (const size_t acceptor_index)
 
void queue_accept_throttled (const size_t acceptor_index, const bool debit_one)
 
void throttle_reset (const Time &now, const bool debit_one)
 
void throttle_timer_wait ()
 
void throttle_timer_callback ()
 
void handle_accept (AsioPolySock::Base::Ptr sock, const openvpn_io::error_code &error) override
 
client_t new_client_id ()
 
void remove_client (Client::Ptr cli)
 
void remove_client_id (const client_t client_id)
 
virtual bool allow_client (AsioPolySock::Base &sock)
 

Private Attributes

openvpn_io::io_context & io_context
 
Listen::List listen_list
 
Config::Ptr config
 
Client::Factory::Ptr client_factory
 
bool halt = false
 
Acceptor::Set acceptors
 
AsioTimerSafe throttle_timer
 
Time throttle_expire
 
int throttle_connections = 0
 
std::deque< size_t > throttle_acceptor_indices
 
client_t next_id = 0
 
ClientMap clients
 

Detailed Description

Definition at line 175 of file httpserv.hpp.

Member Typedef Documentation

◆ Base

◆ ClientMap

typedef std::unordered_map<client_t, Client::Ptr> openvpn::WS::Server::Listener::ClientMap
private

Definition at line 942 of file httpserv.hpp.

◆ Ptr

Definition at line 774 of file httpserv.hpp.

Constructor & Destructor Documentation

◆ Listener()

template<typename L >
openvpn::WS::Server::Listener::Listener ( openvpn_io::io_context &  io_context_arg,
const Config::Ptr config_arg,
const L &  listen_item_or_list,
const Client::Factory::Ptr client_factory_arg 
)
inline

Definition at line 777 of file httpserv.hpp.

Member Function Documentation

◆ allow_client()

virtual bool openvpn::WS::Server::Listener::allow_client ( AsioPolySock::Base sock)
inlineprivatevirtual

Reimplemented in MyListener, and MyListener.

Definition at line 1085 of file httpserv.hpp.

Here is the caller graph for this function:

◆ handle_accept()

void openvpn::WS::Server::Listener::handle_accept ( AsioPolySock::Base::Ptr  sock,
const openvpn_io::error_code &  error 
)
inlineoverrideprivatevirtual

Implements openvpn::Acceptor::ListenerBase.

Definition at line 1009 of file httpserv.hpp.

◆ new_client_id()

client_t openvpn::WS::Server::Listener::new_client_id ( )
inlineprivate

Definition at line 1062 of file httpserv.hpp.

Here is the caller graph for this function:

◆ queue_accept()

void openvpn::WS::Server::Listener::queue_accept ( const size_t  acceptor_index)
inlineprivate

Definition at line 944 of file httpserv.hpp.

Here is the caller graph for this function:

◆ queue_accept_throttled()

void openvpn::WS::Server::Listener::queue_accept_throttled ( const size_t  acceptor_index,
const bool  debit_one 
)
inlineprivate

Definition at line 949 of file httpserv.hpp.

Here is the caller graph for this function:

◆ remove_client()

void openvpn::WS::Server::Listener::remove_client ( Client::Ptr  cli)
inlineprivate

Definition at line 1073 of file httpserv.hpp.

Here is the caller graph for this function:

◆ remove_client_id()

void openvpn::WS::Server::Listener::remove_client_id ( const client_t  client_id)
inlineprivate

Definition at line 1078 of file httpserv.hpp.

Here is the caller graph for this function:

◆ start()

void openvpn::WS::Server::Listener::start ( )
inlineoverridevirtual

Implements openvpn::ProxyListener.

Definition at line 789 of file httpserv.hpp.

Here is the caller graph for this function:

◆ stop()

void openvpn::WS::Server::Listener::stop ( )
inlineoverridevirtual

Implements openvpn::ProxyListener.

Definition at line 913 of file httpserv.hpp.

Here is the caller graph for this function:

◆ throttle_reset()

void openvpn::WS::Server::Listener::throttle_reset ( const Time now,
const bool  debit_one 
)
inlineprivate

Definition at line 977 of file httpserv.hpp.

Here is the caller graph for this function:

◆ throttle_timer_callback()

void openvpn::WS::Server::Listener::throttle_timer_callback ( )
inlineprivate

Definition at line 995 of file httpserv.hpp.

◆ throttle_timer_wait()

void openvpn::WS::Server::Listener::throttle_timer_wait ( )
inlineprivate

Definition at line 985 of file httpserv.hpp.

Here is the caller graph for this function:

◆ walk()

template<typename CLIENT_INSTANCE , typename FUNC >
void openvpn::WS::Server::Listener::walk ( FUNC  func) const
inline

Definition at line 935 of file httpserv.hpp.

Member Data Documentation

◆ acceptors

Acceptor::Set openvpn::WS::Server::Listener::acceptors
private

Definition at line 1111 of file httpserv.hpp.

◆ client_factory

Client::Factory::Ptr openvpn::WS::Server::Listener::client_factory
private

Definition at line 1108 of file httpserv.hpp.

◆ clients

ClientMap openvpn::WS::Server::Listener::clients
private

Definition at line 1119 of file httpserv.hpp.

◆ config

Config::Ptr openvpn::WS::Server::Listener::config
private

Definition at line 1107 of file httpserv.hpp.

◆ halt

bool openvpn::WS::Server::Listener::halt = false
private

Definition at line 1109 of file httpserv.hpp.

◆ io_context

openvpn_io::io_context& openvpn::WS::Server::Listener::io_context
private

Definition at line 1105 of file httpserv.hpp.

◆ listen_list

Listen::List openvpn::WS::Server::Listener::listen_list
private

Definition at line 1106 of file httpserv.hpp.

◆ next_id

client_t openvpn::WS::Server::Listener::next_id = 0
private

Definition at line 1118 of file httpserv.hpp.

◆ throttle_acceptor_indices

std::deque<size_t> openvpn::WS::Server::Listener::throttle_acceptor_indices
private

Definition at line 1116 of file httpserv.hpp.

◆ throttle_connections

int openvpn::WS::Server::Listener::throttle_connections = 0
private

Definition at line 1115 of file httpserv.hpp.

◆ throttle_expire

Time openvpn::WS::Server::Listener::throttle_expire
private

Definition at line 1114 of file httpserv.hpp.

◆ throttle_timer

AsioTimerSafe openvpn::WS::Server::Listener::throttle_timer
private

Definition at line 1113 of file httpserv.hpp.


The documentation for this class was generated from the following file: