about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-04-19 00:56:30 -0700
committerbors <bors@rust-lang.org>2014-04-19 00:56:30 -0700
commit158e0c86fe6c4db2d1dde8da156ce58aaf319dc4 (patch)
tree453907889bbb6913dbc8c6686cfab9fd93acfe3c /src/libstd/rt
parent5a2ecb828bec0465a801b8c843f928ddccb2228f (diff)
parent3915e17cd70e2d584726364851d368badb8bf15b (diff)
downloadrust-158e0c86fe6c4db2d1dde8da156ce58aaf319dc4.tar.gz
rust-158e0c86fe6c4db2d1dde8da156ce58aaf319dc4.zip
auto merge of #13604 : alexcrichton/rust/connect-timeout, r=brson
This adds a `TcpStream::connect_timeout` function in order to assist opening
connections with a timeout (cc #13523). There isn't really much design space for
this specific operation (unlike timing out normal blocking reads/writes), so I
am fairly confident that this is the correct interface for this function.

The function is marked #[experimental] because it takes a u64 timeout argument,
and the u64 type is likely to change in the future.
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/rtio.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstd/rt/rtio.rs b/src/libstd/rt/rtio.rs
index cc8356d2b9a..0f3fc9c21ce 100644
--- a/src/libstd/rt/rtio.rs
+++ b/src/libstd/rt/rtio.rs
@@ -146,7 +146,8 @@ impl<'a> LocalIo<'a> {
 
 pub trait IoFactory {
     // networking
-    fn tcp_connect(&mut self, addr: SocketAddr) -> IoResult<~RtioTcpStream:Send>;
+    fn tcp_connect(&mut self, addr: SocketAddr,
+                   timeout: Option<u64>) -> IoResult<~RtioTcpStream:Send>;
     fn tcp_bind(&mut self, addr: SocketAddr) -> IoResult<~RtioTcpListener:Send>;
     fn udp_bind(&mut self, addr: SocketAddr) -> IoResult<~RtioUdpSocket:Send>;
     fn unix_bind(&mut self, path: &CString)