Skip to content

Commit

Permalink
fix: shutdown the tcpstream when we initiate to close a peer connecti…
Browse files Browse the repository at this point in the history
…on (#2288)
  • Loading branch information
garyyu authored and ignopeverell committed Jan 4, 2019
1 parent 3b44924 commit 6165c08
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion p2p/src/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use std::fs::File;
use std::io::{self, Read, Write};
use std::net::TcpStream;
use std::net::{Shutdown, TcpStream};
use std::sync::{mpsc, Arc};
use std::{cmp, thread, time};

Expand Down Expand Up @@ -291,6 +291,7 @@ fn poll<H>(
.map(|a| a.to_string())
.unwrap_or("?".to_owned())
);
let _ = conn.shutdown(Shutdown::Both);
break;
}

Expand Down

0 comments on commit 6165c08

Please sign in to comment.