]> git.lizzy.rs Git - rust.git/commit
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)
commite16243816251d66eb823ba7199259fcaac7d0deb
tree32dc563af8729e9937534e2716a035b33f903f31
parent967366e988a811ae0fb47d3ad5ce0499a1414a43
parent218d01ef3321c40b091e3b77823f8bd857e87b93
auto merge of #13919 : thomaslee/rust/thomaslee_proposed_tcpstream_open, r=alexcrichton

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.
src/liblibc/lib.rs
src/libstd/io/mod.rs