static void Main(string[] args) { GameClient gc = new GameClient(); gc.localEp = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 7878); gc.remoteEp = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 10888); gc.client = new UdpClient(gc.localEp); gc.Establish(); while (gc.ConnectionEstablished) { gc.servermessage = gc.ReceiveMsgFromServer(); if (gc.servermessage == "RPLY") gc.SendMsgToServer(Console.ReadLine()); else Console.WriteLine(gc.servermessage); } }