Example #1
0
        protected void ResetKey()
        {
            m_key = Security.GenerateKey();

            NetMessageStream maker = new NetMessageStream();

            maker.WriteData(BitConverter.ToString(m_key).Replace("-", ""));

            var keyMsg = maker.CreateMessage((int)NetProtocols.ResetKey);

            keyMsg.Header.SequenceNumber = m_sequenceNumber++;
            var keyMsgBytes = keyMsg.GetBytes();

            m_socket.Send(keyMsgBytes, 0, keyMsgBytes.Length, SocketFlags.None);
        }
Example #2
0
        //#####################################################################################
        // 쓰레드 작업 함수

        protected void SendReceivedSeq()
        {
            // 정상적으로 수신했음을 알림
            NetMessageStream writer = new NetMessageStream();

            writer.WriteData(m_receivedSeqList.Count);

            foreach (int seq in m_receivedSeqList)
            {
                writer.WriteData(seq);
            }

            m_receivedSeqList.Clear();

            this.Sender.SendMessage(writer.CreateMessage((int)NetProtocols.CheckPacket));
        }