From 48facb797ed912e4ea6b04b17d1ff190ac2daac4 Mon Sep 17 00:00:00 2001 From: stefan Date: Wed, 12 Sep 2018 19:26:21 +0200 Subject: Update to 3.5.2 and .net core 2.1 --- Emby.Server.Implementations/Net/IWebSocket.cs | 53 +++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Emby.Server.Implementations/Net/IWebSocket.cs (limited to 'Emby.Server.Implementations/Net/IWebSocket.cs') diff --git a/Emby.Server.Implementations/Net/IWebSocket.cs b/Emby.Server.Implementations/Net/IWebSocket.cs new file mode 100644 index 000000000..f79199a07 --- /dev/null +++ b/Emby.Server.Implementations/Net/IWebSocket.cs @@ -0,0 +1,53 @@ +using System; +using System.Threading; +using System.Threading.Tasks; +using System.Net.WebSockets; + +namespace Emby.Server.Implementations.Net +{ + /// + /// Interface IWebSocket + /// + public interface IWebSocket : IDisposable + { + /// + /// Occurs when [closed]. + /// + event EventHandler Closed; + + /// + /// Gets or sets the state. + /// + /// The state. + WebSocketState State { get; } + + /// + /// Gets or sets the receive action. + /// + /// The receive action. + Action OnReceiveBytes { get; set; } + + /// + /// Sends the async. + /// + /// The bytes. + /// if set to true [end of message]. + /// The cancellation token. + /// Task. + Task SendAsync(byte[] bytes, bool endOfMessage, CancellationToken cancellationToken); + + /// + /// Sends the asynchronous. + /// + /// The text. + /// if set to true [end of message]. + /// The cancellation token. + /// Task. + Task SendAsync(string text, bool endOfMessage, CancellationToken cancellationToken); + } + + public interface IMemoryWebSocket + { + Action, int> OnReceiveMemoryBytes { get; set; } + } +} -- cgit v1.2.3