using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Common.Net
{
///
/// Interface IServerManager
///
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.
///
/// The URL prefix.
/// if set to true [enable HTTP logging].
void Start(string urlPrefix, bool enableHttpLogging);
///
/// Starts the web socket server.
///
void StartWebSocketServer();
///
/// 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);
///
/// Sends the web socket message async.
///
///
/// Type of the message.
/// The data function.
/// The connections.
/// The cancellation token.
/// Task.
Task SendWebSocketMessageAsync(string messageType, Func dataFunction, IEnumerable connections, CancellationToken cancellationToken);
///
/// Adds the web socket listeners.
///
/// The listeners.
void AddWebSocketListeners(IEnumerable listeners);
///
/// Gets the web socket connections.
///
/// The web socket connections.
IEnumerable WebSocketConnections { get; }
}
}