Some of our regression tests fail randomly on FreeBSD with an unexpected
EADDRINUSE error. We didn't see this problem with 4.7, but we see it in
4.11, 5.4, and 6.0. We don't see this behavior on any of our other
supported platforms.
We investigated the problem, and managed to come up with a
Sorry my attachments didn't make it :)
#
# sink.py
#
import socket
import traceback
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(('127.0.0.1', 12345))
s.listen(5)
while True:
try:
n = s.accept()[0]
d = N