Skip to content

Commit

Permalink
agent: rename setsockoptReuseAddrAndPort to setReuseAddrAndPortSockopts
Browse files Browse the repository at this point in the history
  • Loading branch information
tklauser committed Oct 11, 2021
1 parent f38bd6a commit db6b6e9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion agent/agent.go
Expand Up @@ -107,7 +107,7 @@ func Listen(opts Options) error {
}
var lc net.ListenConfig
if opts.ReuseSocketAddrAndPort {
lc.Control = setsockoptReuseAddrAndPort
lc.Control = setReuseAddrAndPortSockopts
}
listener, err = lc.Listen(context.Background(), "tcp", addr)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions agent/sockopt_reuseport.go
Expand Up @@ -13,10 +13,10 @@ import (
"golang.org/x/sys/unix"
)

// setsockoptReuseAddrAndPort sets the SO_REUSEADDR and SO_REUSEPORT socket
// setReuseAddrAndPortSockopts sets the SO_REUSEADDR and SO_REUSEPORT socket
// options on c's underlying socket in order to increase the chance to re-bind()
// to the same address and port upon agent restart.
func setsockoptReuseAddrAndPort(network, address string, c syscall.RawConn) error {
func setReuseAddrAndPortSockopts(network, address string, c syscall.RawConn) error {
var soerr error
if err := c.Control(func(su uintptr) {
sock := int(su)
Expand Down
2 changes: 1 addition & 1 deletion agent/sockopt_unsupported.go
Expand Up @@ -9,6 +9,6 @@ package agent

import "syscall"

func setsockoptReuseAddrAndPort(network, address string, c syscall.RawConn) error {
func setReuseAddrAndPortSockopts(network, address string, c syscall.RawConn) error {
return nil
}

0 comments on commit db6b6e9

Please sign in to comment.