🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
12 messages
12 total messages Started by aaronb Fri, 31 Oct 2003 03:14
Programming/NNTP Questions
#67032
Author: aaronb
Date: Fri, 31 Oct 2003 03:14
17 lines
1751 bytes
Can anyone suggest a good place to look for discussionson programming NNTP
applications?

I've got some questions regarding socket operations and buffer sizes.... My
program is working just fine but I've noticed that changing the buffer size
changes things dramatically. I've done some tests with other programs and
have found that its about half as fast as most news programs.

Anyone have any tips for capturing the data from the socket and processing
the headers fields from an XOVER request? I have a process that does it just
fine, but I'm beginning to think that the slowness factor in my program is
based on how I am processing the buffer, converting the data, and placing it
on the screen in a listview...

Aaron

Re: Programming/NNTP Questions
#67034
Author: Jeffrey M. Vinocur
Date: Fri, 31 Oct 2003 04:09
24 lines
1946 bytes
In article <3fa1d38d$0$50372$c3e8da3@news.astraweb.com>,
aaronb <borgaaron@yahoo.com> wrote:
>Can anyone suggest a good place to look for discussionson programming NNTP
>applications?

Well, here, although I'm not sure how many people will have
intersting things to say with regard to your questions.  Perhaps
news.software.readers.


>I've got some questions regarding socket operations and buffer sizes....

I wonder if you might be better off finding some general network
programming people.  These sound like fairly generic sockets
questions, and you might have more luck asking a larger pool of
people.

But then, perhaps the news.software.nntp crowd will prove me
wrong.  Just don't bet your life on it.


-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: Programming/NNTP Questions
#67049
Author: boob
Date: Sun, 02 Nov 2003 17:49
31 lines
2548 bytes
"aaronb" <borgaaron@yahoo.com> wrote in
news:3fa1d38d$0$50372$c3e8da3@news.astraweb.com: 

> Can anyone suggest a good place to look for discussionson programming
> NNTP applications?
> 
> I've got some questions regarding socket operations and buffer
> sizes.... My program is working just fine but I've noticed that
> changing the buffer size changes things dramatically. I've done some
> tests with other programs and have found that its about half as fast
> as most news programs. 
> 
> Anyone have any tips for capturing the data from the socket and
> processing the headers fields from an XOVER request? I have a process
> that does it just fine, but I'm beginning to think that the slowness
> factor in my program is based on how I am processing the buffer,
> converting the data, and placing it on the screen in a listview...

Your best first step is going to be profiling your program to find out 
where the bottleneck is.  Without that, optimizations are just shots in the 
dark.

For socket I/O it's best to use either asyncronous overlapped I/O or 
threaded blocking I/O to maximize your throughput.  Keep the I/O size 
moderate, if your software is running at full steam, recv should be 
returning MTU size, if it's returning larger then you have a bottle neck 
disposing of the data (i.e. disk I/O).  It can help to double buffer disk 
operations or use overlapped I/O for that as well.

I'm working from the otherside right now, I'm creating an optimized multi-
threaded yEnc poster with auto verify.
Re: Programming/NNTP Questions
#67073
Author: DS
Date: Mon, 03 Nov 2003 12:23
58 lines
3462 bytes
"aaronb" <borgaaron@yahoo.com> wrote in
news:3fa1d38d$0$50372$c3e8da3@news.astraweb.com: 

> Can anyone suggest a good place to look for discussionson programming
> NNTP applications?
> 
> I've got some questions regarding socket operations and buffer
> sizes.... My program is working just fine but I've noticed that
> changing the buffer size changes things dramatically. I've done some
> tests with other programs and have found that its about half as fast
> as most news programs. 
> 
> Anyone have any tips for capturing the data from the socket and
> processing the headers fields from an XOVER request? I have a process
> that does it just fine, but I'm beginning to think that the slowness
> factor in my program is based on how I am processing the buffer,
> converting the data, and placing it on the screen in a listview...
> 
> Aaron
> 
> 

As boob said, you have to figure out where, if any, the bottleneck is.

