The pinging mechanism was also effected by your modification. Please try again, I don't see any freezing now.
Ok thanks, it works almost perfectly

. It no longer freezes "permanently" so requests are all accepted. But if I send a file large enough to allow me to send a simple message, when I press "send", the client becomes unresponsive until the download to the server has finished.
From what you wrote, it doesn't happen to you. From code the call to SendMessage is directed on thread so shouldn't it leave the button in the "pressed" state and not allow me to move the form?
However, the problem is keeping the tasklist locked for too long. So I edited again:
if (not FNeedToBreak) and (not FTaskList.FBlocked) then//#
begin
//mod
FTaskList.Lock;
try
if not FTaskList.IsEmpty then
begin
ProcessTask(TTask(FTaskList.FList[0]));
FTaskList.DeleteFirst;//.FList.Delete(0);
end;
finally
FTaskList.Unlock;
end;
end;
with this
if (not FNeedToBreak) and (not FTaskList.FBlocked) then
//#
if FTaskList.GetNextTask(CurrTask{%H-}) then
begin
ProcessTask(CurrTask);
CurrTask.Free;
end;
It seems to work fine but I don't know if there is anything else to consider..