Skip to content
This repository was archived by the owner on Mar 19, 2019. It is now read-only.

React to HttpContextFactory constructor change #184

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,20 @@
using System;
using Microsoft.AspNetCore.Hosting.Server;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Http.Internal;
using Microsoft.AspNetCore.Server.Features;
using Microsoft.Net.Http.Server;

namespace Microsoft.AspNetCore.Server.WebListener
{
internal static class Utilities
{
// When tests projects are run in parallel, overlapping port ranges can cause a race condition when looking for free
// ports during dynamic port allocation. To avoid this, make sure the port range here is different from the range in
// When tests projects are run in parallel, overlapping port ranges can cause a race condition when looking for free
// ports during dynamic port allocation. To avoid this, make sure the port range here is different from the range in
// Microsoft.Net.Http.Server.
private const int BasePort = 5001;
private const int MaxPort = 8000;
private static int NextPort = BasePort;
private static object PortLock = new object();
private static IHttpContextFactory Factory = new HttpContextFactory(new HttpContextAccessor());

internal static IServer CreateHttpServer(out string baseAddress, RequestDelegate app)
{
Expand Down