private async void Listener(object obj) { while (_clientRun) { var message = _soket.GetMessage(Name); if (message == null) { await Task.Delay(200); } } }
private static async void Listener(object obj) { var packages = new List <string>(); while (_serverRun) { var message = _soket.GetMessage(Name); if (message != null) { _soket.ReceivedMessage(Name); packages.Add(message); if (IsFinPackage(message)) { PackageBuild(packages); packages.Clear(); } } await Task.Delay(500); } }