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.
| 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() [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.
| 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 [Windows Store apps, desktop apps] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps, desktop apps] |
|
Namespace |
|
|
Metadata |
|
|
DLL |
|
|
Capabilities |
|
See also
- Connecting with WebSockets
- Quickstart: Connecting with a MessageWebSocket
- Connecting with WebSockets sample
Build date: 2/25/2013
