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 { } }
private bool AppendToOutMessageQueue(QueuedOutMessage[] msgs) { if (msgs != null && msgs.Length > 0) { foreach (QueuedOutMessage msg in msgs) { AppendToOutMessageQueue(msg); } return true; } return false; }
public bool AppendToOutMessageQueue(QueuedOutMessage msg) { return true; }
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; }