我正在通过 python 在 websocket 上开发 Autobahn 的应用程序。我发现了一个问题,如果我在中断后重新启动我的服务器代码,那么我的服务器代码将向我发送如下错误:
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.
我错误地理解,即使在中断服务器后,还有一些基本服务仍在运行,但是如何清除所有这些端口?