示例#1
0
        private void OnConnet(object sender, AsyncSocketConnectionEventArgs e)
        {
            K_TO_M_CHANNEL_IDX p = new K_TO_M_CHANNEL_IDX();

            p.num  = (byte)PACKET_IDX.KM_CHANNEL_IDX;
            p.len  = (Int16)Marshal.SizeOf(p);
            p.nIdx = crawleridx_;
            byte[] sendbuffer = new byte[p.len];
            PacketProcess.Serialize(p, sendbuffer);
            ((AsyncSocketClient)sender).Send(sendbuffer);
        }
示例#2
0
        private void OnConnet(object sender, AsyncSocketConnectionEventArgs e)
        {
            NewLogManager2.Instance.Log("연결 되었습니다.");
            C_TO_M_CHANNEL_IDX p = new C_TO_M_CHANNEL_IDX();

            p.num  = (byte)PACKET_IDX.CM_CHANNEL_IDX;
            p.len  = (Int16)Marshal.SizeOf(p);
            p.nIdx = CINIManager.Instance.channelseq_;

            byte[] sendbuffer = new byte[p.len];
            PacketProcess.Serialize(p, sendbuffer);
            ((AsyncSocketClient)sender).Send(sendbuffer);
        }
示例#3
0
        private void OnConnet(object sender, AsyncSocketConnectionEventArgs e)
        {
            LogManager.Instance.Log("private void OnConnet(object sender, AsyncSocketConnectionEventArgs e)");
            LQCrawlerInfo      pInfo = CrawlerManager.Instance.GetCrawlerInfo();
            C_TO_M_CHANNEL_IDX p     = new C_TO_M_CHANNEL_IDX();

            p.num = (byte)PACKET_IDX.CM_CHANNEL_IDX;
            p.len = (Int16)Marshal.SizeOf(p);
            //p.nIdx = CrawlerInfoManager.Instance.channelidx_;
            p.nIdx = pInfo.nIdx_;

            byte[] sendbuffer = new byte[p.len];
            PacketProcess.Serialize(p, sendbuffer);
            ((AsyncSocketClient)sender).Send(sendbuffer);
        }
示例#4
0
        // 체커로의 연결을 확인
        void CheckChecker()
        {
            //LogManager.Instance.Log("체커 연결 확인");

            bool bNeedConnection = false;

            if (checker_socket_ == null)
            {
                bNeedConnection = true;
            }
            else
            {
                if (checker_socket_.Connection == null)
                {
                    bNeedConnection = true;
                }
                else
                {
                    if (checker_socket_.Connection.Connected == false)
                    {
                        bNeedConnection = true;
                    }
                    else
                    {
                        LQCrawlerInfo    pInfo = CrawlerManager.Instance.GetCrawlerInfo();
                        C_TO_K_HEARTBEAT p     = new C_TO_K_HEARTBEAT();
                        p.num           = (byte)PACKET_IDX.CK_HEARTBEAT;
                        p.len           = (Int16)Marshal.SizeOf(p);
                        p.CrawlingCount = CrawlerManager.Instance.CrawlingCount();
                        byte[] sendbuffer = new byte[p.len];
                        PacketProcess.Serialize(p, sendbuffer);
                        checker_socket_.Send(sendbuffer);
                    }
                }
            }

            if (bNeedConnection == true)
            {
                CheckerConnect();
            }
        }
示例#5
0
        void Connection_Function(object sender, DoWorkEventArgs e)
        {
            bool bNeedConnection = false;

            if (manager_socket_ == null)
            {
                bNeedConnection = true;
            }
            else
            {
                if (manager_socket_.Connection == null)
                {
                    bNeedConnection = true;
                }
                else
                {
                    if (manager_socket_.Connection.Connected == false)
                    {
                        bNeedConnection = true;
                    }
                    else
                    {
                        K_TO_M_CHANNEL_IDX p = new K_TO_M_CHANNEL_IDX();
                        p.num  = (byte)PACKET_IDX.KM_CHANNEL_IDX;
                        p.len  = (Int16)Marshal.SizeOf(p);
                        p.nIdx = crawleridx_;
                        //p.nChannelIdx = InfoManager.Instance.channelidx_;
                        byte[] sendbuffer = new byte[p.len];
                        PacketProcess.Serialize(p, sendbuffer);
                        ((AsyncSocketClient)sender).Send(sendbuffer);
                    }
                }
            }

            if (bNeedConnection == true)
            {
                ServerConnect();
            }
        }
示例#6
0
        // 매니저의 연결을 확인
        void CheckManager()
        {
            bool bNeedConnection = false;

            if (manager_socket_ == null)
            {
                bNeedConnection = true;
            }
            else
            {
                if (manager_socket_.Connection == null)
                {
                    bNeedConnection = true;
                }
                else
                {
                    if (manager_socket_.Connection.Connected == false)
                    {
                        bNeedConnection = true;
                    }
                    else
                    {
                        LQCrawlerInfo      pInfo = CrawlerManager.Instance.GetCrawlerInfo();
                        C_TO_M_CHANNEL_IDX p     = new C_TO_M_CHANNEL_IDX();
                        p.num  = (byte)PACKET_IDX.CM_CHANNEL_IDX;
                        p.len  = (Int16)Marshal.SizeOf(p);
                        p.nIdx = pInfo.nIdx_;
                        byte[] sendbuffer = new byte[p.len];
                        PacketProcess.Serialize(p, sendbuffer);
                        manager_socket_.Send(sendbuffer);
                    }
                }
            }

            if (bNeedConnection == true)
            {
                ManagerConnect();
            }
        }
示例#7
0
        private void dataGridView_Crawler_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 8)
            {
                string str    = dataGridView_Crawler.Rows[e.RowIndex].Cells[0].Value as string;
                Int32  nChIdx = Convert.ToInt32(str);
                if (AppManager.Instance.Checker_Connection_List_.ContainsKey(nChIdx) == true)
                {
                    AsyncSocketClient psocket = AppManager.Instance.Checker_Connection_List_[nChIdx];

                    M_TO_K_RESTART p = new M_TO_K_RESTART();
                    p.num = (byte)PACKET_IDX.MK_RESTART;
                    p.len = (Int16)Marshal.SizeOf(p);
                    byte[] sendbuffer = new byte[p.len];
                    PacketProcess.Serialize(p, sendbuffer);

                    psocket.Send(sendbuffer);
                }
                else
                {
                    MessageBox.Show("체커와 연결이되지 않았습니다. 체커를 실행 시켜 주세요.");
                }
            }
        }