-
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
Cmake #7
Open
sehe
wants to merge
13
commits into
di9it:master
Choose a base branch
from
sehe:cmake
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Cmake #7
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This can be important. Also, realize that destruction order is the same in reverse.
Note that there is missin error handling as the TODO already indicated
Avoid non standard code to allow portability. Made the headers into a named struct and members. Reworded most _data accesses to use `headers()` accessor.
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.
To use: cmake . make make test Run the example in separate terminals: ./examples/server ./examples/client
sehe
force-pushed
the
cmake
branch
2 times, most recently
from
February 9, 2021 22:26
4d0fa5a
to
c6c78cb
Compare
Somehow the runner was segfaulting with the CMake steps. Didn't want to find out why, instead used the default runner main with auto test suites/cases.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a Cmake for easier start-up
To use:
Run the example in separate terminals: