IHttpWebSocketFeature.AcceptAsync(WebSocketAcceptContext) 方法

定义

尝试将请求升级到 WebSocket。 在调用此项之前,请先检查 IsWebSocketRequest

public:
 System::Threading::Tasks::Task<System::Net::WebSockets::WebSocket ^> ^ AcceptAsync(Microsoft::AspNetCore::Http::WebSocketAcceptContext ^ context);
public System.Threading.Tasks.Task<System.Net.WebSockets.WebSocket> AcceptAsync (Microsoft.AspNetCore.Http.WebSocketAcceptContext context);
abstract member AcceptAsync : Microsoft.AspNetCore.Http.WebSocketAcceptContext -> System.Threading.Tasks.Task<System.Net.WebSockets.WebSocket>
Public Function AcceptAsync (context As WebSocketAcceptContext) As Task(Of WebSocket)

参数

返回

一个 WebSocket

适用于