title: Socket error in python server code
body: <p>I have a python server script given below</p>
  
  <pre><code># create the server, binding to localhost on port 9999
  #
  server = SocketServer.TCPServer((options.ip, options.port), cmdHandler)
  
  While running a Python server script I am getting the following error:
  
  File "C:\Devcon\OCDServer_New.py", line 225, in runTest
  server = SocketServer.TCPServer((options.ip, options.port), cmdHandler)
  File "C:\Python27\lib\SocketServer.py", line 419, in __init__
  self.server_bind()
  File "C:\Python27\lib\SocketServer.py", line 430, in server_bind
  self.socket.bind(self.server_address)
  File "C:\Python27\lib\socket.py", line 224, in meth
  return getattr(self._sock,name)(*args)
  **socket.error: [Errno 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted**
  </code></pre>
  
  <p>How to solve this? In one link I found socket shutdown is a solution. But here the issue is coming while creating the socket itself. It might be because it was opened previously and not closed correctly. But I am unable to reset the entire thing and run the script again. Got stuck here.</p>