Fix nullref exception and added logging

This commit is contained in:
Bond_009
2019-12-26 20:57:46 +01:00
parent 976459d3e8
commit 5ca68f9623
6 changed files with 41 additions and 65 deletions

View File

@@ -1,3 +1,5 @@
#nullable enable
using System;
using System.Net;
using System.Net.WebSockets;
@@ -13,7 +15,7 @@ namespace MediaBrowser.Controller.Net
/// <summary>
/// Occurs when [closed].
/// </summary>
event EventHandler<EventArgs> Closed;
event EventHandler<EventArgs>? Closed;
/// <summary>
/// Gets the last activity date.
@@ -21,23 +23,17 @@ namespace MediaBrowser.Controller.Net
/// <value>The last activity date.</value>
DateTime LastActivityDate { get; }
/// <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.
@@ -49,7 +45,7 @@ namespace MediaBrowser.Controller.Net
/// Gets the remote end point.
/// </summary>
/// <value>The remote end point.</value>
IPAddress RemoteEndPoint { get; }
IPAddress? RemoteEndPoint { get; }
/// <summary>
/// Sends a message asynchronously.