Skip to content

Commit

Permalink
Merge branch 'UshakovMV_NewFixes' into origin/master
Browse files Browse the repository at this point in the history
  • Loading branch information
EvilLord666 committed Apr 5, 2017
2 parents 3a7d261 + 5df964b commit 4438af4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public void TestServerExchangeWithSeveralClients(Int32 numberOfClients, Int32 da
}
foreach (Task clientTask in clientTasks)
clientTask.Start();
Task.WaitAll(clientTasks.ToArray(), 120000);
Task.WaitAll(clientTasks.ToArray(), 180000);
foreach (Task clientTask in clientTasks)
clientTask.Dispose();
_server.Stop(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ private Boolean ReadAsync(Byte[] data, out Int32 bytesRead)
Int32 size = _clientSocket.Available;
_clientSocket.BeginReceive(data, offset, size, SocketFlags.Partial, ReadAsyncCallback, _clientSocket);
_readCompleted.Wait(_readTimeout);
if (_bytesRead == data.Length)
if (_bytesRead == data.Length || (_bytesRead > 0 && data.Length < 3 * _clientSocket.ReceiveBufferSize / 4))
break;
if (attempt > 0 && _bytesRead > offset)
attempt--;
Expand Down

0 comments on commit 4438af4

Please sign in to comment.