服务器卡死bug再现:
程序看上去没有啥问题,但是一旦客户端掉线,while就死循环了,无法退出。通过Client是否为空无法检测出客户端掉线了,于是在网上查阅半天发现
本程序实现了自由收发消息,不卡死
Server代码
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using Syste
服务器卡死bug再现:
程序看上去没有啥问题,但是一旦客户端掉线,while就死循环了,无法退出。通过Client是否为空无法检测出客户端掉线了,于是在网上查阅半天发现
本程序实现了自由收发消息,不卡死
Server代码
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using Syste