diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-12-27 13:06:32 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-12-27 13:06:32 -0500 |
| commit | 0840bb9ba246d928161516e65a7b12e7ed08701b (patch) | |
| tree | 3f91c09a6745fa45e43572f63adb39b02cfcfdf8 /MediaBrowser.Controller/Net/IWebSocket.cs | |
| parent | 52caa0def1a0afe21674a965b85a9e773ec797a2 (diff) | |
move web socket classes to server project
Diffstat (limited to 'MediaBrowser.Controller/Net/IWebSocket.cs')
| -rw-r--r-- | MediaBrowser.Controller/Net/IWebSocket.cs | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Net/IWebSocket.cs b/MediaBrowser.Controller/Net/IWebSocket.cs new file mode 100644 index 000000000..b88f2c389 --- /dev/null +++ b/MediaBrowser.Controller/Net/IWebSocket.cs @@ -0,0 +1,54 @@ +using MediaBrowser.Model.Net; +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace MediaBrowser.Controller.Net +{ + /// <summary> + /// Interface IWebSocket + /// </summary> + public interface IWebSocket : IDisposable + { + /// <summary> + /// Occurs when [closed]. + /// </summary> + event EventHandler<EventArgs> Closed; + + /// <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<byte[]> OnReceiveBytes { get; set; } + + /// <summary> + /// Gets or sets the on receive. + /// </summary> + /// <value>The on receive.</value> + Action<string> OnReceive { get; set; } + + /// <summary> + /// Sends the async. + /// </summary> + /// <param name="bytes">The bytes.</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, bool endOfMessage, CancellationToken cancellationToken); + + /// <summary> + /// Sends the asynchronous. + /// </summary> + /// <param name="text">The text.</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(string text, bool endOfMessage, CancellationToken cancellationToken); + } +} |
