Develop #10
@@ -87,7 +87,7 @@ namespace ClientApp.Utils
|
||||
/// <param name="ar">the result of the async read</param>
|
||||
private void OnRead(IAsyncResult ar)
|
||||
{
|
||||
if (ar == null || (!ar.IsCompleted))
|
||||
if (ar == null || (!ar.IsCompleted) || (!this.stream.CanRead))
|
||||
return;
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Server
|
||||
|
||||
private void OnRead(IAsyncResult ar)
|
||||
{
|
||||
if (ar == null || (!ar.IsCompleted))
|
||||
if (ar == null || (!ar.IsCompleted) || (!this.stream.CanRead))
|
||||
return;
|
||||
|
||||
int receivedBytes = this.stream.EndRead(ar);
|
||||
|
||||
Reference in New Issue
Block a user