🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #4380

Indy 9 NNTP

#4380
From: John Borchers
Date: Fri, 18 Feb 2005 17:05
49 lines
3106 bytes
All,

I'm losing my Indy application in the Post() function. It only returns after 
the news server connection times out and automatically disconnects (5 
minutes or so later). This code was working with the old Borland sockets. 
Everything else with indy seems to port just fine. Any idea whats wrong? The 
LineToStream function simply appends "\r\n"

Why might the Post() function hang?

       LineToStream("From: test@nomail.com");
       LineToStream("Newsgroups: " + Group->Text);
       AnsiString subLine="Subject: ";
       subLine+=Subject->Text+" ";
       subLine+=IntToStr(IndexFile->Data.Posting.ID)+" ("+curPos+
                "\\"+total+")";
       LineToStream(subLine);
       // End of header is a blank line
       LineToStream("");
       TMemoryStream* fileMem=new TMemoryStream();
       fileMem->LoadFromFile(search.Name);
       //add this file size to the total post body size
       TotalPostSize+=fileMem->Size;
       //now add the file to the stream
       FDataStream->Write("Just A Test\n\r",13);
       //clean
       do
        {
         // Set stream pointer to beginning of stream because TNntpCli will 
post
         // from the current position
         FDataStream->Seek(0, soFromBeginning);
         // Ask the component to post the stream. The posting occurs in the
         // background ! We will receive the OnRequestDone event when done.
         // It's in this event handler that the stream must be destroyed
         //set the group
         Label4->Caption="Posting "+subLine;
         //check the connection
         try
          {
           CheckConnect();
           IdNNTP1->SelectGroup(Group->Text);
           IdNNTP1->Post(FDataStream);
          }
         catch(Exception &E)
          {
           ShowMessage("Problem because "+E.Message+" during posting.");
          }
 
Technical Details
Message-ID: <2Y-dnZ73hLhfvYvfRVn-hQ@rcn.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.rcn.net!news.rcn.net.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,95a0a99bcb958c6f,start
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.rcn.net!news.rcn.net.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 18 Feb 2005 11:07:14 -0600
From: "John Borchers" <jborchers@nohere.rcn.com>
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Indy 9 NNTP
Date: Fri, 18 Feb 2005 12:05:27 -0500
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Original
Message-ID: <2Y-dnZ73hLhfvYvfRVn-hQ@rcn.net>
Lines: 51
NNTP-Posting-Host: 65.78.104.119
X-Trace: sv3-yRCx+GjNGJX8RvTzBXAkYLGUewt+f84yZ81cNTdfXe2wb/7aXAUWeSC7nc5K4MBxeQ4uHPoBwQbjx6R!1iYtGrVxB9FnDZGyAXeqZC0C1WlhKENMDCHwd3PTtqs10IQB3xo5sRuMJxurHLvm
X-Complaints-To: abuse@rcn.net
X-DMCA-Complaints-To: abuse@rcn.net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.31