mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-26 00:01:33 +00:00
Refactor transport into multiple modules. (#170)
Addresses #158. Besides the refactoring, the type `EitherIncomingStream` has been removed as it is not used.
This commit is contained in:
committed by
Pierre Krieger
parent
3f2b6a5238
commit
d346a6f495
@ -32,7 +32,8 @@ extern crate tokio_io;
|
||||
use futures::future::{loop_fn, Future, IntoFuture, Loop};
|
||||
use futures::{Sink, Stream};
|
||||
use std::env;
|
||||
use swarm::{SimpleProtocol, Transport, UpgradeExt};
|
||||
use swarm::Transport;
|
||||
use swarm::upgrade::{self, SimpleProtocol, UpgradeExt};
|
||||
use tcp::TcpConfig;
|
||||
use tokio_core::reactor::Core;
|
||||
use tokio_io::AsyncRead;
|
||||
@ -61,7 +62,7 @@ fn main() {
|
||||
// On top of TCP/IP, we will use either the plaintext protocol or the secio protocol,
|
||||
// depending on which one the remote supports.
|
||||
.with_upgrade({
|
||||
let plain_text = swarm::PlainTextConfig;
|
||||
let plain_text = upgrade::PlainTextConfig;
|
||||
|
||||
let secio = {
|
||||
let private_key = include_bytes!("test-private-key.pk8");
|
||||
|
Reference in New Issue
Block a user