aboutsummaryrefslogtreecommitdiff
path: root/SocketHttpListener/WebSocket.cs
diff options
context:
space:
mode:
authorLogicalPhallacy <44458166+LogicalPhallacy@users.noreply.github.com>2019-01-23 00:31:35 -0800
committerGitHub <noreply@github.com>2019-01-23 00:31:35 -0800
commit404bd04cbc17dc8c8bf4a5c9aa3ca9c5cd85aa68 (patch)
tree3d267c6ceef9439a034c113095e10e4d619e7c70 /SocketHttpListener/WebSocket.cs
parent8ff89fdc0c30f595a171ffc550f907ef22b6212a (diff)
parente05e002b8bb4d13eb2b80b56a0aad8903ddb701e (diff)
Merge pull request #8 from jellyfin/master
rebase to latest master
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();