errors_errno.go 666 B

12345678910111213141516171819202122
  1. // SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
  2. // SPDX-License-Identifier: MIT
  3. //go:build aix || darwin || dragonfly || freebsd || linux || nacl || nacljs || netbsd || openbsd || solaris || windows
  4. // +build aix darwin dragonfly freebsd linux nacl nacljs netbsd openbsd solaris windows
  5. // For systems having syscall.Errno.
  6. // Update build targets by following command:
  7. // $ grep -R ECONN $(go env GOROOT)/src/syscall/zerrors_*.go \
  8. // | tr "." "_" | cut -d"_" -f"2" | sort | uniq
  9. package dtls
  10. import (
  11. "errors"
  12. "os"
  13. "syscall"
  14. )
  15. func isOpErrorTemporary(err *os.SyscallError) bool {
  16. return errors.Is(err.Err, syscall.ECONNREFUSED)
  17. }