Use non-pinnable buffer for zero byte read (#3094)

This commit is contained in:
Ben Adams 2018-11-14 20:05:26 +00:00 committed by Stephen Halter
parent e69285a36d
commit 0029b8f053
1 changed files with 4 additions and 0 deletions

View File

@ -15,7 +15,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal
public SocketAwaitableEventArgs WaitForDataAsync()
{
#if NETCOREAPP2_1
_awaitableEventArgs.SetBuffer(Memory<byte>.Empty);
#else
_awaitableEventArgs.SetBuffer(Array.Empty<byte>(), 0, 0);
#endif
if (!_socket.ReceiveAsync(_awaitableEventArgs))
{