Qpid Proton C++
0.12.0
|
A connection_engine for socket-based IO. More...
#include <io.hpp>
Public Types | |
enum | io_flag { READ, WRITE } |
Combine these flags with | to indicate read, write, both or neither. | |
Public Member Functions | |
socket_engine (descriptor socket_, handler &, const connection_options &=no_opts) | |
Wrap an open socket. Sets non-blocking mode. | |
socket_engine (const url &, handler &, const connection_options &=no_opts) | |
Create socket engine connected to url. | |
descriptor | socket () const |
Get the socket descriptor. | |
void | run () |
Start the engine. | |
size_t | can_read () const |
Return the number of bytes that the engine is currently ready to read. | |
size_t | can_write () const |
Return the number of bytes that the engine is currently ready to write. | |
bool | process (int io_flags=READ|WRITE) |
Read, write and dispatch events. More... | |
bool | process_nothrow (int io_flags=READ|WRITE) |
Non-throwing version of process. More... | |
bool | closed () const |
True if the engine is closed, meaning there are no further events to process and close_io has been called. More... | |
std::string | error_str () const |
If the engine was closed by an error, return a pointer. | |
class connection | connection () const |
Get the AMQP connection associated with this connection_engine. | |
class transport | transport () const |
Get the transport associated with this connection_engine. | |
void | disconnect () |
Disconnect the engine. | |
A connection_engine for socket-based IO.
|
inherited |
True if the engine is closed, meaning there are no further events to process and close_io has been called.
Call error_str() to get an error description.
|
inherited |
Read, write and dispatch events.
io_flags indicates whether to read, write, both or neither. dispatches all events generated by reading or writing.
proton::closed_error | if closed() is true before calling process() |
proton::io_error | if the engine is closed by an error. |
|
inherited |
Non-throwing version of process.
Use closed() and error_str() to check the status of the engine.