Re: [beast] I can't write a hello world server.
Loup VAILLANT via Boost-users <[email protected]> Wed, 10 Apr 2024 09:22:50 +0000
| Newsgroups | gmane.comp.lib.boost.user |
|---|---|
| Message-ID | <VI1PR01MB716569FA5BCD8C656E30032D84062@VI1PR01MB7165.eurprd01.prod.exchangelabs.com> |
> > What I need is a way for the user-code to yield, and then resume later when it has the info it needs to build the response. > I used beast::websocket to keep the https connection open with a client and used boost::asio::post() on the server. This way, a worker thread on the server can submit a job for processing and go listen for new incoming requests. Some worker thread will be called-back to run a completion function when the response is ready. Yeah, I didn't know about boost::asio::post() until yesterday. Looks like this is the way, thanks. > Please review http_server_async.cpp and websocket_server_async.cpp files in the examples page. Will do. Loup.