<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>&nbsp; File &quot;C:\Python24\lib\site-packages\twisted\internet\tcp.py&quot;, line 89, in _closeSocket<br>&nbsp;&nbsp;&nbsp; skt = self.socket<br>exceptions.AttributeError: 'Server' object has no attribute 'socket'<br><br>
Error 2:<br>&nbsp; File &quot;C:\Python24\lib\site-packages\twisted\spread\pb.py&quot;, line 572, in expressionReceived<br>&nbsp;&nbsp;&nbsp; raise ProtocolError(&quot;Non-list expression received.&quot;)<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):&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while 1:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; application = service.Application(&quot;copy_receiver&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; internet.TCPServer(8800, pb.PBServerFactory(self)).setServiceParent(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
service.IServiceCollection(application))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.listener = reactor.listenTCP(8800, pb.PBServerFactory(self))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #installSignalHandlers=0 allows the reactor to run in a non-main thread
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reactor.run(installSignalHandlers=0)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <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>