title: Python 'Connection reset by peer'
body: <p>I'm playing around with Python and listening for UDP packets on a given port, everything seems to be working nicely - but after an extended period of time the script crashes with the following error:</p>
  
  <pre><code>data = self._sock.recv(self._rbufsize)
  socket.error: [Errno 54] Connection reset by peer
  </code></pre>
  
  <p>When restarting just the script, the same crash occurs again after a shorter period of time. Restarting the server instead seems to resolve the problem completely for a while again.</p>
  
  <p>With respect to the socket side of things, I'm doing:</p>
  
  <pre><code>UDP_IP = "0.0.0.0"
  UDP_PORT = 6000
  
  sock = socket.socket( socket.AF_INET, socket.SOCK_DGRAM )
  sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
  sock.bind( (UDP_IP, UDP_PORT) )
  </code></pre>
  
  <p>Am I missing something obvious or is there just a simple way of avoiding this?</p>
  
  <p>Thanks in advance for any light you can shed!</p>
  
  <p>Benji</p>