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