473,756 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Very Fast Multithreaded URL Fetching

Hello,

Does anyone know if an object or how to create one, that will allow me to
fetch up to 10 URLs (containing XML-feed data) in an extremelly fast server
side fashion?

If the request is taking longer than it should, the object would need to be
able to timeout on the spot (without waiting). The timeout value would need
to be acurate to about 50 milliseconds. Usually, I would want the timeout to
be around 1.5 seconds.

Thanks in advance,
Arsen
Nov 15 '05 #1
10 2319
Arsen,

Suppose the first question is why does it need to be multithreaded?

Running it in a thread possibly fair enough but a simple loop should
suffice, no point complicating something that doesnt require it ;-)

Look at WebRequest class. You can set the timeout as a property. Feed the
WebRequest.Crea te(URI) from values in a loop from an array of 10 that holds
your urls.

Tam

"Arsen V." <ar************ ****@emergency2 4.com> wrote in message
news:eU******** ******@TK2MSFTN GP12.phx.gbl...
Hello,

Does anyone know if an object or how to create one, that will allow me to
fetch up to 10 URLs (containing XML-feed data) in an extremelly fast server side fashion?

If the request is taking longer than it should, the object would need to be able to timeout on the spot (without waiting). The timeout value would need to be acurate to about 50 milliseconds. Usually, I would want the timeout to be around 1.5 seconds.

Thanks in advance,
Arsen

Nov 15 '05 #2
Arsen,

Suppose the first question is why does it need to be multithreaded?

Running it in a thread possibly fair enough but a simple loop should
suffice, no point complicating something that doesnt require it ;-)

Look at WebRequest class. You can set the timeout as a property. Feed the
WebRequest.Crea te(URI) from values in a loop from an array of 10 that holds
your urls.

Tam

"Arsen V." <ar************ ****@emergency2 4.com> wrote in message
news:eU******** ******@TK2MSFTN GP12.phx.gbl...
Hello,

Does anyone know if an object or how to create one, that will allow me to
fetch up to 10 URLs (containing XML-feed data) in an extremelly fast server side fashion?

If the request is taking longer than it should, the object would need to be able to timeout on the spot (without waiting). The timeout value would need to be acurate to about 50 milliseconds. Usually, I would want the timeout to be around 1.5 seconds.

Thanks in advance,
Arsen

Nov 15 '05 #3
sorry, and i should have added...

Running 10 consecutive webrequests is considered rude by standard internet
protocol. 2 is the standard which is why XP is set to only allow two
downloads at any one time.

so a single threaded loop to go through an array of urls is your best
solution ;)

Tam
"Arsen V." <ar************ ****@emergency2 4.com> wrote in message
news:eU******** ******@TK2MSFTN GP12.phx.gbl...
Hello,

Does anyone know if an object or how to create one, that will allow me to
fetch up to 10 URLs (containing XML-feed data) in an extremelly fast server side fashion?

If the request is taking longer than it should, the object would need to be able to timeout on the spot (without waiting). The timeout value would need to be acurate to about 50 milliseconds. Usually, I would want the timeout to be around 1.5 seconds.

Thanks in advance,
Arsen

Nov 15 '05 #4
sorry, and i should have added...

Running 10 consecutive webrequests is considered rude by standard internet
protocol. 2 is the standard which is why XP is set to only allow two
downloads at any one time.

so a single threaded loop to go through an array of urls is your best
solution ;)

Tam
"Arsen V." <ar************ ****@emergency2 4.com> wrote in message
news:eU******** ******@TK2MSFTN GP12.phx.gbl...
Hello,

Does anyone know if an object or how to create one, that will allow me to
fetch up to 10 URLs (containing XML-feed data) in an extremelly fast server side fashion?

If the request is taking longer than it should, the object would need to be able to timeout on the spot (without waiting). The timeout value would need to be acurate to about 50 milliseconds. Usually, I would want the timeout to be around 1.5 seconds.

Thanks in advance,
Arsen

Nov 15 '05 #5
hey, where did my oringal reply go?... ok, here it is again.

Arsen,

Suppose the first question is why does it need to be multithreaded?

Running it in a thread possibly fair enough but a simple loop should
suffice, no point complicating something that doesnt require it ;-)

Look at WebRequest class. You can set the timeout as a property. Feed the
WebRequest.Crea te(URI) from values in a loop from an array of 10 that holds
your urls.

Tam

"joseph.ing lis" <jo***********@ btclick.com> wrote in message
news:bv******** **@hercules.bti nternet.com...
sorry, and i should have added...

