Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
added close() to servers #38
added a commit
this pull request
Sep 16, 2014
The current implementation (0.3.0) doesn't work.
TSimpleServer will only look at self.closed when processor.process returns, i.e. after processing some packets. Then it will get caught in trans.accept() waiting for new client session.
TThreadedServer will only look at self.closed once a client session ends. It can't be stopped if it doesn't gave or get any client sessions since it is stuck in trans.accept() waiting for a client session.
To support stopping the server, a socket timeout must be set causing "socket.accept" and "processor.process" to return regularly to check is self.closed has been set.