static void test1() { Console.Write("PORT:"); int port = int.Parse(Console.ReadLine()); Console.WriteLine(ClientC.Access("127.0.0.1", 9840, port).Info); ClientC.Receive(ar => { Console.WriteLine(ar); }); while (true) { string cmd = Console.ReadLine(); if (cmd == "shutdown") { break; } else if (cmd == "login") { ClientC.Send(MessageTranslate.EncapsulationInfo(MessageContent.登录, MessageType.请求, "1501", "123")); } else if (cmd == "login1") { ClientC.Send(MessageTranslate.EncapsulationInfo(MessageContent.登录, MessageType.请求, "0000", "123456")); } else { ClientC.Send(cmd); } } }
private void ReceiveData() { while (Running) { string data = null; data = Socket.Receive(); if (data != null) { /* Parse * decide what to do with data */ BotLogger.LogDebug(data); CallbackHandler.RunCallbacks(data); } } }
private void Accept(string remoteEndPoint) { clientSocket.Receive(Receive); }