AspNetWebSocket 類別

定義

表示 web 伺服器和用戶端之間在 ASP.NET 應用程式中的即時全雙工連線。Represents a real-time full-duplex connection between a web server and a client in an ASP.NET application.

public ref class AspNetWebSocket sealed : System::Net::WebSockets::WebSocket
public sealed class AspNetWebSocket : System.Net.WebSockets.WebSocket
type AspNetWebSocket = class
    inherit WebSocket
Public NotInheritable Class AspNetWebSocket
Inherits WebSocket
繼承
AspNetWebSocket

屬性

CloseStatus

取得狀態碼,指出為什麼 AspNetWebSocket 物件已關閉。Gets a status code that indicates why an AspNetWebSocket object was closed.

CloseStatusDescription

取得狀態訊息,說明為什麼 AspNetWebSocket 物件已關閉。Gets a status message that explains why an AspNetWebSocket object was closed.

State

取得值,指出 AspNetWebSocket 物件的開啟或關閉狀態。Gets a value that indicates the open or closed state of an AspNetWebSocket object.

SubProtocol

取得遠端用戶端和伺服器可用來在 AspNetWebSocket 連線上交換資料的應用程式特定通訊協定名稱。Gets the name of an application-specific protocol that a remote client and a server can use to exchange data over an AspNetWebSocket connection.

方法

Abort()

取消 AspNetWebSocket 物件上的任何暫止 I/O 作業,並設定物件的狀態使其無法用來啟動其他 I/O 作業。Cancels any pending I/O operations on the AspNetWebSocket object and sets the state of the object so that it cannot be used to start additional I/O operations.

CloseAsync(WebSocketCloseStatus, String, CancellationToken)

將非同步訊息傳送至用戶端以關閉連線。Sends an asynchronous message to a client to close the connection. 如果伺服器啟始關閉連線的要求,此方法會等候用戶端認可要求,然後才會返回。If the server initiates the request to close the connection, the method waits for the client to acknowledge the request before it returns.

CloseOutputAsync(WebSocketCloseStatus, String, CancellationToken)

將非同步訊息傳送至用戶端以關閉連線。Sends an asynchronous message to a client to close the connection. 如果伺服器啟始關閉連線的要求,這個方法會返回而不等待回應。If the server initiates the request to close the connection, the method returns without waiting for a response.

Dispose()

釋放由 AspNetWebSocket 物件使用的所有資源。Releases all resources used by an AspNetWebSocket object.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ReceiveAsync(ArraySegment<Byte>, CancellationToken)

從遠端用戶端收到單一郵件片段。Receives a single message fragment from a remote client.

ReceiveAsync(Memory<Byte>, CancellationToken)

以非同步方式從 WebSocket 連接接收資料。Receives data from the WebSocket connection asynchronously.

(繼承來源 WebSocket)
SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken)

傳送單一郵件片段到遠端用戶端。Sends a single message fragment to a remote client.

SendAsync(ReadOnlyMemory<Byte>, WebSocketMessageType, Boolean, CancellationToken)

以非同步的方式透過 WebSocket 連線傳送資料。Sends data over the WebSocket connection asynchronously.

(繼承來源 WebSocket)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於