code: func (c *connection) readRespLoop() {
  	defer func() {
  		c.mu.Lock()
  		for _, cc := range c.respc {
  			close(cc)
  		}
  		c.respc = make(map[int32]chan []byte)
  		c.mu.Unlock()
  	}()
  
  	rd := bufio.NewReader(c.rw)
  	for {
  		if c.readTimeout > 0 {
  			err := c.rw.SetReadDeadline(time.Now().Add(c.readTimeout))
  			if err != nil {
  				c.logger.Error("msg", "SetReadDeadline failed",
  					"error", err)
  			}
  		}
  		correlationID, b, err := proto.ReadResp(rd)
  		if err != nil {
  			c.mu.Lock()
  			if c.stopErr == nil {
  				c.stopErr = err
  				close(c.stop)
  			}
  			c.mu.Unlock()
  			return
  		}
  
  		c.mu.Lock()
  		rc, ok := c.respc[correlationID]
  		delete(c.respc, correlationID)
  		c.mu.Unlock()
  		if !ok {
  			c.logger.Warn(
  				"msg", "response to unknown request",
  				"correlationID", correlationID)
  			continue
  		}
  
  		select {
  		case <-c.stop:
  			c.mu.Lock()
  			if c.stopErr == nil {
  				c.stopErr = ErrClosed
  			}
  			c.mu.Unlock()
  		case rc <- b:
  		}
  		close(rc)
  	}
  }
docs: // readRespLoop constantly reading response messages from the socket and after
  // partial parsing, sends byte representation of the whole message to request
  // sending process.