using MediaBrowser.Model.Events;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Net
{
///
/// Interface IServerManager
///
public interface IServerManager : IDisposable
{
///
/// Starts this instance.
///
/// The URL prefixes.
/// If an https prefix is specified,
/// the ssl certificate localtion on the file system.
void Start(IEnumerable urlPrefixes, string certificatePath);
///
/// 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);
///
/// Adds the web socket listeners.
///
/// The listeners.
void AddWebSocketListeners(IEnumerable listeners);
///
/// Gets the web socket connections.
///
/// The web socket connections.
IEnumerable WebSocketConnections { get; }
///
/// Occurs when [web socket connected].
///
event EventHandler> WebSocketConnected;
}
}