github.com/angenalZZZ/gofunc@v0.0.0-20210507121333-48ff1be3917b/net/internal/netpoll/netpoll_stub.go (about)

     1  // +build !linux,!darwin,!dragonfly,!freebsd,!netbsd,!windows
     2  
     3  package netpoll
     4  
     5  import (
     6  	"errors"
     7  	nt "net"
     8  )
     9  
    10  // SetKeepAlive sets the keepalive for the connection.
    11  func SetKeepAlive(fd, secs int) error {
    12  	// OpenBSD has no user-settable per-socket TCP keepalive options.
    13  	return nil
    14  }
    15  
    16  // ReusePortListenPacket returns a net.PacketConn for UDP.
    17  func ReusePortListenPacket(proto, addr string) (nt.PacketConn, error) {
    18  	return nil, errors.New("SO_REUSEPORT/SO_REUSEADDR is not supported on this platform")
    19  }
    20  
    21  // ReusePortListen returns a net.Listener for TCP.
    22  func ReusePortListen(proto, addr string) (nt.Listener, error) {
    23  	return nil, errors.New("SO_REUSEPORT/SO_REUSEADDR is not supported on this platform")
    24  }