// Implements StreamServer.Close
185511
func (s *listenerStreamServer) Close() {
	if s.l == nil {
		panic("server is not currently serving")
	}

	// Mark that we've been closed.
	atomic.StoreInt32(&s.closed, 1)

	// Close our Listener. This will cause our 'Accept' goroutine to terminate.
	s.l.Close()
	close(s.closedC)
	<-s.acceptFinishedC

	// Close our streamParamsC to signal that we're closed. Any blocking Next will
	// drain the channel, then return with nil.
	close(s.streamParamsC)
	s.l = nil
}
60505
func (c *TCPClient) Close() error {
	c.t.Kill(nil)
	_ = c.t.Wait()
	close(c.requestQueue)
	err := c.conn.Close()
	return err
}
619198
func (p *Pool) Close() {
	p.mu.Lock()
	defer p.mu.Unlock()

	for _, c := range p.connections {
		p.errorChannel <- c.removeFromPool()
	}
	close(p.errorChannel)
}
249640
func (s *Stream) Close() error {
	if s.resampling != nil {
		return s.resampling.Close()
	}
	return nil
}
1227990
func (c *serviceStreams) Close() error {
	req := closeReq{
		c.myCode,
		make(chan bool, 1),
	}
	c.r.closeRequests <- req
	<-req.resp
	return nil
}
1359379
func (em *clientEventMonitor) Close() error {
	em.Lock()
	defer em.Unlock()

	if !em.active {
		return nil
	}

	crc := make(chan struct{})
	em.closeChannel <- crc

	select {
	case <-crc:
		em.active = false
		em.subscriptions = make(map[string][]*Subscription)
		em.done = make(chan struct{})
		return nil
	}

}
389096
func (srv *Server) Close() error {
	srv.mu.Lock()
	defer srv.mu.Unlock()
	srv.closeDoneChanLocked()
	err := srv.closeListenersLocked()
	for c := range srv.conns {
		c.Close()
		delete(srv.conns, c)
	}
	return err
}
1089089
func Close(pipe chan interface{}, err error) {
	if err != nil {
		pipe <- err
	}
	close(pipe)
}
1174801
func (s *Session) Close() (err error) {
	s.dieLock.Lock()

	select {
	case <-s.die:
		s.dieLock.Unlock()
		return errors.New(errBrokenPipe)
	default:
		close(s.die)
		s.dieLock.Unlock()
		err = s.conn.Close()
		s.streamLock.Lock()
		for k := range s.streams {
			s.streams[k].sessionClose()
		}
		s.streamLock.Unlock()
		return
	}
}
380612
func (w *writeCloseInformer) Close() error {
	err := w.wc.Close()
	close(w.close)
	return err
}
121398
func (rwaself *ReaderToWriterAdapter) Close() error {
	var wCloseErr error
	var rCloseErr error
	if writeCloser, ok := rwaself.writer.(io.WriteCloser); ok {
		if !rwaself.closedWriter {
			wCloseErr = writeCloser.Close()
		}
	}
	if readCloser, ok := rwaself.upstream.(io.ReadCloser); ok {
		rCloseErr = readCloser.Close()
	} else {
		rCloseErr = rwaself.drain()
	}
	if rCloseErr != nil && rCloseErr != io.EOF {
		return rCloseErr
	}
	if wCloseErr != nil && wCloseErr != io.EOF {
		return wCloseErr
	}
	return nil
}
1271013
func (d *Decoder) Close() {
	if d.current.err == ErrDecoderClosed {
		return
	}
	d.drainOutput()
	if d.stream != nil {
		close(d.stream)
		d.streamWg.Wait()
		d.stream = nil
	}
	if d.decoders != nil {
		close(d.decoders)
		for dec := range d.decoders {
			dec.Close()
		}
		d.decoders = nil
	}
	if d.current.d != nil {
		d.current.d.Close()
		d.current.d = nil
	}
	d.current.err = ErrDecoderClosed
}
579441
func (s *Server) Close() {
	s.client = nil
	s.kv = nil
	s.mu.Lock()
	defer s.mu.Unlock()
	s.locks = nil
}
1219512
func (p *Plugin) Close() error {
	if p.grpcServer != nil {
		p.grpcServer.Stop()
	}
	return nil
}
1095027
func (c *RPCClient) Close() error {
	close(c.streamTimeout)
	if raw, ok := c.MvccStore.(io.Closer); ok {
		return raw.Close()
	}
	return nil
}
897967
func (s *TrapServer) Close() error {
	s.servingMu.Lock()
	s.serving = false
	s.servingMu.Unlock()
	return s.transport.Close(nil)
}
987851
func (client *WebSocketClient) Close() {
	client.closed = true
	client.close(rpc.ErrClientIsAlreadyClosed)
}