Article View: borland.public.cppbuilder.internet.socket
Article #3110Re: Indy TCP "Wait for Reply"
From: Darlington ADIBE
Date: Fri, 18 Nov 2005 16:26
Date: Fri, 18 Nov 2005 16:26
59 lines
3100 bytes
3100 bytes
Remy thank alot,
Indy 9.0.17 was very helpful, the CommandHandler made my code very easy and
well structured, though am still to figure how to use the some other new
features
I give it Up for the Indy Team.
I hope DevStudio2006 will support Indy 10 (as in C++ )
Darl.
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:437d3195$1@newsgroups.borland.com...
>
> "Darlington ADIBE" <bcb@triative.com> wrote in message
> news:437d20f2@newsgroups.borland.com...
>
> > I have up graded to indy9.
>
> Which build, though?
>
> > and now my server doesn't work again i get an
> > access voilation error in the Execute Event
>
> Your code should not be looping at all. The OnExecute event handler is
> already looped internally by Indy. Just process a single command and then
> exit the handler, ie:
>
> void __fastcall TForm1::tcpExecute(TIdPeerThread *AThread)
> {
> AnsiString request = AThread->Connection->ReadLn(LF,
> IdTimeoutDefault, -1);
> request.Delete(1, 1);
> AnsiString cmd = Fetch(request, "#");
> if( cmd == "AUTHEN" )
> Authenticate(AThread, request);
> else if( cmd == "DISCONT" )
> AThread->Connection->DisconnectSocket();
> }
>
> You might also consider using the CommandHandler collection instead of the
> OnExecute event. The CommandHandler collection provides much automation
> when it comes to parsing and processing textual commands.
>
> > I still don't see any property that allow me to change the
> > default Line Terminatior
>
> There is no property for that. Simply specify the desired line terminator
> when calling ReadLn(). That is what its first parameter is for:
>
> AnsiString request =
> AThread->Connection->ReadLn('YourLineDelimiterHere',
IdTimeoutDefault, -1);
>
>
> Gambit
>
>
Technical Details
Message-ID:
<437e0057@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!meganewsservers.com!feeder2.on.meganewsservers.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<437c328b@newsgroups.borland.com> <437cc79a$1@newsgroups.borland.com> <437cd28f@newsgroups.borland.com> <437cf568$1@newsgroups.borland.com> <437cfa81@newsgroups.borland.com> <437cfc7d$1@newsgroups.borland.com> <437d20f2@newsgroups.borland.com> <437d3195$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,187f889f070be6a7 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Darlington ADIBE" <bcb@triative.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <437c328b@newsgroups.borland.com> <437cc79a$1@newsgroups.borland.com> <437cd28f@newsgroups.borland.com> <437cf568$1@newsgroups.borland.com> <437cfa81@newsgroups.borland.com> <437cfc7d$1@newsgroups.borland.com> <437d20f2@newsgroups.borland.com> <437d3195$1@newsgroups.borland.com> Subject: Re: Indy TCP "Wait for Reply" Date: Fri, 18 Nov 2005 17:26:16 +0100 Lines: 61 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 NNTP-Posting-Host: 83.229.68.10 Message-ID: <437e0057@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1132331095 83.229.68.10 (18 Nov 2005 08:24:55 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!meganewsservers.com!feeder2.on.meganewsservers.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail