-
Notifications
You must be signed in to change notification settings - Fork 37
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
Bumped to futures 0.3 / tokio 0.2 and rust 2018 edition #3
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
659b840
Upgrading to new tokio / futures and rust 2018 edition.
ryansroberts 5ce1a0e
Remove handle stuff from interface
ryansroberts a875d22
Fix examples
ryansroberts 456c010
Fix examples
ryansroberts 0a6b884
No need for this to be async other than to force runtime
ryansroberts 5a8b5b3
Add builder, conditional v4 / v6
ryansroberts c36531a
Log fsm init, remove v6 from example
ryansroberts 1ef93ec
Edge triggered, so must poll recv until done, oops
ryansroberts 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
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,23 +2,25 @@ | |
name = "libmdns" | ||
version = "0.2.4" | ||
authors = ["Will Stott <[email protected]>"] | ||
|
||
description = "mDNS Responder library for building discoverable LAN services in Rust" | ||
repository = "https://github.com/librespot-org/libmdns" | ||
readme = "README.md" | ||
license = "MIT" | ||
edition = "2018" | ||
|
||
[dependencies] | ||
byteorder = "1.2" | ||
futures = "0.1" | ||
get_if_addrs = "0.5" | ||
hostname = "0.2" | ||
log = "0.4" | ||
multimap = "0.4" | ||
net2 = "0.2" | ||
rand = "0.5" | ||
tokio-core = "0.1" | ||
quick-error = "1.2" | ||
byteorder = "1.3.4" | ||
futures = "0.3.4" | ||
get_if_addrs = "0.5.3" | ||
hostname = "0.3.1" | ||
log = "0.4.8" | ||
multimap = "0.8.0" | ||
net2 = "0.2.33" | ||
rand = "0.7.3" | ||
tokio = { version = "0.2.13", features = ["udp","stream","io-driver","io-std","macros","signal"] } | ||
quick-error = "1.2.3" | ||
pin-project = "0.4.8" | ||
|
||
|
||
[dev-dependencies] | ||
env_logger = "0.5" | ||
env_logger = "0.7.1" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
extern crate env_logger; | ||
extern crate libmdns; | ||
use env_logger; | ||
use libmdns; | ||
|
||
pub fn main() { | ||
#[tokio::main] | ||
pub async fn main() { | ||
env_logger::init(); | ||
|
||
let responder = libmdns::Responder::new().unwrap(); | ||
let responder = libmdns::Responder::builder().use_v6(false).build().unwrap(); | ||
|
||
let _svc = responder.register( | ||
"_http._tcp".to_owned(), | ||
"libmdns Web Server".to_owned(), | ||
80, | ||
&["path=/"], | ||
); | ||
|
||
loop { | ||
::std::thread::sleep(::std::time::Duration::from_secs(10)); | ||
} | ||
tokio::signal::ctrl_c().await.unwrap(); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
merge_derives=true | ||
merge_imports=true | ||
normalize_comments=true | ||
reorder_impl_items=true | ||
reorder_modules=true | ||
use_try_shorthand=true | ||
use_field_init_shorthand=true |
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
Oops, something went wrong.
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.
If we want to add more options, what do you think about a Builder for each service? Then extending the options for each published Service instead.