Here's one suggestion. Create a semaphore. > - ThreadingTCPServer creates a new thread for each incoming > connection, and makes this a daemon thread (meaning it won't be > waited for at the end of the process). Bump the semaphore count up by one before running each new thread. > - The threads handling the requests are still running, and there's > nothing to guarantee that they have processed all requests. Have the daemons decrement the semaphore when they're done handling a request. > > The test driver needs to somehow wait until all the threads handling > connections (how many? maybe there's only one?) are finished before it > closes sockOut. Have the last step in the main thread be a blocking call to the semaphore so that it doesn't bail out until all requests are handled. Raymond Hettinger ################################################################# ################################################################# ################################################################# ##### ##### ##### ################################################################# ################################################################# #################################################################
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4