public void Handle(ConnectServerCommand connectServerCommand) { _serverFront.ShowMsg($"客户端连接成功:{connectServerCommand.UserName},fromPrivate:{connectServerCommand.FromPrivate},frompublic:{connectServerCommand.FromPublic}"); var response = new GetAllUserResponseCommand { UserInfos = _connectStore.GetAllUser() }; foreach (var item in _connectStore.GetAllUser()) { Send(response, item.FromPublic); } }
public void Send(ConnectServerCommand connectServerCommand) { _socket.SendTo(connectServerCommand.Serialize(), _serverEndPoint); }