We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c46343f commit 7f7d51aCopy full SHA for 7f7d51a
p2p/src/serv.rs
@@ -84,6 +84,14 @@ impl Server {
84
85
match listener.accept() {
86
Ok((stream, peer_addr)) => {
87
+ // We want out TCP stream to be in blocking mode.
88
+ // The TCP listener is in nonblocking mode so we *must* explicitly
89
+ // move the accepted TCP stream into blocking mode (or all kinds of
90
+ // bad things can and will happen).
91
+ // A nonblocking TCP listener will accept nonblocking TCP streams which
92
+ // we do not want.
93
+ stream.set_nonblocking(false)?;
94
+
95
let peer_addr = PeerAddr(peer_addr);
96
97
if self.check_undesirable(&stream) {
0 commit comments