
12 Mar
2009
12 Mar
'09
3:14 p.m.
OK, thanks, but how am I supposed to close a thread which has a blocking receive in it?
Probably, in the current impelmentation of ASIO you can use the technique described in the following discussion: http://www.nabble.com/-asio--sync-receive_from-with-timeout-tt22326399.html#... But in general, how would you "close" blocking recv() (for example, in Winsock)? You can terminate its thread, but then you can't be sure that the socket is in a valid state. Usually, if you're going to make non-trivial i/o with asio (involving timeouts etc.), then asynchronous i/o is the way to go.