-
Notifications
You must be signed in to change notification settings - Fork 634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yield / ping #899
Comments
There's no "background ping" in beast. If you want beast to send a ping you have to explicitly request it (by calling This is described in the documentation: Beast doesn't do anything "in the background". It doesn't set timers and it doesn't create any threads. Any beast behaviors are the result of synchronous or asynchronous operations initiated by the caller.
Blocking a thread calling |
The websocket servers examples should probably implement background pings |
In the next version (147): The timer logic for the advanced-server and advanced-server-flex examples is refactored to use idle pings when the connection has not seen activity for some period of time. This demonstrates the use of the stream's control_callback interface. |
Cool — thanks a lot!
Beet
… Am 28.11.2017 um 01:46 schrieb Vinnie Falco ***@***.***>:
In the next version (147):
The timer logic for the advanced-server and advanced-server-flex examples is refactored to use idle pings when the connection has not seen activity for some period of time. This demonstrates the use of the stream's control_callback interface.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#899 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ASlWX__saQyMQoVBw6xBMnKFKvT5vCN7ks5s61f_gaJpZM4QnMsl>.
|
Hi there,
do I understand it correctly that in this example: http://www.boost.org/doc/libs/master/libs/beast/example/websocket/client/coro/websocket_client_coro.cpp , if I would run a for(;;)-loop in do_session() and send/receive repeatedly, having yields in regular intervals in the loop is essential to keep the background-ping alive ?
The use-case is a client that repeatedly asks for work from the server; processing of this work may then take anything from seconds to days, and the processing is not able to yield.
So running such workloads would require processing to be done asynchronously outside of the loop, e.g. via std::async, some threadpool or via ASIO asynchronous operations.
Thanks and Kind Regards,
Beet
The text was updated successfully, but these errors were encountered: