liuxiaolong
2020-09-16 4501e38ca66f09b35aaaf43fa5a316554930fcf4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// +build !go1.11 !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd
 
package dns
 
import "net"
 
const supportsReusePort = false
 
func listenTCP(network, addr string, reuseport bool) (net.Listener, error) {
    if reuseport {
        // TODO(tmthrgd): return an error?
    }
 
    return net.Listen(network, addr)
}
 
func listenUDP(network, addr string, reuseport bool) (net.PacketConn, error) {
    if reuseport {
        // TODO(tmthrgd): return an error?
    }
 
    return net.ListenPacket(network, addr)
}