This repository has been archived by the owner on Oct 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
socket/ReadWriter: move timeout logic to a
poll(2)
syscall
Previously, we tried to use `set_read/write_timeout` methods on `UnixStream`s to set a timeout on the sockets. This worked fine everywhere, except on MacOS for some elusive reason (possibly a bug in the rust stdlib). There is an alternative way to achieve a read/write with timeouts, implemented in the timeout-readwrite crate: https://docs.rs/crate/timeout-readwrite/0.2.0/source/src/writer.rs We don’t add it as dependency, instead we specialize the interesting `poll(2)` trick to `UnixSocket` since it’s only a few lines of code. The timeout-readwrite library is Apache-2.0, the same license as our project.
- Loading branch information
1 parent
32b8d21
commit 0476708
Showing
3 changed files
with
126 additions
and
38 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,4 @@ bincode = "1.1.3" | |
tempfile = "3.0.7" | ||
vec1 = "1.1.0" | ||
proptest = "0.9.1" | ||
nix = "0.14.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters