aboutsummaryrefslogtreecommitdiff
path: root/SocketHttpListener/Net/HttpEndPointManager.cs
diff options
context:
space:
mode:
authorAndrew Rabert <6550543+nvllsvm@users.noreply.github.com>2019-01-19 15:11:50 -0500
committerGitHub <noreply@github.com>2019-01-19 15:11:50 -0500
commit55538764fa06a64795c099fc6496df9dbb4156bd (patch)
tree8c1f94861ecebdf634b70a7265945b6f8f13aff1 /SocketHttpListener/Net/HttpEndPointManager.cs
parent3b52035ee064a5d9aa215d9515211d4508585d39 (diff)
parentc5430f86b0b5863482e7c4f7e55a79c7d88c133b (diff)
Merge pull request #575 from EraYaN/reformat
Reformat all C# server code to conform with code standards
Diffstat (limited to 'SocketHttpListener/Net/HttpEndPointManager.cs')
-rw-r--r--SocketHttpListener/Net/HttpEndPointManager.cs14
1 files changed, 4 insertions, 10 deletions
diff --git a/SocketHttpListener/Net/HttpEndPointManager.cs b/SocketHttpListener/Net/HttpEndPointManager.cs
index 01b5ae9bd..a75af5f5d 100644
--- a/SocketHttpListener/Net/HttpEndPointManager.cs
+++ b/SocketHttpListener/Net/HttpEndPointManager.cs
@@ -3,12 +3,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
-using System.Reflection;
-using System.Threading.Tasks;
-using MediaBrowser.Model.IO;
using Microsoft.Extensions.Logging;
-using MediaBrowser.Model.Net;
-using SocketHttpListener.Primitives;
namespace SocketHttpListener.Net
{
@@ -22,7 +17,7 @@ namespace SocketHttpListener.Net
public static void AddListener(ILogger logger, HttpListener listener)
{
- List<string> added = new List<string>();
+ var added = new List<string>();
try
{
lock ((s_ipEndPoints as ICollection).SyncRoot)
@@ -62,14 +57,13 @@ namespace SocketHttpListener.Net
int root = p.IndexOf('/', colon, p.Length - colon);
string portString = p.Substring(colon + 1, root - colon - 1);
- int port;
- if (!int.TryParse(portString, out port) || port <= 0 || port >= 65536)
+ if (!int.TryParse(portString, out var port) || port <= 0 || port >= 65536)
{
throw new HttpListenerException((int)HttpStatusCode.BadRequest, "net_invalid_port");
}
}
- ListenerPrefix lp = new ListenerPrefix(p);
+ var lp = new ListenerPrefix(p);
if (lp.Host != "*" && lp.Host != "+" && Uri.CheckHostName(lp.Host) == UriHostNameType.Unknown)
throw new HttpListenerException((int)HttpStatusCode.BadRequest, "net_listener_host");
@@ -184,7 +178,7 @@ namespace SocketHttpListener.Net
private static void RemovePrefixInternal(ILogger logger, string prefix, HttpListener listener)
{
- ListenerPrefix lp = new ListenerPrefix(prefix);
+ var lp = new ListenerPrefix(prefix);
if (lp.Path.IndexOf('%') != -1)
return;