(err error)
| 3090 | } |
| 3091 | |
| 3092 | func isShutdownError(err error) bool { |
| 3093 | if errors.Is(err, context.Canceled) { |
| 3094 | return true |
| 3095 | } |
| 3096 | if errors.Is(err, net.ErrClosed) { |
| 3097 | return true |
| 3098 | } |
| 3099 | errStr := err.Error() |
| 3100 | if strings.Contains(errStr, "use of closed network connection") { |
| 3101 | return true |
| 3102 | } |
| 3103 | if errors.Is(err, syscall.ECONNRESET) || errors.Is(err, syscall.ECONNABORTED) { |
| 3104 | return true |
| 3105 | } |
| 3106 | if strings.Contains(errStr, "connection reset by peer") { |
| 3107 | return true |
| 3108 | } |
| 3109 | // Windows-specific error patterns for connection close during shutdown |
| 3110 | if strings.Contains(errStr, "wsarecv") || strings.Contains(errStr, "wsasend") || |
| 3111 | strings.Contains(errStr, "forcibly closed by the remote host") { |
| 3112 | return true |
| 3113 | } |
| 3114 | return false |
| 3115 | } |
no test coverage detected