errors_errno.go 536 B

12345678910111213141516171819202122232425
  1. // +build aix darwin dragonfly freebsd linux nacl nacljs netbsd openbsd solaris windows
  2. // For systems having syscall.Errno.
  3. // Update build targets by following command:
  4. // $ grep -R ECONN $(go env GOROOT)/src/syscall/zerrors_*.go \
  5. // | tr "." "_" | cut -d"_" -f"2" | sort | uniq
  6. package dtls
  7. import (
  8. "os"
  9. "syscall"
  10. )
  11. func isOpErrorTemporary(err *os.SyscallError) bool {
  12. if ne, ok := err.Err.(syscall.Errno); ok {
  13. switch ne {
  14. case syscall.ECONNREFUSED:
  15. return true
  16. default:
  17. return false
  18. }
  19. }
  20. return false
  21. }