[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ccrtp-devel] How to block on incoming queue?

From: Yaniv Levy
Subject: [Ccrtp-devel] How to block on incoming queue?
Date: Tue, 23 May 2006 10:30:56 +0300


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

I would like somthing like

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]