A class that represents a base websocket transport. More...
#include <wamp_websocket_transport.hpp>

Public Member Functions | |
wamp_websocket_transport (const std::string &uri, bool debug_enabled=false) | |
Constructs a websocket transport. More... | |
virtual boost::future< void > | connect () override |
Attempts to connect the transport. More... | |
virtual boost::future< void > | disconnect () override |
Attempts to disconnect the transport. More... | |
virtual bool | is_connected () const override |
Determines if the transport is connected. More... | |
virtual void | send_message (wamp_message &&message) override |
Send the message synchronously over the transport. More... | |
virtual void | set_pause_handler (pause_handler &&handler) override |
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) override |
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 () override |
Pause receiving of messages. More... | |
virtual void | resume () override |
Resume receiving of messages. More... | |
virtual void | attach (const std::shared_ptr< wamp_transport_handler > &handler) override |
Attaches a handler to the transport. More... | |
virtual void | detach () override |
Detaches the handler currently attached to the transport. More... | |
virtual bool | has_handler () const override |
Determines if the transport has a handler attached. More... | |
![]() | |
virtual | ~wamp_transport ()=default |
Default virtual destructor. | |
Protected Attributes | |
boost::promise< void > | m_connect |
The promise that is fulfilled when the connect attempt is complete. | |
boost::promise< void > | m_disconnect |
The promise that is fulfilled when the disconnect attempt is complete. | |
Additional Inherited Members | |
![]() | |
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. | |
Detailed Description
A class that represents a base websocket transport.
Unlike raw socket base class, there is nothing to share about underlying websocket, It is completely up to derived class to handle specific websocket implementation
Definition at line 53 of file wamp_websocket_transport.hpp.
Constructor & Destructor Documentation
autobahn::wamp_websocket_transport::wamp_websocket_transport | ( | const std::string & | uri, |
bool | debug_enabled = false |
||
) |
Constructs a websocket transport.
- Parameters
-
uri The remote endpoint to connect to.
Member Function Documentation
|
overridevirtual |
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.
Implements autobahn::wamp_transport.
|
overridevirtual |
Attempts to connect the transport.
- Returns
- A future that will be satisfied when the connect attempt has been made.
Implements autobahn::wamp_transport.
|
overridevirtual |
Detaches the handler currently attached to the transport.
Implements autobahn::wamp_transport.
|
overridevirtual |
Attempts to disconnect the transport.
- Returns
- A future that will be satisfied when the disconnect attempt has been made.
Implements autobahn::wamp_transport.
|
overridevirtual |
Determines if the transport has a handler attached.
- Returns
- Whether or not a handler is attached.
Implements autobahn::wamp_transport.
|
overridevirtual |
Determines if the transport is connected.
- Returns
- Whether or not the transport is connected.
Implements autobahn::wamp_transport.
Reimplemented in autobahn::wamp_websocketpp_websocket_transport< Config >.
|
overridevirtual |
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.
Implements autobahn::wamp_transport.
|
overridevirtual |
Resume receiving of messages.
The transport will now begin receiving messsages again and lift backpressure from the sending peer.
Implements autobahn::wamp_transport.
|
overridevirtual |
Send the message synchronously over the transport.
- Parameters
-
message The message to be sent.
Implements autobahn::wamp_transport.
|
overridevirtual |
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.
Implements autobahn::wamp_transport.
|
overridevirtual |
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.
Implements autobahn::wamp_transport.