Connecting Tech Pros Worldwide Forums | Help | Site Map

WebResponse.GetResponse

Kevinyy's Avatar
Member
 
Join Date: Jul 2008
Posts: 77
#1: Sep 11 '08
I've been reading, and ive come across some information that states: "the WebRequest class function GetResponse locks the access to all other processes, the WebRequest tells the retrieved response as closed"

How can i fix this? i was thinking, sockets would work, but i dont know how to get/access web pages data using sockets (i only know how to get the main host data...since that's where the IP address directs)

or even async GetResponse (http://msdn.microsoft.com/en-us/libr...09(VS.71).aspx)

Kevinyy's Avatar
Member
 
Join Date: Jul 2008
Posts: 77
#2: Sep 12 '08

re: WebResponse.GetResponse


and if i choose the async method: http://msdn.microsoft.com/en-us/lib...409(VS.71).aspx
- does anyone know a simpler explanation, this one confuses me :(
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#3: Sep 12 '08

re: WebResponse.GetResponse


a *lot* of functions are blocking like that. Does it take too long for you or something?
Kevinyy's Avatar
Member
 
Join Date: Jul 2008
Posts: 77
#4: Sep 12 '08

re: WebResponse.GetResponse


Quote:

Originally Posted by Plater

a *lot* of functions are blocking like that. Does it take too long for you or something?

It doesnt process all the webrequests properly
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#5: Sep 12 '08

re: WebResponse.GetResponse


GetResponse() should only block the current thread, not anything else.
Kevinyy's Avatar
Member
 
Join Date: Jul 2008
Posts: 77
#6: Sep 12 '08

re: WebResponse.GetResponse


Quote:

Originally Posted by Plater

GetResponse() should only block the current thread, not anything else.

hmm..so if i make each new request start on a new thread i should be in good shape?
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#7: Sep 15 '08

re: WebResponse.GetResponse


I think?
The requests shouldn't take very long anyway though?
Reply