mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-31 00:41:59 +00:00
Update muxers to edition 2018 (#788)
* Upgrade mplex to edition 2018 * Upgrade yamux to edition 2018
This commit is contained in:
@@ -18,18 +18,11 @@
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
extern crate bytes;
|
||||
extern crate futures;
|
||||
extern crate libp2p_mplex as multiplex;
|
||||
extern crate libp2p_core as swarm;
|
||||
extern crate libp2p_tcp as tcp;
|
||||
extern crate tokio;
|
||||
|
||||
use libp2p_core::{muxing, Transport};
|
||||
use libp2p_tcp::TcpConfig;
|
||||
use futures::prelude::*;
|
||||
use std::sync::{Arc, mpsc};
|
||||
use std::thread;
|
||||
use swarm::{muxing, Transport};
|
||||
use tcp::TcpConfig;
|
||||
use tokio::{
|
||||
codec::length_delimited::Builder,
|
||||
runtime::current_thread::Runtime
|
||||
@@ -43,7 +36,7 @@ fn client_to_server_outbound() {
|
||||
|
||||
let bg_thread = thread::spawn(move || {
|
||||
let transport =
|
||||
TcpConfig::new().with_upgrade(multiplex::MplexConfig::new());
|
||||
TcpConfig::new().with_upgrade(libp2p_mplex::MplexConfig::new());
|
||||
|
||||
let (listener, addr) = transport
|
||||
.listen_on("/ip4/127.0.0.1/tcp/0".parse().unwrap())
|
||||
@@ -72,7 +65,7 @@ fn client_to_server_outbound() {
|
||||
let _ = rt.block_on(future).unwrap();
|
||||
});
|
||||
|
||||
let transport = TcpConfig::new().with_upgrade(multiplex::MplexConfig::new());
|
||||
let transport = TcpConfig::new().with_upgrade(libp2p_mplex::MplexConfig::new());
|
||||
|
||||
let future = transport
|
||||
.dial(rx.recv().unwrap())
|
||||
@@ -95,7 +88,7 @@ fn client_to_server_inbound() {
|
||||
|
||||
let bg_thread = thread::spawn(move || {
|
||||
let transport =
|
||||
TcpConfig::new().with_upgrade(multiplex::MplexConfig::new());
|
||||
TcpConfig::new().with_upgrade(libp2p_mplex::MplexConfig::new());
|
||||
|
||||
let (listener, addr) = transport
|
||||
.listen_on("/ip4/127.0.0.1/tcp/0".parse().unwrap())
|
||||
@@ -124,7 +117,7 @@ fn client_to_server_inbound() {
|
||||
let _ = rt.block_on(future).unwrap();
|
||||
});
|
||||
|
||||
let transport = TcpConfig::new().with_upgrade(multiplex::MplexConfig::new());
|
||||
let transport = TcpConfig::new().with_upgrade(libp2p_mplex::MplexConfig::new());
|
||||
|
||||
let future = transport
|
||||
.dial(rx.recv().unwrap())
|
||||
|
Reference in New Issue
Block a user