UDP Send/Receive problem on the same port
Hi,
I have a packet generator connected to my MAC that sends 100 UDP packets to my port 3000(It uses port 4000 to send these packets). I have a loop that receives these packets (recvfrom(..)) and send them back immdeiately, untouched and count them. However, these packets gets to my MAC and all the way up the stack (netdev->stats.rx_packets = 100). But my recvfrom(..) only receives 63 of these and sendto(..) is called 63 times. However, the packet generator receives only 3 packets at all time. Any suggestions as to what might be happening here ? What happened to the missing 37 packets ? And why nedev->stat.tx_packets does not agree with how many times sendto() has been successfully called ? I doubt if it is prohibited to send and receive using the same socket bounded to my receive UDP port...is it ? Should I use two different sockets and bind them to two different port, one for receive and one for send ?
Thanks in advance for any suggestions.
|