System.Net.WebSockets 命名空間

System.Net.WebSockets 命名空間為開發人員提供 WebSocket 介面的 Managed 實作。 The System.Net.WebSockets namespace provides a managed implementation of the WebSocket interface for developers.

類別

ClientWebSocket

提供用於連線到 WebSocket 服務的用戶端。Provides a client for connecting to WebSocket services.

ClientWebSocketOptions

要搭配 ClientWebSocket 物件使用的選項。Options to use with a ClientWebSocket object.

HttpListenerWebSocketContext

可用來存取接受 WebSocket 連接時,HttpListener 類別所收到的資訊。Provides access to information received by the HttpListener class when accepting WebSocket connections.

WebSocket

WebSocket 類別允許應用程式在 WebSocket 升級完成之後傳送和接收資料。The WebSocket class allows applications to send and receive data after the WebSocket upgrade has completed.

WebSocketContext

用來存取 WebSocket 交握中的資訊。Used for accessing the information in the WebSocket handshake.

WebSocketException

表示對 WebSocket 連線執行作業時所發生的例外狀況。Represents an exception that occurred when performing an operation on a WebSocket connection.

WebSocketProtocol

WebSocket 類別允許應用程式在 WebSocket 升級完成之後傳送和接收資料。The WebSocket class allows applications to send and receive data after the WebSocket upgrade has completed.

WebSocketReceiveResult

這個類別的執行個體表示在 WebSocket 上執行單一 ReceiveAsync 作業的結果。An instance of this class represents the result of performing a single ReceiveAsync operation on a WebSocket.

結構

ValueWebSocketReceiveResult

表示在 WebSocket 上執行單一 ReceiveAsync(Memory<Byte>, CancellationToken) 作業的結果。Represents the result of performing a single ReceiveAsync(Memory<Byte>, CancellationToken) operation on a WebSocket.

列舉

WebSocketCloseStatus

表示 WebSocket 通訊協定規格第 11.7 節中所定義的已知 WebSocket 關閉碼。Represents well known WebSocket close codes as defined in section 11.7 of the WebSocket protocol spec.

WebSocketError

包含可能的 WebSocket 錯誤清單。Contains the list of possible WebSocket errors.

WebSocketMessageType

表示訊息類型。Indicates the message type.

WebSocketState

定義 WebSockets 執行個體可以存在的不同狀態。Defines the different states a WebSockets instance can be in.

備註

中的某些類別System.Net.WebSocketsWindows 7、 Windows Vista SP2 和 Windows Server 2008 上支援命名空間。Some of the classes in the System.Net.WebSockets namespace are supported on Windows 7, Windows Vista SP2, and Windows Server 2008. 不過,Windows 8 和 Windows Server 2012 上支援的用戶端和伺服器 WebSockets 只有 public 的實作。However, the only public implementations of client and server WebSockets are supported on Windows 8 and Windows Server 2012. 類別和類別中的項目System.Net.WebSocketsWindows 7、 Windows Vista SP2 和 Windows Server 2008 支援的命名空間是抽象類別。The classes and class elements in the System.Net.WebSockets namespace that are supported on Windows 7, Windows Vista SP2, and Windows Server 2008 are abstract classes. 這可讓應用程式開發人員,繼承與延伸的用戶端 Websocket 的實際實作這些抽象類別。This allows an application developer to inherit and extend these abstract classes with an actual implementation of client WebSockets.