
Hi Caleb, --- Caleb Epstein <caleb.epstein@gmail.com> wrote: <snip>
I had to interrupt the program by attaching a debugger to get it to run to completion (explaining the low result for the last SYNC loop). One thread seems to get stuck in a "recv" call (sync_server::run) that does not get interrupted by main's call to s0.stop(). Not sure if this is a bug in the test program or in asio.
I suspect the problem is that the test program is closing the socket from one thread while the recv call is still in progress. I don't believe you can portably terminate a synchronous receive operation by closing the socket. If you do require behaviour where a receive is terminated by close, the asynchronous receive operation is guaranteed to return as soon as possible with the operation_aborted error. Cheers, Chris