Removed two unnecessary threads in the RtspSetupResponse.

This commit is contained in:
feyris-tan 2025-08-18 23:11:40 +02:00
parent f8521c0b62
commit 1d7c9c3807

View File

@ -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()
{