|
@@ -170,11 +170,11 @@ namespace GWSocketClient
|
170
|
170
|
catch (Exception ex)
|
171
|
171
|
{
|
172
|
172
|
// statuslist.Items.Add(string.Format("连接失败!原因:{0}", ex.Message
|
173
|
|
- btnLogin.Enabled = true;
|
174
|
173
|
Console.WriteLine(ex.Message);
|
175
|
174
|
}
|
176
|
175
|
}
|
177
|
176
|
|
|
177
|
+
|
178
|
178
|
private void tbCCID_TextChanged(object sender, EventArgs e)
|
179
|
179
|
{
|
180
|
180
|
string ccid = tbCCID.Text.Trim();
|
|
@@ -190,7 +190,7 @@ namespace GWSocketClient
|
190
|
190
|
}
|
191
|
191
|
catch (Exception exception)
|
192
|
192
|
{
|
193
|
|
-// addToListboxItem("你还没有登录!!" + exception.Message);
|
|
193
|
+ addToListboxItem("你还没有登录!!" + exception.Message);
|
194
|
194
|
}
|
195
|
195
|
}
|
196
|
196
|
|
|
@@ -300,5 +300,31 @@ namespace GWSocketClient
|
300
|
300
|
e.DrawFocusRectangle();
|
301
|
301
|
}
|
302
|
302
|
}
|
|
303
|
+
|
|
304
|
+ /// <summary>
|
|
305
|
+ /// 压力测试
|
|
306
|
+ /// </summary>
|
|
307
|
+ private void btnPressureTest_Click(object sender, EventArgs e)
|
|
308
|
+ {
|
|
309
|
+
|
|
310
|
+ ip = tbIpaddress.Text.Trim();
|
|
311
|
+ port = tbPort.Text.Trim();
|
|
312
|
+
|
|
313
|
+ ThreadPool.QueueUserWorkItem(o =>
|
|
314
|
+ {
|
|
315
|
+ for (int i = 1024; i < 1024 + 100; i++)
|
|
316
|
+ {
|
|
317
|
+ SocketHelper.TcpClients clientx = new SocketHelper.TcpClients(); //初始化类库
|
|
318
|
+ clientx.InitSocket(ip, int.Parse(port));
|
|
319
|
+ clientx.Start();
|
|
320
|
+
|
|
321
|
+ string loginCmd = "7e7e7e";
|
|
322
|
+ loginCmd += "4442832e" + i;
|
|
323
|
+ loginCmd += "820014383938363032423131393135353034373938" + i;
|
|
324
|
+ loginCmd = Utils.calcCrcCode(loginCmd);
|
|
325
|
+ sockeTcpClients.SendData(HexUtil.hexToBytes(loginCmd));
|
|
326
|
+ }
|
|
327
|
+ });
|
|
328
|
+ }
|
303
|
329
|
}
|
304
|
330
|
}
|