net: debug_assert on creating a tokio socket from a blocking one (#7166)

See #5595 and #7172.

This adds a debug assertion that checks that a supplied underlying std socket is set to nonblocking mode when constructing a tokio socket object from such an object.

This only works on unix.
This commit is contained in:
Noah Kennedy
2025-03-05 18:10:30 +00:00
committed by GitHub
parent 0284d1b5c8
commit 042433cdcc
13 changed files with 101 additions and 3 deletions
+1
View File
@@ -23,6 +23,7 @@ unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(fuzzing)',
'cfg(loom)',
'cfg(mio_unsupported_force_poll_poll)',
'cfg(tokio_allow_from_blocking_fd)',
'cfg(tokio_internal_mt_counters)',
'cfg(tokio_no_parking_lot)',
'cfg(tokio_no_tuning_tests)',