From 8190d9b31b4bbc5b328383e038da3aa90b9aeaa6 Mon Sep 17 00:00:00 2001 From: Dogukan Date: Thu, 22 Oct 2020 16:36:00 +0200 Subject: [PATCH] [ADDITION] added a wait one to the client onread --- Client/Client.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Client/Client.cs b/Client/Client.cs index 29833b2..3a6e12f 100644 --- a/Client/Client.cs +++ b/Client/Client.cs @@ -76,6 +76,7 @@ namespace Client expectedMessageLength = BitConverter.ToInt32(totalBuffer, 0); } + ar.AsyncWaitHandle.WaitOne(); stream.BeginRead(buffer, 0, buffer.Length, new AsyncCallback(OnReadComplete), null); }