In the newsreader I'm writing, the bottleneck is the database system, as 
I'm slipstreaming messages into multiple databases at the time of the 
XOVER, I'm not writing anything to a temporary file.

I would start out by first, picking a server that has good throughput, and 
a group with a good amount of messages in it.

Then, do a lot of timing tests. Start out by having your program start the 
XOVER, when the buffers full, just dump it and keep receiving data. Time 
this. Next, repeat this, but take the buffer data and break it up into the 
correct fields, then just discard the data again. If it's any slower than 
the first part, you know there's a little time lost in the first step of 
processing, assuming the server d/l speed is consistant.

Just keep doing this until you get through all of the steps the data takes 
from recieving through to displaying, and you should find either that one 
specific step is slowing things down, or all together all of the processing 
is slowing it down.

Now, after you know where the issues are, (try to) fix it.

Note: In my experience, the standard listview has proven to be quite slow 
in inserting items. Of course, I was trying to add 100,000+ items...the 
grouplist.

For further discussion's outside the group, please feel free to e-mail the 
address above with all but the last dot removed.

Regards,


DS

http://users.adelphia.net/~thisnthat/zanews/index.htm
Re: Programming/NNTP Questions
#67074
Author: (akula)
Date: Mon, 03 Nov 2003 15:19
15 lines
1521 bytes
DS <t.h.i.s.n.t.h.a.t@a.d.e.l.p.h.i.a..n.e.t> wrote:

[snip]
>Note: In my experience, the standard listview has proven to be quite slow 
>in inserting items. Of course, I was trying to add 100,000+ items...the 
>grouplist.
[snip]

That's a well known problem.
http://www.codeguru.com/listview/VirtualListControl.html
is one solution.  There are
more examples at Codeguru, 
http://www.codeproject.com/
and 
http://msdn.microsoft.com/
Re: Programming/NNTP Questions
#67075
Author: DS
Date: Mon, 03 Nov 2003 15:52
30 lines
2236 bytes
"(akula)" <akula@nym.alias.net> wrote in
news:3f20031103151938Z.21707643539@nntp3.sharks.plc.ltd: 

> DS <t.h.i.s.n.t.h.a.t@a.d.e.l.p.h.i.a..n.e.t> wrote:
> 
> [snip]
>>Note: In my experience, the standard listview has proven to be quite
>>slow in inserting items. Of course, I was trying to add 100,000+
>>items...the grouplist.
> [snip]
> 
> That's a well known problem.
> http://www.codeguru.com/listview/VirtualListControl.html
> is one solution.  There are
> more examples at Codeguru, 
> http://www.codeproject.com/
> and 
> http://msdn.microsoft.com/
> 

And that is the route I chose for my project. It works very well for huge 
recordsets of data. I also worked in different fonts and colors. It also 
works well for formatting data. I have the message byte count's stored as 
longs and when I get the callback to display the message size, it is then 
formatted to show xxx bytes, x.x kbytes, or x.xx megabytes. Time/date 
displays can be altered at that point too, for display the date in the 
local timezone or what have you.

DS
Re: Programming/NNTP Questions
#67128
Author: aaronb
Date: Mon, 10 Nov 2003 05:31
83 lines
4890 bytes
I have followed your suggestion for timing the responses from the server and
I think I have discovered where the bottleneck really is. I think it's the
process that you described. I believe that it's the way I'm grabbing the
data from the buffer itself and not so much the processing. I've found quite
a few examples of getting data from a NNTP server in C#, but everyone of
them was different and were very basic in nature. I'm still in the dark
about how much data at a time I should be getting from the socket and
putting into the buffer. My current method is to get 256 bytes at a time,
process it form the /r/n, cut one whole message from the XOVER response out
of the buffer, store it, save the excess buffer and add on to it in the next
read... of all the methods I've tried it seems to be working the best so
far. I'm not a very experienced programmer with windows apps, but I have
been programming one thing or another for the past 20 years. Is there any
advice you could give me on methods to use for interacting with the socket
and buffer to get the data in an easier or more productive fashion?

