Template Class listener

Inheritance Relationships

Base Type

  • public std::enable_shared_from_this< listener< RouterT, AttachmentT > >

Class Documentation

template<typename RouterT, typename AttachmentT>
class udho::listener : public std::enable_shared_from_this<listener<RouterT, AttachmentT>>

listener runs accept loop for HTTP sockets

Public Functions

listener(RouterT &router, boost::asio::io_service &service, attachment_type &attachment, const boost::asio::ip::tcp::endpoint &endpoint)

Parameters
  • router: HTTP url mapping router

  • service: I/O service

  • endpoint: HTTP server endpoint to listen on

void stop()

stops accepting incomming connections

~listener()
void run()

starts the async accept loop

void accept()

accept an incomming connection

void on_accept(boost::system::error_code ec)