| Zapeth (79) | |||||||
|
Hello, I actually asked this a little while ago (http://www.cplusplus.com/forum/windows/89824/) and I thought I had it solved but that turned out to be false. I also asked for help at stackoverflow (http://stackoverflow.com/questions/14753759/boostasio-io-service-doesnt-return-after-stop/) but I wasn't able to solve the problem yet and I decided to ask here too, hoping for more responsiveness. In my application I am listening for TCP and UDP packets and all the work is being done in the same io_service. I am working under Windows 7 with Visual Studio 2010 and boost 1.51. Here is the main part of my main function:
and here is the TcpServer Class (which I already modfied according to the answer in stackoverflow):
The problem is that the cleanup code in the main function is never reached once io_service.run()[/code] is called. When I quit the console window he enters the handle_stop() (in most cases) but quits when calling acceptor_.close(); or printf(); with the return code(s)
I also tried fiddling around with TcpConnection being used as a shared pointer (as suggested at stackoverflow) but didn't get any different results. Besides all that I tried out the boost::asio http examples 1 and 3 to see how it is done there but the same problem occurs (and I copied the example code 1:1). So at this point I'm not even really sure if I'm doing something wrong or if the problem is something entirely different. I would very much appreciate it if someone could give me some insight here since I couldn't really find any related problem. | |||||||
|
|
|||||||