title: How do I connect to a UDP port in Python?
body: <p>Like everyone else, I can say "I've tried everything!" I kind of did. I looked all over StackOverflow, and tried all the answers, but got nothing. Anyways, I am jetting to at least get some code printed by Python before I get even further in developing this.</p>
  
  <p>I want to receive UDP packets from my Garry's Mod server (logaddress_add MyIP:7131), and I don't seem to be receiving any of those packets. It's most likely not a router firewall problem, as I can use HLSW on my other computer. I have used Wireshark, and didn't see any data from my server's IP. I used the Python interpreter / <a href="http://docs.python.org/library/socket.html#socket-example" rel="nofollow noreferrer">made some code</a> (although example was TCP) to see if I got any data--to make sure Wireshark wasn't doing anything wrong--and nothing came to it either. Am I doing something silly?</p>
  
  <pre><code>import socket
  
  sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  sock.bind(('0.0.0.0', 7131))
  
  sock.settimeout(10)
  sock.recv(1024)
  </code></pre>
  
  <p>Edit : I was doing some testing with HLSW, and found out it seems to be doing some kind of magic. When you try to logaddress_add the certain Port that is not HLSW (say 7135), it won't do anything. Wireshark won't do anything at all. Doesn't show any logs, anything. But, when you change HLSW to use the port that you just added (7135), Wireshark suddenly gets a flow of data, including the console data that I am jetting for. Is it some kind of configuration HLSW is changing?</p>