Boost logo

Boost Users :

Subject: [Boost-users] [ASIO] Do coroutines allow serving multiple clients at once?
From: mmarkd9_at_[hidden]
Date: 2016-10-10 03:44:02

I'm using ASIO with coroutines2 to create a ssl echo server. The code I've been experimenting is the following:
While this is highly readable compared to the asynchronous callbacks version (thanks coroutines), I'd like to know if this code is able to serve multiple clients connecting at the same time to the server.
In theory, every time I return control to the io_service object (i.e. I yield in the spawn coroutine) it should take care of whatever connection is pending / buffered / scheduled to be accepted next, right? Is this a reliable way to handle multiple requests? I don't plan on supporting massive workloads (e.g. 500k connections at once) but having some resilience would be nice indeed.
Any other thoughts/tips are also warmly welcome.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at