aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common/Net/IWebSocket.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Common/Net/IWebSocket.cs')
-rw-r--r--MediaBrowser.Common/Net/IWebSocket.cs35
1 files changed, 35 insertions, 0 deletions
diff --git a/MediaBrowser.Common/Net/IWebSocket.cs b/MediaBrowser.Common/Net/IWebSocket.cs
new file mode 100644
index 000000000..96299e3b2
--- /dev/null
+++ b/MediaBrowser.Common/Net/IWebSocket.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Net.WebSockets;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace MediaBrowser.Common.Net
+{
+ /// <summary>
+ /// Interface IWebSocket
+ /// </summary>
+ public interface IWebSocket : IDisposable
+ {
+ /// <summary>
+ /// Gets or sets the state.
+ /// </summary>
+ /// <value>The state.</value>
+ WebSocketState State { get; }
+
+ /// <summary>
+ /// Gets or sets the receive action.
+ /// </summary>
+ /// <value>The receive action.</value>
+ Action<WebSocketMessageInfo> OnReceiveDelegate { get; set; }
+
+ /// <summary>
+ /// Sends the async.
+ /// </summary>
+ /// <param name="bytes">The bytes.</param>
+ /// <param name="type">The type.</param>
+ /// <param name="endOfMessage">if set to <c>true</c> [end of message].</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task.</returns>
+ Task SendAsync(byte[] bytes, WebSocketMessageType type, bool endOfMessage, CancellationToken cancellationToken);
+ }
+}