Article View: borland.public.cppbuilder.internet.socket
Article #3125Re: Indy CommandHandler (CR+LF) Issue
From: Remy Lebeau (TeamB)
Date: Wed, 23 Nov 2005 18:24
Date: Wed, 23 Nov 2005 18:24
53 lines
2772 bytes
2772 bytes
"Darlington ADIBE" <bcb@triative.com> wrote in message
news:43847621@newsgroups.borland.com...
> The CommandHandler for SENDTO was trigered ok. but
> the unparsedParams value (am not parsing param) contain
> only the first line from the memo1-text, after the commadhandler
> have removed the "SENDTO#".
The CommandHandler system does not support multi-line commands.
> My observation is that the Commandhandler stoped reading
> after CR or CR+LF,.
The CommandHandler system uses ReadLn() to receive commands, where the line
terminator is LF. When the terminator is LF, ReadLn() will stop reading
when it encounters either a LF or a CRLF. It will not stop on a solitary
CR.
> So how do I pass a parameter to the commandhandler if the
> parameter is the text value of controls like Memo controlls that
> insert CR and or CR+LF as you type if WordWrap is set to true
> (which in my vase have to be).
Don't insert line breaks into the middle of a command in the first place.
Replace them with another character sequence that will not break the reading
of the command. For example:
AnsiString s = StringReplace(Memo1->Text, "\r\n", "\r", TReplaceFlags()
<< rfReplaceAll);
cmd.sprintf("SENDTO#'%s'#'%s'#, s.c_str(), LabeledEdit1->Text.c_str());
//...
AnsiString s = StringReplace(ASender->UnparsedParams, "\r", "\r\n",
TReplaceFlags() << rfReplaceAll);
> Do I have controll over what is considered the ATerminator for
> the commandhandler
No.
> like when I use ReadLn
The CommandHandler system uses ReadLn() to receive commands. But it does
not allow you to specify the ATerminator parameter.
> how do I control the commandhabdler Line Terminator char.
You cannot, unless you rewrite and recompile TIdTCPServer manually.
Gambit
Technical Details
Message-ID:
<4384b3c9$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<43847621@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,cb4e95bbbefbce66 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <43847621@newsgroups.borland.com> Subject: Re: Indy CommandHandler (CR+LF) Issue Date: Wed, 23 Nov 2005 10:24:06 -0800 Lines: 55 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <4384b3c9$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1132770249 68.69.17.41 (23 Nov 2005 10:24:09 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail