code: func (nc *Conn) readLoop() {
  	// Release the wait group on exit
  	defer nc.wg.Done()
  
  	// Create a parseState if needed.
  	nc.mu.Lock()
  	if nc.ps == nil {
  		nc.ps = &parseState{}
  	}
  	nc.mu.Unlock()
  
  	// Stack based buffer.
  	b := make([]byte, defaultBufSize)
  
  	for {
  		// ps is thread safe, so RLock is okay
  		nc.mu.RLock()
  		sb := nc.isClosed() || nc.isReconnecting()
  		if sb {
  			nc.ps = &parseState{}
  		}
  		conn := nc.conn
  		nc.mu.RUnlock()
  
  		if sb || conn == nil {
  			break
  		}
  
  		n, err := conn.Read(b)
  		if err != nil {
  			nc.processOpErr(err)
  			break
  		}
  		if err := nc.parse(b[:n]); err != nil {
  			nc.processOpErr(err)
  			break
  		}
  	}
  	// Clear the parseState here..
  	nc.mu.Lock()
  	nc.ps = nil
  	nc.mu.Unlock()
  }
docs: // readLoop() will sit on the socket reading and processing the
  // protocol from the server. It will dispatch appropriately based
  // on the op type.