如下,这段代码有问题吗?为什么我一运行内存就暴涨?
serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint serverIP = new IPEndPoint(IPAddress.Parse("192.168.0.150"), 9050);
serverSocket.Bind(serverIP);
serverSocket.Listen(1);
while (true)
{
serverSocket.BeginAccept(xxx, serverSocket);
}
while死循环,将listen写在while里就行了