Remove unnecessary listener interfaces

This commit is contained in:
Stephen Halter 2015-08-20 11:56:20 -07:00
parent a9b8cfa582
commit a919ea8d0a
7 changed files with 6 additions and 70 deletions

View File

@ -1,21 +0,0 @@
// 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.
using System;
using System.Threading.Tasks;
namespace Microsoft.AspNet.Server.Kestrel.Http
{
/// <summary>
/// A listener waits for incoming connections on a specified socket.
/// </summary>
public interface IListener : IDisposable
{
Task StartAsync(
string scheme,
string host,
int port,
KestrelThread thread,
Func<Frame, Task> application);
}
}

View File

@ -1,23 +0,0 @@
// 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.
using System;
using System.Threading.Tasks;
namespace Microsoft.AspNet.Server.Kestrel.Http
{
/// <summary>
/// A primary listener waits for incoming connections on a specified socket. Incoming
/// connections may be passed to a secondary listener to handle.
/// </summary>
public interface IListenerPrimary : IListener
{
Task StartAsync(
string pipeName,
string scheme,
string host,
int port,
KestrelThread thread,
Func<Frame, Task> application);
}
}

View File

@ -1,20 +0,0 @@
// 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.
using System;
using System.Threading.Tasks;
namespace Microsoft.AspNet.Server.Kestrel.Http
{
/// <summary>
/// A secondary listener is delegated requests from a primary listener via a named pipe or
/// UNIX domain socket.
/// </summary>
public interface IListenerSecondary : IDisposable
{
Task StartAsync(
string pipeName,
KestrelThread thread,
Func<Frame, Task> application);
}
}

View File

@ -11,7 +11,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
/// <summary>
/// Base class for listeners in Kestrel. Listens for incoming connections
/// </summary>
public abstract class Listener : ListenerContext, IListener
public abstract class Listener : ListenerContext, IDisposable
{
protected UvStreamHandle ListenSocket { get; private set; }

View File

@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
/// A primary listener waits for incoming connections on a specified socket. Incoming
/// connections may be passed to a secondary listener to handle.
/// </summary>
abstract public class ListenerPrimary : Listener, IListenerPrimary
abstract public class ListenerPrimary : Listener
{
UvPipeHandle ListenPipe { get; set; }

View File

@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
/// A secondary listener is delegated requests from a primary listener via a named pipe or
/// UNIX domain socket.
/// </summary>
public abstract class ListenerSecondary : ListenerContext, IListenerSecondary
public abstract class ListenerSecondary : ListenerContext, IDisposable
{
UvPipeHandle DispatchPipe { get; set; }

View File

@ -117,7 +117,7 @@ namespace Microsoft.AspNet.Server.Kestrel
if (single)
{
var listener = usingPipes ?
(IListener) new PipeListener(Memory) :
(Listener) new PipeListener(Memory) :
new TcpListener(Memory);
listeners.Add(listener);
listener.StartAsync(scheme, host, port, thread, application).Wait();
@ -125,7 +125,7 @@ namespace Microsoft.AspNet.Server.Kestrel
else if (first)
{
var listener = usingPipes
? (IListenerPrimary) new PipeListenerPrimary(Memory)
? (ListenerPrimary) new PipeListenerPrimary(Memory)
: new TcpListenerPrimary(Memory);
listeners.Add(listener);
@ -134,7 +134,7 @@ namespace Microsoft.AspNet.Server.Kestrel
else
{
var listener = usingPipes
? (IListenerSecondary) new PipeListenerSecondary(Memory)
? (ListenerSecondary) new PipeListenerSecondary(Memory)
: new TcpListenerSecondary(Memory);
listeners.Add(listener);
listener.StartAsync(pipeName, thread, application).Wait();