Re: web serivce: client side timeout?

Tech-Archive recommends: Fix windows errors by optimizing your registry



On Feb 7, 7:35 pm, "John Saunders [MVP]" <john.saunders at
trizetto.com> wrote:
"hzgt9b" <celof...@xxxxxxxxx> wrote in message

news:a0c37b20-24f7-40ca-8da3-960fc07e487f@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Feb 7, 11:53 am, "John Saunders [MVP]" <john.saunders at





trizetto.com> wrote:
"hzgt9b" <celof...@xxxxxxxxx> wrote in message

news:7408ea26-aea6-4cf3-8217-d3a4307cfe80@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Using VS2005, VB.NET,

BACKGROUND
I have a windows forms application that makes calls to a web service.
All my clients work on project provided laptops (all have exact same
set-up, configuration and software installations). The service is long
running (uploading large files) so to avoid timeouts we set the client
side timeout to be infinite:

Dim objWebService As New org.myCompany.myDomain.myServices
objWebService.Timeout = Timeout.Infinite

The server side timeout is set to have a long timeout window (30
minutes) also.

PROBLEM
Given this setup I would not expect timeouts to be possible from the
client side but only from the server side. But here is an error
message that some (not all) of my clients are getting:

System.Net.WebException: Unable to connect to the remote server ---
&gt; System.Net.Sockets.SocketException: A connection attempt failed
because the connected party did not properly respond after a period of
time, or established connection failed because connected host has
failed to respond
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,
SocketAddress socketAddress)
at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean
connectFailure, Socket s4, Socket s6, Socket&amp; socket,
IPAddress&amp; address, ConnectSocketState state, IAsyncResult
asyncResult, Int32 timeout, Exception&amp; exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.GetRequestStream()
at
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at myApp.org.myCompany.myDomain.myServices.Upload(String,
DateTime , String, String, Object) at myApp.myClass.myMethod()

To me this looks like the client side is not able to reach the web
service and is timing out. Because I control what is installed on the
client machines I can rule out third party conflicts (fire walls, anti-
virus, and such). Why else would I be getting a client side timeout
given my set-up (i.e. web service timeout set to infinite)? If this is
not a client side timeout please correct me! BTW, the web service is
on a secure site (https) and I do set the web service object's
credentials to a properly configured NetworkCredential object. Could
the credentials in my NetworkCredential object expire causing a
timeout (don't think so, just grabbing for straws)?

Note that this is a timeout on the connection attempt. Your client-side
timeout is not relevant in this case.

You should consider adding retry code that traps this specific exception
and
tries again a certain number of times.
--
---------------------------------------------------------------------------­­-----
John Saunders | MVP - Windows Server System - Connected System Developer-
Hide quoted text -

- Show quoted text -

So whats the difference betweent the connection attempt and the web
service connection?

=======
Before the client can communicate to the server, a TCP/IP connection needs
to be established. It is that process that is timing out in your case.

Once the connection is established, data can be sent and received using the
TCP/IP connection. This is the timeout you configured to be infinite.
--
---------------------------------------------------------------------------­-----
John Saunders | MVP - Windows Server System - Connected System Developer- Hide quoted text -

- Show quoted text -

Thanks for the prompt replyies:
Obvious next question: if I configured the timeout to be infinite then
why would I get a timeout and why is my "...client-side
timeout is not relevant in this case"? I have some retries in the
application, I'm just trying to understand the root cause behind the
(now identified TCP/IP) timeouts...
.



Relevant Pages

  • Re: web serivce: client side timeout?
    ... client side but only from the server side. ... System.Net.Sockets.SocketException: A connection attempt failed ... asyncResult, Int32 timeout, Exception& exception) ... John Saunders | MVP - Windows Server System - Connected System ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: detecting the (brute) disconnection of a client
    ... crashed, and if an exception occurs, then the client is deconnected. ... You can either use the timeout itself as an indication of connection failure, or you can attempt to send data after the timeout. ... The server has no way to know if the connection has failed due to a client-side crash, or simply due to a temporary problem with the network. ... IMHO, it would be better to simply let the server continue to assume that the connection is valid unless there is some explicit, non-arbitrary verification that it's not. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: VPN timeouts
    ... You remote clients VPN connection will timeout while trying to connect SBS ... We recommend that client to access VPN server by SBS connection manager. ... and then right click 'Microsoft Firewall' to ...
    (microsoft.public.windows.server.sbs)
  • Re: web serivce: client side timeout?
    ... client side but only from the server side. ... System.Net.Sockets.SocketException: A connection attempt failed ... asyncResult, Int32 timeout, Exception& exception) ... John Saunders | MVP - Windows Server System - Connected System ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: web serivce: client side timeout?
    ... I have a windows forms application that makes calls to a web service. ... The server side timeout is set to have a long timeout window (30 ... client side but only from the server side. ... System.Net.Sockets.SocketException: A connection attempt failed ...
    (microsoft.public.dotnet.languages.vb)