共用方式為


ConnectionHandler.OnConnectedAsync(ConnectionContext) 方法

定義

當接受新的連線至端點時呼叫。

public:
 abstract System::Threading::Tasks::Task ^ OnConnectedAsync(Microsoft::AspNetCore::Connections::ConnectionContext ^ connection);
public abstract System.Threading.Tasks.Task OnConnectedAsync (Microsoft.AspNetCore.Connections.ConnectionContext connection);
abstract member OnConnectedAsync : Microsoft.AspNetCore.Connections.ConnectionContext -> System.Threading.Tasks.Task
Public MustOverride Function OnConnectedAsync (connection As ConnectionContext) As Task

參數

傳回

Task 表示連接存留期。 當工作完成時,連線就會完成。

適用於