9#ifndef _1619bae8_acba_4bf8_8205_aa8dd0085c66
10#define _1619bae8_acba_4bf8_8205_aa8dd0085c66
17#include <boost/asio.hpp>
20#if BOOST_VERSION >= 108700
25using io_service = io_context;
48 typedef boost::asio::ip::tcp::socket
Socket;
81 void connect(Socket::endpoint_type
const & peer_endpoint);
87 void receive(Socket::endpoint_type
const & endpoint);
93 std::string
read(std::size_t length);
96 void write(std::string
const & data);
99 boost::asio::io_service _service;
100 std::shared_ptr<Socket> _socket;
102 boost::asio::steady_timer _deadline;
104 std::shared_ptr<boost::asio::ip::tcp::acceptor> _acceptor;
113 void _start_deadline(Source & source, boost::system::error_code & error);
114 void _stop_deadline();
116 void _run(Source & source, boost::system::error_code & error);
Definition EventData.h:24
Definition Association.h:25
#define ODIL_API
Definition odil.h:28
duration_type get_timeout() const
Return the timeout, default to infinity.
std::shared_ptr< Socket const > get_socket() const
Return the socket.
bool is_open() const
Test whether the transport is open.
void receive(Socket::endpoint_type const &endpoint)
Receive a connection on the specified endpoint, raise an exception upon error.
std::string read(std::size_t length)
Read data, raise an exception on error.
std::shared_ptr< Socket > get_socket()
Return the socket.
void close()
Close the connection.
boost::asio::io_service & get_service()
Return the io_service.
boost::asio::steady_timer::duration duration_type
Duration of the timeout.
Definition Transport.h:51
boost::asio::io_service const & get_service() const
Return the io_service.
boost::asio::ip::tcp::socket Socket
Socket type.
Definition Transport.h:48
void connect(Socket::endpoint_type const &peer_endpoint)
Connect to the specified endpoint, raise an exception upon error.
void write(std::string const &data)
Write data, raise an exception on error.
void set_timeout(duration_type timeout)
Set the timeout.