MessageWebSocket class

Expand
0 out of 2 rated this helpful - Rate this topic

MessageWebSocket class

[This documentation is preliminary and is subject to change.]

Applies to: Metro style apps | desktop apps

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() 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.
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 Release Preview

Minimum supported server

Windows Server 2012

Namespace

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

Metadata

Windows.winmd

DLL

Windows.Networking.dll

Capabilities

internetClient
privateNetworkClientServer

See also

Connecting to a WebSocket service
Quickstart: Connecting using a MessageWebSocket
Connecting with WebSockets sample

 

 

Build date: 5/22/2012

Did you find this helpful?
(1500 characters remaining)
Community Additions ADD