Skip to content

Generate a random SRT socket ID for each connection - #2206

Open
michelsbautzen wants to merge 1 commit into
pedroSG94:masterfrom
michelsbautzen:fix-srt-socket-id
Open

michelsbautzen wants to merge 1 commit into
pedroSG94:masterfrom
michelsbautzen:fix-srt-socket-id

Conversation

@michelsbautzen

Copy link
Copy Markdown

Description

The SRT handshake currently uses a fixed socket ID (762640158 / 0x2D74F71E).

This can cause problems when multiple Android devices using RootEncoder connect simultaneously to the same SRT server.

I encountered this issue using two Android devices with Opticast and MediaMTX. Both devices could connect individually, but the second connection failed while the first one was active.

A Wireshark capture showed that both devices were using the same SRT socket ID:

0x2D74F71E

This change generates a random socket ID instead of using the fixed value.

Testing

Tested with:

  • two Android devices
  • Opticast
  • MediaMTX
  • both devices connecting simultaneously to the same SRT UDP port
  • different SRT stream paths

Before the change, only one device could connect at a time.

After the change, both devices can stream simultaneously through the same MediaMTX SRT listener.

@pedroSG94

Copy link
Copy Markdown
Owner

Hello,

This error should be already fixed in the version 2.8.1.
Your PR can be added since the default value proposed is better than my previous value but it is not necessary to work since the value is override and generated in each connection.

Can you confirm that it is fixed using 2.8.1?

@michelsbautzen

Copy link
Copy Markdown
Author

Yes, I can confirm that the issue is fixed in version 2.8.1. I was able to receive both SRT streams from the phones successfully.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants