By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,887 Members | 1,214 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,887 IT Pros & Developers. It's quick & easy.

Managing Bandwidth with C#

P: n/a
I'm writing an application that's bandwidth intense.

My available bandwidth is 1.5Mbps (cable modem) and I know
I can reach around 1.4Mbps, if not more.

The application I am writing right now simply connects to a
newsgroup and downloads the headers. It doesn't do any more
specific programmming after that. However, the app will
use, at most, 100kbps bandwidth. I'm hoping that it can run
much faster than that and reach somewhere close to the 1.
4Mbps maximum.

Is there any way I can use C# to increase this bandwidth
aside from multi-threading and connecting multiple times to
the news server? I hope so... I welcome any input.

Thank you.
Nov 15 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Chibi,

If there is such an option, then you will probably have to set the
individual socket properties (however, I don't know of any offhand,
otherwise, I would have offered it).

Also, you are limited by the bandwidth on the other end as well. Do you
know that the NNTP server on the other end can support that throughput?

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Chibi" <an*******@discussions.microsoft.com> wrote in message
news:07****************************@phx.gbl...
I'm writing an application that's bandwidth intense.

My available bandwidth is 1.5Mbps (cable modem) and I know
I can reach around 1.4Mbps, if not more.

The application I am writing right now simply connects to a
newsgroup and downloads the headers. It doesn't do any more
specific programmming after that. However, the app will
use, at most, 100kbps bandwidth. I'm hoping that it can run
much faster than that and reach somewhere close to the 1.
4Mbps maximum.

Is there any way I can use C# to increase this bandwidth
aside from multi-threading and connecting multiple times to
the news server? I hope so... I welcome any input.

Thank you.

Nov 15 '05 #2

P: n/a
Nicholas,

Thanks for your reply.

