7 Commits

Author SHA1 Message Date
David Craven
b727efee13
Don't poll network unnecessarily. (#1977)
* Don't poll network unnecessarily.

* Fix ci.

* Damn tokio.

* Address review comments.

* Update deps.

* Don't drop packet if socket is not writable.

* Increase TTL and rename to `query_interval`.

* Update CHANGELOG.

Co-authored-by: Roman S. Borschel <roman@parity.io>
2021-03-02 10:18:24 +01:00
David Craven
505a17dfc2
Adds support for handling interface changes to mdns behaviour. (#1830)
* mdns: handle address changes.

* Update examples.

* Use async-io.

* Fix tokio-chat.

* Address review comments.

* Update if-watch.

* Poll interfaces correctly.

* Use socket2 and remove wasm-time.

* Update if-watch.

* Update versions and changelogs.

* Further changelog updates.

Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
Co-authored-by: Roman S. Borschel <roman@parity.io>
2020-12-03 13:30:52 +01:00
Max Inden
991f5af993 misc/mdns: Make MdnsService::new sync by using std::net::UdpSocket::bind (#1382)
* misc/mdns: Make MdnsService::new sync by using std::net::UdpSocket::bind

MdnsService uses an IP address to create a UDP socket. The address does
not need to be resolved. Therefore one can use std's UdpSocket::bind
instead of the async counterpart from async-std. As a result
MdnsService::new and MdnsService::silent don't need to be async.

* examples/mdns-passive-discovery: Don't await sync MdnsService::new

* misc/mdns/src/behaviour: Make Mdns::new sync

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-01-15 13:43:09 +01:00
Toralf Wittner
b7644722ee
Fix examples and update core-derive. (#1317) 2019-11-25 10:45:04 +01:00
Roman Borschel
eeed66707b Address edition-2018 idioms. (#929) 2019-02-11 14:58:15 +01:00
Pierre Krieger
d06eb67353
Add a mDNS network behaviour (#736)
* Move the MdnsService to a service module

* Add a Mdns behaviour

* Add a Mdns network behaviour

* Add minor documentation

* Add minor todo

* Use nat_traversal on the observed address

* Don't add self to topology

* Automatically connect to nodes we discover

* Add Debug implementations

* Fix example
2018-12-10 16:00:16 +01:00
Pierre Krieger
1b05132d6a
Add libp2p-mdns (#590)
* Add libp2p-mdns

* Fix win32

* Make compatible with Rust 1.29

* Remove mDNS on esmcripten

* Fix concerns

* More concern

* Use append_u16

* Make decode_character_string return a Cow

* Add TODO

* Don't send queries from 5353

* Fix flags

* More flags fix

* More concerns

* Fix flags

* Fix removed env_logger
2018-11-24 13:55:18 +01:00