Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Feb : Re: Encrypted command from server for TIdCmdTCPClient

www.cryer.info
Managed Newsgroup Archive

Re: Encrypted command from server for TIdCmdTCPClient

Subject:Re: Encrypted command from server for TIdCmdTCPClient
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Thu, 14 Feb 2008 00:33:05

"Moore" <moore@hotmail.com> wrote in message
news:47b3f844$1@newsgroups.borland.com...

> How to make this with TIdCmdTCPClient? define a command
> named DEVDEL and make the adecuate parsing and retrieving
> in the OnBeforeCommand event?

Yes.  But handle just the decrypting portion in that event, not the full
command parsing.  Let the DEVDEL item in the CommandHandlers collection
handle that for you after decryption has been performed.

> waht if the command is not DEVDEL, it is DEVADD for example?

Simply add a second item to the CommandHandler's collection to handle DEVADD
commands.  The whole point of the CommandHandlers collection to provide
centralized parsing of the lower level semantics of a protocol (receive a
line and separate out the command and parameter values) and then trigger an
OnCommand event handler for each individual command that may be received.


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive