Exemple #1
0
        public bool SendMessage(TMsgWrapper msg, string resAndClient)
        {
            string key = resAndClient;

            if (_resourceLookup.ContainsKey(key))
            {
                Jid userJid = _resourceLookup[key];

                // Convert the SampleMessage to a JSON string
                string jsonStr = JsonConvert.SerializeObject(msg);
                logger.Debug("Sending message - " + jsonStr);
                _xmppMsgServer.SendMessage(jsonStr, "S-" + _nextMsgId.ToString(), userJid);
                _nextMsgId++;
                return(true);
            }
            else
            {
                string err = "error, could not find attached simulation for " + resAndClient;
                logger.Error(err);
                throw new Exception(err);
            }
        }