Skip to content

Commit

Permalink
fix(p2p): tcp sub conn add close write
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Aug 8, 2024
1 parent 4a2b6c3 commit c7cfd94
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gold/p2p/tcp/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@ func (conn *Conn) accept() {
}

func delsubs(i int, subs []*subconn) []*subconn {
tcpconn := subs[i].conn
err := tcpconn.CloseWrite()
if config.ShowDebugLog {
if err != nil {
logrus.Debugln("[tcp] close sub write from", tcpconn.LocalAddr(), "to", tcpconn.RemoteAddr(), "err:", err)
} else {
logrus.Debugln("[tcp] close sub write from", tcpconn.LocalAddr(), "to", tcpconn.RemoteAddr())
}
}
switch i {
case 0:
subs = subs[1:]
Expand Down

0 comments on commit c7cfd94

Please sign in to comment.