ccrtp-devel
[Top][All Lists]
Advanced

[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

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

reply via email to

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