First of all, the session_set_select does lock the mutex for only
breif moment because
the call ortp_cond_wait (which is mapped to pthread_cond_wait on
linux) unlocks the mutex before entering the wiat state.
If you still need a timed wait what you can do is following:
in include/ortp/port.h add
#define ortp_cond_timedwait pthread cond_timedwait
in the src/sessionset.c
create a new function session_set_timedselect which is EXACTLY like
session_set_wait but has a timespec pointer...
in this function replace the call to ortp_cond_wait to
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
one is not a solution, so I wanted to use session_set_select to
data. I'm using a mutex to handle the critical section. Every time a
called, the list of running sessions is locked and no additional
can be added/removed, after select/send/recv is done Mutex will be
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
not ready to send/recv, then session_set_select blocks forever. No
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
how can it be done using oRTP. In current situation I don't see any
to have dynamic list of sessions, it works if the count of sessions is
known from the beginning and is always constant. Shouldn't
be extended by additional argument for timeout as select() is? Or is
any other solution.
Fast help is very appreciated.
Linphone-developers mailing list