C++ Rest SDK
The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Public Member Functions | Friends | List of all members
web::websockets::client::websocket_incoming_message Class Reference

Represents an incoming websocket message More...

#include <ws_msg.h>

Public Member Functions

_ASYNCRTIMP pplx::task< std::string > extract_string () const
 Extracts the body of the incoming message as a string value, only if the message type is UTF-8. A body can only be extracted once because in some cases an optimization is made where the data is 'moved' out. More...
 
concurrency::streams::istream body () const
 Produces a stream which the caller may use to retrieve body from an incoming message. Can be used for both UTF-8 (text) and binary message types. More...
 
size_t length () const
 Returns the length of the received message. More...
 
websocket_message_type messge_type () const
 Returns the type of the received message. More...
 
websocket_message_type message_type () const
 Returns the type of the received message, either string or binary. More...
 

Friends

class details::winrt_callback_client
 
class details::wspp_callback_client
 

Detailed Description

Represents an incoming websocket message

Member Function Documentation

concurrency::streams::istream web::websockets::client::websocket_incoming_message::body ( ) const
inline

Produces a stream which the caller may use to retrieve body from an incoming message. Can be used for both UTF-8 (text) and binary message types.

Returns
A readable, open asynchronous stream.

This cannot be used in conjunction with any other means of getting the body of the message.

_ASYNCRTIMP pplx::task<std::string> web::websockets::client::websocket_incoming_message::extract_string ( ) const

Extracts the body of the incoming message as a string value, only if the message type is UTF-8. A body can only be extracted once because in some cases an optimization is made where the data is 'moved' out.

Returns
String containing body of the message.
size_t web::websockets::client::websocket_incoming_message::length ( ) const
inline

Returns the length of the received message.

websocket_message_type web::websockets::client::websocket_incoming_message::message_type ( ) const
inline

Returns the type of the received message, either string or binary.

Returns
websocket_message_type
websocket_message_type web::websockets::client::websocket_incoming_message::messge_type ( ) const
inline

Returns the type of the received message.


The documentation for this class was generated from the following file: