Exemple #1
0
        /// <summary>
        /// 发送下一个消息
        /// </summary>
        /// <param name="size"></param>
        /// <returns></returns>
        private bool StopSend(int size)
        {
            m_Callee.OnSockSend(this, size);

            byte[] abySendMsg = null;
            lock (s_SendinLock)
            {
                if (m_SendQueue.Count > 0)
                {
                    abySendMsg = (byte[])m_SendQueue.Dequeue();
                }
            }

            if (abySendMsg != null)
            {
                return(SendData(abySendMsg, abySendMsg.Length));
            }

            return(true);
        }
Exemple #2
0
        /// <summary>
        /// 发送下一个消息
        /// </summary>
        /// <param name="size"></param>
        /// <returns></returns>
        private bool StopSend(SendBuffer sendBuff, int size)
        {
            m_Callee.OnSockSend(this, size);
            lock (s_AsyncLockFree)
            {
                m_queueSenderBufferFree.Enqueue(sendBuff);
            }
            byte[] abySendMsg = null;
            lock (s_SendinLock)
            {
                if (m_SendQueue.Count > 0)
                {
                    abySendMsg = (byte[])m_SendQueue.Dequeue();
                }
            }

            if (abySendMsg != null)
            {
                return(SendData(abySendMsg, abySendMsg.Length));
            }

            return(true);
        }