forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#38983 - APTy:udp-peek, r=aturon
Add peek APIs to std::net Adds "peek" APIs to `std::net` sockets, including: - `UdpSocket.peek()` - `UdpSocket.peek_from()` - `TcpStream.peek()` These methods enable socket reads without side-effects. That is, repeated calls to `peek()` return identical data. This is accomplished by providing the POSIX flag `MSG_PEEK` to the underlying socket read operations. This also moves the current implementation of `recv_from` out of the platform-independent `sys_common` and into respective `sys/windows` and `sys/unix` implementations. This allows for more platform-dependent implementations where necessary. Fixes rust-lang#38980
- Loading branch information
Showing
8 changed files
with
251 additions
and
17 deletions.
There are no files selected for viewing
Submodule liblibc
updated
14 files
+2 −2 | Cargo.lock | |
+1 −1 | Cargo.toml | |
+4 −0 | src/redox.rs | |
+18 −0 | src/unix/bsd/apple/mod.rs | |
+1 −0 | src/unix/bsd/freebsdlike/dragonfly/mod.rs | |
+16 −0 | src/unix/bsd/freebsdlike/freebsd/mod.rs | |
+4 −0 | src/unix/bsd/mod.rs | |
+1 −0 | src/unix/bsd/netbsdlike/mod.rs | |
+10 −0 | src/unix/bsd/netbsdlike/netbsd/mod.rs | |
+16 −0 | src/unix/haiku/mod.rs | |
+1 −0 | src/unix/notbsd/android/mod.rs | |
+1 −0 | src/unix/notbsd/linux/mod.rs | |
+7 −0 | src/unix/notbsd/mod.rs | |
+20 −0 | src/unix/solaris/mod.rs |
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
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
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
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
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
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
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