Skip to content

Commit

Permalink
Handle temporary network errors during connection acceptance
Browse files Browse the repository at this point in the history
Signed-off-by: Max <[email protected]>
  • Loading branch information
Max committed Dec 24, 2024
1 parent 6f32efc commit be39cdf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ func ServiceConnections(listener net.Listener, p2id participant2ID, l Logger) (<
for atomic.LoadUint32(&stopFlag) == 0 {
conn, err := listener.Accept()
if err != nil {
if ne, ok := err.(net.Error); ok && ne.Temporary() {
continue
}
return
}

Expand Down

0 comments on commit be39cdf

Please sign in to comment.