Remove unnecessary listener interfaces
This commit is contained in:
parent
a9b8cfa582
commit
a919ea8d0a
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -11,7 +11,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Base class for listeners in Kestrel. Listens for incoming connections
|
/// Base class for listeners in Kestrel. Listens for incoming connections
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class Listener : ListenerContext, IListener
|
public abstract class Listener : ListenerContext, IDisposable
|
||||||
{
|
{
|
||||||
protected UvStreamHandle ListenSocket { get; private set; }
|
protected UvStreamHandle ListenSocket { get; private set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http
|
||||||
/// A primary listener waits for incoming connections on a specified socket. Incoming
|
/// A primary listener waits for incoming connections on a specified socket. Incoming
|
||||||
/// connections may be passed to a secondary listener to handle.
|
/// connections may be passed to a secondary listener to handle.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
abstract public class ListenerPrimary : Listener, IListenerPrimary
|
abstract public class ListenerPrimary : Listener
|
||||||
{
|
{
|
||||||
UvPipeHandle ListenPipe { get; set; }
|
UvPipeHandle ListenPipe { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
/// A secondary listener is delegated requests from a primary listener via a named pipe or
|
||||||
/// UNIX domain socket.
|
/// UNIX domain socket.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class ListenerSecondary : ListenerContext, IListenerSecondary
|
public abstract class ListenerSecondary : ListenerContext, IDisposable
|
||||||
{
|
{
|
||||||
UvPipeHandle DispatchPipe { get; set; }
|
UvPipeHandle DispatchPipe { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ namespace Microsoft.AspNet.Server.Kestrel
|
||||||
if (single)
|
if (single)
|
||||||
{
|
{
|
||||||
var listener = usingPipes ?
|
var listener = usingPipes ?
|
||||||
(IListener) new PipeListener(Memory) :
|
(Listener) new PipeListener(Memory) :
|
||||||
new TcpListener(Memory);
|
new TcpListener(Memory);
|
||||||
listeners.Add(listener);
|
listeners.Add(listener);
|
||||||
listener.StartAsync(scheme, host, port, thread, application).Wait();
|
listener.StartAsync(scheme, host, port, thread, application).Wait();
|
||||||
|
|
@ -125,7 +125,7 @@ namespace Microsoft.AspNet.Server.Kestrel
|
||||||
else if (first)
|
else if (first)
|
||||||
{
|
{
|
||||||
var listener = usingPipes
|
var listener = usingPipes
|
||||||
? (IListenerPrimary) new PipeListenerPrimary(Memory)
|
? (ListenerPrimary) new PipeListenerPrimary(Memory)
|
||||||
: new TcpListenerPrimary(Memory);
|
: new TcpListenerPrimary(Memory);
|
||||||
|
|
||||||
listeners.Add(listener);
|
listeners.Add(listener);
|
||||||
|
|
@ -134,7 +134,7 @@ namespace Microsoft.AspNet.Server.Kestrel
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var listener = usingPipes
|
var listener = usingPipes
|
||||||
? (IListenerSecondary) new PipeListenerSecondary(Memory)
|
? (ListenerSecondary) new PipeListenerSecondary(Memory)
|
||||||
: new TcpListenerSecondary(Memory);
|
: new TcpListenerSecondary(Memory);
|
||||||
listeners.Add(listener);
|
listeners.Add(listener);
|
||||||
listener.StartAsync(pipeName, thread, application).Wait();
|
listener.StartAsync(pipeName, thread, application).Wait();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue