thrift_asio_transport.hpp
26 class thrift_asio_transport : public apache::thrift::transport::TVirtualTransport<thrift_asio_transport>
209 return socket_->remote_endpoint().address().to_string() + ":" + std::to_string(socket_->remote_endpoint().port());
Definition: thrift_asio_transport.hpp:32
virtual void on_disconnected()
Gets invoked when the transport is disconnected.
Definition: thrift_asio_transport.hpp:46
virtual void on_error(const boost::system::error_code &ec)
Gets invoked when an error occurred while communication over the transport.
Definition: thrift_asio_transport.hpp:35
virtual bool peek() override
return true, if there is data available to be processed
Definition: thrift_asio_transport.hpp:157
void write(const uint8_t *buf, uint32_t len)
Definition: thrift_asio_transport.hpp:112
bool isClosed()
Checks wether this transport is closed.
Definition: thrift_asio_transport.hpp:151
State
enum to represent the state-machine of the connection
Definition: thrift_asio_transport.hpp:214
virtual void close() override
closes the transport
Definition: thrift_asio_transport.hpp:183
virtual void open() override
opens the transport
Definition: thrift_asio_transport.hpp:163
we're currently trying to resolve host_name:service_name
Definition: thrift_asio_transport.hpp:218
event_handlers * event_handlers_
handles events like on_error, etc.
Definition: thrift_asio_transport.hpp:224
uint32_t read(uint8_t *buf, uint32_t len)
Attempt to read up to the specified number of bytes into the string.
Definition: thrift_asio_transport.hpp:74
virtual void on_connected()
Gets invoked when the transport was successfully connected.
Definition: thrift_asio_transport.hpp:41
size_t available_bytes() const
the number of bytes, that have been received on not yet read()
Definition: thrift_asio_transport.hpp:94
virtual bool isOpen() override
return true unless an error occured or the transport was closed
Definition: thrift_asio_transport.hpp:140
virtual const std::string getOrigin() override
Definition: thrift_asio_transport.hpp:207
std::shared_ptr< boost::asio::ip::tcp::socket > socket_ptr
a shared_ptr to a tcp socket
Definition: thrift_asio_transport.hpp:52
socket_ptr socket_
the underlying socket
Definition: thrift_asio_transport.hpp:223
thrift_asio_transport(socket_ptr socket, event_handlers *event_handlers)
creates a thrift_asio_transport from a socket_ptr
Definition: thrift_asio_transport.hpp:55
State state_
the state of this transport
Definition: thrift_asio_transport.hpp:222
Definition: thrift_asio_transport.hpp:26
the transport is open and ready for communication
Definition: thrift_asio_transport.hpp:219
the transport is closed
Definition: thrift_asio_transport.hpp:216
the transport is currently connecting
Definition: thrift_asio_transport.hpp:217
