Skip to content

Commit

Permalink
fix: add "windows" build tag under SO_REUSEPORT mode
Browse files Browse the repository at this point in the history
  • Loading branch information
panjf2000 committed Jun 6, 2020
1 parent c4448ff commit 7862f3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions internal/netpoll/netpoll_stub.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.

// +build !linux,!darwin,!dragonfly,!freebsd,!netbsd
// +build !linux,!darwin,!dragonfly,!freebsd,!netbsd,!windows

package netpoll

Expand All @@ -20,10 +20,10 @@ func SetKeepAlive(fd, secs int) error {

// ReusePortListenPacket returns a net.PacketConn for UDP.
func ReusePortListenPacket(proto, addr string) (net.PacketConn, error) {
return nil, errors.New("reuseport is not available")
return nil, errors.New("SO_REUSEPORT/SO_REUSEADDR is not supported on this platform")
}

// ReusePortListen returns a net.Listener for TCP.
func ReusePortListen(proto, addr string) (net.Listener, error) {
return nil, errors.New("reuseport is not available")
return nil, errors.New("SO_REUSEPORT/SO_REUSEADDR is not supported on this platform")
}
2 changes: 1 addition & 1 deletion internal/netpoll/reuseport.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.

// +build linux darwin netbsd freebsd openbsd dragonfly
// +build linux darwin netbsd freebsd openbsd dragonfly windows

package netpoll

Expand Down

0 comments on commit 7862f3e

Please sign in to comment.