Board index » delphi » Am i right?

Am i right?

i am relateve newbie with indy,so want to now some things

if i put on server side code like this

idtcpserver.execute
var
a,b,s:string;
buf:somebuffer;

begin

s:=athread.connection.readln;

if s='x' then
begin
a:=athread.connection.readln;
if a='do some job' then dosomejob;
athread.connection.readbuffer(buf,sizeof(buf));
b:=athread.connection.readln;
end;

if s='y' then
begin
athread.connection.writeln('sdgjhjkh');
c:=athread.connection.readln;
end;

      is this correct?
      i mean,when i accidentaly send string 'do' (with writeln('do')) in
client,that means that this code can receive that string anywhere!?

thanks

 

Re:Am i right?


Quote
----- Original Message -----
From: "Exorcist" <prevodi...@hotmail.com>
Newsgroups: borland.public.delphi.internet.winsock
Sent: Saturday, 21 September, 2002 2:05
Subject: Am i right?

> idtcpserver.execute
> var
> a,b,s:string;
> buf:somebuffer;

> begin

> s:=athread.connection.readln;

> if s='x' then
> begin
> a:=athread.connection.readln;
> if a='do some job' then dosomejob;
> athread.connection.readbuffer(buf,sizeof(buf));
> b:=athread.connection.readln;
> end;

else //<< add this (not that it is important)

> if s='y' then
> begin
> athread.connection.writeln('sdgjhjkh');
> c:=athread.connection.readln;
> end;

>       is this correct?

looks ok to me.

>       i mean,when i accidentaly send string 'do' (with writeln('do')) in
> client,that means that this code can receive that string anywhere!?

the code ignores the 'do', as 'do'<>'x' and 'do' <> 'y'

> thanks

--
Bas Gooijen

Other Threads