error_unix.go 454 B

12345678910111213141516
  1. // Copyright 2018 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. //go:build aix || darwin || dragonfly || freebsd || hurd || js || linux || netbsd || openbsd || solaris
  5. package net
  6. import "syscall"
  7. func isConnError(err error) bool {
  8. if se, ok := err.(syscall.Errno); ok {
  9. return se == syscall.ECONNRESET || se == syscall.ECONNABORTED
  10. }
  11. return false
  12. }