🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #80583

Re: basic nntp connections question

#80583
From: Curt Welch
Date: Fri, 17 Apr 2009 17:28
47 lines
4219 bytes
tanderson <holden@mcgroyn.com> wrote:
> I am fooling around writing a newsreader and have some of the basics in
> place. My question is about every 10 connections or so I will get
> rejected with a 502 upon doing the authinfo. I know everything is valid
> and I am not maxing out the connections. I have noticed through the years
> newsreaders having a number of retries setting. So I am guessing that
> this behavior is normal and I just need to retry the login?

It's not "normal" technically.  If your news server is randomly rejecting
connections about 1 out of 10 times, it's a broken news server.  Our
servers are broken in similar ways at times. :)  However,  my first guess
would be that your client code is doing something wrong.

Most news servers have per user connection limits, and it's possible,
depending on how the server implements that limit, that your closed
connections might still be counting against the limit for some period of
time (a few seconds, or a few minutes?).  So, if you are opening and
closing a lot of connections, instead of opening one (or a few), and
keeping it open for the long term, you might be creating problems for
yourself by confusing the server's connection limit counting.  That's just
a guess.  But normally, NNTP is not like HTTP.  News servers don't expect
you to open and close connections 100 times a second.  Historically, the
typical usage is to open a connection when the user starts his newsreader,
and leave it open until he's done.  It's perfectly fine to dynamically open
more as needed, but in general, you might run into some problems if you are
constantly opening and closing new connections quickly.

However, there are lots of broken news servers around, and as such, it is
normal to add code to the client side to automatically retry connections
when they don't work, or to automatically try to re-connect if you get
disconnected.  You have to be careful however not to put the client and
server into a tight infinite loop when you start adding automatic retry
code.  You have to put retry limits, and should use some automatic back-off
algorithm to make it delay longer between consecutive failed retry
attempts.  If the account is blocked on the server side, you don't want the
client to go into a tight infinite loop trying 100 times per second to
connect while constantly being rejected.

So it's possible that the server you are using is just broken and does
reject connections about 1 out of 10 times, but it shouldn't do that, so
check your code carefully to make sure the server really is doing what you
think it's doing, but then, do whatever you have to in your code, to make
it work with the server you are using.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                                        http://NewsReader.Com/
Technical Details
Message-ID: <20090417132501.794$OL@newsreader.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!news.glorb.com!news2.glorb.com!news.glorb.com!transit3.readnews.com!news-xxxfer.readnews.com!transit4.readnews.com!news-out.readnews.com!postnews3.readnews.com!nr5-q1.newsreader.com.POSTED!not-for-mail
References: <gdydnR0nDbBlYXrUnZ2dnUVZ_tKdnZ2d@giganews.com>

Show Full Headers
Complete Article Headers
Message-ID: <20090417132501.794$OL@newsreader.com>
Subject: Re: basic nntp connections question
Date: Fri, 17 Apr 2009 17:28:02 +0000
From: curt@kcwc.com (Curt Welch)
References: <gdydnR0nDbBlYXrUnZ2dnUVZ_tKdnZ2d@giganews.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!news.glorb.com!news2.glorb.com!news.glorb.com!transit3.readnews.com!news-xxxfer.readnews.com!transit4.readnews.com!news-out.readnews.com!postnews3.readnews.com!nr5-q1.newsreader.com.POSTED!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-NRC-Trace: NewsReader.Com s14F+ag4JoXm2dK8cnTlb6DPdBx/D,Xu4VV@5g_t6k3a+5uE
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,
 ?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5
 %IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Lines: 47
NNTP-Posting-Host: b037e4a8.nr5-q1.newsreader.com
X-Trace: DXC=2@; Nj\\8b7Sh2CO9^B]6[QbgZaH`e<A[YZ?:i9<JJBS^[DM\aJX]Z8YiJ;
 iV2YAoGU<HKZPBfghJRJoNK@6Q\STX
X-Complaints-To: abuse@newsreader.com