Пример #1
0
        public void SendAsc(QueuedOutMessage msg)
        {
            try
            {
                if (msg == null || msg.Client == null || !msg.Client.Socket.Connected || msg.Command == null)
                    return;

                ClientManager clmngr = msg.Client;
                ISocketMessage message = msg.Command;

                byte[] buf = message.GetBytes();
                msg.Length = (uint)buf.Length;
                msg.ShutdownClientAfterSend = true;
                clmngr.Socket.BeginSend(buf, 0, buf.Length, SocketFlags.None, new AsyncCallback(SendAscyCallback), msg);
            }
            catch
            {
            }
            finally { }
        }
Пример #2
0
 private bool AppendToOutMessageQueue(QueuedOutMessage[] msgs)
 {
     if (msgs != null && msgs.Length > 0)
     {
         foreach (QueuedOutMessage msg in msgs)
         {
             AppendToOutMessageQueue(msg);
         }
         return true;
     }
     return false;
 }
Пример #3
0
 public bool AppendToOutMessageQueue(QueuedOutMessage msg)
 {
     return true;
 }
Пример #4
0
 private bool AppendToOutMessageQueue(QueuedOutMessage msg)
 {
     try
     {
         if (msg == null || msg.Client == null || MsgDeliver == null || MsgDeliver.Length < 1)
             return false;
         //int idx = msg.Client.nUID % MESSAGE_DELIVER_THREADS;
         int idx = (int)(msg.Client.nUID % this._Config.SendThreads);
         if (idx >= 0 && idx < MsgDeliver.Length && MsgDeliver[idx] != null)
         {
             MsgDeliver[idx].SendAsc(msg);
         }
     }
     catch { }
     return true;
 }