9#ifndef _1619bae8_acba_4bf8_8205_aa8dd0085c66
10#define _1619bae8_acba_4bf8_8205_aa8dd0085c66
15#include <boost/asio.hpp>
16#include <boost/date_time.hpp>
19#if BOOST_VERSION >= 108700
24using io_service = io_context;
47 typedef boost::asio::ip::tcp::socket
Socket;
80 void connect(Socket::endpoint_type
const & peer_endpoint);
86 void receive(Socket::endpoint_type
const & endpoint);
92 std::string
read(std::size_t length);
95 void write(std::string
const & data);
98 boost::asio::io_service _service;
99 std::shared_ptr<Socket> _socket;
101 boost::asio::deadline_timer _deadline;
103 std::shared_ptr<boost::asio::ip::tcp::acceptor> _acceptor;
112 void _start_deadline(Source & source, boost::system::error_code & error);
113 void _stop_deadline();
115 void _run(Source & source, boost::system::error_code & error);
Definition Association.h:25
#define ODIL_API
Definition odil.h:28
TCP transport for the DICOM Upper Layer.
Definition Transport.h:45
boost::asio::deadline_timer::duration_type duration_type
Duration of the timeout.
Definition Transport.h:50
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::io_service const & get_service() const
Return the io_service.
boost::asio::ip::tcp::socket Socket
Socket type.
Definition Transport.h:47
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.