Merge remote-tracking branch 'upstream/master' into syncplay

This commit is contained in:
gion
2020-05-15 18:59:35 +02:00
352 changed files with 11661 additions and 4262 deletions

View File

@@ -1,4 +1,7 @@
#nullable enable
using System;
using System.Net;
using System.Net.WebSockets;
using System.Threading;
using System.Threading.Tasks;
@@ -7,18 +10,12 @@ using Microsoft.AspNetCore.Http;
namespace MediaBrowser.Controller.Net
{
public interface IWebSocketConnection : IDisposable
public interface IWebSocketConnection
{
/// <summary>
/// Occurs when [closed].
/// </summary>
event EventHandler<EventArgs> Closed;
/// <summary>
/// Gets the id.
/// </summary>
/// <value>The id.</value>
Guid Id { get; }
event EventHandler<EventArgs>? Closed;
/// <summary>
/// Gets the last activity date.
@@ -32,22 +29,17 @@ namespace MediaBrowser.Controller.Net
/// <value>The date of last Keeplive received.</value>
DateTime LastKeepAliveDate { get; set; }
/// <summary>
/// Gets or sets the URL.
/// </summary>
/// <value>The URL.</value>
string Url { get; set; }
/// <summary>
/// Gets or sets the query string.
/// </summary>
/// <value>The query string.</value>
IQueryCollection QueryString { get; set; }
IQueryCollection QueryString { get; }
/// <summary>
/// Gets or sets the receive action.
/// </summary>
/// <value>The receive action.</value>
Func<WebSocketMessageInfo, Task> OnReceive { get; set; }
Func<WebSocketMessageInfo, Task>? OnReceive { get; set; }
/// <summary>
/// Gets the state.
@@ -59,7 +51,7 @@ namespace MediaBrowser.Controller.Net
/// Gets the remote end point.
/// </summary>
/// <value>The remote end point.</value>
string RemoteEndPoint { get; }
IPAddress? RemoteEndPoint { get; }
/// <summary>
/// Sends a message asynchronously.
@@ -71,21 +63,6 @@ namespace MediaBrowser.Controller.Net
/// <exception cref="ArgumentNullException">message</exception>
Task SendAsync<T>(WebSocketMessage<T> message, CancellationToken cancellationToken);
/// <summary>
/// Sends a message asynchronously.
/// </summary>
/// <param name="buffer">The buffer.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task SendAsync(byte[] buffer, CancellationToken cancellationToken);
/// <summary>
/// Sends a message asynchronously.
/// </summary>
/// <param name="text">The text.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
/// <exception cref="ArgumentNullException">buffer</exception>
Task SendAsync(string text, CancellationToken cancellationToken);
Task ProcessAsync(CancellationToken cancellationToken = default);
}
}