Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio] Error running as Windows service; runs fine from console
From: Igor R (boost.lists_at_[hidden])
Date: 2010-09-15 05:08:05


>> my call to boost::asio::ip::tcp::acceptor::async_accept() immediately calls the passed
>> accept handler to report error 995: "The I/O operation has been aborted
>> because of either a thread exit or an application request". This occurs even
>> when I run the service under the same account as the logged-in user.
>
> Maybe it's just a coincidence that the issue appears in service mode
> only. Ensure that the thread where you call async_accept() doesn't
> exit until the handler gets called.

By the way, I guess you use different threading models in console and
service modes. In console mode it can be just:
int main()
{
  // prepare i/o object, call async_accept() etc
  io_service_.run()
}

But how and where do you run your io_service in service mode?
Probably the answer to this question would explain why you get the error.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net