Skip to content

Commit d5495aa

Browse files
committed
doc update
1 parent 28985ea commit d5495aa

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

library/std/src/net/tcp.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ use crate::time::Duration;
5353
/// Ok(())
5454
/// } // the stream is closed here
5555
/// ```
56+
///
57+
/// # SIGPIPE
58+
///
59+
/// Writes to the underlying socket in `SOCK_STREAM` mode are made with `MSG_NOSIGNAL` flag.
60+
/// This suppresses the emission of the `SIGPIPE` signal when writing to disconnected socket.
61+
/// In some cases getting a `SIGPIPE` would trigger process termination.
5662
#[stable(feature = "rust1", since = "1.0.0")]
5763
pub struct TcpStream(net_imp::TcpStream);
5864

library/std/src/os/unix/net/stream.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ use crate::time::Duration;
6262
/// Ok(())
6363
/// }
6464
/// ```
65+
///
66+
/// # SIGPIPE
67+
///
68+
/// Writes to the underlying socket in `SOCK_STREAM` mode are made with `MSG_NOSIGNAL` flag.
69+
/// This suppresses the emission of the `SIGPIPE` signal when writing to disconnected socket.
70+
/// In some cases getting a `SIGPIPE` would trigger process termination.
6571
#[stable(feature = "unix_socket", since = "1.10.0")]
6672
pub struct UnixStream(pub(super) Socket);
6773

0 commit comments

Comments
 (0)