Skip to content

Commit

Permalink
Use Environment.SystemPageSize to set desireBufferSize (dotnet#40247)
Browse files Browse the repository at this point in the history
PAGE_SIZE is not all 4096 for all architecture, so we can get it by Environment.SystemPageSize

Co-authored-by: Sunguoyun <[email protected]>
  • Loading branch information
sunny868 and sunny868 authored Aug 3, 2020
1 parent d10f6f1 commit ba97db3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static void Linux_BufferSizeRoundtrips()
// On Linux, setting the buffer size of the server will also set the buffer size of the
// client, regardless of the direction of the flow

int desiredBufferSize = 4096;
int desiredBufferSize = Environment.SystemPageSize;
using (var server = new AnonymousPipeServerStream(PipeDirection.Out, HandleInheritability.None, desiredBufferSize))
{
Assert.Equal(desiredBufferSize, server.OutBufferSize);
Expand Down

0 comments on commit ba97db3

Please sign in to comment.