code: func (cs *clientStore) register(info *spb.ClientInfo) (*client, error) {
  	cs.Lock()
  	defer cs.Unlock()
  	c := cs.clients[info.ID]
  	if c != nil {
  		return nil, ErrInvalidClient
  	}
  	sc, err := cs.store.AddClient(info)
  	if err != nil {
  		return nil, err
  	}
  	c = &client{info: sc, subs: make([]*subState, 0, 4)}
  	cs.clients[c.info.ID] = c
  	if len(c.info.ConnID) > 0 {
  		cs.connIDs[string(c.info.ConnID)] = c
  	}
  	delete(cs.knownInvalid, getKnownInvalidKey(info.ID, info.ConnID))
  	if cs.waitOnRegister != nil {
  		ch := cs.waitOnRegister[c.info.ID]
  		if ch != nil {
  			ch <- struct{}{}
  			delete(cs.waitOnRegister, c.info.ID)
  		}
  	}
  	return c, nil
  }
docs: // Register a new client. Returns ErrInvalidClient if client is already registered.