Adding internal Constants class

This commit is contained in:
Louis DeJardin 2015-07-24 15:43:43 -07:00
parent f935567cfd
commit 62ec11be7e
3 changed files with 16 additions and 2 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNet.Server.Kestrel.Infrastructure;
using Microsoft.AspNet.Server.Kestrel.Networking; using Microsoft.AspNet.Server.Kestrel.Networking;
using System; using System;
using System.Diagnostics; using System.Diagnostics;
@ -53,7 +54,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
ListenSocket = new UvTcpHandle(); ListenSocket = new UvTcpHandle();
ListenSocket.Init(Thread.Loop, Thread.QueueCloseHandle); ListenSocket.Init(Thread.Loop, Thread.QueueCloseHandle);
ListenSocket.Bind(new IPEndPoint(IPAddress.Any, port)); ListenSocket.Bind(new IPEndPoint(IPAddress.Any, port));
ListenSocket.Listen(128, _connectionCallback, this); ListenSocket.Listen(Constants.ListenBacklog, _connectionCallback, this);
tcs.SetResult(0); tcs.SetResult(0);
} }
catch (Exception ex) catch (Exception ex)

View File

@ -1,6 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNet.Server.Kestrel.Infrastructure;
using Microsoft.AspNet.Server.Kestrel.Networking; using Microsoft.AspNet.Server.Kestrel.Networking;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -35,7 +36,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
ListenPipe = new UvPipeHandle(); ListenPipe = new UvPipeHandle();
ListenPipe.Init(Thread.Loop, false); ListenPipe.Init(Thread.Loop, false);
ListenPipe.Bind(pipeName); ListenPipe.Bind(pipeName);
ListenPipe.Listen(128, OnListenPipe, null); ListenPipe.Listen(Constants.ListenBacklog, OnListenPipe, null);
}, null); }, null);
} }

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.AspNet.Server.Kestrel.Infrastructure
{
internal class Constants
{
public const int ListenBacklog = 128;
}
}