WebSocketManager.AcceptWebSocketAsync 方法

定义

重载

AcceptWebSocketAsync()

将请求转换为 WebSocket 连接。

AcceptWebSocketAsync(WebSocketAcceptContext)
AcceptWebSocketAsync(String)

使用指定的子协议将请求转换为 WebSocket 连接。

AcceptWebSocketAsync()

Source:
WebSocketManager.cs
Source:
WebSocketManager.cs
Source:
WebSocketManager.cs

将请求转换为 WebSocket 连接。

public:
 virtual System::Threading::Tasks::Task<System::Net::WebSockets::WebSocket ^> ^ AcceptWebSocketAsync();
public virtual System.Threading.Tasks.Task<System.Net.WebSockets.WebSocket> AcceptWebSocketAsync ();
abstract member AcceptWebSocketAsync : unit -> System.Threading.Tasks.Task<System.Net.WebSockets.WebSocket>
override this.AcceptWebSocketAsync : unit -> System.Threading.Tasks.Task<System.Net.WebSockets.WebSocket>
Public Overridable Function AcceptWebSocketAsync () As Task(Of WebSocket)

返回

表示转换完成的任务。

适用于

AcceptWebSocketAsync(WebSocketAcceptContext)

Source:
WebSocketManager.cs
public virtual System.Threading.Tasks.Task<System.Net.WebSockets.WebSocket> AcceptWebSocketAsync (Microsoft.AspNetCore.Http.WebSocketAcceptContext acceptContext);
abstract member AcceptWebSocketAsync : Microsoft.AspNetCore.Http.WebSocketAcceptContext -> System.Threading.Tasks.Task<System.Net.WebSockets.WebSocket>
override this.AcceptWebSocketAsync : Microsoft.AspNetCore.Http.WebSocketAcceptContext -> System.Threading.Tasks.Task<System.Net.WebSockets.WebSocket>
Public Overridable Function AcceptWebSocketAsync (acceptContext As WebSocketAcceptContext) As Task(Of WebSocket)

参数

acceptContext
WebSocketAcceptContext

返回

适用于

AcceptWebSocketAsync(String)

Source:
WebSocketManager.cs
Source:
WebSocketManager.cs
Source:
WebSocketManager.cs

使用指定的子协议将请求转换为 WebSocket 连接。

public:
 abstract System::Threading::Tasks::Task<System::Net::WebSockets::WebSocket ^> ^ AcceptWebSocketAsync(System::String ^ subProtocol);
public abstract System.Threading.Tasks.Task<System.Net.WebSockets.WebSocket> AcceptWebSocketAsync (string subProtocol);
public abstract System.Threading.Tasks.Task<System.Net.WebSockets.WebSocket> AcceptWebSocketAsync (string? subProtocol);
abstract member AcceptWebSocketAsync : string -> System.Threading.Tasks.Task<System.Net.WebSockets.WebSocket>
Public MustOverride Function AcceptWebSocketAsync (subProtocol As String) As Task(Of WebSocket)

参数

subProtocol
String

要使用的子协议。

返回

表示转换完成的任务。

适用于