P
pub66cn
Unregistered / Unconfirmed
GUEST, unregistred user!
我用的是indy10
在程序退出时清空所有连接:
procedure TMain.DisClients;
var
List: TList;
i: Integer;
begin
if IdTCPServer1.Active then
begin
List :=IdTCPServer1.Contexts.LockList;
for I := List.Count - 1do
wnto 0do
begin
try
TIdContext(List.Items).Connection.Disconnect;
except
end;
end;
IdTCPServer1.Contexts.UnlockList;
end;
IdTCPServer1.Active :=false;
end;
调用后程序就死掉,无响应,,请问题出在哪里,希望高手指正
在程序退出时清空所有连接:
procedure TMain.DisClients;
var
List: TList;
i: Integer;
begin
if IdTCPServer1.Active then
begin
List :=IdTCPServer1.Contexts.LockList;
for I := List.Count - 1do
wnto 0do
begin
try
TIdContext(List.Items).Connection.Disconnect;
except
end;
end;
IdTCPServer1.Contexts.UnlockList;
end;
IdTCPServer1.Active :=false;
end;
调用后程序就死掉,无响应,,请问题出在哪里,希望高手指正