This commit is contained in:
James Newton-King 2018-04-16 10:43:06 +12:00
parent 62f14054eb
commit a17320221e
No known key found for this signature in database
GPG Key ID: 0A66B2F456BF5526
1 changed files with 2 additions and 2 deletions

View File

@ -143,7 +143,7 @@ namespace Microsoft.AspNetCore.Http.Connections.Internal.Transports
while (true)
{
#if NETCOREAPP2_1
// Do a 0 byte read so that idle connections don't allocate a buffer when waiting for a read
// Do a 0 byte read so that idle connections don't allocate a buffer when waiting for a read
var result = await socket.ReceiveAsync(Memory<byte>.Empty, CancellationToken.None);
if (result.MessageType == WebSocketMessageType.Close)
@ -154,7 +154,7 @@ namespace Microsoft.AspNetCore.Http.Connections.Internal.Transports
var memory = _application.Output.GetMemory();
#if NETCOREAPP2_1
// Because we checked the CloseStatus from the 0 byte read above, we don't need to check again after reading
// Because we checked the CloseStatus from the 0 byte read above, we don't need to check again after reading
var receiveResult = await socket.ReceiveAsync(memory, CancellationToken.None);
#else
var isArray = MemoryMarshal.TryGetArray<byte>(memory, out var arraySegment);