github.com/pion/dtls/v2@v2.2.12/errors_errno.go (about)

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