Пример #1
0
        // 크롤러가 접속 됐을때 호출되는 callback
        private void OnAcceptCrawler(object sender, AsyncSocketAcceptEventArgs e)
        {
            AsyncSocketClient worker = new AsyncSocketClient(SocketID_++, e.Worker);

            // 데이터 수신을 대기한다.
            worker.Receive();
            worker.OnConnet  += new AsyncSocketConnectEventHandler(OnConnet);
            worker.OnClose   += new AsyncSocketCloseEventHandler(OnClose);
            worker.OnError   += new AsyncSocketErrorEventHandler(OnError);
            worker.OnSend    += new AsyncSocketSendEventHandler(OnSend);
            worker.OnReceive += new AsyncSocketReceiveEventHandler(OnReceive);
        }