共用方式為


HubConnectionHandler<THub>.OnConnectedAsync(ConnectionContext) 方法

定義

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

public:
 override System::Threading::Tasks::Task ^ OnConnectedAsync(Microsoft::AspNetCore::Connections::ConnectionContext ^ connection);
public override System.Threading.Tasks.Task OnConnectedAsync (Microsoft.AspNetCore.Connections.ConnectionContext connection);
override this.OnConnectedAsync : Microsoft.AspNetCore.Connections.ConnectionContext -> System.Threading.Tasks.Task
Public Overrides Function OnConnectedAsync (connection As ConnectionContext) As Task

參數

傳回

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

適用於