noos::cloud::asio_https Class Reference

ASIO socket controller for TLS (encrypred) cloud service calls. More...

#include <asio_https.hpp>

Public Member Functions

 asio_https (std::function< void(std::string)> cloud_callback, std::function< void(error_code error)> error_callback, boost::asio::io_service &io_service, const bool keep_alive, boost::asio::streambuf &request)
 constructor More...
 
void begin (boost::asio::ip::tcp::resolver::query &query, boost::asio::ip::tcp::resolver &resolver, unsigned int timeout)
 begin connection More...
 
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 More...
 
void shutdown (const boost::system::error_code)
 shutdown handler
 
void stop_timeout ()
 stop timeout timer
 
bool is_connected () const
 
- Public Member Functions inherited from noos::cloud::asio_handler< tls_socket, asio_https >
 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< tls_socket > 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

ASIO socket controller for TLS (encrypred) cloud service calls.

Version
0.7.2
Date
15 December 2016
Author
Alex Giokas a.gki.nosp@m.okas.nosp@m.@orte.nosp@m.lio..nosp@m.co.uk
See also
asio_handler
http_request
http_response
Inheritance diagram for noos::cloud::asio_https:
Collaboration diagram for noos::cloud::asio_https:

Constructor & Destructor Documentation

noos::cloud::asio_https::asio_https ( std::function< void(std::string)>  cloud_callback,
std::function< void(error_code error)>  error_callback,
boost::asio::io_service &  io_service,
const bool  keep_alive,
boost::asio::streambuf &  request 
)

constructor

cloud_function is the virtual json_parser::deserialize receiving the data error_function is the handler which may receive the errors io_service is the ASIO service controller request is a stream buffer containing the request (0.8.0) load certificate from a system-wide location (e.g., /opt/noos/cert/public.noos.cloud)

Member Function Documentation

void noos::cloud::asio_https::begin ( boost::asio::ip::tcp::resolver::query &  query,
boost::asio::ip::tcp::resolver &  resolver,
unsigned int  timeout 
)

begin connection

Parameters
querydefines the URL/URI
resolverresolves the URL/URI address
io_serviceis the queue on which jobs are scheduled
Warning
only TLS 1.2 and later are allowed
void noos::cloud::asio_https::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

Parameters
querydefines the URL/URI
resolverresolves the URL/URI address
io_serviceis the queue on which jobs are scheduled
bool noos::cloud::asio_https::is_connected ( ) const
Returns
if socket is connected

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