How to write a C program to Check While packet(s) hasn't been acked in C programming Language ?
Solution For C Program :
void *chitcpd_run_timeout_thread_t(void *threadargs)
{
retrans_queue_item_t *retrans = (retrans_queue_item_t *) threadargs;
chilog(TRACE, "Spawned new timeout thread.");
/* check while packet(s) hasn't been acked */
while (!retrans->acked)
{
int rc = pthread_cond_timedwait(
retrans->ack_condvar,
retrans->mutex,
retrans->timeout
);
if (rc == ETIMEDOUT)
{
chilog(TRACE, "THREAD GENERATING TIMEOUT");
retrans->timed_out = TRUE;
chitcpd_timeout(retrans->si, retrans->entry);
pthread_exit(NULL);
}
}
chilog(INFO, "Packet in retransmission queue ACK'ed. Exiting thread.");
pthread_exit(NULL);
}
Learn More :
Check
- CHECKING LEAP YEAR USING C PROGRAM.
- Check given number is prime number or not using c program.
- Write a c program to check given string is palindrome number or not.
- C Program to Check Prime Use Loop And Recursive
- Given a numerical value, check if at least one of the elements of the vector is equal to the numerical value if so, say where in the negative case, say that there is no.
- C Program To Find The Length, Reverse Of A String And To Check It Is Palindrome or Not
- C Program To Check The Given Value Is Vowel
- C Function to Check Vowel
- C Program To Check Leap Year
- C Program To Check If It Is A Palindrome Numbers Or Not
- C Program to Check if a number is in an array[1000]
- Armstrong Number Checker in C
- C Program to Check Given String is Palindrome or Not
- C Program to Check Whether Number Is Perfect Or Not
- C Program To Alarm Check
- C Program To Read A Parenthesised Infix Expression From The User And Check Whether It Is Well Parenthesised Or Not
- Input a Number and Check if it's Palindrome or not C Program
- Input Number and Check if it's Armstrong C Program
- Input Number and Check if it's Even or Odd C Program
Packet