/// <summary> /// 连线时调用 /// </summary> /// <returns></returns> public override Task OnConnected() { Console.WriteLine("客户端连接,连接ID是:{0},当前在线人数为{1}", Context.ConnectionId, OnlineUsers.Count + 1); IOHelper.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + string.Format("Client On line,ID:{0},Total On Line {1}", Context.ConnectionId, OnlineUsers.Count + 1)); return(base.OnConnected()); }