Boost logo

Boost Users :

From: Dominique Devienne (ddevienne_at_[hidden])
Date: 2020-12-15 10:54:13


Hi. Continuing my explorations of Boost.Beast.

So now I have:
* a small Boost.Beast HTTP server (based on async_http_server example), and
* a small Boost.Beast HTTP client (based on sync_http_client example).

This works, in that I can start the client (wrapped in a helper class),
make several requests, and close the client. But until now, the client was
short-lived,
so no problem. (the server was started too of course, and long lived as
expected).

Now I'm embedding that HTTP client into another (WebSocket) server,
which uses that same wrapper class above, successfully connects to the
HTTP server on startup, and now waits for WebSocket connections, at which
time it's supposed to make HTTP requests to the HTTP server for various
reasons.

Problem is, the HTTP client times out after 5s. While I want it to be long
lived.
I've read Vinnie's answer in https://stackoverflow.com/a/56880415/103724
about
sync operation not having timeouts, but I don't want to control timeouts of
individual
requests here (for now at least), I want to not have the underlying socket
not timeout
on its own, the same way a WebSocket does not timeout either. Is that
possible?
Who controls that 5s timeout?

Would switching to an async HTTP client make any difference? Sounds to me
that
it would allow me to control timeouts of requests, but would it make any
difference
to the socket timeout described above?

Thanks, --DD



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