Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Mar : Comments for TIdECHOServer.DoExecute in Indy10.1.5

www.cryer.info
Managed Newsgroup Archive

Comments for TIdECHOServer.DoExecute in Indy10.1.5

Subject:Comments for TIdECHOServer.DoExecute in Indy10.1.5
Posted by:"Huang Xiaobin" (hxbtoug..@yahoo.com.cn)
Date:Tue, 7 Mar 2006 23:03:20

I think use the following style should be bettet.

function TIdECHOServer.DoExecute(AContext:TIdContext): boolean;
begin
  Result := False;
  with AContext.Connection do begin
    while Connected do begin
      IOHandler.CheckForDataOnSource;
      IOHandler.Write(IOHandler.InputBufferAsString);
    end;
  end;
end;

it means use Result := False to finish the context, not the raising
exception style.^_^

Replies:

www.cryer.info
Managed Newsgroup Archive