We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
get_socket_nosigpipe
1 parent 1a9d129 commit 5e5c046Copy full SHA for 5e5c046
tests/net/sockopt.rs
@@ -177,6 +177,14 @@ fn test_sockopts_socket(s: &OwnedFd) {
177
sockopt::set_socket_incoming_cpu(&s, 3).unwrap();
178
assert_eq!(sockopt::get_socket_incoming_cpu(&s).unwrap(), 3);
179
}
180
+
181
+ // Check the initial value of SO_NOSIGPIPE, set it, and check it.
182
+ #[cfg(any(apple, freebsdlike, target_os = "netbsd"))]
183
+ {
184
+ assert_eq!(sockopt::get_socket_nosigpipe(&s).unwrap(), false);
185
+ sockopt::set_socket_nosigpipe(&s, true).unwrap();
186
+ assert_eq!(sockopt::get_socket_nosigpipe(&s).unwrap(), true);
187
+ }
188
189
190
// Test `tcp` socket options.
0 commit comments