mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-17 02:47:51 +01:00
Sync reuseport sub-package to latest version
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# reuseport
|
||||
|
||||
This is a fork from `https://github.com/libp2p/go-reuseport`. Last sync of changes: 16.03.2021
|
||||
This is a fork from `https://github.com/libp2p/go-reuseport`. Last sync of changes: 11.10.2021
|
||||
|
||||
**NOTE:** This package REQUIRES go >= 1.11.
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build !plan9 && !windows && !wasm
|
||||
// +build !plan9,!windows,!wasm
|
||||
|
||||
package reuseport
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build wasm
|
||||
// +build wasm
|
||||
|
||||
package reuseport
|
||||
|
||||
@@ -19,9 +19,8 @@ package reuseport
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// Available returns whether or not SO_REUSEPORT or equivalent behaviour is
|
||||
@@ -54,7 +53,7 @@ func ListenPacket(network, address string) (net.PacketConn, error) {
|
||||
func Dial(network, laddr, raddr string) (net.Conn, error) {
|
||||
nla, err := ResolveAddr(network, laddr)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "resolving local addr")
|
||||
return nil, fmt.Errorf("failed to resolve local addr: %w", err)
|
||||
}
|
||||
d := net.Dialer{
|
||||
Control: Control,
|
||||
|
||||
Reference in New Issue
Block a user