Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Sep : Re: Indy 9 TPC client/Server and CommandHandlers
| Subject: | Re: Indy 9 TPC client/Server and CommandHandlers |
| Posted by: | "RandomAccess" (n..@tellingyou.com) |
| Date: | Wed, 26 Sep 2007 00:27:17 |
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:46f96125$1@newsgroups.borland.com...
>
> "RandomAccess" <Not@TellingYou.com> wrote in message
> news:46f94ecf$1@newsgroups.borland.com...
>
>> Well, currently I set up the server to send the response automatically
>
> That does not stop you from sending responses manually as well. When the
> SendReply() method is called in your code, the TIdCommand's PerformReply
> property is set to False so the command handler's automated reply is not
> sent as well.
Ok.
>> So, All I need to do is to get the CommandHandler to send
>> the appropriate data from the server (a stream) to the client.
>
> You can't send streams (or any other kind of dynamic data) using the
> command
> handler's properties in the Object Inspector by itself.
Yes, I know. That is part of the point of my post.
I want to use the command handlers for commands and responses, But
I need to send stream data depending on the command recieved.
> You must have
> OnCommand event handlers to send the data, which (almost always, depending
> on your protocol) means calls SendReply() directly before sending the data
> afterwards.
Ok, that is straight forward, and sounds like exactly what I want to do.
Remy, thank you for this example. I didn't realize it was this simple.
I've only just started looking at Indy after wasting alot of time trying to
master borlands socket components in in background threads.
It's indy's command and response mechanism that is of real interest to me,
as it saves a tremendous amount of coding.
Once again, very much appreciated.
thank you.
none