Provides an abstraction for a transport to be used by the session. More...
#include <wamp_transport.hpp>

Public Types | |
using | pause_handler = std::function< void()> |
Handler to invoke when pausing transport transmission. | |
using | resume_handler = std::function< void()> |
Handler to invoke when resuming transport transmission. | |
Public Member Functions | |
virtual | ~wamp_transport ()=default |
Default virtual destructor. | |
virtual boost::future< void > | connect ()=0 |
Attempts to connect the transport. More... | |
virtual boost::future< void > | disconnect ()=0 |
Attempts to disconnect the transport. More... | |
virtual bool | is_connected () const =0 |
Determines if the transport is connected. More... | |
virtual void | send_message (wamp_message &&message)=0 |
Send the message synchronously over the transport. More... | |
virtual void | set_pause_handler (pause_handler &&handler)=0 |
Set the handler to be invoked when the transport detects congestion sending to the remote peer and needs to apply backpressure on the application. More... | |
virtual void | set_resume_handler (resume_handler &&handler)=0 |
Set the handler to be invoked when the transport detects congestion has subsided on the remote peer and the application can resume sending messages. More... | |
virtual void | pause ()=0 |
Pause receiving of messages. More... | |
virtual void | resume ()=0 |
Resume receiving of messages. More... | |
virtual void | attach (const std::shared_ptr< wamp_transport_handler > &handler)=0 |
Attaches a handler to the transport. More... | |
virtual void | detach ()=0 |
Detaches the handler currently attached to the transport. | |
virtual bool | has_handler () const =0 |
Determines if the transport has a handler attached. More... | |
Detailed Description
Provides an abstraction for a transport to be used by the session.
A wamp transport is defined as being message based, bidirectional, reliable, and ordered.
Definition at line 49 of file wamp_transport.hpp.
Member Function Documentation
|
pure virtual |
Attaches a handler to the transport.
Only one handler may be attached at any given time.
- Parameters
-
handler The handler to attach to this transport.
Implemented in autobahn::wamp_rawsocket_transport< Socket >, autobahn::wamp_rawsocket_transport< boost::asio::ip::tcp::socket >, and autobahn::wamp_websocket_transport.
|
pure virtual |
Attempts to connect the transport.
- Returns
- A future that will be satisfied when the connect attempt has been made.
Implemented in autobahn::wamp_rawsocket_transport< Socket >, autobahn::wamp_rawsocket_transport< boost::asio::ip::tcp::socket >, autobahn::wamp_websocket_transport, and autobahn::wamp_tcp_transport.
|
pure virtual |
Attempts to disconnect the transport.
- Returns
- A future that will be satisfied when the disconnect attempt has been made.
Implemented in autobahn::wamp_rawsocket_transport< Socket >, autobahn::wamp_rawsocket_transport< boost::asio::ip::tcp::socket >, and autobahn::wamp_websocket_transport.
|
pure virtual |
Determines if the transport has a handler attached.
- Returns
- Whether or not a handler is attached.
Implemented in autobahn::wamp_rawsocket_transport< Socket >, autobahn::wamp_rawsocket_transport< boost::asio::ip::tcp::socket >, and autobahn::wamp_websocket_transport.
|
pure virtual |
Determines if the transport is connected.
- Returns
- Whether or not the transport is connected.
Implemented in autobahn::wamp_rawsocket_transport< Socket >, autobahn::wamp_rawsocket_transport< boost::asio::ip::tcp::socket >, autobahn::wamp_websocket_transport, and autobahn::wamp_websocketpp_websocket_transport< Config >.
|
pure virtual |
Pause receiving of messages.
This will prevent the transport from receiving any more messages until it has been resumed. This is used to excert backpressure on the sending peer.
Implemented in autobahn::wamp_rawsocket_transport< Socket >, autobahn::wamp_rawsocket_transport< boost::asio::ip::tcp::socket >, and autobahn::wamp_websocket_transport.
|
pure virtual |
Resume receiving of messages.
The transport will now begin receiving messsages again and lift backpressure from the sending peer.
Implemented in autobahn::wamp_rawsocket_transport< Socket >, autobahn::wamp_rawsocket_transport< boost::asio::ip::tcp::socket >, and autobahn::wamp_websocket_transport.
|
pure virtual |
Send the message synchronously over the transport.
- Parameters
-
message The message to be sent.
Implemented in autobahn::wamp_rawsocket_transport< Socket >, autobahn::wamp_rawsocket_transport< boost::asio::ip::tcp::socket >, and autobahn::wamp_websocket_transport.
|
pure virtual |
Set the handler to be invoked when the transport detects congestion sending to the remote peer and needs to apply backpressure on the application.
- Parameters
-
handler The pause handler to be invoked.
Implemented in autobahn::wamp_rawsocket_transport< Socket >, autobahn::wamp_rawsocket_transport< boost::asio::ip::tcp::socket >, and autobahn::wamp_websocket_transport.
|
pure virtual |
Set the handler to be invoked when the transport detects congestion has subsided on the remote peer and the application can resume sending messages.
- Parameters
-
handler The resume handler to be invoked.
Implemented in autobahn::wamp_rawsocket_transport< Socket >, autobahn::wamp_rawsocket_transport< boost::asio::ip::tcp::socket >, and autobahn::wamp_websocket_transport.