(addr string, st transport.ServerTransport)
| 1156 | } |
| 1157 | |
| 1158 | func (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 | |
| 1175 | func (s *Server) incrCallsStarted() { |
| 1176 | s.channelz.ServerMetrics.CallsStarted.Add(1) |
no test coverage detected