move styles to sharedproject and disposed client

This commit is contained in:
shinichi
2020-10-14 16:28:37 +02:00
parent bbb0220c11
commit dc2b2f06ae
9 changed files with 48 additions and 10 deletions

View File

@@ -34,14 +34,16 @@ namespace Server
private void OnRead(IAsyncResult ar)
{
if (ar == null || (!ar.IsCompleted))
return;
int receivedBytes = this.stream.EndRead(ar);
if (totalBufferReceived + receivedBytes > 1024)
if (totalBufferReceived + receivedBytes > 1024)
{
throw new OutOfMemoryException("buffer too small");
}
if (totalBufferReceived + receivedBytes > 1024)
{
throw new OutOfMemoryException("buffer too small");
}
Array.Copy(buffer, 0, totalBuffer, totalBufferReceived, receivedBytes);
totalBufferReceived += receivedBytes;
@@ -209,7 +211,7 @@ namespace Server
}
}