Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Delphi Components Usage > Problems using ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 136 of 175
Post > Topic >>

Problems using TTcpserver & TTcpClient

by "Dave87" <davidesteves.87@[EMAIL PROTECTED] > Dec 22, 2004 at 12:30 PM

Hi everyone

I'm doing a program (a client/server program) using Ttcpserver and
Ttcpclient.

Ttcpserver is configured to bmThreadBlocking. With this program i pretend
it do something (like change caption, etc...) when it receives a specific
text from client.
Well this is done, but i have another problem i just do 1 action (like
change caption, if clients send text to do anything else it doesn't work
:( )

well here is the snippet of this part of the code (server):

procedure TForm1.TcpServer1Accept(Sender: TObject;
  ClientSocket: TCustomIpClient);

var
cmds: string;

begin

Randomize();

cmds:=ClientSocket.Receiveln;

 If cmds = 'caption' then

   Form1.caption :'worked';

 Else if cmds = 'dar' then

   Form1.caption := 'deu';

end;


and here is the source of the client:

procedure TForm1.Frame31Button1Click(Sender: TObject);
begin
Form1.TcpClient1.Sendln('caption');

end;

procedure TForm1.Frame31Button2Click(Sender: TObject);
begin
Form1.TcpClient1.Sendln('dar');

end;

 

Thx a lot for read, if possible help me, and sorry my english, cheers
 




 1 Posts in Topic:
Problems using TTcpserver & TTcpClient
"Dave87" <da  2004-12-22 12:30:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 18:41:36 CDT 2008.