From 6efd22a3d22f8d87ad17da3a1e47ca26c5bb09f2 Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Tue, 26 Feb 2013 11:10:55 -0500 Subject: added a shutdown api method, font size fix and other decouplings --- MediaBrowser.Common/Kernel/IServerManager.cs | 54 ++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 MediaBrowser.Common/Kernel/IServerManager.cs (limited to 'MediaBrowser.Common/Kernel/IServerManager.cs') diff --git a/MediaBrowser.Common/Kernel/IServerManager.cs b/MediaBrowser.Common/Kernel/IServerManager.cs new file mode 100644 index 000000000..cfea6eee1 --- /dev/null +++ b/MediaBrowser.Common/Kernel/IServerManager.cs @@ -0,0 +1,54 @@ +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace MediaBrowser.Common.Kernel +{ + public interface IServerManager : IDisposable + { + /// + /// Gets a value indicating whether [supports web socket]. + /// + /// true if [supports web socket]; otherwise, false. + bool SupportsNativeWebSocket { get; } + + /// + /// Gets the web socket port number. + /// + /// The web socket port number. + int WebSocketPortNumber { get; } + + /// + /// Starts this instance. + /// + void Start(); + + /// + /// Sends a message to all clients currently connected via a web socket + /// + /// + /// Type of the message. + /// The data. + /// Task. + void SendWebSocketMessage(string messageType, T data); + + /// + /// Sends a message to all clients currently connected via a web socket + /// + /// + /// Type of the message. + /// The function that generates the data to send, if there are any connected clients + void SendWebSocketMessage(string messageType, Func dataFunction); + + /// + /// Sends a message to all clients currently connected via a web socket + /// + /// + /// Type of the message. + /// The function that generates the data to send, if there are any connected clients + /// The cancellation token. + /// Task. + /// messageType + Task SendWebSocketMessageAsync(string messageType, Func dataFunction, CancellationToken cancellationToken); + } +} \ No newline at end of file -- cgit v1.2.3