title: Error 10051 while trying to connect socket
body: <p>I recently built a socket-server chat in <strong>linux</strong>.</p>
  
  <p>When I try to connect my <strong>windows 8.1</strong> main computer (Both under the same subnet), i get an:</p>
  
  <pre><code>[Errno 10051]: A socket operation was attempted to an unreachable network
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>import socket
  import datetime 
  import getpass          # Get username
  import sys
  import thread
  import select
  
  def client():
  
  sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
  sock.bind(("127.0.0.1", 8856))
  sock.connect(("192.168.1.17", 23657))
  sock.send(getpass.getuser()+"[$ID$]4sthg")
  
  socket_list = [sys.stdin, sock]
  partner = raw_input("Chat partner: ")
  
  while 1:
      # Get the list sockets which are readable
      read_sockets, write_sockets, error_sockets =       select.select(socket_list , [], [])
      for sock_index in read_sockets:
          # incoming message from remote server
          if sock_index == sock:
              data = sock_index.recv(4096)
              if not data :
                  print '\nDisconnected from chat server'
                  sys.exit()
              else :
                  #print data
                  sys.stdout.write(data)
          # user entered a message
          else:
              msg = sys.stdin.readline()
              sock.send(partner + "|" + msg)
  
  def get_time():
      return datetime.datetime.strftime(datetime.datetime.now(), '%H:%M:%S')
  
  def main():
      client()
  
  if __name__ == "__main__":
      main()
  </code></pre>
  
  <p>I tried "ping" to my laptop address, and it worked well. also added a rule in my linux firewall, declares that every packet comes from my windows computer is allowed. </p>
  
  <p>Any idea why it happens?</p>
  
  <p><strong>Thanks!</strong></p>