title: Fix "[Errno 11] Resource temporarily unavailable" in Python 2.x.x?
body: <p>I have two scripts <code>server.py</code> &amp; <code>talk.py</code></p>
  
  <p><code>server.py</code> is supposed to listen to connections &amp; consume data from  <code>talk.py</code></p>
  
  <p>It works perfectly on localhost i.e if I run <code>server.py</code> &amp; <code>talk.py</code> in different terminals on the same machine...</p>
  
  <p>a) <code>talk.py</code> asks for a string
  b) <code>server.py</code> consumes the string from a) &amp; prints it in the terminal that is running <code>server.py</code></p>
  
  <p>Like I said, the scripts run ok on a local machine, Ubuntu.</p>
  
  <p>When I deployed my <code>server.py</code> to a GCP VM instance it seems runs fine,
  however, why I ran my <code>talk.py</code> code in on the local machine to connect to the <code>server.py</code> socket via an external web IP address, <code>talk.py</code> give the error code</p>
  
  <pre class="lang-py prettyprint-override"><code>Traceback (most recent call last):
    File "talk.py", line 11, in &lt;module&gt;
      s.connect(('35.247.28.0', port))
    File "/usr/lib/python2.7/socket.py", line 228, in meth
      return getattr(self._sock,name)(*args)
  socket.error: [Errno 11] Resource temporarily unavailable
  </code></pre>
  
  <pre class="lang-py prettyprint-override"><code>#server.py
  
  # first of all import the socket library
  import socket               
  
  # next create a socket object
  s = socket.socket()         
  print "Socket successfully created"
  
  # reserve a port on your computer in our
  # case it is 12345 but it can be anything
  port = 12345               
  
  # Next bind to the port
  # we have not typed any ip in the ip field
  # instead we have inputted an empty string
  # this makes the server listen to requests 
  # coming from other computers on the network
  s.bind(('', port))        
  print "socket binded to %s" %(port)
  
  # put the socket into listening mode
  s.listen(5)     
  print "socket is listening"           
  
  # a forever loop until we interrupt it or 
  # an error occurs
  while True:
  
     # Establish connection with client.
     c, addr = s.accept()     
     print 'Got connection from', addr
  
     # Get data from client
     """
     try:
         data = c.recv(1024)
     except IOError as e:
         print e
     """
  
     print data
  
     if not data:
       break
  
     # Send back reversed data to client   
     c.sendall(data)
  
  
     # send a thank you message to the client. 
     #c.send('\n Thank you for sending message!!!!')
  
     # Close the connection with the client
     c.close()
  </code></pre>
  
  <pre class="lang-py prettyprint-override"><code># talk.py
  # first of all import the socket library
  import socket               
  
  # next create a socket object
  s = socket.socket()         
  print "Socket successfully created"
  
  # reserve a port on your computer in our
  # case it is 12345 but it can be anything
  port = 12345               
  
  # Next bind to the port
  # we have not typed any ip in the ip field
  # instead we have inputted an empty string
  # this makes the server listen to requests 
  # coming from other computers on the network
  s.bind(('', port))        
  print "socket binded to %s" %(port)
  
  # put the socket into listening mode
  s.listen(5)     
  print "socket is listening"           
  
  # a forever loop until we interrupt it or 
  # an error occurs
  while True:
  
     # Establish connection with client.
     c, addr = s.accept()     
     print 'Got connection from', addr
  
     print data
  
     if not data:
       break
  
     # Send back reversed data to client   
     c.sendall(data)
  
  
     # send a thank you message to the client. 
     #c.send('\n Thank you for sending message!!!!')
  
     # Close the connection with the client
     c.close()
  
  </code></pre>