MCPcopy
hub / github.com/davyxu/cellnet / NewGenericPeer

Function NewGenericPeer

peer/peerreg.go:70–78  ·  view source on GitHub ↗

创建Peer后,设置基本属性

(peerType, name, addr string, q cellnet.EventQueue)

Source from the content-addressed store, hash-verified

68
69// 创建Peer后,设置基本属性
70func NewGenericPeer(peerType, name, addr string, q cellnet.EventQueue) cellnet.GenericPeer {
71
72 p := NewPeer(peerType)
73 gp := p.(cellnet.GenericPeer)
74 gp.SetName(name)
75 gp.SetAddress(addr)
76 gp.SetQueue(q)
77 return gp
78}

Callers 15

serverFunction · 0.92
clientFunction · 0.92
rpc_StartServerFunction · 0.92
rpc_StartClientFunction · 0.92
relay_backendFunction · 0.92
relay_agentFunction · 0.92
relay_clientFunction · 0.92
echo_StartServerFunction · 0.92
echo_StartClientFunction · 0.92
recreateConn_StartServerFunction · 0.92
runConnCloseFunction · 0.92

Calls 4

NewPeerFunction · 0.85
SetNameMethod · 0.65
SetAddressMethod · 0.65
SetQueueMethod · 0.65

Tested by 15

rpc_StartServerFunction · 0.74
rpc_StartClientFunction · 0.74
relay_backendFunction · 0.74
relay_agentFunction · 0.74
relay_clientFunction · 0.74
echo_StartServerFunction · 0.74
echo_StartClientFunction · 0.74
recreateConn_StartServerFunction · 0.74
runConnCloseFunction · 0.74
runMultiConnectionFunction · 0.74
TestPrintPageFunction · 0.74