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

Method removeConn

server.go:1158–1173  ·  view source on GitHub ↗
(addr string, st transport.ServerTransport)

Source from the content-addressed store, hash-verified

1156}
1157
1158func (s *Server) removeConn(addr string, st transport.ServerTransport) {
1159 s.mu.Lock()
1160 defer s.mu.Unlock()
1161
1162 conns := s.conns[addr]
1163 if conns != nil {
1164 delete(conns, st)
1165 if len(conns) == 0 {
1166 // If the last connection for this address is being removed, also
1167 // remove the map entry corresponding to the address. This is used
1168 // in GracefulStop() when waiting for all connections to be closed.
1169 delete(s.conns, addr)
1170 }
1171 s.cv.Broadcast()
1172 }
1173}
1174
1175func (s *Server) incrCallsStarted() {
1176 s.channelz.ServerMetrics.CallsStarted.Add(1)

Callers 2

handleRawConnMethod · 0.95
ServeHTTPMethod · 0.95

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected