aboutsummaryrefslogtreecommitdiff
path: root/SocketHttpListener/Net/HttpListenerPrefixCollection.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2019-02-09 15:39:17 +0100
committerBond_009 <bond.009@outlook.com>2019-02-09 15:39:17 +0100
commit449074e73f6f94fa5fb98f1f9250c937806851c0 (patch)
tree35e13ad1ef884bb2b2e9d1bd401f3cbd95d387ce /SocketHttpListener/Net/HttpListenerPrefixCollection.cs
parent2fc97212a7c7152f22dd4e18d9769c76fe255170 (diff)
Make more things async
Diffstat (limited to 'SocketHttpListener/Net/HttpListenerPrefixCollection.cs')
-rw-r--r--SocketHttpListener/Net/HttpListenerPrefixCollection.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/SocketHttpListener/Net/HttpListenerPrefixCollection.cs b/SocketHttpListener/Net/HttpListenerPrefixCollection.cs
index 97dc6797c..130c5c142 100644
--- a/SocketHttpListener/Net/HttpListenerPrefixCollection.cs
+++ b/SocketHttpListener/Net/HttpListenerPrefixCollection.cs
@@ -36,6 +36,25 @@ namespace SocketHttpListener.Net
HttpEndPointManager.AddPrefix(_logger, uriPrefix, listener);
}
+ public void AddRange(IEnumerable<string> uriPrefixes)
+ {
+ listener.CheckDisposed();
+ //ListenerPrefix.CheckUri(uriPrefix);
+ foreach (var uriPrefix in uriPrefixes)
+ {
+ if (prefixes.Contains(uriPrefix))
+ {
+ continue;
+ }
+
+ prefixes.Add(uriPrefix);
+ if (listener.IsListening)
+ {
+ HttpEndPointManager.AddPrefix(_logger, uriPrefix, listener);
+ }
+ }
+ }
+
public void Clear()
{
listener.CheckDisposed();