srt_connect behaviour on non-blocking mode #2819
-
Hi. So I want to setup a caller socket with an "async" connect so it never blocks. I replace the thread block with an "interruptible sleep" that I do with a condition variable. So my code looks something like this:
I would hope that if no client is listening on Is this how is is supposed to be used? It would be very great to be able to have an "infinite" timeout so I know the socket won't be created again and again if the program is running a lot of time with no clients. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Broken sockets cannot be reused and there's no intended "infinite" value for Not sure why you need non-blocking mode for such a scenario. You are doing the same thing as it would be with blocking mode, just with more idle calls. |
Beta Was this translation helpful? Give feedback.
Broken sockets cannot be reused and there's no intended "infinite" value for
SRTO_CONNTIMEO
. So yes, the only solution is to recreate the socket on failure.Not sure why you need non-blocking mode for such a scenario. You are doing the same thing as it would be with blocking mode, just with more idle calls.