destructor Tmythread.Destroy;
begin
inherited Destroy;
end;
procedure TMythread.DoTerminate;
begin
inherited DoTerminate;
end;
procedure TMythread.Execute;
begin
with Form1 do
begin
EnterCriticalSection(cs);
if F_info.command='ADD'then
begin
form1.listview1.items.add................
end;
LeaveCriticalSection(cs);
Terminate;
end;
//=========================
procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread);
var
C_info:ClientInfo;
begin
// if (not AThread.Terminated) and (AThread.Connection.Connected=True) then
begin
AThread.Connection.ReadBuffer(C_info,SizeOf(C_info));
TMyThread.Create(C_info,AThread);
end;
end;