Running 10 consecutive webrequests is considered rude by standard internet
protocol. 2 is the standard which is why XP is set to only allow two
downloads at any one time.

so a single threaded loop to go through an array of urls is your best
solution ;)

Tam
"Arsen V." <ar************ ****@emergency2 4.com> wrote in message
news:eU******** ******@TK2MSFTN GP12.phx.gbl...
Hello,

Does anyone know if an object or how to create one, that will allow me to fetch up to 10 URLs (containing XML-feed data) in an extremelly fast server
side fashion?

If the request is taking longer than it should, the object would need to

be
able to timeout on the spot (without waiting). The timeout value would

need
to be acurate to about 50 milliseconds. Usually, I would want the

timeout to
be around 1.5 seconds.

Thanks in advance,
Arsen


Nov 15 '05 #6
hey, where did my oringal reply go?... ok, here it is again.

Arsen,

Suppose the first question is why does it need to be multithreaded?

Running it in a thread possibly fair enough but a simple loop should
suffice, no point complicating something that doesnt require it ;-)

Look at WebRequest class. You can set the timeout as a property. Feed the
WebRequest.Crea te(URI) from values in a loop from an array of 10 that holds
your urls.

Tam

"joseph.ing lis" <jo***********@ btclick.com> wrote in message
news:bv******** **@hercules.bti nternet.com...
sorry, and i should have added...

Running 10 consecutive webrequests is considered rude by standard internet
protocol. 2 is the standard which is why XP is set to only allow two
downloads at any one time.

so a single threaded loop to go through an array of urls is your best
solution ;)

Tam
"Arsen V." <ar************ ****@emergency2 4.com> wrote in message
news:eU******** ******@TK2MSFTN GP12.phx.gbl...
Hello,

Does anyone know if an object or how to create one, that will allow me to fetch up to 10 URLs (containing XML-feed data) in an extremelly fast server
side fashion?

If the request is taking longer than it should, the object would need to

be
able to timeout on the spot (without waiting). The timeout value would

need
to be acurate to about 50 milliseconds. Usually, I would want the

timeout to
be around 1.5 seconds.

Thanks in advance,
Arsen


Nov 15 '05 #7
There are a couple of ways of doing this. I think the simplest is to use the
HttpWebRequest object. In your loop you would do:

foreach (string url in urls)
{
HttpWebRequest request = new HttpWebRequest( ...);
request.BeginGe tResponse(...);
}

that will queue up all the requests. In the call to BeginGetRespons e(), you
can specify a callback that will be executed when the requests finish. In
that function you'll get EndGetResponse( ) which will get you a WebResponse
object with the data you want.

--
Eric Gunnerson

Visit the C# product team at http://www.csharp.net
Eric's blog is at http://weblogs.asp.net/ericgu/

This posting is provided "AS IS" with no warranties, and confers no rights.
"Arsen V." <ar************ ****@emergency2 4.com> wrote in message
news:eU******** ******@TK2MSFTN GP12.phx.gbl...
Hello,

Does anyone know if an object or how to create one, that will allow me to
fetch up to 10 URLs (containing XML-feed data) in an extremelly fast server side fashion?

If the request is taking longer than it should, the object would need to be able to timeout on the spot (without waiting). The timeout value would need to be acurate to about 50 milliseconds. Usually, I would want the timeout to be around 1.5 seconds.

Thanks in advance,
Arsen

Nov 15 '05 #8
There are a couple of ways of doing this. I think the simplest is to use the
HttpWebRequest object. In your loop you would do:

foreach (string url in urls)
{
HttpWebRequest request = new HttpWebRequest( ...);
request.BeginGe tResponse(...);
}

that will queue up all the requests. In the call to BeginGetRespons e(), you
can specify a callback that will be executed when the requests finish. In
that function you'll get EndGetResponse( ) which will get you a WebResponse
object with the data you want.

--
Eric Gunnerson

Visit the C# product team at http://www.csharp.net
Eric's blog is at http://weblogs.asp.net/ericgu/

This posting is provided "AS IS" with no warranties, and confers no rights.
"Arsen V." <ar************ ****@emergency2 4.com> wrote in message
news:eU******** ******@TK2MSFTN GP12.phx.gbl...
Hello,

Does anyone know if an object or how to create one, that will allow me to
fetch up to 10 URLs (containing XML-feed data) in an extremelly fast server side fashion?

If the request is taking longer than it should, the object would need to be able to timeout on the spot (without waiting). The timeout value would need to be acurate to about 50 milliseconds. Usually, I would want the timeout to be around 1.5 seconds.

Thanks in advance,
Arsen

Nov 15 '05 #9
Hi Eric,

