You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

listen_no_reuseport.go 485B

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