RAPP Platform API
 All Classes Namespaces Files Functions Variables Typedefs
asio_service_http.hpp
Go to the documentation of this file.
1 #ifndef RAPP_ASIO_SERVICE_HTTP
2 #define RAPP_ASIO_SERVICE_HTTP
3 #include "includes.ihh"
4 namespace rapp {
5 namespace cloud {
14 class asio_service_http : public asio_socket, protected asio_handler
15 {
16 public:
21  asio_service_http(const std::string token)
22  : asio_handler(token)
23  {}
24 
31  void schedule(
32  boost::asio::ip::tcp::resolver::query & query,
33  boost::asio::ip::tcp::resolver & resolver,
34  boost::asio::io_service & io_service
35  );
36 
37 protected:
43  void handle_resolve(
44  const boost::system::error_code & err,
45  boost::asio::ip::tcp::resolver::iterator endpoint_iterator
46  );
47 
53  void handle_connect(
54  const boost::system::error_code & err,
55  boost::asio::ip::tcp::resolver::iterator endpoint_iterator
56  );
57 
59  void handle_write_request(const boost::system::error_code & err);
60 
62  void handle_read_status_line(const boost::system::error_code & err);
63 
65  void handle_read_headers(const boost::system::error_code & err);
66 
68  void handle_read_content(const boost::system::error_code & err, std::size_t bytes);
69 
71  void reset();
72 
74  void check_timeout();
75 
76 private:
78  std::unique_ptr<boost::asio::ip::tcp::socket> socket_;
79 };
80 }
81 }
82 #endif
asio_service_http(const std::string token)
void handle_resolve(const boost::system::error_code &err, boost::asio::ip::tcp::resolver::iterator endpoint_iterator)
Callback for Handling Address Resolution.
base class for asio handling, including helper methods and most protected members ...
void check_timeout()
check timed-out
void handle_connect(const boost::system::error_code &err, boost::asio::ip::tcp::resolver::iterator endpoint_iterator)
void schedule(boost::asio::ip::tcp::resolver::query &query, boost::asio::ip::tcp::resolver &resolver, boost::asio::io_service &io_service)
void reset()
reset handler (clear data, bytes, etc) and stop connection
void handle_read_headers(const boost::system::error_code &err)
Callback for Handling Headers.
base class for asynchronous http websockets used for connecting to cloud services ...
void handle_read_content(const boost::system::error_code &err, std::size_t bytes)
Callback for Handling Actual Data Contents.
void handle_read_status_line(const boost::system::error_code &err)
Callback for handling HTTP Header Response Data.
std::unique_ptr< boost::asio::ip::tcp::socket > socket_
TCP Socket (plain-text)
void handle_write_request(const boost::system::error_code &err)
Callback for handling request and waiting for response.
Abstract Base ASIO Socket class Use for passing around to the service controller, various types of cl...
Definition: asio_socket.hpp:22