Ejemplo n.º 1
0
        // 클라이언트로 보낼 메시지 큐
        // 큐의 사이즈가 커질 수 있으니... 메시지 통신 사이즈를 늘려야하나?
        // 큐는... 리스트 같은거라 Enqueue랑 Dequeue 동기화 안해줘도 상관없지 않나?
        public void PushBroadcastData(CruMessage msg)
        {
            if (msg == null)
            {
                throw new ArgumentNullException("parameter is null");
            }

            lock (_sendQueue)
            {
                _sendQueue.Enqueue(msg);
            }
        }
Ejemplo n.º 2
0
        // 클라이언트로부터 온 메시지들을 저장하는 큐
        public void PushReceiveData(CruMessage msg, int clientNum)
        {
            if (msg == null)
            {
                throw new ArgumentNullException("msgs is null");
            }

            lock (_receiveQueue)
            {
                _receiveQueue.Enqueue(msg);
            }
        }
Ejemplo n.º 3
0
        // SendData가 들어오면 Thread를 실행시켜주자.
        public void PushSendData(CruMessage[] msg)
        {
            if (msg == null)
            {
                throw new ArgumentNullException("parameter is null");
            }

            lock (_sendQueue)
            {
                _sendQueue.Enqueue(msg);
            }

            _sendEventControl.Set();
        }
Ejemplo n.º 4
0
        private void PushToReceiveQueue(CruMessage[] msg, int clientNum)
        {
            if (msg == null)
            {
                throw new ArgumentNullException("parameter is null");
            }

            lock (_receiveQueue)
            {
                _receiveQueue.Enqueue(msg);
            }
        }