srt-live-transmit: add option to cancel timeout #570
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add an option (
-taoc
,-timeout-abort-on-connect
) to cancel the timeout (as set with-t
) after a client is accepted. This allows forsrt-live-transmit
to run in listener mode and wait for a limited amount of time (timeout) for a client to connect.Due to the paired tx/rx operation of
srt-live-transmit
and the fact that a sender process may not accept multiple clients, should one want to operate such a server they would need to devise a way to spawn sender processes as necessary. In such a case sender processes spawned in listener mode wait for the client to connect; it then becomes important to enforce a timeout so the sender process does not wait forever. You already have thetimeout
option forsrt-live-transmit
, but that works as an unconditional exit timer. This patch introduces a second option, which changes the behavior oftimeout
: once a client is accepted the pendingalarm(2)
is canceled.This is probably an abuse of the
timeout
option, but it seems to be the only way to achieve a listener timeout. Thetimeout
(SRTO_RCVTIMEO
,SRTO_SNDTIMEO
) andconntimeo
parameters do not seem to have any effect at the particular stage.