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:
Toralf Wittner
2018-05-02 11:50:48 +02:00
committed by Pierre Krieger
parent 3f2b6a5238
commit d346a6f495
23 changed files with 1513 additions and 1185 deletions

View File

@ -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");