Thanks for the suggestion.

Would I be able to achive performance of the Web Application Stress tool
using the Async HttpWebRequest or do I have to use sockets in multiple
threads?

Also, in your example how do I implement the timeout (needs to be able to
timeout in 500ms - 2000ms).

Also, how do I wait for either the timeout or all of the Async requests
completing?

Thanks,
Arsen

"Eric Gunnerson [MS]" <er****@online. microsoft.com> wrote in message
news:OI******** ******@tk2msftn gp13.phx.gbl...
There are a couple of ways of doing this. I think the simplest is to use the HttpWebRequest object. In your loop you would do:

foreach (string url in urls)
{
HttpWebRequest request = new HttpWebRequest( ...);
request.BeginGe tResponse(...);
}

that will queue up all the requests. In the call to BeginGetRespons e(), you can specify a callback that will be executed when the requests finish. In
that function you'll get EndGetResponse( ) which will get you a WebResponse
object with the data you want.

--
Eric Gunnerson

Visit the C# product team at http://www.csharp.net
Eric's blog is at http://weblogs.asp.net/ericgu/

This posting is provided "AS IS" with no warranties, and confers no rights. "Arsen V." <ar************ ****@emergency2 4.com> wrote in message
news:eU******** ******@TK2MSFTN GP12.phx.gbl...
Hello,

Does anyone know if an object or how to create one, that will allow me to fetch up to 10 URLs (containing XML-feed data) in an extremelly fast server
side fashion?

If the request is taking longer than it should, the object would need to

be
able to timeout on the spot (without waiting). The timeout value would

need
to be acurate to about 50 milliseconds. Usually, I would want the

timeout to
be around 1.5 seconds.

Thanks in advance,
Arsen


Nov 15 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2430
by: Eric S. Johansson | last post by:
I have an application where I need a very simple database, effectively a very large dictionary. The very large dictionary must be accessed from multiple processes simultaneously. I need to be able to lock records within the very large dictionary when records are written to. Estimated number of records will be in the ballpark of 50,000 to 100,000 in his early phase and 10 times that in the future. Each record will run about 100 to 150...
2
6641
by: pradyumna | last post by:
In Project settins - C/C++ - Code Generation, what is the difference between the option "Multithreaded" and "Multithreaded DLL". I understand that on selecting multithreaded option, single and multithreaded applications can both use that dll, but what about multithreaded DLL option. Thanks
6
2788
by: Dan Kelley | last post by:
We have a multithreaded app that responds to events, and writes these events to a text file. This text file is used by an external system for further processing. We want to be able to write multiple entries to the file, and then rename it and copy it to a new location when the file reaches a certian size, or a certain time span elapses (which ever comes first). I have created a static/shared timer member variable in class that writes...
4
1709
by: Jürgen Devlieghere | last post by:
We encounter a crash every now and then at a client, and now I'm starting to doubt the fundamentals of life :-) We have a list of structs. struct SContactProperty { public: SContactProperty(void) : m_strName(_T("")), m_strValue(_T("")), m_bHidden(false) {};
6
8579
by: B B | last post by:
Okay, here is what's happening: I have a reasonably fast laptop (1.4 GHz Mobile M, so comparable to 2.5GHz P4) doing .net development. Running Windows XP pro, SP2 IIS is installed and running fine All SQL Servers I am referring to share a small (10 computers or so) LAN with a 100MB Switch. No other computers on the LAN exhibit this problem.
0
1706
by: Shujun Huang | last post by:
Hi, I am working on converting Informix database to Postgre. I have one question for fetching records using PostgreSQL. The record I am fetching is a variable size text string. Before fetching the record, a preallocated static buffer size will have to be declared beforehand in the declaration section. Since the record sizes vary a lot, instead of using the static buffer, is there a dynamic way to fetch these records? Informix (Oracle...
50
5727
by: diffuser78 | last post by:
I have just started to learn python. Some said that its slow. Can somebody pin point the issue. Thans
3
2601
by: groups | last post by:
Hi all, I've recently ported a rather large C application to run multithreaded. A few functions have seriously deteriorated in performance, in particular when accessing a rather large global array, that contains information that is shared among threads. Any idea, why the lines accessing this global array now take about 50x longer in the multithreaded application?
3
4599
by: Jake K | last post by:
I have a multithreaded application that I now want to convert into a Windows Service. Does application.run work in a windows service? Are there things to take into consideration when creating a multithreaded windows service as opposed to a multithreaded windows forms application? E.G. namespace whatever {
0
9271
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10031
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9869
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9838
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8709
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2665
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.