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>
36 typedef boost::asio::ip::tcp::socket
Socket;
69 void connect(Socket::endpoint_type
const & peer_endpoint);
75 void receive(Socket::endpoint_type
const & endpoint);
81 std::string
read(std::size_t length);
84 void write(std::string
const & data);
87 boost::asio::io_service _service;
88 std::shared_ptr<Socket> _socket;
90 boost::asio::deadline_timer _deadline;
92 std::shared_ptr<boost::asio::ip::tcp::acceptor> _acceptor;
101 void _start_deadline(Source & source, boost::system::error_code & error);
102 void _stop_deadline();
104 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:34
boost::asio::deadline_timer::duration_type duration_type
Duration of the timeout.
Definition: Transport.h:39
boost::asio::io_service & get_service()
Return the io_service.
std::shared_ptr< Socket > get_socket()
Return the socket.
duration_type get_timeout() const
Return the timeout, default to infinity.
boost::asio::io_service const & get_service() const
Return the io_service.
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.
void close()
Close the connection.
boost::asio::ip::tcp::socket Socket
Socket type.
Definition: Transport.h:36
void connect(Socket::endpoint_type const &peer_endpoint)
Connect to the specified endpoint, raise an exception upon error.
std::shared_ptr< Socket const > get_socket() const
Return the socket.
void write(std::string const &data)
Write data, raise an exception on error.
void set_timeout(duration_type timeout)
Set the timeout.