From ea559a6e274c2067cda780ba81bc5237c9e2ebf7 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 18 Jul 2014 18:14:59 -0400 Subject: create http listener abstraction --- .../HttpServer/IHttpListener.cs | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 MediaBrowser.Server.Implementations/HttpServer/IHttpListener.cs (limited to 'MediaBrowser.Server.Implementations/HttpServer/IHttpListener.cs') diff --git a/MediaBrowser.Server.Implementations/HttpServer/IHttpListener.cs b/MediaBrowser.Server.Implementations/HttpServer/IHttpListener.cs new file mode 100644 index 000000000..1d80a263c --- /dev/null +++ b/MediaBrowser.Server.Implementations/HttpServer/IHttpListener.cs @@ -0,0 +1,42 @@ +using System.Threading.Tasks; +using MediaBrowser.Common.Net; +using ServiceStack.Web; +using System; +using System.Collections.Generic; + +namespace MediaBrowser.Server.Implementations.HttpServer +{ + public interface IHttpListener : IDisposable + { + IEnumerable LocalEndPoints { get; } + + /// + /// Gets or sets the error handler. + /// + /// The error handler. + Action ErrorHandler { get; set; } + + /// + /// Gets or sets the request handler. + /// + /// The request handler. + Func RequestHandler { get; set; } + + /// + /// Gets or sets the web socket handler. + /// + /// The web socket handler. + Action WebSocketHandler { get; set; } + + /// + /// Starts this instance. + /// + /// The URL prefixes. + void Start(IEnumerable urlPrefixes); + + /// + /// Stops this instance. + /// + void Stop(); + } +} -- cgit v1.2.3