Updated connect(...) with API changes for TcpStream.
This commit is contained in:
parent
f229f4ebaf
commit
8d37f71c3a
1 changed files with 1 additions and 1 deletions
|
@ -16,7 +16,7 @@ impl Connection<BufferedWriter<TcpStream>, BufferedReader<TcpStream>> {
|
||||||
/// Creates a thread-safe TCP connection to the specified server
|
/// Creates a thread-safe TCP connection to the specified server
|
||||||
#[experimental]
|
#[experimental]
|
||||||
pub fn connect(host: &str, port: u16) -> IoResult<Connection<BufferedWriter<TcpStream>, BufferedReader<TcpStream>>> {
|
pub fn connect(host: &str, port: u16) -> IoResult<Connection<BufferedWriter<TcpStream>, BufferedReader<TcpStream>>> {
|
||||||
let socket = try!(TcpStream::connect(host, port));
|
let socket = try!(TcpStream::connect(format!("{}:{}", host, port)[]));
|
||||||
Ok(Connection::new(BufferedWriter::new(socket.clone()), BufferedReader::new(socket)))
|
Ok(Connection::new(BufferedWriter::new(socket.clone()), BufferedReader::new(socket)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue