private void Open(IWebSocketConnection socket) { var v = socket.GetPaarmiter(username); //如果未取到用户名,则断开连接 if (string.IsNullOrWhiteSpace(v)) { socket.Close(); return; } if (!userlist.ContainsKey(v)) { userlist.Add(v, socket); CreateMsg.Run(updatelist()); } else { var n = CreateMsg.CreateMsgRequest("在其他地方登入"); n.RecUserlist.Add(v); CreateMsg.Run(n); userlist[v].Close(); userlist.Add(v, socket); CreateMsg.Run(updatelist()); } }
private void OnClose(IWebSocketConnection socket) { var un = socket.GetPaarmiter(username); userlist.Remove(un); CreateMsg.Run(updatelist()); }
private void OnClose(IWebSocketConnection socket) { var un = socket.GetPaarmiter(username); try { userlist.Remove(un); driverService.driverinfo.Remove(un); } catch { } //CreateMsg.Run(updatelist()); }