1

我有一个在 TCP 套接字上运行的多线程服务器。

我写了这个方法来测试多个线程

TcpClient[] ClientArray = new TcpClient[10000];
for(i = 0; i < 10000; i++)
{
     ClientArray[i] = new TcpClient();
     // connect is my connect method to connect to the server
     ClientArray[i].connect() 
}

这种方法是否正确或者是否有更好的方法来测试同时连接

4

0 回答 0