chunk websocket frame when buff > 15M (#981)
* ws is now chunked * remove chunk in example * fix build
This commit is contained in:
@@ -73,17 +73,7 @@ namespace cp
|
||||
|
||||
memoryStream.Position = 0;
|
||||
|
||||
const int bufferSize = 31 * 1024 * 1024; // must be lower than 32 * 1024 * 1024
|
||||
byte[] localBuffer = new byte[bufferSize];
|
||||
while (true)
|
||||
{
|
||||
int numRead = await memoryStream.ReadAsync(localBuffer, 0, localBuffer.Length);
|
||||
if (numRead <= 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
await stdIn.WriteAsync(localBuffer, 0, numRead);
|
||||
}
|
||||
await memoryStream.CopyToAsync(stdIn);
|
||||
await stdIn.FlushAsync();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user