I'm going mad with a simple TCP connection...

Giganews Newsgroups
Subject: I'm going mad with a simple TCP connection...
Posted by:  Michele (giovanni.costantino…@tin.it)
Date: Wed, 9 Jul 2003

Sorry 4 my english....
I'm a very newbie with Indy and i've a big problem....(i think it's simple 4
you all!)
I've 2 simple form: a client form  and a server form (with server tcp
component ACTIVE)
The problem is that i can't comunicate via TCP....that's my little project:

        On the server side:

procedure TForm1.TCPServerExecute(AThread: TIdPeerThread);
var str:string;
begin
memo.Lines.Add('OnExecute');
AThread.Connection.ReadBuffer(str,sizeof(str));          //
!!!!!!!!!!!!!this hang the process!!!!!!!!!!!!
memo.Lines.Add(str);
end;

        On the client form there's a TCPClient and a button (that does
TCPClient.Connect();)

procedure TForm1.TCPClientConnected(Sender: TObject);
begin
memo.Lines.Add('Connected'); //a memo to tell me that i'm connected and
works fine (i can see the connection on the server side)
TCPClient.WriteLn('Hello world!');  // i want to send something to the
server...just to say "Hi!"
end;

What i'm doing that doesn't work??????

Many thanks!

Replies