Help receiving a frame in C!

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.

Set Receive Timeout
Try this

socklen_t optval;
struct timeval tv;

tv.tv_sec=5;
tv.tv_usec = 0;
optval=sizeof(tv);

     int ret = setsockopt(recv_sock,SOL_SOCKET, SO_RCVTIMEO,&tv,optval);
     if( ret < 0 )
        printf("Sorry - setsockopt failed");

That's it!!! Thank you, Johnbach!!! Thank you!