Edit

Share via


WebSocketStream.CreateWritableMessageStream Method

Definition

Creates a WebSocketStream that writes a single message to the underlying WebSocket.

public:
 static System::Net::WebSockets::WebSocketStream ^ CreateWritableMessageStream(System::Net::WebSockets::WebSocket ^ webSocket, System::Net::WebSockets::WebSocketMessageType writeMessageType);
public static System.Net.WebSockets.WebSocketStream CreateWritableMessageStream(System.Net.WebSockets.WebSocket webSocket, System.Net.WebSockets.WebSocketMessageType writeMessageType);
static member CreateWritableMessageStream : System.Net.WebSockets.WebSocket * System.Net.WebSockets.WebSocketMessageType -> System.Net.WebSockets.WebSocketStream
Public Shared Function CreateWritableMessageStream (webSocket As WebSocket, writeMessageType As WebSocketMessageType) As WebSocketStream

Parameters

webSocket
WebSocket

The wrapped WebSocket.

writeMessageType
WebSocketMessageType

The type of messages that should be written as part of WriteAsync calls.

Each write on the Stream results in writing a partial message to the underlying WebSocket.

When the Stream is disposed, it will write an empty message to the underlying WebSocket to signal the end of the message.

Returns

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

Applies to