Aaron



"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:<Xns94284B9E63709idispcom@24.48.107.53>...
> "aaronb" <borgaaron@yahoo.com> wrote in
> news:3fa1d38d$0$50372$c3e8da3@news.astraweb.com:
>
> > Can anyone suggest a good place to look for discussion programming
> > NNTP applications?
> >
> > I've got some questions regarding socket operations and buffer
> > sizes.... My program is working just fine but I've noticed that
> > changing the buffer size changes things dramatically. I've done some
> > tests with other programs and have found that its about half as fast
> > as most news programs.
> >
> > Anyone have any tips for capturing the data from the socket and
> > processing the headers fields from an XOVER request? I have a process
> > that does it just fine, but I'm beginning to think that the slowness
> > factor in my program is based on how I am processing the buffer,
> > converting the data, and placing it on the screen in a listview...
> >
> > Aaron
> >
> >
>
> As boob said, you have to figure out where, if any, the bottleneck is.
>
> In the newsreader I'm writing, the bottleneck is the database system, as
> I'm slipstreaming messages into multiple databases at the time of the
> XOVER, I'm not writing anything to a temporary file.
>
> I would start out by first, picking a server that has good throughput, and
> a group with a good amount of messages in it.
>
> Then, do a lot of timing tests. Start out by having your program start the
> XOVER, when the buffers full, just dump it and keep receiving data. Time
> this. Next, repeat this, but take the buffer data and break it up into the
> correct fields, then just discard the data again. If it's any slower than
> the first part, you know there's a little time lost in the first step of
> processing, assuming the server d/l speed is consistent.
>
> Just keep doing this until you get through all of the steps the data takes
> from receiving through to displaying, and you should find either that one
> specific step is slowing things down, or all together all of the
processing
> is slowing it down.
>
> Now, after you know where the issues are, (try to) fix it.
>
> Note: In my experience, the standard listview has proven to be quite slow
> in inserting items. Of course, I was trying to add 100,000+ items...the
> grouplist.
>
> For further discussion's outside the group, please feel free to e-mail the
> address above with all but the last dot removed.
>
> Regards,
>
>
> DS
>
> http://users.adelphia.net/~thisnthat/zanews/index.htm

Re: Programming/NNTP Questions
#67134
Author: DS
Date: Mon, 10 Nov 2003 13:46
69 lines
4693 bytes
"aaronb" <borgaaron@yahoo.com> wrote in
news:3faf228c$0$801$c3e8da3@news.astraweb.com: 

> I have followed your suggestion for timing the responses from the
> server and I think I have discovered where the bottleneck really is. I
> think it's the process that you described. I believe that it's the way
> I'm grabbing the data from the buffer itself and not so much the
> processing. I've found quite a few examples of getting data from a
> NNTP server in C#, but everyone of them was different and were very
> basic in nature. I'm still in the dark about how much data at a time I
> should be getting from the socket and putting into the buffer. My
> current method is to get 256 bytes at a time, process it form the
> /r/n, cut one whole message from the XOVER response out of the buffer,
> store it, save the excess buffer and add on to it in the next read...
> of all the methods I've tried it seems to be working the best so far.
> I'm not a very experienced programmer with windows apps, but I have 
> been programming one thing or another for the past 20 years. Is there
> any advice you could give me on methods to use for interacting with
> the socket and buffer to get the data in an easier or more productive
> fashion? 
> 
> Aaron
> 

Aaron, I can't help you with specific C# code, I'm using VB, but I can 
explain how I've coded my program.

First, I'm not using the VB Winsock control, I have a Winsock class I'm 
using. The class:

1) Receives data. This fires the data received event.

2) The OnDataReceive event reads the entire buffer, then sends it to a 
procedure that parses the data packet.

3) In the parsePacket procedure, I do a headers() = Split(data,cr/lf), 
splitting the data by cr/lf's. Each element in the array is then passed to 
another procedure, parseHeader(headers(x)), which breaks the header dataset 
down into the actual NNTP fields and does additional processing such as 
multi-part detection. Any leftover data from the Split() is stored in a 
string variable. If at the start of the parsePacket() proc., there is data 
in the leftover variable, it is added to the beginning of the next packet 
sent.

