private void buttonDebug2_Click(object sender, EventArgs e) { AsyncSocketClient client = new AsyncSocketClient(); client.Connect("127.0.0.1", (int)numericUpDown1.Value); client.Send("hello", Encoding.Unicode); }
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_); }
// 체커 연결 private void CheckerConnect() { //NewLogManager2.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", CINIManager.Instance.checkerport_); }
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_); }
public static void Main(string[] args) { AsyncSocketClientReceive.LittleEndian = true; AsyncSocketClientReceive.MaxPackageSize = 1024 * 1024; AsyncSocketClientReceive.ErrorMsg = ClientMsg; AsyncSocketClientReceive.RegisterEvent <LoginEvent>(Command.Login); AsyncSocketClientReceive.RegisterEvent <FriendsEvent>(Command.Friends); AsyncSocketClientReceive.RegisterEvent <LabaEvent>(Command.Laba); AsyncSocketClientReceive.RegisterEvent <LabaEvent>(Command.BigData); client = new AsyncSocketClient(4096); client.Connected += new EventHandler <AsyncSocketTokenEventArgs>(client_Connected); //连接成功 client.Disconnected += new EventHandler <AsyncSocketTokenEventArgs>(client_Disconnected); //断开连接 client.DataReceived += new EventHandler <AsyncSocketTokenEventArgs>(client_DataReceived); //接收到数据 client.Error += new EventHandler <AsyncSocketErrorEventArgs>(client_Error); //出错 client.Connect("tcp://127.0.0.1:3000"); //连接服务器 Thread.Sleep(10000000); }
// Start is called before the first frame update void Start() { client.Connect(); }