设置定显示器 Timer 每隔段时间检查 LastTime
如果 now -LastTime >心跳包时间间隔 即认为断线了
socket.close;
可用 TList 链表保存维护第个客户的UseInfo_Record的信息
pUseInfo:^UseInfo_Record
for i:=List.count-1 downto 0 do
begin
pUseInfo:= List[i];
if now-pUseInfo.lastTime>25 then
begin
pUseInfo.UseSocket.close;
dispose(pUseInof);
List.delete(i);
end;
end;
List.add(pUseInfo);当客户连接到时 新增一条记录 填充 pUseInfo
List.delete(i);