mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-23 01:05:19 +03:00
Rewrite WebSocket handling code
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Net.WebSockets;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Model.Net;
|
||||
using MediaBrowser.Model.Services;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace MediaBrowser.Controller.Net
|
||||
@@ -15,12 +15,6 @@ namespace MediaBrowser.Controller.Net
|
||||
/// </summary>
|
||||
event EventHandler<EventArgs> Closed;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the id.
|
||||
/// </summary>
|
||||
/// <value>The id.</value>
|
||||
Guid Id { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the last activity date.
|
||||
/// </summary>
|
||||
@@ -32,6 +26,7 @@ namespace MediaBrowser.Controller.Net
|
||||
/// </summary>
|
||||
/// <value>The URL.</value>
|
||||
string Url { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the query string.
|
||||
/// </summary>
|
||||
@@ -54,7 +49,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.
|
||||
@@ -66,21 +61,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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user