tgbot-cpp
Loading...
Searching...
No Matches
TgBot::HttpServer< Protocol > Class Template Reference

This class handles HTTP requests from the Internet. More...

#include <HttpServer.h>

Inheritance diagram for TgBot::HttpServer< Protocol >:
TgBot::TgWebhookServer< Protocol >

Classes

class  Connection
 

Public Types

typedef std::function< std::string(const std::string &, const std::unordered_map< std::string, std::string > &)> ServerHandler
 

Public Member Functions

 HttpServer (const typename boost::asio::basic_socket_acceptor< Protocol >::endpoint_type &endpoint, ServerHandler handler)
 
void start ()
 Starts receiving new connections.
 
void stop ()
 Stops receiving new connections.
 

Protected Member Functions

void _startAccept ()
 

Protected Attributes

boost::asio::io_service _ioService
 
boost::asio::basic_socket_acceptor< Protocol > _acceptor
 
boost::asio::basic_stream_socket< Protocol > _socket
 
const ServerHandler _handler
 
const HttpParser _httpParser
 

Detailed Description

template<typename Protocol>
class TgBot::HttpServer< Protocol >

This class handles HTTP requests from the Internet.

Definition at line 25 of file HttpServer.h.

Member Typedef Documentation

◆ ServerHandler

template<typename Protocol >
typedef std::function<std::string (const std::string&, const std::unordered_map<std::string, std::string>&)> TgBot::HttpServer< Protocol >::ServerHandler

Definition at line 31 of file HttpServer.h.

Constructor & Destructor Documentation

◆ HttpServer()

template<typename Protocol >
TgBot::HttpServer< Protocol >::HttpServer ( const typename boost::asio::basic_socket_acceptor< Protocol >::endpoint_type & endpoint,
ServerHandler handler )
inline

Definition at line 33 of file HttpServer.h.

Member Function Documentation

◆ _startAccept()

template<typename Protocol >
void TgBot::HttpServer< Protocol >::_startAccept ( )
inlineprotected

Definition at line 148 of file HttpServer.h.

◆ start()

template<typename Protocol >
void TgBot::HttpServer< Protocol >::start ( )
inline

Starts receiving new connections.

Definition at line 41 of file HttpServer.h.

◆ stop()

template<typename Protocol >
void TgBot::HttpServer< Protocol >::stop ( )
inline

Stops receiving new connections.

Definition at line 49 of file HttpServer.h.

Member Data Documentation

◆ _acceptor

template<typename Protocol >
boost::asio::basic_socket_acceptor<Protocol> TgBot::HttpServer< Protocol >::_acceptor
protected

Definition at line 164 of file HttpServer.h.

◆ _handler

template<typename Protocol >
const ServerHandler TgBot::HttpServer< Protocol >::_handler
protected

Definition at line 166 of file HttpServer.h.

◆ _httpParser

template<typename Protocol >
const HttpParser TgBot::HttpServer< Protocol >::_httpParser
protected

Definition at line 167 of file HttpServer.h.

◆ _ioService

template<typename Protocol >
boost::asio::io_service TgBot::HttpServer< Protocol >::_ioService
protected

Definition at line 163 of file HttpServer.h.

◆ _socket

template<typename Protocol >
boost::asio::basic_stream_socket<Protocol> TgBot::HttpServer< Protocol >::_socket
protected

Definition at line 165 of file HttpServer.h.


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