Fix concerns

This commit is contained in:
Pierre Krieger
2017-12-07 12:56:44 +01:00
parent 4881c4a6a1
commit 4f981e922d
4 changed files with 26 additions and 34 deletions

View File

@ -28,7 +28,7 @@ extern crate tokio_io;
use bytes::BytesMut;
use futures::{Stream, Sink, Future};
use swarm::Transport;
use swarm::{Transport, SimpleProtocol};
use tcp::TcpConfig;
use tokio_core::reactor::Core;
use tokio_io::codec::length_delimited;
@ -47,9 +47,9 @@ fn main() {
}
});
let with_echo = with_secio.with_simple_protocol_upgrade("/echo/1.0.0", |socket| {
let with_echo = with_secio.with_upgrade(SimpleProtocol::new("/echo/1.0.0", |socket| {
Ok(length_delimited::Framed::<_, BytesMut>::new(socket))
});
}));
let dialer = with_echo.dial(swarm::multiaddr::Multiaddr::new("/ip4/127.0.0.1/tcp/10333").unwrap())
.unwrap_or_else(|_| panic!())