while (true){TcpListener tcpListener = new TcpListener(Program.MessageListenerPort);tcpListener.Start();TcpClient tcpClient = tcpListener.AcceptTcpClient();NetworkStream networkStream = tcpClient.GetStream();.......networkStream.Close();tcpListener.Stop();tcpClient.Close();}该在哪儿加些什么东西呢?
try{TcpClient tcpClient = tcpListener.AcceptTcpClient();NetworkStream networkStream = tcpClient.GetStream();.......}catch 代码{ 异常抛在这里,比如与客户端建立连接失败。}