Websocket client class, used to maintain a connection to a remote host for an extended session.
More...
#include <ws_client.h>
Public Member Functions
Connects to the remote network destination. The connect method initiates the websocket handshake with the remote network destination, takes care of the protocol upgrade request.
More...
Sends a websocket message to the server .
More...
Receive a websocket message.
More...
Closes a websocket client connection, sends a close frame to the server and waits for a close message from the server.
More...
Closes a websocket client connection, sends a close frame to the server and waits for a close message from the server.
More...
Gets the websocket client URI.
More...
Gets the websocket client config object.
More...
Detailed Description
Websocket client class, used to maintain a connection to a remote host for an extended session.
Constructor & Destructor Documentation
web::websockets::client::websocket_client::websocket_client
(
)
inline
Creates a new websocket_client.
- Parameters
-
config The client configuration object containing the possible configuration options to initialize the
websocket_client
.
Member Function Documentation
pplx::task<void> web::websockets::client::websocket_client::close
(
)
inline
Closes a websocket client connection, sends a close frame to the server and waits for a close message from the server.
- Returns
- An asynchronous operation that is completed the connection has been successfully closed.
const utility::string_t &
close_reason = _XPLATSTR("")
)
inline
Closes a websocket client connection, sends a close frame to the server and waits for a close message from the server.
- Parameters
-
close_status Endpoint MAY use the following pre-defined status codes when sending a Close frame.
close_reason While closing an established connection, an endpoint may indicate the reason for closure.
- Returns
- An asynchronous operation that is completed the connection has been successfully closed.
Gets the websocket client config object.
- Returns
- A reference to the client configuration object.
pplx::task<void> web::websockets::client::websocket_client::connect
(
const
web::uri &
uri )
inline
Connects to the remote network destination. The connect method initiates the websocket handshake with the remote network destination, takes care of the protocol upgrade request.
- Parameters
-
uri The uri address to connect.
- Returns
- An asynchronous operation that is completed once the client has successfully connected to the websocket server.
Receive a websocket message.
- Returns
- An asynchronous operation that is completed when a message has been received by the client endpoint.
Sends a websocket message to the server .
- Returns
- An asynchronous operation that is completed once the message is sent.
const
web::uri& web::websockets::client::websocket_client::uri
(
)
const
inline
Gets the websocket client URI.
- Returns
- URI connected to.
The documentation for this class was generated from the following file: