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