MessageWebSocketMessageReceivedEventArgs MessageWebSocketMessageReceivedEventArgs MessageWebSocketMessageReceivedEventArgs MessageWebSocketMessageReceivedEventArgs Class

Definition

Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Prerelease APIs are identified by a Prerelease label.

[Contains prerelease APIs.]
Provides data for a message received event on a MessageWebSocket.

public : sealed class MessageWebSocketMessageReceivedEventArgs : IMessageWebSocketMessageReceivedEventArgspublic sealed class MessageWebSocketMessageReceivedEventArgs : IMessageWebSocketMessageReceivedEventArgsPublic NotInheritable Class MessageWebSocketMessageReceivedEventArgs Implements IMessageWebSocketMessageReceivedEventArgs// You can use this class in JavaScript.
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

Prerelease. 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// You can use this property in JavaScript.
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 Insider Preview (introduced v10.0.16257.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// You can use this property in JavaScript.

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// You can use this method in JavaScript.
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// You can use this method in JavaScript.
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