From 1d7c9c380772e4089310cf3e1ac5dddf61c10e31 Mon Sep 17 00:00:00 2001 From: feyris-tan <4116042+feyris-tan@users.noreply.github.com> Date: Mon, 18 Aug 2025 23:11:40 +0200 Subject: [PATCH] Removed two unnecessary threads in the RtspSetupResponse. --- .../SatIp/RtspResponses/RtspSetupResponse.cs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/skyscraper8/SatIp/RtspResponses/RtspSetupResponse.cs b/skyscraper8/SatIp/RtspResponses/RtspSetupResponse.cs index 95f5ff2..ebe5553 100644 --- a/skyscraper8/SatIp/RtspResponses/RtspSetupResponse.cs +++ b/skyscraper8/SatIp/RtspResponses/RtspSetupResponse.cs @@ -55,15 +55,7 @@ namespace skyscraper8.SatIp.RtspResponses rtpCancellation = new CancellationTokenSource(); rtcpCancellation = new CancellationTokenSource(); - rtpThread = new Thread(RtpThread); - rtcpThread = new Thread(RtcpThread); - rtpThread.Start(); - rtcpThread.Start(); - listenersStarted = true; - } - private void RtpThread() - { Task.Run(async () => { byte[] buffer = new byte[2048]; @@ -78,10 +70,7 @@ namespace skyscraper8.SatIp.RtspResponses exitedThread++; } ); - } - private void RtcpThread() - { Task.Run(async () => { byte[] buffer = new byte[2048]; @@ -96,7 +85,10 @@ namespace skyscraper8.SatIp.RtspResponses exitedThread++; } ); + + listenersStarted = true; } + internal void InvokeCancellationTokens() {