jellyfin/MediaBrowser.Common/Net/IWebSocket.cs

36 lines
1.1 KiB
C#
Raw Normal View History

2013-02-20 18:33:05 -07:00
using System;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.Net;
2013-02-20 18:33:05 -07:00
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>
2013-02-24 14:53:54 -07:00
Action<byte[]> OnReceiveDelegate { get; set; }
2013-02-20 18:33:05 -07:00
/// <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);
}
}