C sendto works sometimes…just stops after some time… NO ERRORS
Ive been getting strange results with the sendto function in C.(LINUX) What I am trying to do is to implement a reliable UDP kind of scheme.
The snippet of code provided below is a part of the timer that expires when a packet is dropped and sends a message to a process to retransmit that packet.
The weird problem which I am having is that when transferring a large file say... >300KB The code given below works perfectly (i.e. THE ELSE PART IS EXECUTED) But after a certain number of packets are sent...it executes the then part.!!!
THIS IS STRANGE BECAUSE THE CODE WORKED FINE FOR ABOUT 250 PACKETS BUT WITH THE 251 PACKET kabooom!!!
n = sendto(sockfd, &(forwardPeer->id), sizeof(forwardPeer->id), 0, (struct sockaddr*)&tcpd_addr, sizeof(tcpd_addr));
printf("\n error sending to tcpdc");
printf("\n message sent to tcpdc");
I tried with strerror and got an error number of 134514723
Perror gives Unknown File descriptor