473,387 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

WebRequest.Create and timeout

Bob
I've got to use the http protocol to communicate with another machine as
part of a Web Service using HttpWebRequest and HttpWebResponse. As such,
timing is important.

When I create the HttpWebRequest as shown in the help example:
Dim myReq As HttpWebRequest = _
WebRequest.Create("http://www.contoso.com/")

does this actually go out and try and establish some sort of connection
with the remote site? If so, I'll need to spin this off in a thread so I
can create a timeout.

Thanks,

Bob
Nov 18 '05 #1
4 1944
Bob <no********@forevermail.com> wrote in news:MPG.1a9ac5e95b3fac86989680
@news.microsoft.com:
When I create the HttpWebRequest as shown in the help example:
Dim myReq As HttpWebRequest = _
WebRequest.Create("http://www.contoso.com/")

does this actually go out and try and establish some sort of connection
with the remote site? If so, I'll need to spin this off in a thread so I
can create a timeout.


Do you mean the Create as opposed to another method? or the WebRequest object
in general?
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
ELKNews - Get your free copy at http://www.atozedsoftware.com

Nov 18 '05 #2
Bob
In article <Xn******************@127.0.0.1>, cp**@hower.org says...
Bob <no********@forevermail.com> wrote in news:MPG.1a9ac5e95b3fac86989680
@news.microsoft.com:
When I create the HttpWebRequest as shown in the help example:
Dim myReq As HttpWebRequest = _
WebRequest.Create("http://www.contoso.com/")

does this actually go out and try and establish some sort of connection
with the remote site? If so, I'll need to spin this off in a thread so I
can create a timeout.


Do you mean the Create as opposed to another method? or the WebRequest object
in general?
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
ELKNews - Get your free copy at http://www.atozedsoftware.com

Sorry. The Create method.

Bob
Nov 18 '05 #3
Bob wrote:
I've got to use the http protocol to communicate with another machine
as part of a Web Service using HttpWebRequest and HttpWebResponse. As
such, timing is important.

When I create the HttpWebRequest as shown in the help example:
Dim myReq As HttpWebRequest = _
WebRequest.Create("http://www.contoso.com/")

does this actually go out and try and establish some sort of
connection with the remote site? If so, I'll need to spin this off in
a thread so I can create a timeout.


No, it can't. Otherwise, you would have a hard time setting HTTP headers
that affect the underlying TCP connection ;-)

Cheers,
--
Joerg Jooss
jo*********@gmx.net

Nov 18 '05 #4
The request isn't executed until you try to get the response stream.

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.

"Joerg Jooss" <jo*********@gmx.net> wrote in message
news:uq*************@TK2MSFTNGP09.phx.gbl...
Bob wrote:
I've got to use the http protocol to communicate with another machine
as part of a Web Service using HttpWebRequest and HttpWebResponse. As
such, timing is important.

When I create the HttpWebRequest as shown in the help example:
Dim myReq As HttpWebRequest = _
WebRequest.Create("http://www.contoso.com/")

does this actually go out and try and establish some sort of
connection with the remote site? If so, I'll need to spin this off in
a thread so I can create a timeout.


No, it can't. Otherwise, you would have a hard time setting HTTP headers
that affect the underlying TCP connection ;-)

Cheers,
--
Joerg Jooss
jo*********@gmx.net

Nov 18 '05 #5

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

Similar topics

5
by: C# Learner | last post by:
Is it possible to create a WebRequest instance and, instead of giving it a URI, give it an actual HTTP request? e.g.: GET / HTTP/1.1 Host: www.google.com CR LF CR LF Thanks in advance.
2
by: news.microsoft.com | last post by:
Hello I try to implement "retry" if connection to web ends with "time out". I want to give a chance to prolong waiting for response. The following code is taken from WebRequest.GetResponse()...
1
by: aaronfude | last post by:
Hi, I'm running the following code to read a URL into a string. When the url is offline, it times out after about 10 seconds regardless of what I set myRequest.Timeout to. Any suggestions? ...
3
by: Stephane | last post by:
Hi, I'm trying to use PayPal and its Instant Payment Notification. In short, when a payment is made, PayPal send a post to my server and I post it back to PayPal. I'm using WebRequest to do...
0
by: Gordon | last post by:
I use the following code to get source HTML. The second line seems to work when I get no response from a site. However, I want to stop the request if it's taking more than 20 - 30 seconds. I can't...
1
by: Christian Urbanczyk | last post by:
Hello! I have a problem with the Webrequest. I've search everywhere to find an answer but it seems that no one has the the problem before. So i hope somebody can help me here! Following Code:...
0
by: thomasabcd | last post by:
Hi, During the user's registration I wan't to geo-code an address using localsearchmaps.com/geo. For that purpose I use a webrequest like this: string url =...
3
by: Jonathan | last post by:
I appreciate anyone's insight on this as I am new to web programming with .NET. I have a simple method which I use to send various HTTP requests to a web server (snippet below). On the first...
2
by: kkb | last post by:
Hello! First, I'm sorry because of my english... I'll try to be understandable! I've got a strange problem using .NET 2003 C# and I haven't figured it out for a long time. I'm implementing an...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...

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.