Rename libp2p-tcp-transport to libp2p-tcp (#762)

This commit is contained in:
Pierre Krieger 2018-12-10 13:39:11 +01:00 committed by GitHub
parent 05e4a84da3
commit a8a6438fbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 34 additions and 34 deletions

View File

@ -39,7 +39,7 @@ tokio-io = "0.1"
[target.'cfg(not(target_os = "emscripten"))'.dependencies] [target.'cfg(not(target_os = "emscripten"))'.dependencies]
libp2p-dns = { path = "./transports/dns" } libp2p-dns = { path = "./transports/dns" }
libp2p-mdns = { path = "./misc/mdns" } libp2p-mdns = { path = "./misc/mdns" }
libp2p-tcp-transport = { path = "./transports/tcp" } libp2p-tcp = { path = "./transports/tcp" }
[target.'cfg(target_os = "emscripten")'.dependencies] [target.'cfg(target_os = "emscripten")'.dependencies]
stdweb = { version = "0.1.3", default-features = false } stdweb = { version = "0.1.3", default-features = false }

View File

@ -29,7 +29,7 @@ void = "1"
[dev-dependencies] [dev-dependencies]
libp2p-ping = { path = "../protocols/ping" } libp2p-ping = { path = "../protocols/ping" }
libp2p-tcp-transport = { path = "../transports/tcp" } libp2p-tcp = { path = "../transports/tcp" }
libp2p-mplex = { path = "../muxers/mplex" } libp2p-mplex = { path = "../muxers/mplex" }
rand = "0.6" rand = "0.6"
tokio = "0.1" tokio = "0.1"

View File

@ -41,13 +41,13 @@ use std::collections::VecDeque;
/// ```no_run /// ```no_run
/// # extern crate futures; /// # extern crate futures;
/// # extern crate libp2p_core; /// # extern crate libp2p_core;
/// # extern crate libp2p_tcp_transport; /// # extern crate libp2p_tcp;
/// # extern crate tokio; /// # extern crate tokio;
/// # fn main() { /// # fn main() {
/// use futures::prelude::*; /// use futures::prelude::*;
/// use libp2p_core::nodes::listeners::{ListenersEvent, ListenersStream}; /// use libp2p_core::nodes::listeners::{ListenersEvent, ListenersStream};
/// ///
/// let mut listeners = ListenersStream::new(libp2p_tcp_transport::TcpConfig::new()); /// let mut listeners = ListenersStream::new(libp2p_tcp::TcpConfig::new());
/// ///
/// // Ask the `listeners` to start listening on the given multiaddress. /// // Ask the `listeners` to start listening on the given multiaddress.
/// listeners.listen_on("/ip4/0.0.0.0/tcp/0".parse().unwrap()).unwrap(); /// listeners.listen_on("/ip4/0.0.0.0/tcp/0".parse().unwrap()).unwrap();
@ -274,7 +274,7 @@ where
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
extern crate libp2p_tcp_transport; extern crate libp2p_tcp;
use super::*; use super::*;
use transport; use transport;

View File

@ -20,5 +20,5 @@ tokio-io = "0.1"
unsigned-varint = { version = "0.2.1", features = ["codec"] } unsigned-varint = { version = "0.2.1", features = ["codec"] }
[dev-dependencies] [dev-dependencies]
libp2p-tcp-transport = { path = "../../transports/tcp" } libp2p-tcp = { path = "../../transports/tcp" }
tokio = "0.1" tokio = "0.1"

View File

@ -22,7 +22,7 @@ extern crate bytes;
extern crate futures; extern crate futures;
extern crate libp2p_mplex as multiplex; extern crate libp2p_mplex as multiplex;
extern crate libp2p_core as swarm; extern crate libp2p_core as swarm;
extern crate libp2p_tcp_transport as tcp; extern crate libp2p_tcp as tcp;
extern crate tokio; extern crate tokio;
use futures::prelude::*; use futures::prelude::*;

View File

@ -25,5 +25,5 @@ unsigned-varint = { version = "0.2.1", features = ["codec"] }
void = "1.0" void = "1.0"
[dev-dependencies] [dev-dependencies]
libp2p-tcp-transport = { path = "../../transports/tcp" } libp2p-tcp = { path = "../../transports/tcp" }
tokio = "0.1" tokio = "0.1"

View File

@ -253,12 +253,12 @@ fn parse_proto_msg(msg: BytesMut) -> Result<(IdentifyInfo, Multiaddr), IoError>
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
extern crate libp2p_tcp_transport; extern crate libp2p_tcp;
extern crate tokio; extern crate tokio;
use crate::protocol::{IdentifyInfo, RemoteInfo, IdentifyProtocolConfig}; use crate::protocol::{IdentifyInfo, RemoteInfo, IdentifyProtocolConfig};
use self::tokio::runtime::current_thread::Runtime; use self::tokio::runtime::current_thread::Runtime;
use self::libp2p_tcp_transport::TcpConfig; use self::libp2p_tcp::TcpConfig;
use futures::{Future, Stream}; use futures::{Future, Stream};
use libp2p_core::{PublicKey, Transport, upgrade::{apply_outbound, apply_inbound}}; use libp2p_core::{PublicKey, Transport, upgrade::{apply_outbound, apply_inbound}};
use std::sync::mpsc; use std::sync::mpsc;

View File

@ -32,5 +32,5 @@ unsigned-varint = { version = "0.2.1", features = ["codec"] }
void = "1.0" void = "1.0"
[dev-dependencies] [dev-dependencies]
libp2p-tcp-transport = { path = "../../transports/tcp" } libp2p-tcp = { path = "../../transports/tcp" }
tokio = "0.1" tokio = "0.1"

View File

@ -455,11 +455,11 @@ fn proto_to_resp_msg(
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
extern crate libp2p_tcp_transport; extern crate libp2p_tcp;
extern crate tokio; extern crate tokio;
/*// TODO: restore /*// TODO: restore
use self::libp2p_tcp_transport::TcpConfig; use self::libp2p_tcp::TcpConfig;
use self::tokio::runtime::current_thread::Runtime; use self::tokio::runtime::current_thread::Runtime;
use futures::{Future, Sink, Stream}; use futures::{Future, Sink, Stream};
use libp2p_core::{PeerId, PublicKey, Transport}; use libp2p_core::{PeerId, PublicKey, Transport};

View File

@ -24,6 +24,6 @@ tokio-timer = "0.2.6"
void = "1.0" void = "1.0"
[dev-dependencies] [dev-dependencies]
libp2p-tcp-transport = { path = "../../transports/tcp" } libp2p-tcp = { path = "../../transports/tcp" }
tokio = "0.1" tokio = "0.1"
tokio-tcp = "0.1" tokio-tcp = "0.1"

View File

@ -52,7 +52,7 @@
//! extern crate futures; //! extern crate futures;
//! extern crate libp2p_ping; //! extern crate libp2p_ping;
//! extern crate libp2p_core; //! extern crate libp2p_core;
//! extern crate libp2p_tcp_transport; //! extern crate libp2p_tcp;
//! extern crate tokio; //! extern crate tokio;
//! //!
//! use futures::{Future, Stream}; //! use futures::{Future, Stream};
@ -61,7 +61,7 @@
//! use tokio::runtime::current_thread::Runtime; //! use tokio::runtime::current_thread::Runtime;
//! //!
//! # fn main() { //! # fn main() {
//! let ping_dialer = libp2p_tcp_transport::TcpConfig::new() //! let ping_dialer = libp2p_tcp::TcpConfig::new()
//! .and_then(|socket, _| { //! .and_then(|socket, _| {
//! apply_outbound(socket, Ping::default()).map_err(|e| e.into_io_error()) //! apply_outbound(socket, Ping::default()).map_err(|e| e.into_io_error())
//! }) //! })

View File

@ -41,6 +41,6 @@ rsa = ["ring/rsa_signing"]
aes-all = ["aesni", "lazy_static"] aes-all = ["aesni", "lazy_static"]
[dev-dependencies] [dev-dependencies]
libp2p-tcp-transport = { path = "../../transports/tcp" } libp2p-tcp = { path = "../../transports/tcp" }
tokio = "0.1" tokio = "0.1"
tokio-tcp = "0.1" tokio-tcp = "0.1"

View File

@ -34,14 +34,14 @@
//! extern crate tokio_io; //! extern crate tokio_io;
//! extern crate libp2p_core; //! extern crate libp2p_core;
//! extern crate libp2p_secio; //! extern crate libp2p_secio;
//! extern crate libp2p_tcp_transport; //! extern crate libp2p_tcp;
//! //!
//! # fn main() { //! # fn main() {
//! use futures::Future; //! use futures::Future;
//! use libp2p_secio::{SecioConfig, SecioKeyPair, SecioOutput}; //! use libp2p_secio::{SecioConfig, SecioKeyPair, SecioOutput};
//! use libp2p_core::{Multiaddr, upgrade::apply_inbound}; //! use libp2p_core::{Multiaddr, upgrade::apply_inbound};
//! use libp2p_core::transport::Transport; //! use libp2p_core::transport::Transport;
//! use libp2p_tcp_transport::TcpConfig; //! use libp2p_tcp::TcpConfig;
//! use tokio_io::io::write_all; //! use tokio_io::io::write_all;
//! use tokio::runtime::current_thread::Runtime; //! use tokio::runtime::current_thread::Runtime;
//! //!

View File

@ -46,9 +46,9 @@
//! //!
//! ```rust //! ```rust
//! use libp2p::{Multiaddr, Transport, tcp::TcpConfig}; //! use libp2p::{Multiaddr, Transport, tcp::TcpConfig};
//! let tcp_transport = TcpConfig::new(); //! let tcp = TcpConfig::new();
//! let addr: Multiaddr = "/ip4/98.97.96.95/tcp/20500".parse().expect("invalid multiaddr"); //! let addr: Multiaddr = "/ip4/98.97.96.95/tcp/20500".parse().expect("invalid multiaddr");
//! let _outgoing_connec = tcp_transport.dial(addr); //! let _outgoing_connec = tcp.dial(addr);
//! // Note that `_outgoing_connec` is a `Future`, and therefore doesn't do anything by itself //! // Note that `_outgoing_connec` is a `Future`, and therefore doesn't do anything by itself
//! // unless it is run through a tokio runtime. //! // unless it is run through a tokio runtime.
//! ``` //! ```
@ -77,9 +77,9 @@
//! ```rust //! ```rust
//! # #[cfg(all(not(target_os = "emscripten"), feature = "libp2p-secio"))] { //! # #[cfg(all(not(target_os = "emscripten"), feature = "libp2p-secio"))] {
//! use libp2p::{Transport, tcp::TcpConfig, secio::{SecioConfig, SecioKeyPair}}; //! use libp2p::{Transport, tcp::TcpConfig, secio::{SecioConfig, SecioKeyPair}};
//! let tcp_transport = TcpConfig::new(); //! let tcp = TcpConfig::new();
//! let secio_upgrade = SecioConfig::new(SecioKeyPair::ed25519_generated().unwrap()); //! let secio_upgrade = SecioConfig::new(SecioKeyPair::ed25519_generated().unwrap());
//! let with_security = tcp_transport.with_upgrade(secio_upgrade); //! let with_security = tcp.with_upgrade(secio_upgrade);
//! // let _ = with_security.dial(...); //! // let _ = with_security.dial(...);
//! // `with_security` also implements the `Transport` trait, and all the connections opened //! // `with_security` also implements the `Transport` trait, and all the connections opened
//! // through it will automatically negotiate the `secio` protocol. //! // through it will automatically negotiate the `secio` protocol.
@ -153,7 +153,7 @@ pub extern crate libp2p_plaintext as plaintext;
pub extern crate libp2p_ratelimit as ratelimit; pub extern crate libp2p_ratelimit as ratelimit;
pub extern crate libp2p_secio as secio; pub extern crate libp2p_secio as secio;
#[cfg(not(target_os = "emscripten"))] #[cfg(not(target_os = "emscripten"))]
pub extern crate libp2p_tcp_transport as tcp; pub extern crate libp2p_tcp as tcp;
pub extern crate libp2p_transport_timeout as transport_timeout; pub extern crate libp2p_transport_timeout as transport_timeout;
pub extern crate libp2p_uds as uds; pub extern crate libp2p_uds as uds;
#[cfg(feature = "libp2p-websocket")] #[cfg(feature = "libp2p-websocket")]

View File

@ -17,5 +17,5 @@ tokio-dns-unofficial = "0.4"
tokio-io = "0.1" tokio-io = "0.1"
[dev-dependencies] [dev-dependencies]
libp2p-tcp-transport = { path = "../../transports/tcp" } libp2p-tcp = { path = "../../transports/tcp" }
tokio = "0.1" tokio = "0.1"

View File

@ -279,8 +279,8 @@ where
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
extern crate libp2p_tcp_transport; extern crate libp2p_tcp;
use self::libp2p_tcp_transport::TcpConfig; use self::libp2p_tcp::TcpConfig;
use futures::future; use futures::future;
use swarm::Transport; use swarm::Transport;
use multiaddr::{Protocol, Multiaddr}; use multiaddr::{Protocol, Multiaddr};

View File

@ -1,5 +1,5 @@
[package] [package]
name = "libp2p-tcp-transport" name = "libp2p-tcp"
description = "TCP/IP transport protocol for libp2p" description = "TCP/IP transport protocol for libp2p"
version = "0.1.0" version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]

View File

@ -27,8 +27,8 @@
//! Example: //! Example:
//! //!
//! ``` //! ```
//! extern crate libp2p_tcp_transport; //! extern crate libp2p_tcp;
//! use libp2p_tcp_transport::TcpConfig; //! use libp2p_tcp::TcpConfig;
//! //!
//! # fn main() { //! # fn main() {
//! let tcp = TcpConfig::new(); //! let tcp = TcpConfig::new();

View File

@ -23,5 +23,5 @@ websocket = { version = "0.21.0", default-features = false, features = ["async",
stdweb = { version = "0.1.3", default-features = false } stdweb = { version = "0.1.3", default-features = false }
[target.'cfg(not(target_os = "emscripten"))'.dev-dependencies] [target.'cfg(not(target_os = "emscripten"))'.dev-dependencies]
libp2p-tcp-transport = { path = "../tcp" } libp2p-tcp = { path = "../tcp" }
tokio = "0.1" tokio = "0.1"

View File

@ -258,7 +258,7 @@ fn client_addr_to_ws(client_addr: &Multiaddr, is_wss: bool) -> String {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
extern crate libp2p_tcp_transport as tcp; extern crate libp2p_tcp as tcp;
extern crate tokio; extern crate tokio;
use self::tokio::runtime::current_thread::Runtime; use self::tokio::runtime::current_thread::Runtime;
use futures::{Future, Stream}; use futures::{Future, Stream};

View File

@ -53,11 +53,11 @@
//! //!
//! ``` //! ```
//! extern crate libp2p_core; //! extern crate libp2p_core;
//! extern crate libp2p_tcp_transport; //! extern crate libp2p_tcp;
//! extern crate libp2p_websocket; //! extern crate libp2p_websocket;
//! //!
//! use libp2p_core::{Multiaddr, Transport}; //! use libp2p_core::{Multiaddr, Transport};
//! use libp2p_tcp_transport::TcpConfig; //! use libp2p_tcp::TcpConfig;
//! use libp2p_websocket::WsConfig; //! use libp2p_websocket::WsConfig;
//! //!
//! # fn main() { //! # fn main() {