Class IConnection
Defined in File IConnection.h
Page Contents
Class Documentation
-
class IConnection
Manages a single connection to a remote endpoint or source server. A connection may be composed of multiple socket connections for purposes of multi-plexing and improved performance.
Public Types
-
typedef std::function<void(std::shared_ptr<net::IWebSocketMessage> msg)> MessageCallback
Describes a callback function for receiving push notifications from the server.
Public Functions
-
virtual std::vector<MessageCallback>::const_iterator AddMessageListener(MessageCallback callback) = 0
Registers the given callback function to be notified when a message is received from this connection.
- Parameters
callback – The callback function to register.
- Returns
The iterator of the entry to use when unregistering the callback.
-
virtual void RemoveMessageListener(std::vector<MessageCallback>::const_iterator iter) = 0
Removes the callback with the given iterator.
- Parameters
iter – The iterator to unregister, was returned by the original call to
AddMessageListener
.
-
virtual pplx::task<void> Connect(utility::string_t url) = 0
Initiates a network connection to the given url.
Adds the given socket to the connection for monitoring and processing.
Transmits the given data buffer to the outgoing connection.
-
typedef std::function<void(std::shared_ptr<net::IWebSocketMessage> msg)> MessageCallback