2019-01-13 21:01:16 +01:00
|
|
|
using System.Threading.Tasks;
|
2022-01-01 17:59:25 +01:00
|
|
|
using Microsoft.AspNetCore.Http;
|
2018-12-28 00:27:57 +01:00
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Net
|
|
|
|
{
|
|
|
|
/// <summary>
|
2020-11-28 11:21:53 +01:00
|
|
|
/// Interface for listening to messages coming through a web socket connection.
|
2018-12-28 00:27:57 +01:00
|
|
|
/// </summary>
|
|
|
|
public interface IWebSocketListener
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Processes the message.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="message">The message.</param>
|
|
|
|
/// <returns>Task.</returns>
|
2019-02-24 03:16:19 +01:00
|
|
|
Task ProcessMessageAsync(WebSocketMessageInfo message);
|
2020-11-28 11:21:53 +01:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Processes a new web socket connection.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="connection">An instance of the <see cref="IWebSocketConnection"/> interface.</param>
|
2022-01-01 17:59:25 +01:00
|
|
|
/// <param name="httpContext">The current http context.</param>
|
2020-11-28 11:21:53 +01:00
|
|
|
/// <returns>Task.</returns>
|
2022-01-01 17:59:25 +01:00
|
|
|
Task ProcessWebSocketConnectedAsync(IWebSocketConnection connection, HttpContext httpContext);
|
2018-12-28 00:27:57 +01:00
|
|
|
}
|
|
|
|
}
|