VB.NET Windows service and Web service that times out.

  • Thread starter Thread starter Genojoe
  • Start date Start date
G

Genojoe

I have a Windows Service (VB.NET) that runs 24/7. It
contacts a Web Service (VB.NET on IIS). As long as we
send requests to the Web Service at least once every 15
minutes, everything works fine. We send the request
asynchronously and wait for the response. When there is
a 30 minute or greater gap between requests, we get the
following error message in the Windows service return
thread:

Error #: 5, Description: The underlying connection was
closed: An unexpected error occurred on a receive.

The problem seems to be with some type of connection
timeout that is controlled either by the client or the
host. We can't find any settings in the IIS server or the
VB.NET Windows service that controls connection timeout.
If we immediately resend the request, it works fine. Our
sending code is:

Dim oAsyncCallback As AsyncCallback
oAsyncCallback = New AsyncCallback(AddressOf
priCallbackLoyalty)
C.WebService.BeginATransaction(oDataSet, oAsyncCallback,
C.WebService)

(C.WebService points to a valid Web service on the
internet. ATransaction is the name of a method on the Web
service.)

Our return code is:

Private Sub priCallbackLoyalty(ByVal oResult As
IAsyncResult)
Dim oDataSet As DataSet
Try
C.WebService.EndATransaction(oResult, oDataSet)
Catch ex As Exception
C.Log("Error reading Asynch return: " & Err.Description)
End Try

Any help, feedback, or comments would be appreciated.
 
Genojoe,
I think this is the mainpart of your question

The problem seems to be with some type of connection
timeout that is controlled either by the client or the
host. We can't find any settings in the IIS server or the
VB.NET Windows service that controls connection timeout.
If we immediately resend the request, it works fine.

Did you check this in the asp.net group?
Cor
 
(Duplicate of answer for previous question. Hope you see
one of these. You can watch to see if any results occur
at my alternate posting.

To Cor and Fergus:

Thank you for your comments. Here are some answers to
your comments.

(1) I am posting these questions to the
microsoft.public.dotnet.framework.webservices. Thanks for
the tip. I found that location by searching for "ASP.NET"
and finding the most frequently used site.

(2) Neither the Windows Service or Web Service has any
ASP.NET associated with them.

(3) I posted these separately because the problems are
independent of each other. In one case, it happens
whenever we go more than 30 minutes without a transaction
being sent by server. We have error trapping and the
system functions. It just causes an automatic
resubmission and a delay in the process (which makes the
end user wait longer than expected). During the busy time
of day there is no problem because the requests go every
10 or 15 minutes. During slower part of day, there can be
a 60 minute gap between requests.

The second problem happens sporatically perhaps once every
week or two at one location (out of 10). We have no idea
about what causes it. We have never seen it happen when
being closely monitored or tested. So far, our error
trapping has not yielded any clues and we have no idea of
how to duplicate the problem. (We only know how to fix it
(stop and restart windows service.) Who knows when it
will happen again?

Gene
 
Back
Top