<br>I have an application that requires each node using it to update each other, and to fetch updates automatically. Each node, therefore, has a server and a client on it. <br>I am receiving different errors each time I run the program, and they are coming from within the twisted packages, (shown below)
<br><br>Error 1:<br> File "C:\Python24\lib\site-packages\twisted\internet\tcp.py", line 89, in _closeSocket<br> skt = self.socket<br>exceptions.AttributeError: 'Server' object has no attribute 'socket'<br><br>
Error 2:<br> File "C:\Python24\lib\site-packages\twisted\spread\pb.py", line 572, in expressionReceived<br> raise ProtocolError("Non-list expression received.")<br>twisted.spread.pb.ProtocolError: Non-list expression received.
<br><br><br>I suspect that they are caused by the way that I am running my server. On occasion, reactor.run() finishes, and thus there is no longer a server running in effect. I therefore use a while loop to always be running the server. The server is launched as a thread.
<br><br>def run(self): <br> while 1:<br> application = service.Application("copy_receiver")<br> internet.TCPServer(8800, pb.PBServerFactory(self)).setServiceParent(<br>
service.IServiceCollection(application)) <br> self.listener = reactor.listenTCP(8800, pb.PBServerFactory(self))<br> <br> #installSignalHandlers=0 allows the reactor to run in a non-main thread
<br> reactor.run(installSignalHandlers=0)<br> <br>Is this known to cause problems? If not, any ideas of why i might be getting the error messages? or any ideas how I can keep the server running so that it doesn't exit?
<br><br><br>Alex Couper<br><br>