Hello everybody,
I have a problem with a program i'm coding, the thing is that i need the program to check quickly if it receives a response, if not, just go ahead.
My program sends the frame successfully, but it keeps waiting for the response until it receives something. That's what i need to fix, i mean, how do i do to wait for a response just, let's say 100 nanoseconds, and break the "listening" if no response is received in that period of time?
Here's part of the code:
...
if((length=recvfrom(recv_sock,&f,ETH_FRAME_LEN,0,NULL,NULL))<0){
close(send_sock);
return(NON_OK);
}
if(ntohs(f.arp_opcode)==operation){
printf("received!\n");
}
Please excuse my poor english. Thanks.