Setup reuse address to run the validation server more robustly
(network, address string, conn syscall.RawConn)
| 93 | |
| 94 | // Setup reuse address to run the validation server more robustly |
| 95 | func reuseAddr(network, address string, conn syscall.RawConn) error { |
| 96 | return conn.Control(func(descriptor uintptr) { |
| 97 | err := unix.SetsockoptInt(int(descriptor), unix.SOL_SOCKET, unix.SO_REUSEADDR, 1) |
| 98 | if err != nil { |
| 99 | log.Errorf("Fail to set fd %d SO_REUSEADDR with error %v", descriptor, err) |
| 100 | } |
| 101 | err = unix.SetsockoptInt(int(descriptor), unix.SOL_SOCKET, unix.SO_REUSEPORT, 1) |
| 102 | if err != nil { |
| 103 | log.Errorf("Fail to set fd %d SO_REUSEPORT with error %v", descriptor, err) |
| 104 | } |
| 105 | }) |
| 106 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…