title: Sending and receiving packets through different sockets with SO_REUSEADDR
body: <p>As a continuation to this question: <a href="https://stackoverflow.com/questions/20275980/is-it-possible-to-send-and-receive-packets-through-different-sockets#20276248">Is it possible to send and receive packets through different sockets?</a></p>
  
  <p>I've tried using SO_REUSEADDR (after realizing I cannot use SO_REUSEPORT).
  But still, my code doesn't work.</p>
  
  <p>Here it is:</p>
  
  <pre><code>HOST='127.0.0.1'
  PORT=10000
  recvSock = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_RAW)
  recvSock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
  
  sendSock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  sendSock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
  
  sendSock.bind((HOST,PORT))
  sendSock.sendto("",(HOST,PORT))
  
  recvSock.bind((HOST,PORT))
  response,addr = recvSock.recvfrom(65535)
  </code></pre>
  
  <p>I get an error on the first 'bind' line (binding sendsock).</p>
  
  <p>If I omit the sendSock.bind line, I get an error on recvSock.recvfrom line.</p>
  
  <p>I also get an error for omitting both setsockopt lines and bind lines, so I guess my use of setsockopt in order to bind two sockets to the same address is just not good.</p>
  
  <p>Couldn't find examples on the internet on how to use them...
  Any help?</p>
  
  <p>P.S using python 2.7 on windows XP.</p>