noos::cloud::asio_handler< socket_type, child_class > Class Template Reference

ASIO socket controller of boost asio socket type T. More...

#include <asio_handler.hpp>

Public Member Functions

 asio_handler (const bool keep_alive, std::function< void(error_code)> error_callback)
 construct by callbacks and socket T pointer More...
 
void set_socket (const std::shared_ptr< socket_type > socket)
 set socket pointer
 
void write_request (const boost::system::error_code &err, const std::size_t bytes)
 write the cloud request to the socket More...
 
void read_status_line (const boost::system::error_code &err, const std::size_t bytes)
 read first HTTP line and check for a 200 response More...
 
void read_headers (const boost::system::error_code &err, const std::size_t bytes)
 read HTTP headers and validate More...
 
void read_content (const boost::system::error_code &err, const std::size_t bytes)
 strip the header and read the POST data More...
 
void end (const boost::system::error_code &err)
 close socket and cleanup members More...
 

Detailed Description

template<class socket_type, class child_class>
class noos::cloud::asio_handler< socket_type, child_class >

ASIO socket controller of boost asio socket type T.

Version
0.7.0
Date
12 August 2016
Author
Alex Giokas a.gki.nosp@m.okas.nosp@m.@orte.nosp@m.lio..nosp@m.co.uk
Note
This class is used internally from asio_http and asio_https.
Inheritance diagram for noos::cloud::asio_handler< socket_type, child_class >:
Collaboration diagram for noos::cloud::asio_handler< socket_type, child_class >:

Constructor & Destructor Documentation

template<class socket_type, class child_class>
noos::cloud::asio_handler< socket_type, child_class >::asio_handler ( const bool  keep_alive,
std::function< void(error_code)>  error_callback 
)

construct by callbacks and socket T pointer

Parameters
cloud_functionwill receive the platform JSON reply
error_functionwill receive any asio errors
socketis the actual type T socket pointer

Member Function Documentation

template<class socket_type, class child_class>
void noos::cloud::asio_handler< socket_type, child_class >::write_request ( const boost::system::error_code &  err,
const std::size_t  bytes 
)

write the cloud request to the socket

Parameters
erris propagated from boost asio
template<class socket_type, class child_class>
void noos::cloud::asio_handler< socket_type, child_class >::read_status_line ( const boost::system::error_code &  err,
const std::size_t  bytes 
)

read first HTTP line and check for a 200 response

Parameters
erris propagated from boost asio
template<class socket_type, class child_class>
void noos::cloud::asio_handler< socket_type, child_class >::read_headers ( const boost::system::error_code &  err,
const std::size_t  bytes 
)

read HTTP headers and validate

Parameters
erris propagated from boost asio
template<class socket_type, class child_class>
void noos::cloud::asio_handler< socket_type, child_class >::read_content ( const boost::system::error_code &  err,
const std::size_t  bytes 
)

strip the header and read the POST data

Parameters
erris propagated from boost asio
template<class socket_type, class child_class>
void noos::cloud::asio_handler< socket_type, child_class >::end ( const boost::system::error_code &  err)

close socket and cleanup members

Parameters
erris propagated from boost asio

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