Originally Posted by xpi0t0s
No I can't help. Despite me asking about five million times you still haven't said WHAT ACTUALLY GOES WRONG. So no, haven't got a clue, no idea whatsoever.
I am really sorry if I am unable to explain my problem. In short, I am unable to send the smallest time stamped packet at its play out time. I get the smallest time stamped packet when i come out of while() loop. Then I am checking this time stamp with the system clock time in the if() block. Here is the problem. I am comparing the clock time with the packet arrival time. If the packet time is smaller than the system clock time (means system clock time has already reached the packet time) then sending the packet. Here if the packet time is still greater then i dont want to wait here using any sleep or usleep or else. I only want the packet to take out from the list, when its play out time is reached and it's smallest among all packets.
I hope I have explained the problem in quite better way now. Sorry again.
Here is the code.
pthread_mutex_lock( &mut );
// pthread_mutex_lock( &mut );
if(snode->ts.tv_sec < scurr->ts.tv_sec && snode->ts.tv_usec < scurr->ts.tv_usec)
if(curr_time.tv_sec >= snode->ts.tv_sec && curr_time.tv_usec >= snode->ts.tv_usec)
struct sockaddr_ll destAddr;
if(snode2->rFlag==0 && snode2->wFlag==1)
printf("retVal is %d",retVal);
printf("sendto() error \n");
printf("SENDER 1 --- packet number is %d OF length %d Sent \n",snode2->pkt_id,retVal);
pthread_mutex_unlock( &mut );
}while(snode->next != NULL);