MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / RemoteIP

Method RemoteIP

p2p/peer.go:139–157  ·  view source on GitHub ↗

Return the IP from the connection RemoteAddr

()

Source from the content-addressed store, hash-verified

137
138// Return the IP from the connection RemoteAddr
139func (pc peerConn) RemoteIP() net.IP {
140 if pc.ip != nil {
141 return pc.ip
142 }
143
144 host, _, err := net.SplitHostPort(pc.conn.RemoteAddr().String())
145 if err != nil {
146 panic(err)
147 }
148
149 ips, err := net.LookupIP(host)
150 if err != nil {
151 panic(err)
152 }
153
154 pc.ip = ips[0]
155
156 return pc.ip
157}
158
159// peer implements Peer.
160//

Callers

nothing calls this directly

Calls 2

StringMethod · 0.65
RemoteAddrMethod · 0.65

Tested by

no test coverage detected