TXT record method and safety check on netServiceDidResolveAddress()#3
Open
artificiel wants to merge 13 commits into
Open
TXT record method and safety check on netServiceDidResolveAddress()#3artificiel wants to merge 13 commits into
artificiel wants to merge 13 commits into
Conversation
Author
|
Added a method to set the TXT record of the mDNS service to push arbitrary data alongside the discovered services. |
Author
|
The two commits are not part of a common plan but being in the same branch github includes both... |
2bbb
reviewed
Jan 4, 2022
|
|
||
| bool ofxBonjourPublisher::setTextRecord(std::vector<std::pair<std::string, std::string>> key_values = {}) { | ||
| NSMutableDictionary * record = [NSMutableDictionary dictionary]; | ||
| for (const auto & [key, value]: key_values) [record setValue:@(value.c_str()) forKey: @(key.c_str())]; |
Owner
There was a problem hiding this comment.
this is a feature from C++17.
please rewrite as C++11 like:
for(const auto &kv : key_values) [record setValue:@(kv.second.c_str()) forKey: @(kv.first.c_str())];
Author
There was a problem hiding this comment.
hey! now that C++17 is OK, what about these? note a few more changes below.
This file contains hidden or 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
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.
Difficult to reproduce but switching network configurations can produce this odd situation (and hard crash when there is no objectAtIndex:0).