mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-24 00:00:11 +02:00
return TcpStreamNew for TcpStream::connect_std (#66)
This commit is contained in:
committed by
Alex Crichton
parent
402cd3034d
commit
23a0e990d2
+3
-3
@@ -299,13 +299,13 @@ impl TcpStream {
|
||||
pub fn connect_std(stream: net::TcpStream,
|
||||
addr: &SocketAddr,
|
||||
handle: &Handle)
|
||||
-> Box<Future<Item=TcpStream, Error=io::Error> + Send>
|
||||
-> TcpStreamNew
|
||||
{
|
||||
let state = match mio::net::TcpStream::connect_stream(stream, addr) {
|
||||
let inner = match mio::net::TcpStream::connect_stream(stream, addr) {
|
||||
Ok(tcp) => TcpStream::new(tcp, handle),
|
||||
Err(e) => TcpStreamNewState::Error(e),
|
||||
};
|
||||
Box::new(state)
|
||||
TcpStreamNew { inner: inner }
|
||||
}
|
||||
|
||||
/// Test whether this stream is ready to be read or not.
|
||||
|
||||
Reference in New Issue
Block a user