Debian Codegraph @

listen_no_socket_options.go

raw symbols SCIP
1 //go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd
2 // +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd
3
4 package dns
5
6 import (
7 "fmt"
8 "net"
9 )
10
11 const (
12 supportsReusePort = false
13 supportsReuseAddr = false
14 )
15
16 func listenTCP(network, addr string, reuseport, reuseaddr bool) (net.Listener, error) {
17 if reuseport || reuseaddr {
18 // TODO(tmthrgd): return an error?
19 }
20
21 return net.Listen(network, addr)
22 }
23
24 func listenUDP(network, addr string, reuseport, reuseaddr bool) (net.PacketConn, error) {
25 if reuseport || reuseaddr {
26 // TODO(tmthrgd): return an error?
27 }
28
29 return net.ListenPacket(network, addr)
30 }
31
32 // this is just for test compatibility
33 func checkReuseport(fd uintptr) (bool, error) {
34 return false, fmt.Errorf("not supported")
35 }
36
37 // this is just for test compatibility
38 func checkReuseaddr(fd uintptr) (bool, error) {
39 return false, fmt.Errorf("not supported")
40 }