Open p12tic opened 2 years ago
Hi,
what's happening is internal io_context is used ?
the do_accept
will not be called and the acceptor will not be registered to the io_context ?
Using the added unit tests, I am not sure how I can simulate a failure on on_accept, or doing it using the examples.
You're right. I will create a failing unit test and get back.
Hi @dfleury2 - this issue still occurs on the latest version. From what I can see, it's caused by the acceptor handling the accept error by calling app.stop() - but this method does nothing if user's io context is used. This patch would at least alleviate the issue by not causing infinite spam in the console, only logging the error once; ideally, I would prefer if the error from bind() call in the acceptor could be propagated to the user's thread calling server.listen() as an exception. Should I try to submit such a patch?
Hi, yes of course. The use of an external io_context was added later, and it's not the prefered way to use beauty. If you succeed this issue, you are welcome.
This fixes infinite loop in case application uses an external io_context in which case
_app.stop()
does nothing.