-
Notifications
You must be signed in to change notification settings - Fork 8
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
join() never completes because of outstanding operations #4
Comments
Actually this needs bit more work, because one does not by default want to cut operations in the middle of sending output. I suggest giving Existing locations to invoke msghub msghub(io_service);
msghub.connect("localhost", 1334);
msghub.publish("Publish", "new message");
//msghub.join(); // implied Here the message should be expected to be delivered, regardless of timings. Of course barring connectivity issues, in which case |
Graceful shutdown requires closing the hubconnection and any acceptor if applicable. Only then will a join() complete. Actually this needs bit more work, because one does not by default want to cut operations in the middle of sending output. I suggest giving `do_close` a bool flag `forced` to indicate whether pending write operations (operations for which we own the initiative) are to be forcibly interrupted. Existing locations to invoke `do_close` in error conditions shall supply `forced = true`. Other cases should default to `forced = false` so as to make sure that simple client programs will work as expected: ```c++ msghub msghub(io_service); msghub.connect("localhost", 1334); msghub.publish("Publish", "new message"); //msghub.join(); // implied ``` Here the message should be expected to be delivered, regardless of timings. Of course barring connectivity issues, in which case `do_close(forced = true)` should happen because of the error condition.
Graceful shutdown requires closing the hubconnection and any acceptor if applicable. Only then will a join() complete. Actually this needs bit more work, because one does not by default want to cut operations in the middle of sending output. I suggest giving `do_close` a bool flag `forced` to indicate whether pending write operations (operations for which we own the initiative) are to be forcibly interrupted. Existing locations to invoke `do_close` in error conditions shall supply `forced = true`. Other cases should default to `forced = false` so as to make sure that simple client programs will work as expected: ```c++ msghub msghub(io_service); msghub.connect("localhost", 1334); msghub.publish("Publish", "new message"); //msghub.join(); // implied ``` Here the message should be expected to be delivered, regardless of timings. Of course barring connectivity issues, in which case `do_close(forced = true)` should happen because of the error condition.
Even on a publish-only channel there will be an extant async_read via hubconnection.
On publishers there will be an accept loop.
Both need cancelling.
The text was updated successfully, but these errors were encountered: