title: socket.error:[errno 99] cannot assign requested address and namespace in python
body: <p>My server software says <code>errno99: cannot assign requested address</code> while using an ip address other than <code>127.0.0.1</code> for binding.</p>
  
  <p>But if the IP address is <code>127.0.0.1</code> it works.
  Is it related to namespaces?</p>
  
  <p>I am executing my server and client codes in another python program by calling <code>execfile()</code>.
  I am actually editing the mininet source code.I edited net.py and inside that I used execfile('server.py') execfile('client1.py') and execfile('client2.py').So as soon as "sudo mn --topo single,3" is called along with the creation of 3 hosts my server and client codes will get executed.I have given my server and client codes below.</p>
  
  <pre><code>#server code
  import select 
  import socket 
  import sys 
  backlog = 5 
  size = 1024 
  server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 
  server.bind(("10.0.0.1",9999)) 
  server.listen(backlog) 
  input = [server] 
  running = 1 
  while running: 
      inputready,outputready,exceptready = select.select(input,[],[]) 
      for s in inputready: 
          if s == server: 
              client, address = server.accept() 
              input.append(client)
          else: 
              l = s.recv(1024)
              sys.stdout.write(l)
  server.close()
  </code></pre>
  
  <p><br></p>
  
  <pre><code>#client code
  import socket
  import select
  import sys
  import time
  while(1) :
      s,addr=server1.accept()    
      data=int(s.recv(4))
      s = socket.socket()
      s.connect(("10.0.0.1",9999))
      while (1):
          f=open ("hello1.txt", "rb")
          l = f.read(1024)
          s.send(l)
          l = f.read(1024)
          time.sleep(5)
  s.close()
  </code></pre>