listen_on now returns a new Multiaddr on success

This commit is contained in:
Pierre Krieger
2017-11-24 16:10:34 +01:00
parent 2dafcdf896
commit fd7b86ddcb
3 changed files with 50 additions and 23 deletions

View File

@ -65,7 +65,7 @@ fn main() {
let future = with_echo.listen_on(swarm::multiaddr::Multiaddr::new("/ip4/0.0.0.0/tcp/10333").unwrap())
.map_err(|_| panic!())
.unwrap()
.unwrap().0
.for_each(|socket| {
loop_fn(socket, |socket| {
socket.into_future()