Expand wildcard IP addresses in TCP transport. (#1044)

Wildcard IP addresses (e.g. 0.0.0.0) are used to listen on all host
interfaces. To report those addresses such that clients know about them
and can actually make use of them we use the `get_if_addrs` crate and
maintain a collection of addresses. We report the whole expansion at the
very beginning of the listener stream with `ListenerEvent::NewAddress`
events and add new addresses should they come to our attention.

What remains to be done is to potentially allow users to filter IP
addresses, for example the local loopback one, and to detect expired
addresses not only if a new address is discovered.
This commit is contained in:
Toralf Wittner
2019-04-11 22:51:07 +02:00
committed by GitHub
parent 6e0a38bb4a
commit 05a74aed43
5 changed files with 294 additions and 109 deletions

View File

@ -335,7 +335,7 @@ mod tests {
let transport = TcpConfig::new();
let future = transport.dial(rx.recv().unwrap().clone())
let future = transport.dial(rx.recv().unwrap())
.unwrap()
.and_then(|socket| {
apply_outbound(socket, IdentifyProtocolConfig)