예제 #1
0
파일: UserSock.cs 프로젝트: 56059943/test1
        /// <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);
        }
예제 #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);
        }