code: func newXmppGcmClient(senderID string, apiKey string) (*xmppGcmClient, error) {
  	xmppClients.Lock()
  	defer xmppClients.Unlock()
  	if xc, ok := xmppClients.m[senderID]; ok {
  		return xc, nil
  	}
  
  	nc, err := xmpp.NewClient(xmppAddress, xmppUser(senderID), apiKey, DebugMode)
  	if err != nil {
  		return nil, fmt.Errorf("error connecting client>%v", err)
  	}
  
  	xc := &xmppGcmClient{
  		XmppClient: *nc,
  		messages: struct {
  			sync.RWMutex
  			m map[string]*messageLogEntry
  		}{
  			m: make(map[string]*messageLogEntry),
  		},
  		senderID: senderID,
  	}
  
  	xmppClients.m[senderID] = xc
  	return xc, nil
  }
docs: // Factory method for xmppGcmClient, to minimize the number of clients to one per sender id.
  // TODO(silvano): this could be revised, taking into account that we cannot have more than 1000
  // connections per senderId.