private void button1_Click(object sender, EventArgs e) { IPEndPoint remote = new IPEndPoint(IPAddress.Parse("58.198.176.217"), 8888); Msg m = new Msg(remote, "zz", "zhujun", Commands.Entry, "test11111111111111111111111111111", "test2333333333"); m.IsRequireReceive = true; m.PackageNo = Msg.GetRandomNumber(); tran.Send(m); }
static void Main(string[] args) { UDPThread udp = new UDPThread("58.198.176.217", 7777); MsgTranslator tran = new MsgTranslator(udp); tran.MessageReceived += tran_MessageReceived; IPEndPoint remote = new IPEndPoint(IPAddress.Any, 7777); Msg m = new Msg(remote, "zz", "zhujun", Commands.Join, "test1", "test2"); m.PackageNo = 12345678; tran.Send(m); }