private void ServerConnect() { manager_socket_ = new AsyncSocketClient(0); // 이벤트 핸들러 재정의 manager_socket_.OnConnet += new AsyncSocketConnectEventHandler(OnConnet); manager_socket_.OnClose += new AsyncSocketCloseEventHandler(OnClose); manager_socket_.OnSend += new AsyncSocketSendEventHandler(OnSend); manager_socket_.OnReceive += new AsyncSocketReceiveEventHandler(OnReceive); manager_socket_.OnError += new AsyncSocketErrorEventHandler(OnError); manager_socket_.Connect(manager_ip_, manager_port_); }
private void ManagerConnect() { manager_socket_ = new AsyncSocketClient(0); // 이벤트 핸들러 재정의 manager_socket_.OnConnet += new AsyncSocketConnectEventHandler(OnConnet); manager_socket_.OnClose += new AsyncSocketCloseEventHandler(OnClose); manager_socket_.OnSend += new AsyncSocketSendEventHandler(OnSend); manager_socket_.OnReceive += new AsyncSocketReceiveEventHandler(OnReceive); manager_socket_.OnError += new AsyncSocketErrorEventHandler(OnError); manager_socket_.Connect(CrawlerInfoManager.Instance.managerip_, CrawlerInfoManager.Instance.managerport_); }
// 크롤러가 접속 됐을때 호출되는 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); }
private void CheckerConnect() { LogManager.Instance.Log("private void CheckerConnect()"); checker_socket_ = new AsyncSocketClient(1); // 이벤트 핸들러 재정의 checker_socket_.OnConnet += new AsyncSocketConnectEventHandler(OnConnet); checker_socket_.OnClose += new AsyncSocketCloseEventHandler(OnClose); checker_socket_.OnSend += new AsyncSocketSendEventHandler(OnSend); checker_socket_.OnReceive += new AsyncSocketReceiveEventHandler(OnReceive); checker_socket_.OnError += new AsyncSocketErrorEventHandler(OnError); checker_socket_.Connect("127.0.0.1", CrawlerInfoManager.Instance.checkerport_); }