aboutsummaryrefslogtreecommitdiff
path: root/SocketHttpListener/WebSocket.cs
diff options
context:
space:
mode:
authorAndrew Rabert <6550543+nvllsvm@users.noreply.github.com>2019-01-22 18:13:47 -0500
committerGitHub <noreply@github.com>2019-01-22 18:13:47 -0500
commit28483bdb54be96ae83e0fded097f534d7e26ba1e (patch)
treee7f4b92326417ebf55eecdf68a01d2c3b9e660d7 /SocketHttpListener/WebSocket.cs
parent920c39454c05e979eabe81877269cd4517a03ccf (diff)
parent8106c8393b711a7e1d40487e3caf2b014decbe28 (diff)
Merge pull request #651 from jellyfin/release-10.1.0
Release 10.1.0
Diffstat (limited to 'SocketHttpListener/WebSocket.cs')
-rw-r--r--SocketHttpListener/WebSocket.cs24
1 files changed, 6 insertions, 18 deletions
diff --git a/SocketHttpListener/WebSocket.cs b/SocketHttpListener/WebSocket.cs
index 7d61850e6..bf400599d 100644
--- a/SocketHttpListener/WebSocket.cs
+++ b/SocketHttpListener/WebSocket.cs
@@ -3,15 +3,12 @@ using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Net;
+using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
-using MediaBrowser.Model.Cryptography;
-using MediaBrowser.Model.IO;
using SocketHttpListener.Net.WebSockets;
-using SocketHttpListener.Primitives;
using HttpStatusCode = SocketHttpListener.Net.HttpStatusCode;
-using System.Net.Sockets;
using WebSocketState = System.Net.WebSockets.WebSocketState;
namespace SocketHttpListener
@@ -81,11 +78,8 @@ namespace SocketHttpListener
init();
}
- public static TimeSpan DefaultKeepAliveInterval
- {
- // In the .NET Framework, this pulls the value from a P/Invoke. Here we just hardcode it to a reasonable default.
- get { return TimeSpan.FromSeconds(30); }
- }
+ // In the .NET Framework, this pulls the value from a P/Invoke. Here we just hardcode it to a reasonable default.
+ public static TimeSpan DefaultKeepAliveInterval => TimeSpan.FromSeconds(30);
#endregion
@@ -96,13 +90,7 @@ namespace SocketHttpListener
/// One of the <see cref="WebSocketState"/> enum values, indicates the state of the WebSocket
/// connection. The default value is <see cref="WebSocketState.Connecting"/>.
/// </value>
- public WebSocketState ReadyState
- {
- get
- {
- return _readyState;
- }
- }
+ public WebSocketState ReadyState => _readyState;
#region Public Events
@@ -740,7 +728,7 @@ namespace SocketHttpListener
{
if (data == null)
{
- throw new ArgumentNullException("data");
+ throw new ArgumentNullException(nameof(data));
}
var msg = _readyState.CheckIfOpen();
@@ -765,7 +753,7 @@ namespace SocketHttpListener
{
if (data == null)
{
- throw new ArgumentNullException("data");
+ throw new ArgumentNullException(nameof(data));
}
var msg = _readyState.CheckIfOpen();