Trait p2p::TcpStreamExt [−][src]
pub trait TcpStreamExt { fn connect_reusable(
bind_addr: &SocketAddr,
addr: &SocketAddr,
handle: &Handle
) -> BoxFuture<TcpStream, ConnectReusableError>; fn rendezvous_connect<C>(
channel: C,
handle: &Handle,
mc: &P2p
) -> TcpRendezvousConnect<C>
where
C: Stream<Item = Bytes>,
C: Sink<SinkItem = Bytes>,
<C as Stream>::Error: Debug,
<C as Sink>::SinkError: Debug,
C: 'static; }
Extension methods for TcpStream
.
Required Methods
fn connect_reusable(
bind_addr: &SocketAddr,
addr: &SocketAddr,
handle: &Handle
) -> BoxFuture<TcpStream, ConnectReusableError>
bind_addr: &SocketAddr,
addr: &SocketAddr,
handle: &Handle
) -> BoxFuture<TcpStream, ConnectReusableError>
Connect to addr
using a reusably-bound socket, bound to bind_addr
. This can be used to
create multiple TCP connections with the same local address, or with the same local address
as a reusably-bound TcpListener
.
fn rendezvous_connect<C>(
channel: C,
handle: &Handle,
mc: &P2p
) -> TcpRendezvousConnect<C> where
C: Stream<Item = Bytes>,
C: Sink<SinkItem = Bytes>,
<C as Stream>::Error: Debug,
<C as Sink>::SinkError: Debug,
C: 'static,
channel: C,
handle: &Handle,
mc: &P2p
) -> TcpRendezvousConnect<C> where
C: Stream<Item = Bytes>,
C: Sink<SinkItem = Bytes>,
<C as Stream>::Error: Debug,
<C as Sink>::SinkError: Debug,
C: 'static,
Perform a TCP rendezvous connect. Both peers must call this method simultaneously in order
to form one TCP connection, connected from both ends. channel
must provide a channel
through which the two connecting peers can communicate with each other out-of-band while
negotiating the connection.
Implementations on Foreign Types
impl TcpStreamExt for TcpStream
[src]
impl TcpStreamExt for TcpStream
fn connect_reusable(
bind_addr: &SocketAddr,
addr: &SocketAddr,
handle: &Handle
) -> BoxFuture<TcpStream, ConnectReusableError>
[src]
fn connect_reusable(
bind_addr: &SocketAddr,
addr: &SocketAddr,
handle: &Handle
) -> BoxFuture<TcpStream, ConnectReusableError>
fn rendezvous_connect<C>(
channel: C,
handle: &Handle,
mc: &P2p
) -> TcpRendezvousConnect<C> where
C: Stream<Item = Bytes>,
C: Sink<SinkItem = Bytes>,
<C as Stream>::Error: Debug,
<C as Sink>::SinkError: Debug,
C: 'static,
[src]
fn rendezvous_connect<C>(
channel: C,
handle: &Handle,
mc: &P2p
) -> TcpRendezvousConnect<C> where
C: Stream<Item = Bytes>,
C: Sink<SinkItem = Bytes>,
<C as Stream>::Error: Debug,
<C as Sink>::SinkError: Debug,
C: 'static,