Dela via


ServerMessageWebSocket Class

Definition

Supports network communication that allows reading and writing whole messages using a WebSocket object owned by a web server. You can't register for an arbitrary WebSocket connection; instead, an instance of ServerMessageWebSocket is created by system code such as the Windows Device Portal (WDP).

public ref class ServerMessageWebSocket sealed : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 393216)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ServerMessageWebSocket final : IClosable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 393216)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ServerMessageWebSocket : System.IDisposable
Public NotInheritable Class ServerMessageWebSocket
Implements IDisposable
Inheritance
Object Platform::Object IInspectable ServerMessageWebSocket
Attributes
Implements

Windows requirements

Device family
Windows 10, version 1803 (introduced in 10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v6.0)
App capabilities
internetClientServer privateNetworkClientServer

Properties

Control

Gets socket control data on a ServerMessageWebSocket object.

Information

Gets socket information on a ServerMessageWebSocket object.

OutputStream

Gets the output stream to write to the remote network destination on a ServerMessageWebSocket object.

Methods

Close()

Closes the ServerMessageWebSocket object and sends an empty close frame to the server.

Close(UInt16, String)

Closes the ServerMessageWebSocket object and indicates a reason for the closure.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Events

Closed

Occurs when a close frame is received on the ServerMessageWebSocket object as part of the close handshake.

MessageReceived

An event that indicates that a message was received on the ServerMessageWebSocket object.

Applies to

See also