MCPcopy Create free account
hub / github.com/DNAProject/DNA / ParseIPAddr

Function ParseIPAddr

p2pserver/common/p2p_common.go:161–167  ·  view source on GitHub ↗

ParseIPAddr return ip address

(s string)

Source from the content-addressed store, hash-verified

159
160//ParseIPAddr return ip address
161func ParseIPAddr(s string) (string, error) {
162 i := strings.Index(s, ":")
163 if i < 0 {
164 return "", errors.New("[p2p]split ip address error")
165 }
166 return s[:i], nil
167}
168
169//ParseIPPort return ip port
170func ParseIPPort(s string) (string, error) {

Callers 5

connectSeedsMethod · 0.92
GetAddr16Method · 0.92
startNetAcceptMethod · 0.92
IsIPInInConnRecordMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected