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

Method Start

p2p/peer_test.go:168–183  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

166}
167
168func (rp *remotePeer) Start() {
169 if rp.listenAddr == "" {
170 rp.listenAddr = "127.0.0.1:0"
171 }
172
173 l, e := net.Listen("tcp", rp.listenAddr) // any available address
174 if e != nil {
175 golog.Fatalf("net.Listen tcp :0: %+v", e)
176 }
177 rp.listener = l
178 rp.addr = NewNetAddress(PubKeyToID(rp.PrivKey.PubKey()), l.Addr())
179 if rp.channels == nil {
180 rp.channels = []byte{testCh}
181 }
182 go rp.accept()
183}
184
185func (rp *remotePeer) Stop() {
186 rp.listener.Close()

Calls 6

acceptMethod · 0.95
NewNetAddressFunction · 0.85
PubKeyToIDFunction · 0.85
ListenMethod · 0.65
PubKeyMethod · 0.65
AddrMethod · 0.45

Tested by

no test coverage detected