]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #13919 : thomaslee/rust/thomaslee_proposed_tcpstream_open, r=alexcrichton
authorbors <bors@rust-lang.org>
Tue, 13 May 2014 06:11:45 +0000 (23:11 -0700)
committerbors <bors@rust-lang.org>
Tue, 13 May 2014 06:11:45 +0000 (23:11 -0700)
Been meaning to try my hand at something like this for a while, and noticed something similar mentioned as part of #13537. The suggestion on the original ticket is to use `TcpStream::open(&str)` to pass in a host + port string, but seems a little cleaner to pass in host and port separately -- so a signature like `TcpStream::open(&str, u16)`.

Also means we can use std::io::net::addrinfo directly instead of using e.g. liburl to parse the host+port pair from a string.

One outstanding issue in this PR that I'm not entirely sure how to address: in open_timeout, the timeout_ms will apply for every A record we find associated with a hostname -- probably not the intended behavior, but I didn't want to waste my time on elaborate alternatives until the general idea was a-OKed. :)

Anyway, perhaps there are other reasons for us to prefer the original proposed syntax, but thought I'd get some thoughts on this. Maybe there are some solid reasons to prefer using liburl to do this stuff.

1  2 
src/liblibc/lib.rs
src/libstd/io/mod.rs

Simple merge
Simple merge