]> git.deb.at Git - rhonda/impostor.hazel.git/commitdiff
Add stub DTLS listener
authorMatthew Endsley <mendsley@gmail.com>
Thu, 17 Dec 2020 18:25:22 +0000 (10:25 -0800)
committerMatthew Endsley <mendsley@gmail.com>
Tue, 2 Feb 2021 16:53:35 +0000 (08:53 -0800)
Hazel/Dtls/DtlsConnectionListener.cs [new file with mode: 0644]
Hazel/Hazel.csproj

diff --git a/Hazel/Dtls/DtlsConnectionListener.cs b/Hazel/Dtls/DtlsConnectionListener.cs
new file mode 100644 (file)
index 0000000..dddc9ca
--- /dev/null
@@ -0,0 +1,36 @@
+using System.Net;
+using Hazel.Udp.FewerThreads;
+
+namespace Hazel.Dtls
+{
+    /// <summary>
+    /// Listens for new UDP-DTLS connections and creates UdpConnections for them.
+    /// </summary>
+    /// <inheritdoc />
+    public class DtlsConnectionListener : ThreadLimitedUdpConnectionListener
+    {
+        /// <summary>
+        /// Create a new instance of the DTLS listener
+        /// </summary>
+        /// <param name="numWorkers"></param>
+        /// <param name="endPoint"></param>
+        /// <param name="logger"></param>
+        /// <param name="ipMode"></param>
+        public DtlsConnectionListener(int numWorkers, IPEndPoint endPoint, ILogger logger, IPMode ipMode = IPMode.IPv4)
+            : base(numWorkers, endPoint, logger, ipMode)
+        {
+        }
+
+        /// <inheritdoc />
+        protected override void ProcessIncomingMessageFromOtherThread(MessageReader message, EndPoint peerAddress, ConnectionId connectionId)
+        {
+            base.ProcessIncomingMessageFromOtherThread(message, peerAddress, connectionId);
+        }
+
+        /// <inheritdoc />
+        protected override void QueueRawData(ByteSpan span, EndPoint remoteEndPoint)
+        {
+            base.QueueRawData(span, remoteEndPoint);
+        }
+    }
+}
index 9becc82e711638d2d1a106718a98cfc5a8b51951..5f1d51e80deaffe921d8a08560b9e07022969ea6 100644 (file)
@@ -79,6 +79,7 @@
     <Compile Include="DataReceivedEventArgs.cs" />
     <Compile Include="DisconnectedEventArgs.cs" />
     <Compile Include="Dtls\AesGcmRecordProtection.cs" />
+    <Compile Include="Dtls\DtlsConnectionListener.cs" />
     <Compile Include="Dtls\Handshake.cs" />
     <Compile Include="Dtls\IHandshakeCipherSuite.cs" />
     <Compile Include="Dtls\IRecordProtection.cs" />