1 #ifndef NOOS_CLOUD_ASIO_HTTP 2 #define NOOS_CLOUD_ASIO_HTTP 6 #include "includes.ihh" 7 #include <boost/asio.hpp> 8 #include <noos/cloud/asio/asio_handler.hpp> 34 std::function<
void(std::string)> cloud_callback,
35 std::function<
void(error_code)> error_callback,
36 boost::asio::io_service & io_service,
37 const bool keep_alive,
38 boost::asio::streambuf & request
48 boost::asio::ip::tcp::resolver::query & query,
49 boost::asio::ip::tcp::resolver & resolver,
60 boost::asio::ip::tcp::resolver::query & query,
61 boost::asio::ip::tcp::resolver & resolver,
63 boost::asio::streambuf & request
67 void shutdown(boost::system::error_code);
80 boost::system::error_code err,
81 boost::asio::ip::tcp::resolver::iterator endpoint_iterator
86 const boost::system::error_code err,
87 boost::asio::ip::tcp::resolver::iterator endpoint_iterator
91 void time_check(
const boost::system::error_code & ec);
94 std::function<void(boost::system::error_code)> error_;
95 std::function<void(std::string)> callback_;
96 std::shared_ptr<http_socket> socket_;
97 boost::asio::streambuf & request_;
98 std::shared_ptr<boost::asio::deadline_timer> deadline_;
99 std::atomic<bool> connected_ = {
false };
ASIO socket controller asynchronous http websockets used for cloud service calls. ...
Definition: asio_http.hpp:22
void begin(boost::asio::ip::tcp::resolver::query &query, boost::asio::ip::tcp::resolver &resolver, unsigned int timeout)
begin connection
ASIO socket controller of boost asio socket type T.
Definition: asio_handler.hpp:27
Definition: asio_handler.hpp:14
asio_http(std::function< void(std::string)> cloud_callback, std::function< void(error_code)> error_callback, boost::asio::io_service &io_service, const bool keep_alive, boost::asio::streambuf &request)
constructor
void shutdown(boost::system::error_code)
shutdown connection
void send(boost::asio::ip::tcp::resolver::query &query, boost::asio::ip::tcp::resolver &resolver, unsigned int timeout, boost::asio::streambuf &request)
send data in an existing connection
bool is_connected() const
void stop_timeout()
stop timeout timer