diff --git a/.gitignore b/.gitignore
index 85ce7798..12a4e183 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,7 @@ BenchmarkDotNet.Artifacts/
.gradle/
src/SignalR/clients/**/dist/
modules/
+.idea
# File extensions
*.aps
diff --git a/samples/ClientApplication/ClientApplication.csproj b/samples/ClientApplication/ClientApplication.csproj
index 9f2037a7..b626a73d 100644
--- a/samples/ClientApplication/ClientApplication.csproj
+++ b/samples/ClientApplication/ClientApplication.csproj
@@ -2,7 +2,7 @@
Exe
- netcoreapp3.1;net6.0
+ netcoreapp3.1;net6.0;net7.0
diff --git a/samples/ServerApplication/ServerApplication.csproj b/samples/ServerApplication/ServerApplication.csproj
index 8ffeecc9..68f20e19 100644
--- a/samples/ServerApplication/ServerApplication.csproj
+++ b/samples/ServerApplication/ServerApplication.csproj
@@ -2,7 +2,7 @@
Exe
- netcoreapp3.1;net6.0
+ netcoreapp3.1;net6.0;net7.0
diff --git a/src/Bedrock.Framework/Hosting/ServerHostedService.cs b/src/Bedrock.Framework/Hosting/ServerHostedService.cs
index 99e23485..dc5edfee 100644
--- a/src/Bedrock.Framework/Hosting/ServerHostedService.cs
+++ b/src/Bedrock.Framework/Hosting/ServerHostedService.cs
@@ -1,5 +1,8 @@
-using System.Threading;
+using System;
+using System.Net;
+using System.Threading;
using System.Threading.Tasks;
+using Microsoft.AspNetCore.Connections;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
@@ -23,5 +26,15 @@ public Task StopAsync(CancellationToken cancellationToken)
{
return _server.StopAsync(cancellationToken);
}
+
+ public Task AddSocketListenerAsync(EndPoint endpoint, Action configure)
+ {
+ return _server.AddSocketListenerAsync(endpoint, configure);
+ }
+
+ public Task RemoveSocketListenerAsync(EndPoint endpoint)
+ {
+ return _server.RemoveSocketListener(endpoint);
+ }
}
}
diff --git a/src/Bedrock.Framework/Server/Server.cs b/src/Bedrock.Framework/Server/Server.cs
index 3253314f..281b6d5e 100644
--- a/src/Bedrock.Framework/Server/Server.cs
+++ b/src/Bedrock.Framework/Server/Server.cs
@@ -1,11 +1,14 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
+using System.Linq;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Connections;
+using Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets;
using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Options;
namespace Bedrock.Framework
{
@@ -13,10 +16,12 @@ public class Server
{
private readonly ServerBuilder _builder;
private readonly ILogger _logger;
- private readonly List _listeners = new List();
+ private readonly Dictionary _listeners = new Dictionary();
private readonly TaskCompletionSource