🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #67140

Re: Programming/NNTP Questions

#67140
From: DS
Date: Mon, 10 Nov 2003 22:18
97 lines
5580 bytes
"aaronb" <borgaaron@yahoo.com> wrote in
news:3fafdbf0$0$15854$c3e8da3@news.astraweb.com: 

> What you are doing sounds similar to what I'm doing... I suppose. I
> don't understand what you are defining as a packet... doesn't the
> server send you all the data you've requested in one long stream?
> Isn't it up to us as the programmer to decide where to break off
> receiving data and process it? I've tried using anything from 1 byte
> at a time up to 4-8k bytes in one read.... but I have yet to find a
> sweet spot that I'm satisfied with.

I'm not sure who's responsibility it is. I probably shouldn't have used 
the word packet, since that isn't really what I'm doing. What I meant was 
actually 'data'. The data in the receive buffer when the OnDataReceive 
event notifies me there is data waiting. Like I said, I'm using a Winsock 
class in VB. The class fires the event OnDataReceive according to 
whatever is set up in the registry for winsock buffers. I just looked 
through the class and didn't see any settings for the buffer size.

> 
> Yes, data does build up when I use a 256 byte buffer... I started out
> using a 32 byte buffer so that I didn't have much if anything left
> over after receiving one complete header but I found that I shaved off
> some processing time when moving up to 256.
> 
> I start off by creating a TCPClient and connect to the server, send my
> commands, process the first 3 bytes received so I can know what
> response code was given and treat it accordingly. When I know that the
> XOVER data will be coming, I switch over to the 256byte buffer and
> loop till done. 

See, here's where I'm not to sure about what to tell you. With the 
Winsock class I have, when I send an XOVER xxxxx- command, I get an 
OnDataReceive event. I retreive the data and it only contains the '224 
Data to Follow' string. Then, when the OnDataReceive event fires again, 
it is the start of the XOVER datastream. With slow servers, the class' 
buffer doesn't even fill up most of the time, even while still receiving 
the stream. There could be some type of timeout built in to it such that 
if the connection is still valid and x amount of time has passed since 
data was received, fire the event.

The class I'm using is here:
http://www.vbip.com/winsock-api/csocket-class/csocket-class-01.asp

> 
> I guess what I'm looking for is other conceptual methods of
> interacting with the incoming stream that will increase the speed of
> the program. I've timed Outlook express, Newsbin and Xnews and they
> are all very similar in speed, but my process is anywhere from 2-5
> times slower. I had not thought of sending multiple XOVER commands to
> receive the data in multiple streams. That does sound like a great
> idea. 
> 

I must ask, and should have asked earlier, what language you are using, 
and what kind of PC ? The way I'm doing it is fairly CPU intensive. I'm 
developing on a 1GHz CPU w/512 Megs of RAM. When I did a test install on 
a K6-2 500 MHz, it was only going half the speed. You did mention C# in 
one of your other posts, if so, the class above won't do you any good, 
sorry. The multiple datastreams I'm utilizing for XOVER is 1 connection 
per server per group. So I could be XOVER'g from 4 different groups, on 3 
different servers, for a total of 12 streams. Not a very easy thing to 
accomplish in VB6.

Have you tried setting your buffer to a high number, like 1 MBytes, or 
256KBytes ?

Regards,

DS




> "DS" <t.h.i.s.n.t.h.a.t@a.d.e.l.p.h.i.a..n.e.t> wrote in message
> news:Xns942F59DEF723Aidispcom@24.48.107.54...
>> "aaronb" <borgaaron@yahoo.com> wrote in
>> news:3faf228c$0$801$c3e8da3@news.astraweb.com:
>> So in response to the rx buffer size, I never messed with any of
>> those settings. On a fast server, incoming data can be 4096K, on
>> slower servers sometimes it's only a few hundred bytes. The only
>> leftover data I'm 
> storing
>> is incomplete header info. I end up processing all of the received
>> data before I accept another packet. Depending on you're server's
>> speed, and 
> the
>> fact that you're only taking 256 bytes at a time, I can see the
>> 'leftover' buffer growing to be huge at somepoint, depending on the
>> additional processing you're doing.
>>
>>
>> DS
>>
> 
> 
Technical Details
Message-ID: <Xns942FB0A468A4Cidispcom@24.48.107.54>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!border1.nntp.ash.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp-relay.ihug.net!ihug.co.nz!logbridge.uoregon.edu!router1.news.adelphia.net!news1.news.adelphia.net.POSTED!not-for-mail
References: <3fa1d38d$0$50372$c3e8da3@news.astraweb.com> <Xns94284B9E63709idispcom@24.48.107.53> <3faf228c$0$801$c3e8da3@news.astraweb.com> <Xns942F59DEF723Aidispcom@24.48.107.54> <3fafdbf0$0$15854$c3e8da3@news.astraweb.com>

Show Full Headers
Complete Article Headers
Message-ID: <Xns942FB0A468A4Cidispcom@24.48.107.54>
Subject: Re: Programming/NNTP Questions
Date: Mon, 10 Nov 2003 22:18:38 GMT
From: DS <t.h.i.s.n.t.h.a.t@a.d.e.l.p.h.i.a..n.e.t>
References: <3fa1d38d$0$50372$c3e8da3@news.astraweb.com> <Xns94284B9E63709idispcom@24.48.107.53> <3faf228c$0$801$c3e8da3@news.astraweb.com> <Xns942F59DEF723Aidispcom@24.48.107.54> <3fafdbf0$0$15854$c3e8da3@news.astraweb.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.20140818.mbox.gz!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!border1.nntp.ash.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!nntp-relay.ihug.net!ihug.co.nz!logbridge.uoregon.edu!router1.news.adelphia.net!news1.news.adelphia.net.POSTED!not-for-mail
Newsgroups: news.software.nntp
Organization: Home
User-Agent: Xnews/5.04.25
Lines: 97
NNTP-Posting-Host: 68.71.192.103
X-Complaints-To: abuse@adelphia.net
X-Trace: news1.news.adelphia.net 1068502718 68.71.192.103 (Mon,
NNTP-Posting-Date: Mon, 10 Nov 2003 17:18:38 EST