JayBeams
0.1
Another project to have fun coding.
|
Create a control server for the program. More...
#include <acceptor.hpp>
Public Member Functions | |
acceptor (boost::asio::io_service &io, boost::asio::ip::tcp::endpoint const &ep, std::shared_ptr< request_dispatcher > dispatcher) | |
Create an acceptor a Embedded HTTP Server and start accepting connections. More... | |
boost::asio::ip::tcp::endpoint | local_endpoint () const |
Return the local listening endpoint. More... | |
void | shutdown () |
Gracefully shutdown the acceptor. More... | |
Private Member Functions | |
void | on_accept (boost::system::error_code const &ec) |
Handle a completed asynchronous accept() call. More... | |
Private Attributes | |
boost::asio::ip::tcp::acceptor | acceptor_ |
std::shared_ptr< request_dispatcher > | dispatcher_ |
boost::asio::ip::tcp::socket | sock_ |
Create a control server for the program.
The program runs as a typical daemon, accepting HTTP requests to start new replays, stop them, and show its current status.
Definition at line 17 of file acceptor.hpp.
jb::ehs::acceptor::acceptor | ( | boost::asio::io_service & | io, |
boost::asio::ip::tcp::endpoint const & | ep, | ||
std::shared_ptr< request_dispatcher > | dispatcher | ||
) |
Create an acceptor a Embedded HTTP Server and start accepting connections.
io | Boost.ASIO service used to demux I/O events for this acceptor. |
ep | the endpoint this control server listens on. |
dispatcher | the object to process requests. |
Definition at line 8 of file acceptor.cpp.
References acceptor_, jb::info, JB_LOG, local_endpoint(), on_accept(), and sock_.
|
inline |
Return the local listening endpoint.
Definition at line 32 of file acceptor.hpp.
References acceptor_, on_accept(), and shutdown().
Referenced by acceptor(), and BOOST_AUTO_TEST_CASE().
|
private |
Handle a completed asynchronous accept() call.
Definition at line 31 of file acceptor.cpp.
References acceptor_, dispatcher_, jb::info, JB_LOG, and sock_.
Referenced by acceptor(), and local_endpoint().
void jb::ehs::acceptor::shutdown | ( | ) |
Gracefully shutdown the acceptor.
Definition at line 26 of file acceptor.cpp.
References acceptor_, jb::info, and JB_LOG.
Referenced by BOOST_AUTO_TEST_CASE(), and local_endpoint().
|
private |
Definition at line 46 of file acceptor.hpp.
Referenced by acceptor(), local_endpoint(), on_accept(), and shutdown().
|
private |
Definition at line 47 of file acceptor.hpp.
Referenced by on_accept().
|
private |
Definition at line 49 of file acceptor.hpp.
Referenced by acceptor(), and on_accept().