about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-04-21 20:30:07 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-04-23 19:07:31 -0700
commite5d3e5180f667f8850cdd96af60fc5511746b1bd (patch)
treeb960b71ae8310007eabf6e2565173f7081cab267 /src/rustllvm/RustWrapper.cpp
parentbb580f1a56138bd5a96ccc95c0f61caab72cf975 (diff)
downloadrust-e5d3e5180f667f8850cdd96af60fc5511746b1bd.tar.gz
rust-e5d3e5180f667f8850cdd96af60fc5511746b1bd.zip
std: Add support for an accept() timeout
This adds experimental support for timeouts when accepting sockets through
`TcpAcceptor::accept`. This does not add a separate `accept_timeout` function,
but rather it adds a `set_timeout` function instead. This second function is
intended to be used as a hard deadline after which all accepts will never block
and fail immediately.

This idea was derived from Go's SetDeadline() methods. We do not currently have
a robust time abstraction in the standard library, so I opted to have the
argument be a relative time in millseconds into the future. I believe a more
appropriate argument type is an absolute time, but this concept does not exist
yet (this is also why the function is marked #[experimental]).

The native support is built on select(), similarly to connect_timeout(), and the
green support is based on channel select and a timer.

cc #13523
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions