0 out of 5 rated this helpful - Rate this topic

MessageWebSocket class

Supports network communication that allows reading and writing whole messages using a WebSocket.

Syntax


var messageWebSocket = new Windows.Networking.Sockets.MessageWebSocket();

Attributes

ActivatableAttribute(NTDDI_WIN8)
DualApiPartitionAttribute()
MarshalingBehaviorAttribute(Agile)
ThreadingAttribute(Both)
VersionAttribute(NTDDI_WIN8)

Members

The MessageWebSocket class has these types of members:

Constructors

The MessageWebSocket class has these constructors.

ConstructorDescription
MessageWebSocket Creates a new MessageWebSocket object.

 

Events

The MessageWebSocket class has these events.

EventDescription
Closed Occurs when a close frame is received on the MessageWebSocket object as part of the close handshake.
MessageReceived An event that indicates that a message was received on the MessageWebSocket object.

 

Methods

The MessageWebSocket class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
Close() [C++, JavaScript]Closes the MessageWebSocket object and sends an empty close frame to the server.
Close(UInt16, String) Closes the MessageWebSocket object and indicates a reason for the closure.
ConnectAsync Starts an asynchronous operation to connect to a remote network destination on a MessageWebSocket object.
Dispose [C#, VB]Performs tasks associated with freeing, releasing, or resetting unmanaged resources.
SetRequestHeader Adds an HTTP request header to the HTTP request message used in the WebSocket protocol handshake by the MessageWebSocket object.

 

Properties

The MessageWebSocket class has these properties.

PropertyAccess typeDescription

Control

Read-onlyGets socket control data on a MessageWebSocket object.

Information

Read-onlyGets socket information on a MessageWebSocket object.

OutputStream

Read-onlyGets the output stream to write to the remote network destination on a MessageWebSocket object.

 

Requirements

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.winmd

DLL

Windows.Networking.dll

Capabilities

internetClient
privateNetworkClientServer

See also

Connecting with WebSockets
Quickstart: Connecting with a MessageWebSocket
Connecting with WebSockets sample

 

 

Build date: 2/25/2013

© 2013 Microsoft. All rights reserved.