using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Common.Net
{
///
/// Interface IServerManager
///
public interface IServerManager : IDisposable
{
///
/// Gets the web socket port number.
///
/// The web socket port number.
int WebSocketPortNumber { get; }
///
/// Starts this instance.
///
/// The URL prefixes.
void Start(IEnumerable urlPrefixes);
///
/// 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; }
}
}