AspNetWebSocket AspNetWebSocket AspNetWebSocket AspNetWebSocket Class

定義

表示 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
繼承
AspNetWebSocketAspNetWebSocketAspNetWebSocketAspNetWebSocket

屬性

CloseStatus CloseStatus CloseStatus CloseStatus

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

CloseStatusDescription CloseStatusDescription CloseStatusDescription CloseStatusDescription

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

State State State State

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

SubProtocol SubProtocol SubProtocol 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() Abort() Abort() 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) CloseAsync(WebSocketCloseStatus, String, CancellationToken) CloseAsync(WebSocketCloseStatus, String, CancellationToken) 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) CloseOutputAsync(WebSocketCloseStatus, String, CancellationToken) CloseOutputAsync(WebSocketCloseStatus, String, CancellationToken) 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() Dispose() Dispose() Dispose()

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

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
ReceiveAsync(ArraySegment<Byte>, CancellationToken) ReceiveAsync(ArraySegment<Byte>, CancellationToken) ReceiveAsync(ArraySegment<Byte>, CancellationToken) ReceiveAsync(ArraySegment<Byte>, CancellationToken)

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

ReceiveAsync(Memory<Byte>, CancellationToken) ReceiveAsync(Memory<Byte>, CancellationToken) ReceiveAsync(Memory<Byte>, CancellationToken) ReceiveAsync(Memory<Byte>, CancellationToken) Inherited from WebSocket
SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken)

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

SendAsync(ReadOnlyMemory<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ReadOnlyMemory<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ReadOnlyMemory<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ReadOnlyMemory<Byte>, WebSocketMessageType, Boolean, CancellationToken) Inherited from WebSocket
ToString() ToString() ToString() ToString()

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

(Inherited from Object)

適用於