[magneticod] detect UDP socket closure reliably

This commit is contained in:
Bora M. Alper 2019-05-19 17:23:55 +01:00
parent 738e5c1e0f
commit 061aff8ddc
No known key found for this signature in database
GPG Key ID: 8F1A9504E1BD114D

View File

@ -94,7 +94,8 @@ func (t *Transport) readMessages() {
zap.L().Warn("READ CONGESTION!", zap.Error(err)) zap.L().Warn("READ CONGESTION!", zap.Error(err))
t.onCongestion() t.onCongestion()
} else if err != nil { } else if err != nil {
zap.L().Warn("Could NOT read an UDP packet!", zap.Error(err)) // Socket is probably closed
break
} }
if n == 0 { if n == 0 {