aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common/Kernel/IServerManager.cs
diff options
context:
space:
mode:
authorLukePulverenti <luke.pulverenti@gmail.com>2013-02-26 11:10:55 -0500
committerLukePulverenti <luke.pulverenti@gmail.com>2013-02-26 11:10:55 -0500
commit6efd22a3d22f8d87ad17da3a1e47ca26c5bb09f2 (patch)
tree04a9058a1f3ad39d1247245427589def347d710d /MediaBrowser.Common/Kernel/IServerManager.cs
parentefdb2f3990f6a5250949b7a86bbd83def876f612 (diff)
added a shutdown api method, font size fix and other decouplings
Diffstat (limited to 'MediaBrowser.Common/Kernel/IServerManager.cs')
-rw-r--r--MediaBrowser.Common/Kernel/IServerManager.cs54
1 files changed, 54 insertions, 0 deletions
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
+ {
+ /// <summary>
+ /// Gets a value indicating whether [supports web socket].
+ /// </summary>
+ /// <value><c>true</c> if [supports web socket]; otherwise, <c>false</c>.</value>
+ bool SupportsNativeWebSocket { get; }
+
+ /// <summary>
+ /// Gets the web socket port number.
+ /// </summary>
+ /// <value>The web socket port number.</value>
+ int WebSocketPortNumber { get; }
+
+ /// <summary>
+ /// Starts this instance.
+ /// </summary>
+ void Start();
+
+ /// <summary>
+ /// Sends a message to all clients currently connected via a web socket
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <param name="messageType">Type of the message.</param>
+ /// <param name="data">The data.</param>
+ /// <returns>Task.</returns>
+ void SendWebSocketMessage<T>(string messageType, T data);
+
+ /// <summary>
+ /// Sends a message to all clients currently connected via a web socket
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <param name="messageType">Type of the message.</param>
+ /// <param name="dataFunction">The function that generates the data to send, if there are any connected clients</param>
+ void SendWebSocketMessage<T>(string messageType, Func<T> dataFunction);
+
+ /// <summary>
+ /// Sends a message to all clients currently connected via a web socket
+ /// </summary>
+ /// <typeparam name="T"></typeparam>
+ /// <param name="messageType">Type of the message.</param>
+ /// <param name="dataFunction">The function that generates the data to send, if there are any connected clients</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task.</returns>
+ /// <exception cref="System.ArgumentNullException">messageType</exception>
+ Task SendWebSocketMessageAsync<T>(string messageType, Func<T> dataFunction, CancellationToken cancellationToken);
+ }
+} \ No newline at end of file