MCPcopy
hub / github.com/grpc/grpc-go / RegisterSocket

Function RegisterSocket

internal/channelz/funcs.go:190–196  ·  view source on GitHub ↗

RegisterSocket registers the given normal socket s in channelz database with ref as its reference name, and adds it to the child list of its parent (identified by skt.Parent, which must be set). It returns the unique channelz tracking id assigned to this normal socket. If channelz is not turned ON,

(skt *Socket)

Source from the content-addressed store, hash-verified

188//
189// If channelz is not turned ON, the channelz database is not mutated.
190func RegisterSocket(skt *Socket) *Socket {
191 skt.ID = IDGen.genID()
192 if IsOn() {
193 db.addSocket(skt)
194 }
195 return skt
196}
197
198// RemoveEntry removes an entry with unique channelz tracking id to be id from
199// channelz database.

Callers 9

ServeMethod · 0.92
NewServerTransportFunction · 0.92
NewHTTP2ClientFunction · 0.92
TestGetServerSocketsMethod · 0.92
TestGetSubChannelMethod · 0.92
TestGetSocketMethod · 0.92
TestGetSocketOptionsMethod · 0.92

Calls 3

IsOnFunction · 0.85
genIDMethod · 0.80
addSocketMethod · 0.80

Tested by 6

TestGetServerSocketsMethod · 0.74
TestGetSubChannelMethod · 0.74
TestGetSocketMethod · 0.74
TestGetSocketOptionsMethod · 0.74