title: Python socket.error: [Errno 113] No route to host but ping works
body: <p>I am trying to connect using TCP. In the client side I have the following code </p>
  
  <pre><code>import socket
  BUFFER_SIZE = 1024
  
  server_addres = ('172.16.1.52',3201)
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  s.connect(server_addres)
  data = s.recv(BUFFER_SIZE)
  s.close()
  
  print "received data:", data
  </code></pre>
  
  <p>I run it using:</p>
  
  <pre><code>sudo python myProgram.py
  </code></pre>
  
  <p>This error appears</p>
  
  <pre><code>File "/usr/lib/python2.7/socket.py", line 224, in meth
      return getattr(self._sock,name)(*args)
  socket.error: [Errno 113] No route to host
  </code></pre>
  
  <p>However if i run: </p>
  
  <pre><code>sudo ping 172.16.1.52
  </code></pre>
  
  <p>The pings work properly. I need to run ping as sudo because running it without sudo gives <code>ping: icmp open socket: Operation not permitted</code></p>