public void Connect() { // Set the server Task taskSever = new Task(() => { InfoServer.SetServer(); InfoServer.Start(); }); Task taskClient = new Task(() => { CommandsChannel.AssignSocket(); }); Task connectionFlow = new Task(() => { taskSever.Start(); taskSever.Wait(); Console.WriteLine("Finished waiting as server"); taskClient.Start(); taskClient.Wait(); }); connectionFlow.Start(); }
public async void Send() { this._instructionsList = turnStringintoList(this._instructionsString); foreach (string i in this._instructionsList) { CommandsChannel.SendCommands(i); await Task.Delay(2000); Console.WriteLine(i); } IsTyping = "White"; }
private void SendMessage(string message) { CommandsChannel.SendCommands(message); }