As for the other end, using a newsreader, I can constantly
reach 1.4Mbps. I tested both applications (the one I'm
writing and the one I'm currently using) side by side and
the current newsreader never has any speed issues. Of
course, I'm not running both simultaneously.

I will have to look into socket properties now. At least
you got me thinking a bit.

I appreciate your help and hope you or anyone else reading
this can help me find a good solution.

Thank you!

-----Original Message-----
Chibi,

If there is such an option, then you will probably have to set theindividual socket properties (however, I don't know of any offhand,otherwise, I would have offered it).

Also, you are limited by the bandwidth on the other end as well. Do youknow that the NNTP server on the other end can support that throughput?
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Chibi" <an*******@discussions.microsoft.com> wrote in messagenews:07****************************@phx.gbl...
I'm writing an application that's bandwidth intense.

My available bandwidth is 1.5Mbps (cable modem) and I know I can reach around 1.4Mbps, if not more.

The application I am writing right now simply connects to a newsgroup and downloads the headers. It doesn't do any more specific programmming after that. However, the app will
use, at most, 100kbps bandwidth. I'm hoping that it can run much faster than that and reach somewhere close to the 1. 4Mbps maximum.

Is there any way I can use C# to increase this bandwidth
aside from multi-threading and connecting multiple times to the news server? I hope so... I welcome any input.

Thank you.

.

Nov 15 '05 #3

P: n/a
Hi Chibi,

IIRC a TCP connection speed is dependand of several factors, in general
it's as fast as the bandwith allow, creating more connection will not help
the speed of the first, al least of course that you have some bandwidth
control system in place.

I'm also curious of how you calculate the bandwidth of both the
applications.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Chibi" <an*******@discussions.microsoft.com> wrote in message
news:07****************************@phx.gbl...
I'm writing an application that's bandwidth intense.

My available bandwidth is 1.5Mbps (cable modem) and I know
I can reach around 1.4Mbps, if not more.

The application I am writing right now simply connects to a
newsgroup and downloads the headers. It doesn't do any more
specific programmming after that. However, the app will
use, at most, 100kbps bandwidth. I'm hoping that it can run
much faster than that and reach somewhere close to the 1.
4Mbps maximum.

Is there any way I can use C# to increase this bandwidth
aside from multi-threading and connecting multiple times to
the news server? I hope so... I welcome any input.

Thank you.

Nov 15 '05 #4

P: n/a
Ignacio,

My calculation is not very scientific. Basically, I'm
using both applications to download only headers from the
same newsgroup and news server. With the application I've
written, I've calculated 100 headers in about 30 seconds.
With the commercial application, 100 headers download at
about 2-3 seconds.

Also, it is possible to measure ballpark figures by
calculating number of lines in each header and multiply it
by average number of characters per line.

Obviously, I didn't use a calculator to calculate exact
figures but by the measurements I pointed out above,
there's a huge difference in speed in what I wrote and
what the other application can do. I would like to know
how I can get figures closer to those of the commercial
application.

Any suggestions would be kindly welcomed.

Thank you.

-----Original Message-----
Hi Chibi,

IIRC a TCP connection speed is dependand of several factors, in generalit's as fast as the bandwith allow, creating more connection will not helpthe speed of the first, al least of course that you have some bandwidthcontrol system in place.

I'm also curious of how you calculate the bandwidth of both theapplications.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Chibi" <an*******@discussions.microsoft.com> wrote in messagenews:07****************************@phx.gbl...
I'm writing an application that's bandwidth intense.

My available bandwidth is 1.5Mbps (cable modem) and I know I can reach around 1.4Mbps, if not more.

The application I am writing right now simply connects to a newsgroup and downloads the headers. It doesn't do any more specific programmming after that. However, the app will
use, at most, 100kbps bandwidth. I'm hoping that it can run much faster than that and reach somewhere close to the 1. 4Mbps maximum.

Is there any way I can use C# to increase this bandwidth
aside from multi-threading and connecting multiple times to the news server? I hope so... I welcome any input.

Thank you.

.

Nov 15 '05 #5

P: n/a
HI Chibi,
My calculation is not very scientific. Basically, I'm
using both applications to download only headers from the
same newsgroup and news server. With the application I've
written, I've calculated 100 headers in about 30 seconds.
With the commercial application, 100 headers download at
about 2-3 seconds.


Are you running your application from the debugger?
If so I will suggest you to compile it to release and run it from the
prompt.
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Nov 15 '05 #6

P: n/a
Chibi,

10 bucks says that you're using the NNTP HEAD command to retrieve the
headers individually instead of using the NNTP XOVER command (which is what
every other respectable newsgroup software is doing).

If you ever want to find out what commands your news software is using, try
a packet sniffer to monitor your TCP communications.
http://www.prism.gatech.edu/~gte477n/languages/csharp/

Hope this helps,
Jacob
"Chibi" <an*******@discussions.microsoft.com> wrote in message
news:07****************************@phx.gbl...
I'm writing an application that's bandwidth intense.

My available bandwidth is 1.5Mbps (cable modem) and I know
I can reach around 1.4Mbps, if not more.

The application I am writing right now simply connects to a
newsgroup and downloads the headers. It doesn't do any more
specific programmming after that. However, the app will
use, at most, 100kbps bandwidth. I'm hoping that it can run
much faster than that and reach somewhere close to the 1.
4Mbps maximum.

Is there any way I can use C# to increase this bandwidth
aside from multi-threading and connecting multiple times to
the news server? I hope so... I welcome any input.

Thank you.

Nov 15 '05 #7

P: n/a
Also, reuse open connections when possible. TCP takes a bit to get to
the max capacity of the line. If your code makes many connections and
then closes them, the speed won't/can't increase. Agent, my
newswreader, usually keeps a connection to server open for 5 minutes,
allowing efficient retrieval of headers/messages.

Increase the # of headers you download, and you should come close to
maxing out.

Austin
On Mon, 5 Jan 2004 06:16:44 -0800, "Chibi"
<an*******@discussions.microsoft.com> wrote:
Ignacio,

My calculation is not very scientific. Basically, I'm
using both applications to download only headers from the
same newsgroup and news server. With the application I've
written, I've calculated 100 headers in about 30 seconds.
With the commercial application, 100 headers download at
about 2-3 seconds.

Also, it is possible to measure ballpark figures by
calculating number of lines in each header and multiply it
by average number of characters per line.

Obviously, I didn't use a calculator to calculate exact
figures but by the measurements I pointed out above,
there's a huge difference in speed in what I wrote and
what the other application can do. I would like to know
how I can get figures closer to those of the commercial
application.

Any suggestions would be kindly welcomed.

Thank you.

-----Original Message-----
Hi Chibi,

IIRC a TCP connection speed is dependand of several

factors, in general
it's as fast as the bandwith allow, creating more

connection will not help
the speed of the first, al least of course that you have

some bandwidth
control system in place.

I'm also curious of how you calculate the bandwidth of

both the
applications.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Chibi" <an*******@discussions.microsoft.com> wrote in

message
news:07****************************@phx.gbl...
I'm writing an application that's bandwidth intense.

My available bandwidth is 1.5Mbps (cable modem) and Iknow I can reach around 1.4Mbps, if not more.

The application I am writing right now simply connectsto a newsgroup and downloads the headers. It doesn't do anymore specific programmming after that. However, the app will
use, at most, 100kbps bandwidth. I'm hoping that it canrun much faster than that and reach somewhere close to the1. 4Mbps maximum.

Is there any way I can use C# to increase this bandwidth
aside from multi-threading and connecting multipletimes to the news server? I hope so... I welcome any input.

Thank you.

.


Nov 15 '05 #8

P: n/a
Jacob,

Thank you very much for your feedback.

Both of your suggestions have turned out to be very
helpful in my case. If I could send you a $10 bill via
newsgroups, I would. I was using the HEAD command to
retrieve headers. I read an (apparently outdated) RFC on
the NNTP protocol and did not run across the XOVER
command. I'm glad you mentioned it to me.

The NetSniffer also retrieved information that really
helped me understand my problem. It's a very handy utility.

Now, I'm going to go back and study more on the XOVER
command and figure out how to parse the data sent back.

I appreciate your help and from all those others who gave
me information to think about.

Thank you and take care!

-----Original Message-----
Chibi,

10 bucks says that you're using the NNTP HEAD command to retrieve theheaders individually instead of using the NNTP XOVER command (which is whatevery other respectable newsgroup software is doing).

If you ever want to find out what commands your news software is using, trya packet sniffer to monitor your TCP communications.
http://www.prism.gatech.edu/~gte477n/languages/csharp/

Hope this helps,
Jacob
"Chibi" <an*******@discussions.microsoft.com> wrote in messagenews:07****************************@phx.gbl...
I'm writing an application that's bandwidth intense.

My available bandwidth is 1.5Mbps (cable modem) and I know I can reach around 1.4Mbps, if not more.

The application I am writing right now simply connects to a newsgroup and downloads the headers. It doesn't do any more specific programmming after that. However, the app will
use, at most, 100kbps bandwidth. I'm hoping that it can run much faster than that and reach somewhere close to the 1. 4Mbps maximum.

Is there any way I can use C# to increase this bandwidth
aside from multi-threading and connecting multiple times to the news server? I hope so... I welcome any input.

Thank you.

.

Nov 15 '05 #9

P: n/a
At one point I had to find out the same thing. The original NNTP protocol
doesn't include the XOVER command. It's part of the NNTP extensions (RFC
2980). You'll find that virtually every server supports this command, but
it would be wise to still develop a method using the HEAD command just in
case your client's server doesn't. To make the most of the XOVER command,
do some research on the LIST OVERVIEW.FMT command. It will return a list of
all the fields of information that you can expect to receive from the XOVER
command. That what you know what your client's server will be sending and
how to parse it. The XOVER command should return all those fields separated
by tabs, so it should be easy to split the field information on the tabs.

I've been writing a NNTP program for some time, but because of work
restraints, I don't know if I'll ever be able to finish it. But I would be
happy to help you out form time to time with the things I learned along the
way. Keep me apprised of your progress.

ja**********@hotmail.com
Jacob


"Chibi" <an*******@discussions.microsoft.com> wrote in message
news:01****************************@phx.gbl...
Jacob,

Thank you very much for your feedback.

Both of your suggestions have turned out to be very
helpful in my case. If I could send you a $10 bill via
newsgroups, I would. I was using the HEAD command to
retrieve headers. I read an (apparently outdated) RFC on
the NNTP protocol and did not run across the XOVER
command. I'm glad you mentioned it to me.

The NetSniffer also retrieved information that really
helped me understand my problem. It's a very handy utility.

Now, I'm going to go back and study more on the XOVER
command and figure out how to parse the data sent back.

I appreciate your help and from all those others who gave
me information to think about.

Thank you and take care!

-----Original Message-----
Chibi,

10 bucks says that you're using the NNTP HEAD command to

retrieve the
headers individually instead of using the NNTP XOVER

command (which is what
every other respectable newsgroup software is doing).

If you ever want to find out what commands your news

software is using, try
a packet sniffer to monitor your TCP communications.
http://www.prism.gatech.edu/~gte477n/languages/csharp/

Hope this helps,
Jacob
"Chibi" <an*******@discussions.microsoft.com> wrote in

message
news:07****************************@phx.gbl...
I'm writing an application that's bandwidth intense.

My available bandwidth is 1.5Mbps (cable modem) and I know I can reach around 1.4Mbps, if not more.

The application I am writing right now simply connects to a newsgroup and downloads the headers. It doesn't do any more specific programmming after that. However, the app will
use, at most, 100kbps bandwidth. I'm hoping that it can run much faster than that and reach somewhere close to the 1. 4Mbps maximum.

Is there any way I can use C# to increase this bandwidth
aside from multi-threading and connecting multiple times to the news server? I hope so... I welcome any input.

Thank you.

.

Nov 15 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.