I am working on Autobahn's app on websocket over python. I found one problem, if I restart my server code once after interrupting then my server code will send me error like:
2016-03-03 13:20:34+0530 [-] Log opened.
2016-03-03 13:20:34+0530 [-] Traceback (most recent call last):
2016-03-03 13:20:34+0530 [-] File "TestServer.py", line 23, in <module>
2016-03-03 13:20:34+0530 [-] reactor.listenTCP(9008, factory)
2016-03-03 13:20:34+0530 [-] File "/home/ddserver/python1/local/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 478, in listenTCP
2016-03-03 13:20:34+0530 [-] p.startListening()
2016-03-03 13:20:34+0530 [-] File "/home/ddserver/python1/local/lib/python2.7/site-packages/twisted/internet/tcp.py", line 984, in startListening
2016-03-03 13:20:34+0530 [-] raise CannotListenError(self.interface, self.port, le)
2016-03-03 13:20:34+0530 [-] twisted.internet.error.CannotListenError: Couldn't listen on any:9008: [Errno 98] Address already in use.
I understand by error is there are some basic services which is running on behind even after interrupting server, but how clear all such ports ?
You are quite right about that , your service keeps on running even after you interupt . You need to check for your process that is running on that port and kill it manually. You can use the command: ps aux to look for your process and kill it using : kill -9 Or you could find help here: