Namespaces | Typedefs | Functions
NetworkTypes.hpp File Reference

(7)

Low level types used in networking code. More...

#include <Balau/Type/ToString.hpp>
#include <Balau/Type/FromString.hpp>
#include <Balau/Util/Enums.hpp>
#include <Balau/ThirdParty/Boost/Beast/Http/BasicFileBody.hpp>
#include <boost/asio/bind_executor.hpp>
#include <boost/asio/connect.hpp>
#include <boost/asio/io_context.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/ssl/error.hpp>
#include <boost/asio/ssl/stream.hpp>
#include <boost/asio/strand.hpp>
#include <boost/beast/core.hpp>
#include <boost/beast/http.hpp>
#include <boost/beast/version.hpp>
#include <boost/beast/websocket.hpp>
#include <boost/config.hpp>
Include dependency graph for NetworkTypes.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Balau::Network
 Components and utilities working on network data transmission.
 

Typedefs

using Address = boost::asio::ip::address
 An IP4 or IP6 address. More...
 
using BoostSystemError = boost::system::system_error
 Boost system error. More...
 
using BoostSystemErrorCode = boost::system::error_code
 Boost system error codes. More...
 
using Buffer = boost::beast::flat_buffer
 A data buffer used in HTTP code. More...
 
using CharVectorBody = boost::beast::http::vector_body< char >
 A message body represented by a vector of 8 bit characters. More...
 
using CharVectorRequest = Request< CharVectorBody >
 A request with a char vector body. More...
 
using CharVectorResponse = Response< CharVectorBody >
 A response with a char vector body. More...
 
using EmptyBody = boost::beast::http::empty_body
 A message body wth no content. More...
 
using EmptyResponse = Response< EmptyBody >
 A response with an empty body. More...
 
using Endpoint = boost::asio::ip::tcp::endpoint
 An IP address and port number. More...
 
using Error = boost::beast::http::error
 Boost error codes returned from HTTP algorithms and operations. More...
 
using Field = boost::beast::http::field
 An HTTP header field. More...
 
using FileBody = Balau::Boost::Beast::Http::basic_file_body< boost::beast::file >
 A message body represented by a file on the filesystem. More...
 
using FileBodyValue = FileBody::value_type
 The type of the message body represented by a file on the filesystem. More...
 
using FileMode = boost::beast::file_mode
 Boost HTTP file open modes. More...
 
using Method = boost::beast::http::verb
 The HTTP method (GET, HEAD, POST). More...
 
template<class Body , class Fields = boost::beast::http::fields>
using Request = boost::beast::http::request< Body, Fields >
 The request type. More...
 
template<class Body , class Fields = boost::beast::http::fields>
using Response = boost::beast::http::response< Body, Fields >
 The response type. More...
 
using Status = boost::beast::http::status
 Boost status code. More...
 
using StringBody = boost::beast::http::basic_string_body< char >
 A message body represented by a UTF-8 string. More...
 
using StringRequest = Request< StringBody >
 A request with a string body. More...
 
using StringResponse = Response< StringBody >
 A response with a string body. More...
 
using TCP = boost::asio::ip::tcp
 The Boost SSL namespace. More...
 
using WsFrame = WS::frame_type
 The Boost HTTP namespace. More...
 

Functions

void fromString (tcp::endpoint &endpoint, std::string_view value)
 Populate the endpoint by parsing the supplied string. More...
 
Endpoint makeEndpoint (const std::string &address, unsigned short port)
 Make an endpoint on the stack. More...
 
Endpoint makeEndpoint (const char *address, unsigned short port)
 Make an endpoint on the stack. More...
 
std::shared_ptr< Endpoint > newEndpoint (const std::string &address, unsigned short port)
 Make an endpoint on the heap. More...
 
std::shared_ptr< Endpoint > newEndpoint (const char *address, unsigned short port)
 Make an endpoint on the heap. More...
 
template<typename AllocatorT >
Balau::U8String< AllocatorT > toString (const address &a)
 Print the IP address as a UTF-8 string. More...
 
template<typename AllocatorT >
Balau::U8String< AllocatorT > toString (const tcp::endpoint &endpoint)
 Print the endpoint as a UTF-8 string. More...
 
template<typename AllocatorT >
Balau::U8String< AllocatorT > toString (const error_code &errorCode)
 Print the error code as a UTF-8 string. More...
 
template<typename AllocatorT >
Balau::U8String< AllocatorT > toString (const status &s)
 Print the network status as a UTF-8 string. More...
 
template<typename AllocatorT >
Balau::U8String< AllocatorT > toString (const verb &method)
 Print the network status as a UTF-8 string. More...
 
template<typename AllocatorT >
Balau::U8String< AllocatorT > toString (const field &f)
 Print the network status as a UTF-8 string. More...
 

Detailed Description

Low level types used in networking code.

Function Documentation

◆ fromString()

void boost::asio::ip::fromString ( tcp::endpoint &  endpoint,
std::string_view  value 
)
inline

Populate the endpoint by parsing the supplied string.

◆ toString() [1/6]

std::string toString ( const address &  a)
inline

Print the IP address as a UTF-8 string.

Returns
a UTF-8 string representing the IP address

◆ toString() [2/6]

std::string toString ( const tcp::endpoint &  endpoint)
inline

Print the endpoint as a UTF-8 string.

Returns
a UTF-8 string representing the endpoint

◆ toString() [3/6]

std::string toString ( const error_code &  errorCode)
inline

Print the error code as a UTF-8 string.

Returns
a UTF-8 string representing the error code

◆ toString() [4/6]

std::string toString ( const status &  s)
inline

Print the network status as a UTF-8 string.

Returns
a UTF-8 string representing the network status

◆ toString() [5/6]

std::string toString ( const verb &  method)
inline

Print the network status as a UTF-8 string.

Returns
a UTF-8 string representing the network status

◆ toString() [6/6]

std::string toString ( const field &  f)
inline

Print the network status as a UTF-8 string.

Returns
a UTF-8 string representing the network status