(UDP) Does ARP happen at any time before data sending is attempted on a Windows socket?
IE, does it play any role during the creation of a UDP socket? I'm pretty sure the answer i开发者_如何学Pythons "no", but who knows.
Thanks.
The ARP (if necessary) would be triggered by the send()
or sendto()
call.
Most of the time an ARP doesn't need to be sent since the destination is most likely reachable through the default gateway for which the ARP entry will already be cached.
Also, you may be interested in the SendARP function. You can explicitly call it before you start sending UDP packets if you want a little extra insurance against drops while waiting for the initial ARP response. Otherwise, it might be possible to overfill the transmit queue while the stack waits around for ARP resolution.
精彩评论