code: func (c *Connection) retrieveMessageIDs() (err error) {
  	t := time.Now()
  
  	msgs := api.GetRegisteredMessages()
  
  	var n int
  	for name, msg := range msgs {
  		msgID, err := c.GetMessageID(msg)
  		if err != nil {
  			log.Debugf("retrieving msgID for %s failed: %v", name, err)
  			continue
  		}
  		n++
  
  		if c.pingReqID == 0 && msg.GetMessageName() == msgControlPing.GetMessageName() {
  			c.pingReqID = msgID
  			msgControlPing = reflect.New(reflect.TypeOf(msg).Elem()).Interface().(api.Message)
  		} else if c.pingReplyID == 0 && msg.GetMessageName() == msgControlPingReply.GetMessageName() {
  			c.pingReplyID = msgID
  			msgControlPingReply = reflect.New(reflect.TypeOf(msg).Elem()).Interface().(api.Message)
  		}
  
  		if debugMsgIDs {
  			log.Debugf("message %q (%s) has ID: %d", name, getMsgNameWithCrc(msg), msgID)
  		}
  	}
  	log.Debugf("retrieved %d/%d msgIDs (took %s)", n, len(msgs), time.Since(t))
  
  	return nil
  }
docs: // retrieveMessageIDs retrieves IDs for all registered messages and stores them in map