Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple client connections (receive, generate) #37

Merged
merged 8 commits into from
Jul 4, 2024

Conversation

maxsharabayko
Copy link
Owner

@maxsharabayko maxsharabayko commented Jul 13, 2021

Two new CLI options are added to receive and generate subcommand.

  • --maxconns: specifies the maximum number of connections to initiate or accept (-1: infinite, default: 1).
  • --concurrent-streams: specifies the maximum number of concurrent streams (default: 1)..

In the case of SRT caller, maxconns connections will be initiated by default from a different source UDP port to the same remote UDP port.

srt-xtransmit generate srt://127.0.0.1:4200?bind=:5200 --sendrate 5Mbps --duration 5s
    --reconnect --concurrent-streams 2 --maxconns 2

srt-xtransmit receive srt://:4200 -v --reconnect --concurrent-streams 2 --maxconns 2

To initiate connections from the same port bind to that port explicitly.

srt-xtransmit generate srt://127.0.0.1:4200?bind=:5200 --sendrate 5Mbps --duration 5s
    --reconnect --concurrent-streams 2 --maxconns 2

In the case of SRT listener up to n incoming connection requests will be accepted.

Each SRT connection creates a separate thread for a processing loop.
There is no way to specify different remotes yet, mainly due to the potential collision of the CLI syntax with the SRT socket group syntax.

Example Usage

Call from Different UDP Ports

Sender/caller (generate), receiver/listener (receive).

(receiver, accepting on UDP port 4200)
./srt-xtransmit receive srt://:4200 --enable-metrics --maxconns 6 --concurrent-streams 4

(sender, calling from different random UDP ports to a single remote UDP port 4200)
./srt-xtransmit generate srt://127.0.0.1:4200 --sendrate 1Mbps --enable-metrics --maxconns 6 --concurrent-streams 4

Call from the Same UDP Port

Sender/listener (generate), receiver/caller (receive).

(receiver, calling from the same UDP port 4201 to a single remote UDP port 4200)
./srt-xtransmit receive "srt://127.0.0.1:4200?bind=127.0.0.1:4201" --enable-metrics --maxconns 6 --concurrent-streams 4

(sender, accepting on UDP port 4200)
./srt-xtransmit generate "srt://:4200" --sendrate 1Mbps --enable-metrics --maxconns 6 --concurrent-streams 4

TODO

  • Does not work properly with the --reconnect option. Client must tell the number of simultaneous connections, i.e. wait for it to finish before reconnecting.

  • Move metrics thread to be shared between pipes.

Copy link
Owner Author

maxsharabayko commented Apr 28, 2022

Quality gate Quality gate: Passed

No issues Everything looks good
Details

@maxsharabayko maxsharabayko merged commit dd3fa68 into master Jul 4, 2024
6 checks passed
@maxsharabayko maxsharabayko deleted the develop/max-clients branch July 4, 2024 15:28
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.

1 participant