MessageWebSocketMessageReceivedEventArgs MessageWebSocketMessageReceivedEventArgs MessageWebSocketMessageReceivedEventArgs MessageWebSocketMessageReceivedEventArgs Class

Definition

Provides data for a message received event on a MessageWebSocket.

public : sealed class MessageWebSocketMessageReceivedEventArgs : IMessageWebSocketMessageReceivedEventArgs
public sealed class MessageWebSocketMessageReceivedEventArgs : IMessageWebSocketMessageReceivedEventArgs
Public NotInheritable Class MessageWebSocketMessageReceivedEventArgs Implements IMessageWebSocketMessageReceivedEventArgs
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The MessageWebSocketMessageReceivedEventArgs is used to receive data on a MessageWebSocket object.

A MessageWebSocket.MessageReceived event occurs on a MessageWebSocket when a message is received. A MessageWebSocketMessageReceivedEventArgs instance is created when the MessageWebSocket.MessageReceived event occurs.

Properties

IsMessageComplete IsMessageComplete IsMessageComplete IsMessageComplete

Allow clients to query if a MessageReceived callback indicates the received message is complete or just a partial message.

public : Platform::Boolean IsMessageComplete { get; }
public bool IsMessageComplete { get; }
Public ReadOnly Property IsMessageComplete As bool
var bool = messageWebSocketMessageReceivedEventArgs.isMessageComplete;
Value
Platform::Boolean bool bool bool

TRUE if the message is complete. The default value is FALSE.

Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Remarks

This flag is always true if ReceiveMode is FullMessage mode (the default), but only true for the last (for a given set of fragments) MessageReceive callback in the new PartialMessage mode.

MessageType MessageType MessageType MessageType

Gets the type of the message received by a MessageWebSocket object.

public : SocketMessageType MessageType { get; }
public SocketMessageType MessageType { get; }
Public ReadOnly Property MessageType As SocketMessageType
var socketMessageType = messageWebSocketMessageReceivedEventArgs.messageType;

Remarks

The WebSocket protocol currently supports two message types: UTF-8 and binary messages. If a message is sent as a binary message, it is up to the app to correctly interpret the binary data. Note that it is perfectly legal to return a binary message where the binary data is a UTF-8 string.

The value of MessageType property is informative. It does not affect what methods are supported on the returned data by the MessageWebSocket object.

See Also

Methods

GetDataReader() GetDataReader() GetDataReader() GetDataReader()

Gets a DataReader object to read incoming data received from the remote network destination on a MessageWebSocket.

public : DataReader GetDataReader()
public DataReader GetDataReader()
Public Function GetDataReader() As DataReader
var dataReader = messageWebSocketMessageReceivedEventArgs.getDataReader();
Returns

A DataReader object to read incoming data received from the remote network destination on a MessageWebSocket.

Remarks

If the underlying TCP connection is suddenly terminated, GetDataReader throws the WININET_E_CONNECTION_ABORTED exception.

An empty message results in GetDataReader returning a valid IDataReader instance with UnconsumedBufferLength set to 0.

See Also

GetDataStream() GetDataStream() GetDataStream() GetDataStream()

Gets an IInputStream object (a message represented as a sequential stream of bytes) from the remote network destination on a MessageWebSocket object.

public : IInputStream GetDataStream()
public IInputStream GetDataStream()
Public Function GetDataStream() As IInputStream
var iInputStream = messageWebSocketMessageReceivedEventArgs.getDataStream();
Returns

A message represented as a sequential stream of bytes.

Remarks

If the underlying TCP connection is suddenly terminated, GetDataStream throws the WININET_E_CONNECTION_ABORTED exception.

An empty message results in GetDataStream returning a valid IInputStream instance that yields zero bytes.

See Also

See Also