title: Python Socket Error "Only one usage of each socket address is normally permitted"
body: <p>I have a basic server and client that prints a message on the server when a client connects, and then prints a message on the client saying "Thanks for connecting." But when I try to run the server again(after closing it), I get "error: Only one usage of each socket address is normally permitted"(Not exact). And when I change the port again it works. </p>
  
  <pre><code>#Server 
  import socket               
  
  s = socket.socket()         
  host = socket.gethostname() 
  port = 12345             
  s.bind((host, port))        
  
  s.listen(5)                 
  while True:
     c, addr = s.accept()    
     print 'Got connection from', addr
     c.send('Thank you for connecting')
     c.close()
  </code></pre>
  
  <p>.</p>
  
  <pre><code>#Client 
  import socket               
  
  s = socket.socket()         
  host = socket.gethostname() 
  port = 12345              
  
  s.connect((host, port))
  print s.recv(1024)
  s.close  
  </code></pre>
  
  <p>If I change the last two lines of code for the server to</p>
  
  <pre><code>    break
  c.close()
  </code></pre>
  
  <p>it works but closes the server.</p>
  
  <p>How can I keep the server up after the client disconnects without having to change the port each time?</p>