public void Send_content(Socket soc, _baseModel _0x01) { Ccontext c = new Ccontext(); //处理数据库------------- //处理数据库------------- c.Content = " 射点发射点发射点 射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点射点发射点发射点"; _0x01.Parameter = "ok"; _0x01.Root = c.Content; send(soc, 0x01, _0x01.Getjson()); //获取在线人员token this.GetOnline(); }
private void button2_Click(object sender, EventArgs e) { int i = 0; while (i < 10) { i++; //_baseModel bm = new _baseModel(); //bm.Request = "Send_content";//请求的方法名 //bm.Token = p2pc.Tokan;//服务器登录成功返回的token ////c中存放的是传递给服务器的内容 Ccontext c = new Ccontext(); c.Content = "张三去干活去。"; c.Recusername = "******"; c.Sendusername = "******"; //bm.SetParameter<Ccontext>(c); //向服务器发送数据 // p2pc.send((byte)0x01, bm.Getjson()); p2pc.SendParameter<Ccontext>(0x01, "Send_content", c, 0); p2pc.SendRoot<Ccontext>(0x01, "Send_content", c, 0); } }
public void test(object obj) { P2Pclient p2pc2 = new P2Pclient(false); p2pc2.timeoutevent += P2pc_timeoutevent; p2pc2.receiveServerEvent += new P2Pclient.receive(delegate (byte command, string text) { lock (this) { reccount = reccount + 1; } }); if (p2pc2.start("127.0.0.1", Convert.ToInt32(textBox1.Text), true)) { lock (this) { okcount = okcount + 1; } } else { lock (this) { errorcount = errorcount + 1; } } Ccontext c = new Ccontext(); c.Content = "张三去干活去。"; c.Recusername = "******"; c.Sendusername = "******"; //bm.SetParameter<Ccontext>(c); //向服务器发送数据 // p2pc.send((byte)0x01, bm.Getjson()); p2pc2.SendParameter<Ccontext>(0x01, "Send_content", c, 0); }