Odil
A C++11 library for the DICOM standard
|
TCP transport for the DICOM Upper Layer. More...
#include <Transport.h>
Public Types | |
typedef boost::asio::ip::tcp::socket | Socket |
Socket type. More... | |
typedef boost::asio::deadline_timer::duration_type | duration_type |
Duration of the timeout. More... | |
Public Member Functions | |
Transport () | |
Constructor. More... | |
~Transport () | |
Destructor. More... | |
const boost::asio::io_service & | get_service () const |
Return the io_service. More... | |
boost::asio::io_service & | get_service () |
Return the io_service. More... | |
std::shared_ptr< Socket const > | get_socket () const |
Return the socket. More... | |
std::shared_ptr< Socket > | get_socket () |
Return the socket. More... | |
duration_type | get_timeout () const |
Return the timeout, default to infinity. More... | |
void | set_timeout (duration_type timeout) |
Set the timeout. More... | |
bool | is_open () const |
Test whether the transport is open. More... | |
void | connect (Socket::endpoint_type const &peer_endpoint) |
Connect to the specified endpoint, raise an exception upon error. More... | |
void | receive (Socket::endpoint_type const &endpoint) |
Receive a connection on the specified endpoint, raise an exception upon error. More... | |
void | close () |
Close the connection. More... | |
std::string | read (std::size_t length) |
Read data, raise an exception on error. More... | |
void | write (std::string const &data) |
Write data, raise an exception on error. More... | |
TCP transport for the DICOM Upper Layer.
The behavior of connect, receive, read and write is governed by the timeout value: if the timeout expires before the operation is completed, an exception will be raised.
typedef boost::asio::deadline_timer::duration_type odil::dul::Transport::duration_type |
Duration of the timeout.
typedef boost::asio::ip::tcp::socket odil::dul::Transport::Socket |
Socket type.
odil::dul::Transport::Transport | ( | ) |
Constructor.
odil::dul::Transport::~Transport | ( | ) |
Destructor.
void odil::dul::Transport::close | ( | ) |
Close the connection.
void odil::dul::Transport::connect | ( | Socket::endpoint_type const & | peer_endpoint | ) |
Connect to the specified endpoint, raise an exception upon error.
boost::asio::io_service& odil::dul::Transport::get_service | ( | ) |
Return the io_service.
const boost::asio::io_service& odil::dul::Transport::get_service | ( | ) | const |
Return the io_service.
std::shared_ptr<Socket> odil::dul::Transport::get_socket | ( | ) |
Return the socket.
std::shared_ptr<Socket const> odil::dul::Transport::get_socket | ( | ) | const |
Return the socket.
duration_type odil::dul::Transport::get_timeout | ( | ) | const |
Return the timeout, default to infinity.
bool odil::dul::Transport::is_open | ( | ) | const |
Test whether the transport is open.
std::string odil::dul::Transport::read | ( | std::size_t | length | ) |
Read data, raise an exception on error.
void odil::dul::Transport::receive | ( | Socket::endpoint_type const & | endpoint | ) |
Receive a connection on the specified endpoint, raise an exception upon error.
void odil::dul::Transport::set_timeout | ( | duration_type | timeout | ) |
Set the timeout.
void odil::dul::Transport::write | ( | std::string const & | data | ) |
Write data, raise an exception on error.