MCPcopy Create free account
hub / github.com/datastax/cql-proxy / compareIPAddr

Function compareIPAddr

proxy/proxy.go:1033–1049  ·  view source on GitHub ↗
(a *net.IPAddr, b *net.IPAddr)

Source from the content-addressed store, hash-verified

1031}
1032
1033func compareIPAddr(a *net.IPAddr, b *net.IPAddr) int {
1034 if a == b {
1035 return 0
1036 }
1037
1038 res := bytes.Compare(a.IP, b.IP)
1039 if res != 0 {
1040 return res
1041 }
1042
1043 res = strings.Compare(a.Zone, b.Zone)
1044 if res != 0 {
1045 return res
1046 }
1047
1048 return 0
1049}
1050
1051// Wrap the listener so that if it's closed in the serve loop it doesn't race with proxy Close()
1052type closeOnceListener struct {

Callers 1

buildNodesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected