[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.
| Constructor | Description |
|---|---|
| MessageWebSocket | Creates a new MessageWebSocket object. |
Events
The MessageWebSocket class has these events.
| Event | Description |
|---|---|
| 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.
| Method | Description |
|---|---|
| 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.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets socket control data on a MessageWebSocket object. | |
| Read-only | Gets socket information on a MessageWebSocket object. | |
| Read-only | Gets 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 |
|
|
Metadata |
|
|
DLL |
|
|
Capabilities |
|
See also
- Connecting to a WebSocket service
- Quickstart: Connecting using a MessageWebSocket
- Connecting with WebSockets sample
Build date: 5/22/2012
