title: PYTHON - socket "[Errorno 105] No buffer space available" after 10 hours execution
body: <p>I implemented a code that sends pings to different destinations in a continuous way, but, after a 10 hours execution cycle, the socket I'm using is affected by some sort of aging that makes the application stop with a "[Errorno 105] No buffer space available". How can I MONITOR and SOLVE this problem? </p>
  
  <p>Just for info, once opened, I use always the same socket to send and receive pings: could changing the socket periodically solve the problem?</p>
  
  <h2>SENDER CODE</h2>
  
  <pre><code>import socket
  
  icmp = socket.getprotobyname('icmp')
  self.socket = socket.socket(socket.AF_INET,socket.SOCK_RAW,icmp)
  
  for target in target_list:
          #...
          packet = header+data
          while packet:
                  sent = self.socket.sendto(packet,(target, 1))
                  packet = packet[sent:]
  </code></pre>
  
  <h2>RECEIVER CODE</h2>
  
  <pre><code>import select
  
  whatReady = select.select([self.socket],[],[])
  
  if whatReady[0] != []:
          for skt in whatReady[0]:
          #...
          (recPacket,addr) = self.socket.recvfrom(self.PACKET_SIZE+64)
  </code></pre>
  
  <p>NOTES:</p>
  
  <ol>
  <li><code>self.socket</code> is the same object reference for both modules. </li>
  <li>I never close or change <code>self.socket</code> during execution.</li>
  <li>self.PACKET_SIZE = 32 (byte)</li>
  </ol>