Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Problem with asynchronous HttpWebRequest

Reply
Thread Tools

Problem with asynchronous HttpWebRequest

 
 
Assaf Shemesh
Guest
Posts: n/a
 
      02-07-2006
Hi,

I'm having a problem with asynchronous HttpWebRequest. It's a simple
http client-server. For most of my users it works fine. However, some
of them get the exception:

System.Net.WebException: Unable to connect to the remote server --->
System.Net.Sockets.SocketException: The attempted operation is not
supported for the type of object referenced
at System.Net.Sockets.Socket.get_ConnectEx()
at System.Net.Sockets.Socket.BeginConnectEx(EndPoint remoteEP,
Boolean flowContext, AsyncCallback callback, Object state)
at System.Net.Sockets.Socket.UnsafeBeginConnect(EndPo int remoteEP,
AsyncCallback callback, Object state)
at System.Net.ServicePoint.ConnectSocketInternal(Bool ean
connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress&
address, ConnectSocketState state, IAsyncResult asyncResult, Int32
timeout, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult
asyncResult)

My code is:

Uri url = new Uri(getURI());
m_request = (HttpWebRequest)WebRequest.Create(url);
m_request.Credentials = CredentialCache.DefaultCredentials;
m_request.UserAgent = getUserAgent();
m_request.BeginGetResponse(new AsyncCallback(ProcessResponse), null);

and then:

private void ProcessResponse(IAsyncResult asynchronousResult) {
HttpWebResponse response =
(HttpWebResponse)m_request.EndGetResponse(asynchro nousResult);
Stream stream = response.GetResponseStream();
....
}

This is so weird.
Any ideas ?

Thanks!

 
Reply With Quote
 
 
 
 
Eric Pearson
Guest
Posts: n/a
 
      02-07-2006
Is it a normal "http://server/" address?

Are you using IPSEC?

It's possible the tcp/ip registry settings could be corrupted...
http://support.microsoft.com/kb/811259



> Hi,
>
> I'm having a problem with asynchronous HttpWebRequest. It's a simple
> http client-server. For most of my users it works fine. However, some
> of them get the exception:
>
> System.Net.WebException: Unable to connect to the remote server --->
> System.Net.Sockets.SocketException: The attempted operation is not
> supported for the type of object referenced
> at System.Net.Sockets.Socket.get_ConnectEx()
> at System.Net.Sockets.Socket.BeginConnectEx(EndPoint remoteEP,
> Boolean flowContext, AsyncCallback callback, Object state)
> at System.Net.Sockets.Socket.UnsafeBeginConnect(EndPo int remoteEP,
> AsyncCallback callback, Object state)
> at System.Net.ServicePoint.ConnectSocketInternal(Bool ean
> connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress&
> address, ConnectSocketState state, IAsyncResult asyncResult, Int32
> timeout, Exception& exception)
> --- End of inner exception stack trace ---
> at System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult
> asyncResult)
> My code is:
>
> Uri url = new Uri(getURI());
> m_request = (HttpWebRequest)WebRequest.Create(url);
> m_request.Credentials = CredentialCache.DefaultCredentials;
> m_request.UserAgent = getUserAgent();
> m_request.BeginGetResponse(new AsyncCallback(ProcessResponse), null);
> and then:
>
> private void ProcessResponse(IAsyncResult asynchronousResult) {
> HttpWebResponse response =
> (HttpWebResponse)m_request.EndGetResponse(asynchro nousResult);
> Stream stream = response.GetResponseStream();
> ...
> }
> This is so weird.
> Any ideas ?
> Thanks!
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Asynchronous HttpWebRequest APA ASP .Net 0 05-31-2008 08:17 AM
HttpWebRequest Asynchronous Mike C# ASP .Net 2 11-13-2006 01:23 AM
HttpWebRequest: Processing synchronous or asynchronous Sojwal Chitnis ASP .Net 1 06-09-2005 06:15 PM
Asynchronous HttpWebRequest Michael ASP .Net 2 11-16-2004 11:46 PM
HttpWebResponse/HttpWebRequest problem... Satinderpal Singh ASP .Net 2 06-04-2004 04:40 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57