R. David Murray added the comment:

I'm not a networking expert at this level, but I believe what is happening here 
is that the network stack does an arp, and has a timeout waiting for the arp 
response that is longer than your socket timeout.  So at some point its arp 
timeout expires while the socket timeout hasn't, and it reports that there's no 
route to the host and resets its state.  Then on the *next* socket request it 
sends another arp request (because the host may have appeared since the last 
time it checked), and the cycle repeats.   I think this is a reasonable way for 
it to behave when the socket timeout is shorter than the arp response timeout, 
because otherwise you'd either lose the information that there's no route to 
the host, or you'd lose the association between "open the socket" and "send an 
arp".  But like I said, I'm not an expert at the layer 2 stuff.  I suppose in 
theory one could associate arp requests with socket operations one-for-one, but 
that would require more memory and I'm not surprised that
  the network stack doesn't go that route.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31268>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to