diff options
Diffstat (limited to 'vendor/github.com/pion/dtls/v2/errors_errno.go')
-rw-r--r-- | vendor/github.com/pion/dtls/v2/errors_errno.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/vendor/github.com/pion/dtls/v2/errors_errno.go b/vendor/github.com/pion/dtls/v2/errors_errno.go new file mode 100644 index 0000000..a9a439b --- /dev/null +++ b/vendor/github.com/pion/dtls/v2/errors_errno.go @@ -0,0 +1,25 @@ +// +build aix darwin dragonfly freebsd linux nacl nacljs netbsd openbsd solaris windows + +// For systems having syscall.Errno. +// Update build targets by following command: +// $ grep -R ECONN $(go env GOROOT)/src/syscall/zerrors_*.go \ +// | tr "." "_" | cut -d"_" -f"2" | sort | uniq + +package dtls + +import ( + "os" + "syscall" +) + +func isOpErrorTemporary(err *os.SyscallError) bool { + if ne, ok := err.Err.(syscall.Errno); ok { + switch ne { + case syscall.ECONNREFUSED: + return true + default: + return false + } + } + return false +} |