Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Sep : Re: Indy 9 CommandHandlers
| Subject: | Re: Indy 9 CommandHandlers |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Tue, 4 Sep 2007 16:20:57 |
"Jamie Dale" <jamie.dale@yahoo.com> wrote in message
news:46ddd5ac@newsgroups.borland.com...
> Is there a reason why TIdTCPServer disconnects Clients instantly
> when ComandHandlers.Enabled := True; ?
It does not do that.
> Are there any examples on how to use the CommandHandlers?
Many of Indy's own components use CommandHandlers. You can look at their
source code. In particular, the POP3, SMTP, and NNTP client/server
components.
> Do I just WriteString() to the server or do I need to use SendCmd?
It depends on the nature of the particular commands that you define in the
CommandHandlers, but generally you would use SendCmd().
> Whats with the smallInt?
If you read Indy's documentation, you would know what it is for. Basically,
it allows SendCmd() to automatically validate the reply that it receives.
Each CommandHandler has a numerical code that it can return. If the code(s)
you pass to SendCmd() do not match the code that is received, an exception
is raised.
Gambit
none