예제 #1
0
        //-------------------------------------------------------------------------------

        //--- Send message  -------------------------------------------------------------
        public void SendSingleMessage(cMessageData msg)
        {
            try
            {
                isSending = true;
                ClientChannel.BeginSendSingleMessage(msg, new AsyncCallback(EndSendSingleMessage), null);
            }
            catch (Exception ex)
            {
                isSending = false;
                OnFault();
            }
        }
예제 #2
0
        private void createNewMessage(string text)
        {
            cMessageData msg = new cMessageData
            {
                msgDate = DateTime.Now,
                msgNum  = staticMsgNum++,
                msgText = text
            };

            msgArhive.Add(msg);

            if (IsLogEnabled)
            {
                LOG.addMessageToLog(msg.msgToString());
            }

            if (IsSpamEnabled)
            {
                foreach (MDSClient c in Clients.Values.ToArray())
                {
                    c.SendSingleMessage(msg);
                }
            }
        }