A class that represents a rawsocket transport. More...
#include <wamp_rawsocket_transport.hpp>

Public Types | |
typedef Socket | socket_type |
Convenience type for the socket being used. | |
typedef Socket::endpoint_type | endpoint_type |
Convenience type for the endpoint being used. | |
![]() | |
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 | |
wamp_rawsocket_transport (boost::asio::io_service &io_service, const endpoint_type &remote_endpoint, bool debug_enabled=false) | |
Constructs a rawsocket 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 Member Functions | |
socket_type & | socket () |
Detailed Description
template<typename Socket>
class autobahn::wamp_rawsocket_transport< Socket >
A class that represents a rawsocket transport.
It is templated based on the socket type
- Template Parameters
-
Socket The socket type for the transport. Endpoint The endpoint type for the socket to connect to.
Definition at line 55 of file wamp_rawsocket_transport.hpp.
Constructor & Destructor Documentation
autobahn::wamp_rawsocket_transport< Socket >::wamp_rawsocket_transport | ( | boost::asio::io_service & | io_service, |
const endpoint_type & | remote_endpoint, | ||
bool | debug_enabled = false |
||
) |
Constructs a rawsocket transport.
- Parameters
-
io_service The io service to use for asynchronous operations. remote_endpoint 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.
Reimplemented in autobahn::wamp_tcp_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.
|
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.