Rob

>>I suggest you test your server using an established telnet client, not

>>the one you wrote yourself. That way, you can isolate errors in your 
>>server instead of working around them in your client.


Thanks for your response.
Looking at the Indy docs site
http://docs.indyproject.org/online/frames.html?frmname=topic&frmfile=ind
ex.html

there is an example using the "OnExecute" Event. This seems to trigger
when data comes in so this might work.

Do you know of any other Telnet Server components that are available?

TMyForm.MyServerExecute(AContext: TIdContext);
   var
      lCmd: string;
   begin
      lCmd := Trim(AContext.Connection.IOHandler.ReadLn);
      if AnsiSameText(lCmd, 'HELP') then
      begin
         AContext.Connection.IOHandler.WriteLn('HELP');
         AContext.Connection.IOHandler.WriteLn('QUIT');
         AContext.Connection.IOHandler.WriteLn('GETTIMESTAMP');
         AContext.Connection.IOHandler.WriteLn('');
      end

      else if AnsiSameText(lCmd, 'QUIT') then
      begin
         AContext.Connection.IOHandler.WriteLn('Goodbye...');
         AContext.Connection.IOHandler.WriteLn('');
         AContext.Connection.Disconnect;
      end

      else if AnsiSameText(lCmd, 'GETTIMESTAMP') then
      begin
         AContext.Connection.IOHandler.WriteLn(
            FormatDateTime(Now, 'yyyy-mm-ddThh:nn:ss.zzz'));
         AContext.Connection.IOHandler.WriteLn('');
      end;
   end;


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Rob Kennedy
Sent: Wednesday, 6 April 2005 3:08 PM
To: Borland's Delphi Discussion List
Subject: Re: TIdTelnetServer


_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to