-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add mDNS client #7
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
cda0d64
Add a mDNS package
sgjesse 5242a77
Fix warning and hint int test
sgjesse 8394100
Correct two typos.
karlklose 3147614
Extend the mDNS package with a native extension used on Mac OS
sgjesse 1aecdd0
Revert "Extend the mDNS package with a native extension used on Mac OS"
sgjesse b753a49
Re-land "Extend the mDNS package with a native extension used on Mac OS"
sgjesse bd21b36
Improve resource record implementation in the mdns package.
karlklose 5eae734
Minor fixes to the mDNS package
sgjesse be10902
Update the mDNS command line tools in the mdns package
sgjesse 67e73fc
Update the mDNS native extension for Mac OS to handle PTR and SRV rec…
sgjesse 51c2879
Add multiple results and timeout handling to the Mac OS mDNS native e…
sgjesse 8ba84d1
Add mDNS discovery to the Fletch compiler
sgjesse 2b2fe61
Avoid a warning due to bug in Dart SDK
sgjesse afd0ffa
Update project authors statements to Dartino
mit-mit 27e32bb
Rename fletch -> dartino
ricowind a02b198
Update Dart binaries to 1.18.0-dev.4.4
karlklose 372e481
Move the serial_port native code
sgjesse 13440cc
Initial refactor/adding of mdns
dnfield a062a28
Initial refactor/adding of mdns
dnfield 0a158b2
move helper methods to tool/
dnfield cf98f1f
update docs, add example
dnfield 2d8f0ab
merge
dnfield f962358
remove RRType.any - not ready
dnfield a223011
README
dnfield 1ae7747
remove lint ignore, update CI
dnfield 8a711b9
update CI for non-flutter packages
dnfield 60f3635
update regex
dnfield a935aee
revert incremental_build.sh
dnfield 4aba212
Update docs, expose multicast parameter
dnfield cefc13b
fix tests, run analyze first
dnfield dcf69e4
Fix readme for mDNS
dnfield 2c09d26
move bin to example, remove args from main pubspec
dnfield d0071bd
Update example
dnfield af7a0df
Remove collection dep
dnfield 14826cb
Fix unintentional change to Palette, avoid abbreviations, real hash c…
dnfield f3a79a8
vertical alignment
dnfield b9572ba
dartfmt and remove all references to args package
dnfield 9dbb4dd
cleanup
dnfield 5bcabe2
typo, word wrap
dnfield 1961d9f
Add type parameters
dnfield 0eb9bc1
Update examples to use type parameters
dnfield d379223
minor fixes
dnfield 8d3c4e2
Merge remote-tracking branch 'upstream/master'
dnfield 64902f4
remvoe debugging cde
dnfield b8251d9
move dumpDatagram to tools
dnfield 2ad7aea
format
dnfield 09b47d2
Set socket options
dnfield 0962e7d
bump
dnfield 3d2f2a4
update version constraint, fix analyzer issues
dnfield 4a0974d
Merge remote-tracking branch 'upstream/master'
dnfield de88b93
Fix cache, var names, comments
dnfield 3602baa
one missed comment
dnfield bceebbd
missed renames
dnfield b5b1d4e
formatting
dnfield 554ac6f
missing comment
dnfield File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update example
- Loading branch information
commit d0071bde0b4a02503ce3d7fb9b6d97a52f6b1d04
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,11 @@ void main() async { | |
| // other mDNS queries are running elsewhere on the machine. | ||
| await for (SrvResourceRecord srv | ||
| in client.lookup(RRType.srv, ptr.domainName)) { | ||
| print('Dart obvservatory instance found at ${srv.target}:${srv.port}.'); | ||
| // Domain name will be something like "[email protected]._dartobservatory._tcp.local" | ||
| final String bundleId = | ||
| ptr.domainName.substring(0, ptr.domainName.indexOf('@')); | ||
| print( | ||
| 'Dart obvservatory instance found at ${srv.target}:${srv.port} for "$bundleId".'); | ||
dnfield marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
| client.stop(); | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more crazy formatting...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would you have it do? The formatter doesn't split string literals, so it has to make the best it can with what you give it. The right answer in most cases is to split the string literal into two adjacent strings and it will then format this better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In both cases I would override the preferred line width and not wrap.
Specifically, I would have two line widths. One would be the hard limit. If something doesn't exceed the hard limit, it wouldn't wrap it. If it does, then it would wrap it to the soft limit.
Also, if these exceeded the wrap limit, in the line 27 case I would wrap inside the expression, not after the
=(i.e. do what it would do with a trailing comma), and in the line 29 case I would either split the string (why should the formatter not do that? IMHO it should totally do that, especially if the string has a literal\nin it! that's a perfect place to wrap. Not that it helps here), or I would similarly act as if there was a trailing comma.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well FWIW, I've now split the string manually into two so this looks a little better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a reasonable preference. I personally go back and forth on whether splitting around
=is useful. Some LHS sides get really long (think calling very long setters), so it turns out to be useful and more users seem to be happy with the results.One of the goals of the formatter is to be "reversible" as much as possible. So if you:
Make a change to some code.
Format it.
Undo the change.
Format it again.
You get back to the original code. The formatter doesn't unsplit adjacent strings, and I think that's a good thing — users often use adjacent strings because they specifically want the split to be right where they put it. So if the formatter did split strings then in step 2 above, it could split a string, but then in step 4, it wouldn't put it back together again.