Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / March 2008

Tip: Looking for answers? Try searching our database.

Troubleshoot IOException on IAsyncResult and HTTPS

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Martijn van Schie - 07 Mar 2008 11:05 GMT
Hi,

I have a issue where is ever so often get an IOException:

Type : System.IO.IOException, mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
Message : Unable to read data from the transport connection: The connection
was closed.
Source : System
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : System.IAsyncResult InternalWrite(Boolean, Byte[], Int32,
Int32, System.AsyncCallback, System.Object)

We are creating the request custom using the HttpWebRequest object and
execute the using the Page.RegisterAsyncTask.

           HttpWebRequest request =
(HttpWebRequest)WebRequest.Create(_navigationUri);

           byte[] requestBytes =
System.Text.Encoding.ASCII.GetBytes(authenticateMessage);

           request.Method = "POST";
           request.ContentType = "text/xml; charset=\"utf-8\"";
           request.ContentLength = requestBytes.Length;

           combinedAsyncState.ProxyState = new object[] { request,
requestBytes };
           return request.BeginGetRequestStream(callback, state);

The error occures only once every 10 minutes during a webtest. The trouble
is that this is very hard to debug because i cannot reproduce the error when
i want.
The party claims they have no error, nor are they responsible for the error.
Putting something like Fiddler in between to catch the request and response
message is also no option, because the requests are over HTTPS.

What is the best opproach to tackle this issue.
Regards,
Martijn
John Saunders [MVP] - 07 Mar 2008 16:40 GMT
> Hi,
>
> I have a issue where is ever so often get an IOException:
...
> The error occures only once every 10 minutes during a webtest. The trouble
> is that this is very hard to debug because i cannot reproduce the error
[quoted text clipped - 5 lines]
>
> What is the best opproach to tackle this issue.

Can you try to reproduce it with HTTP?

Also, please post the entire exception, including the InnerException and
stack traces.
Signature

--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer

Martijn van Schie - 10 Mar 2008 09:36 GMT
Hi John,

It's hard for me to reproduce it using HTTP, because we are using a test
WebService from a third party authorisation service.

The entire stacktrace comes to this:

Stack Trace :
   at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer,
Int32 offset, Int32 size, AsyncCallback callback, Object state)
   at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32
size)
   at TestApplication.ClientProxy.EndPostXmlMessageRequest(IAsyncResult
asyncResult)
   at TestApplication.ClientProxy.EndVerifyRequest(IAsyncResult
asyncResultRequest)
   at
TestApplication.Async.AsyncVerification.EndAsyncVerifyRequest(IAsyncResult
asyncResult)

We recently found out that a bug in .NET framework 2.0 sometimes results in
a connection closed causes by a Keep-Alive connection time out. This was
fixed in SP1.
I have asked the customer i they have installer SP1 on there production
machines.

>> Hi,
>>
[quoted text clipped - 14 lines]
> Also, please post the entire exception, including the InnerException and
> stack traces.
John Saunders [MVP] - 10 Mar 2008 18:22 GMT
> Hi John,
>
[quoted text clipped - 15 lines]
> TestApplication.Async.AsyncVerification.EndAsyncVerifyRequest(IAsyncResult
> asyncResult)

That's an interesting pattern of End* method calls. Can you provide an
outline of the pattern of async calling? Is EndPostXmlMessageRequest your
code? Does it explicitly call Write on the stream?

Also, in this case, it's possible that more than just the stack trace may be
interesting. Can you provide the output of ex.ToString()? That is, when you
catch the exception, run ToString on the caught exception, then post the
result. That will include all of the nested InnerException instances.

Signature

--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer

Martijn van Schie - 10 Mar 2008 20:59 GMT
Hi John,

Our customer let me know today that the issue is resolved after installing
SP1.
I agree on the End* stack :). The application is programmed to be very
generic and modulated, and yes, the EndPostXmlMessageRequest is ours. It's
handles the callback from a custom soap request to a webservice proxy using
the HttpWebRequest object.

One problem is that i can't reproduce the issue that easily anymore, as i
installed SP1 on both the test and development machine. I might have a stack
for you from an eventlog backup or issue tracker. I'll try to find one and
post it for you.

Thank you for your time anyways.

Regards,
Martijn

>> Hi John,
>>
[quoted text clipped - 24 lines]
> you catch the exception, run ToString on the caught exception, then post
> the result. That will include all of the nested InnerException instances.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.