4) Add to the database - this is my bottleneck. Since I'm using an Access 
database structure, I had experimented with many different techniques to 
get records into it and it is currently at what worked best at the time, 
but since then I have come up with a couple of other possibilities that I 
need to try out. It's the bottleneck because I'm d/l XOVER data on 10 
download threads simultaneously, and passing all of this data over thread 
boundaries, and generally maxing out the capabilities of the Jet db engine.

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.

While d/l XOVER data from 6 to 8 threads, I get about 100Kbytes d/l 
throughput while slipstreaming into the database. If, instead of entering 
into the db, I just write the data to a text file, I get 200-300KBytes d/l 
throughput from those same 6 to 8 threads. That is how much the db 
functions slow it down.

DS
Re: Programming/NNTP Questions
#67136
Author: aaronb
Date: Mon, 10 Nov 2003 18:42
44 lines
3436 bytes
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.

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.

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.

"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
>

Re: Programming/NNTP Questions
#67140
Author: 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
>>
> 
> 
Re: Programming/NNTP Questions
#67143
Author: Aaron Borg
Date: Tue, 11 Nov 2003 02:03
140 lines
7877 bytes
I think I see what you are doing now. You are using a class that someone
else built that uses a control that someone else built... so all the
workings under the hood are really hidden from you.

I'm using C# for this project. It's my first C# app. I'm used to using
VB.NET. I imagine that under the hood somewhere you are using a default
buffer size for each read from the socket. I have the ability to alter that
buffer size.

Here are the methods that I have tried:

1. Receive all the data from the socket till there isn't anymore to get.
Throw it all into one big string every time the buffer gets full, and then
put it in an array splitting it up by the /r/n's. Then I make another array
for each header breaking them up by the \t's. This works fine, but there is
nothing on the screen till the entire reading process in complete. Nothing
on the screen for a few minutes (or longer if you are downloading 800,000+
headers).

2. Send a new HEAD request for every header I want. Terribly slow. Most of
the examples I looked at worked this way.

3. Use XOVER and read X bytes from the stream, check for a /r/n, if found,
cut out and parse one header. if not found, read from the stream again till
I do find the /r/n. This is the method that I am using now and it seems to
work fine... I parse each header as I receive it and make DataTables inside
a DataSet. I make a new DataTable for each Message and store each header
that corresponds to it inside that table. Then when I want to download  a
file, all the posts that contain data for the one multi-part encoded file
are all located in the one table and I then have to download and decode
them.

I've been trying to figure out how the other commercial readers read from
the socket and parse the data so quickly... I'm not accessing the hard drive
at all in my process, its all stored in ram, but its still nowhere as fast
as these other products. Guess I'll just have to hack away at it till I
figure something out.


"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:Xns942FB0A468A4Cidispcom@24.48.107.54...
> "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
> >>
> >
> >
>

Re: Programming/NNTP Questions
#67911
Author: Collin David
Date: Sat, 07 Feb 2004 05:29
27 lines
2491 bytes
Here are my two cents...
i am in early process of creating a newsgroup client myself, in C# just like
you. For now, i'm in very early stage, just gathering information and all.
In the past, i've been mostly working in C++ for reading and parsing binary
files, and i'm currently working on another project of a business billing
software that mostly accesses and treats databases, all in C#. I though i
had to tell you about my background.

As far as my experience with C++ programming taught me, socket
conversations, file reading and com ports reading are very similar
processes. And different methods give different results on the same data,
but each time giving data with the same meaning.

getc() returns a single byte
fread(n) returns n bytes
readline() returns all bytes until a <CR><LF> is met.

So i didn't check the dot NET Framework documentation toroughly, but i guess
you might use another method for reading information sent by the server!

Despite i lack time currently, i'd be interesting in joining you in building
your news reader. If you chose to let me, please contact me directly... I'm
sending using my real e-mail ;-)

ThaNerd

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads