Boost logo

Boost Users :

Subject: [Boost-users] [Boost.Asio coroutines] Question about HTTPServer4 examples
From: daniil_at_[hidden]
Date: 2019-04-26 13:42:27

Hello everyone,
I have a small question regarding Boost.Asio stackless coroutines, and especially the HTTP server 4 example provided on the website (
I noticed that in the example, the socket_ shared pointer is being reset at every async_accept loop, basically deleting (?) the value it points to every time a new socket is accepted, since there seems to be only one shared_pointer instance, stored in a property of the server class.
How would eventual forks be able to use the newly accepted socket, if the main loop resets the pointer? Coroutine forking does not create a copy of the process like with POSIX forks (=> another shared pointer pointing to the same object); does it clone the coroutine object, along with all its properties?
Daniil Gentili

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