public bool RemoveHandler(String handler) { TcpClientChannel RemoveClient = TcpClientChannel.getInstance(); RemoveClient.SendCommand(new CommandMessage(4, handler)); while (!this.handlerDeleted) { Thread.Sleep(1000); } ServiceConfig.Handlers.Remove(handler); RemoveClient.Stop(); return(true); }
public LogModel() { isRunning = false; //connecting for the first time to the server and send "log command" command. this.client = TcpClientChannel.getInstance(); this.LogMes = new ObservableCollection <MsgRecievedEventArgs>(); Object locker = new Object(); BindingOperations.EnableCollectionSynchronization(LogMes, locker); //If the client is connected to the server, continue with asking the log. if (this.client.IsConnected) { isRunning = true; client.UpdateModel += ViewLogUpdate; client.SendCommand(new CommandMessage(3, null)); } }