Closed connection is being re-used

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello,

I have a windows service (written on .NET 1.1/C#) connecting to a webservice
at a specified interval. I have a webreference in my project, create and
instance of this object, and call my webservice methods. The interval was
initially set to 60 seconds and everything was working fine. I changed the
config so that the service is connecting to the webservice every 5 minutes.
This is when i started getting the following error messages: 'The underlying
connection was closed: An unexpected error occurred on a send.'

I did some investigation on this error and used a packet sniffer to see what
is exactly happening. The first time everything is working fine and after
about 2 minutes the connection is reset. (Server sends TCP header with RST
flag). The instance of proxy class (from webreference) does not detect the
connection is reset and tries to connect over the closed connection. This
causes the exception. The next call will succeed (a new connection is
created), the following call will fail again etc. I thought that creating a
new instance of the proxy class at every call and explicitly call Dispose()
would fix my problem but it doesn't. There seems to be some connection
pooling not removing closed connections?

Any idea what causes this behaviour? Thanks in advance!

Eric




.



Relevant Pages

  • Re: Some clients wont connect - node type?
    ... As suggested I ran ipconfig /renew on a failing workstation while ... but eventaully connection is Closed. ... NetBios session, Closed Connection, Allow ... You can use the logging functionality in ISA to see which rule is causing ...
    (microsoft.public.windows.server.sbs)
  • Re: Some clients wont connect - node type?
    ... As suggested I ran ipconfig /renew on a failing workstation while ... but eventaully connection is Closed. ... NetBios session, Closed Connection, Allow ... You can use the logging functionality in ISA to see which rule is causing ...
    (microsoft.public.windows.server.sbs)
  • Re: Checking peer connection is lost or not
    ... whether peer socket is closed or not. ... If the peer has closed connection, then select will return and no ...
    (comp.unix.programmer)
  • Optimising Connections & DataAdapters
    ... "when you use the adapter with a closed connection it will open it, ... If you use the adapter ... currently each DataLayer function creates its own, new, SqlConnection, and I ...
    (microsoft.public.dotnet.framework.adonet)
  • Optimising Connections & DataAdapters
    ... "when you use the adapter with a closed connection it will open it, ... If you use the adapter ... currently each DataLayer function creates its own, new, SqlConnection, and I ...
    (microsoft.public.dotnet.framework.aspnet)