How to block on incoming queue?

"Yaniv Levy" <[email protected]>
Newsgroups gmane.comp.gnu.ccrtp.devel
Message-ID <[email protected]>
Hello,

I'm looking for a way to listen an RTPSession in a blocking way.

in all examples, RTPSession object runs a thread that handle RTCP, sends due
RTP packets, and takes incoming packets from its socket to the Incoming
packet queue.
However, My application can not block on getData() method, and has to poll
and sleep, waiting for data to be inserted to the queue.
I dont like this solution since my application will continue sleeping for a
fixed time  while a packet may be already waiting for it to process.
I thought about inheriting RTPSession and override virtual onRTPPacketRecv
() method,  but its risky, since it is called from takeInDataPacket() before
the packet is actually inserted to the queue.

today the the code looks like that

RTPSession socket;
while(1) {
  if (socket.getData(getFirstTimestamp() )
    //do somthing
  else
   sleep(100);
}

I would like somthing like

while(1) {
  socket.getData(getFirstTimestamp() )
  {  //do somthing}
}

Thanks,
Yaniv

_______________________________________________
Ccrtp-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/ccrtp-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.