[FIX] fixed the async for updating the label, as well as the chat messages

This commit is contained in:
Dogukan
2020-10-23 12:48:27 +02:00
parent 97be0f937c
commit 7fcf424b65

View File

@@ -59,7 +59,6 @@ namespace Server.Models
throw new OutOfMemoryException("buffer is too small!");
}
ar.AsyncWaitHandle.WaitOne();
// copy the received bytes into the buffer
Array.Copy(buffer, 0, totalBuffer, totalBufferReceived, bytesReceived);
@@ -92,6 +91,8 @@ namespace Server.Models
}
ar.AsyncWaitHandle.WaitOne();
// start reading for a new message
stream.BeginRead(buffer, 0, buffer.Length, new AsyncCallback(OnRead), null);
}