Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jun : idcmdTCPClient freeze - indy 10.1.5
| Subject: | idcmdTCPClient freeze - indy 10.1.5 |
| Posted by: | "Jacques" (jacques.no..@btinternet.com) |
| Date: | Mon, 26 Jun 2006 01:11:49 |
Hop someone can help with this, i'm writing a client/server program using
idcmdtcpclient/server components. The problem is that i'm not sure how to
read data sent by the server. currently i have the following code:
server:
procedure TForm1.servCommandHandlers3Command(ASender: TIdCommand);
begin
//ASender.Context.Connection.IOHandler.WriteLn('Test cmd recieved');
ASender.Reply.Text.Text:='Test cmd recieved';
end;
Client:
procedure TForm1.Button2Click(Sender: TObject);
begin
client.SendCmd('Testing');
memo1.Lines.Add(client.LastCmdResult.Text.Text);
//memo1.Lines.Add(client.IOHandler.ReadLn);
end;
When i sent the test command the client just freezes. I'm not sure what the
problem is. Also i dont know which methods to use to read and write to the
server and client.
To read response from the server do i write:
memo1.Lines.Add(client.LastCmdResult.Text.Text);
OR
memo1.Lines.Add(client.IOHandler.ReadLn);
And to write to the client:
ASender.Context.Connection.IOHandler.WriteLn('Test cmd recieved');
OR
ASender.Reply.Text.Text:='Test cmd recieved';
When i use either methods with telnet it all works fine, but when i use a
GUI client, it freezes.
Thanks