Edit

Share via


WebSocketStream.CreateReadableMessageStream(WebSocket) Method

Definition

Creates a WebSocketStream that reads a single message from the underlying WebSocket.

public:
 static System::Net::WebSockets::WebSocketStream ^ CreateReadableMessageStream(System::Net::WebSockets::WebSocket ^ webSocket);
public static System.Net.WebSockets.WebSocketStream CreateReadableMessageStream(System.Net.WebSockets.WebSocket webSocket);
static member CreateReadableMessageStream : System.Net.WebSockets.WebSocket -> System.Net.WebSockets.WebSocketStream
Public Shared Function CreateReadableMessageStream (webSocket As WebSocket) As WebSocketStream

Parameters

webSocket
WebSocket

The wrapped WebSocket.

Returns

A new instance of WebSocketStream that forwards reads on the Stream to the underlying WebSocket.

Remarks

Reads on the Stream will read a single message from the underlying WebSocket. This means that reads will start returning 0 bytes read once all data has been consumed from the next message received in the WebSocket.

Applies to