I have an existing client server project that I am converting to use TIdTCPClient and TIdTCPServer. The "old" version used TClientSocket & TServerSocket with non-blocking sockets.
The current problem is with the Server. I have a TIdTCPServer and TIdAntiFreeze components on the main server form. The Execute method is very simple (right now):
procedure TfmMain.IdTCPServer1Execute(AThread: TIdPeerThread);
if (AThread.Terminated) or (not AThread.Connection.Connected) then EXIT;
Client := PClientInfo(AThread.Data);
Client.LastAction := Now;
TaskMsgStrList.CommaText := AThread.Connection.ReadLn; // <== input to fmMain.TaskMsgStrList
AThread.Connection.WriteLn(TaskMsgStrList.CommaText); // <== just ECHO it
sTaskType := LowerCase(TaskMsgStrList.Values['TaskType']);
if sTaskType = 'login' then
Client.UserName := TaskMsgStrList.Values['UserName'];
The problem is that in between communications the Server form is completely unresponsive. It appears to be "blocked" on the ReadLn statement above.
I thought that that was what the TIdAntiFreeze component was supposed to prevent.