I've decided to use oRTP library for
a large RTP session manager and now stucking. I have a dynamic list of
rtp sessions. Because of the rich number of sessions, own thread for each
one is not a solution, so I wanted to use session_set_select to send/recv
data. I'm using a mutex to handle the critical section. Every time a session_set_select
called, the list of running sessions is locked and no additional sessions
can be added/removed, after select/send/recv is done Mutex will be unlocked
and new sessions can be added to the list. In this time no send/recv is
possible. So far is the theory, but if all running sessions are permanently
not ready to send/recv, then session_set_select blocks forever. No send,
no receive, no open new session or close running one.
The "normal" select (based
on filedescriptors) has an extra argument for timeout, to unblock the thread.
how can it be done using oRTP. In current situation I don't see any possibility
to have dynamic list of sessions, it works if the count of sessions is
known from the beginning and is always constant. Shouldn't session_set_select(...)
be extended by additional argument for timeout as select() is? Or is there
any other solution.