Connection Reset by Peer - Timeout changes not taking effect?

I'm using Delphi 2010 and have a product that consumes a Web Service that I have been having some trouble with lately, and I cannot put my finger on how to get it back up and running. I originally started getting the "Handle is in the wrong state" error, but I was able to use the updated SOAPHTTPTrans.pas from this forum to fix this issue and at least get a proper error, which in my case is "Connection Reset by Peer". I've tried changing the Connect, Send and Receive timeout values on the HTTPWebNode, but
 they do not seem to have any effect on how long it takes (not long, approximately 2 seconds) for the error to pop up. If I make repeated attempts, eventually I can get lucky and get a response before the connection gives out, but this isn't workable in the long term. 

I don't have any control of the web server, so I tried creating a test app in VB.NET in VS2008, and when doing the same calls in that environment it works fine, but it is obviously waiting much longer than D2010 is for the call to complete. Its worth noting that it takes about 6 seconds for the call to come back when it works, its nothing obscene like 5 minutes or anything like that.

I looked into the SOAPHTTPTrans file to make sure that it wasn't using Nil for the Request parameter in the Wininet calls to set those values, and it is definitely passing Request as I understand it should be, but even when passing larger values, like 12 seconds, or very large values, like 2 minutes it always fails after approximately 2 seconds. 

Is there some other kind of timeout setting I should be looking at?
0
Scott
7/25/2011 7:57:47 PM
embarcadero.delphi.webservices 976 articles. 0 followers. Follow

4 Replies
874 Views

Similar Articles

[PageSpeed] 56

Hello,

> I'm using Delphi 2010 and have a product that consumes a Web Service that 
> I have been having some trouble with lately, and I cannot put my finger on 
> how to get it back up and running. I originally started getting the 
> "Handle is in the wrong state" error, but I was able to use the updated 
> SOAPHTTPTrans.pas from this forum to fix this issue and at least get a 
> proper error, which in my case is "Connection Reset by Peer". I've tried 
> changing the Connect, Send and Receive timeout values on the HTTPWebNode, 
> but
> they do not seem to have any effect on how long it takes (not long, 
> approximately 2 seconds) for the error to pop up. If I make repeated 
> attempts, eventually I can get lucky and get a response before the 
> connection gives out, but this isn't workable in the long term.
>
> I don't have any control of the web server, so I tried creating a test app 
> in VB.NET in VS2008, and when doing the same calls in that environment it 
> works fine, but it is obviously waiting much longer than D2010 is for the 
> call to complete. Its worth noting that it takes about 6 seconds for the 
> call to come back when it works, its nothing obscene like 5 minutes or 
> anything like that.
>
> I looked into the SOAPHTTPTrans file to make sure that it wasn't using Nil 
> for the Request parameter in the Wininet calls to set those values, and it 
> is definitely passing Request as I understand it should be, but even when 
> passing larger values, like 12 seconds, or very large values, like 2 
> minutes it always fails after approximately 2 seconds.
>
> Is there some other kind of timeout setting I should be looking at?
>

When it comes to timeout, the version of WinInet matters. Sadly, earlier 
versions were quite buggy. So, the first thing would be to find the version 
of WinInet - typically tied to the version of IE - installed on the client 
machine.

We've been successful with the latest version of WinInet regarding timeout: 
our internal bug tracking client (known as RAID) often needs minutes to 
handle queries that return large datasets. So we expose UI that tweak the 
'ConnectTimeOut/SendTimeOut and ReceiveTimeOut' values.

Can you tell us about the version of WinInet/IE where the problem is seen? 
Does the Service require https? If not, you can also try using Indy instead 
of WinInet. It's slower in general but handles timeout better than earlier 
versions of WinInet.

Cheers,

Bruneau
0
Jean
7/28/2011 3:08:29 PM
> {quote:title=Jean-Marie Babet wrote:}{quote}
> 
> Can you tell us about the version of WinInet/IE where the problem is seen? 
> Does the Service require https? If not, you can also try using Indy instead 
> of WinInet. It's slower in general but handles timeout better than earlier 
> versions of WinInet.
> 

The web service that I am consuming does require https, so it seems Indy is out, unfortunately. I have IE 8 (8.0.7601.17514) and my wininet.dll is reporting its version as 8.00.7601.17601.

I did read several notes about previous versions having issues, but I thought I was clear of that by being on IE 8. 

In case I'm doing something wrong here and that my code is causing the problem, here is the code I'm using in my test application to create the HTTPRIO and set the timeout values:

var
  gHTTP: THTTPRIO;

  gHTTP := THTTPRIO.Create(self);
  gHTTP.HTTPWebNode.ConnectTimeout := 120000;
  gHTTP.HTTPWebNode.SendTimeout    := 120000;
  gHTTP.HTTPWebNode.ReceiveTimeout := 120000;
  gHTTP.WSDLLocation := '###';
  gHTTP.HTTPWebNode.UserName := '###';
  gHTTP.HTTPWebNode.Password := '###';

This code will only wait ~2 seconds before giving up, even though it looks to me that it should be 2 minutes at this point (I've tried increasing large values with no change).
0
Scott
8/1/2011 2:08:03 PM
Hello,

> In case I'm doing something wrong here and that my code is causing the 
> problem, here is the code I'm using in my test application to create the 
> HTTPRIO and set the timeout values:
>
> var
>  gHTTP: THTTPRIO;
>
>  gHTTP := THTTPRIO.Create(self);
>  gHTTP.HTTPWebNode.ConnectTimeout := 120000;
>  gHTTP.HTTPWebNode.SendTimeout    := 120000;
>  gHTTP.HTTPWebNode.ReceiveTimeout := 120000;
>  gHTTP.WSDLLocation := '###';
>  gHTTP.HTTPWebNode.UserName := '###';
>  gHTTP.HTTPWebNode.Password := '###';
>
> This code will only wait ~2 seconds before giving up, even though it looks 
> to me
> that it should be 2 minutes at this point (I've tried increasing large 
> values with no change).
>

Don't know if that's the culprit but don't use the 'WSDLLocation' property. 
Instead use the '.URL' property. When you use WSDLLocation, at runtime we 
have to reload the WSDL, parse it and find the Service EndPoint. That worked 
fined for earlier services where the WSDL contains all the information. 
Nowdays, most (lots of) WSDLs import/refer-to other URLs... and the 
'.WSDLLocation' logic won't follow them.

Look at the file generated by the importer. Somewhere in there you'll see a 
'getInterfaceName' method and the latter should have the value of the 
Service's URL/Endpoint. That's what you want to use.

Let me know if that does not help.

Also have something like WireShark/Ethereal to see what's going on the wire 
would help here.

Cheers,

Bruneau
0
Jean
8/1/2011 3:42:17 PM
> {quote:title=Jean-Marie Babet wrote:}{quote}
> Hello,
> 
> > In case I'm doing something wrong here and that my code is causing the 
> > problem, here is the code I'm using in my test application to create the 
> > HTTPRIO and set the timeout values:
> >
> > var
> >  gHTTP: THTTPRIO;
> >
> >  gHTTP := THTTPRIO.Create(self);
> >  gHTTP.HTTPWebNode.ConnectTimeout := 120000;
> >  gHTTP.HTTPWebNode.SendTimeout    := 120000;
> >  gHTTP.HTTPWebNode.ReceiveTimeout := 120000;
> >  gHTTP.WSDLLocation := '###';
> >  gHTTP.HTTPWebNode.UserName := '###';
> >  gHTTP.HTTPWebNode.Password := '###';
> >
> > This code will only wait ~2 seconds before giving up, even though it looks 
> > to me
> > that it should be 2 minutes at this point (I've tried increasing large 
> > values with no change).
> >
> 
> Don't know if that's the culprit but don't use the 'WSDLLocation' property. 
> Instead use the '.URL' property. When you use WSDLLocation, at runtime we 
> have to reload the WSDL, parse it and find the Service EndPoint. That worked 
> fined for earlier services where the WSDL contains all the information. 
> Nowdays, most (lots of) WSDLs import/refer-to other URLs... and the 
> '.WSDLLocation' logic won't follow them.
> 
> Look at the file generated by the importer. Somewhere in there you'll see a 
> 'getInterfaceName' method and the latter should have the value of the 
> Service's URL/Endpoint. That's what you want to use.
> 
> Let me know if that does not help.
> 
> Also have something like WireShark/Ethereal to see what's going on the wire 
> would help here.
> 
> Cheers,
> 
> Bruneau

I changed my code so that I'm setting the URL to the endpoint URL instead of using the WSDL location and it seems to have fixed my issue! Jumping into long operations right out of the gate is causing no further problems and it seems everything is working as expected. 

I don't know if I would have ever tried that one without the advise, thanks!
0
Scott
8/1/2011 3:54:49 PM
Reply:

Similar Artilces:

Delphi XE HTTP: error "Socket Error #10054 Connection reset by peer" [Edit]
Communication type is set to HTTP, LifeCycle is set to Invocation. Invocation represents a stateless connection, but when the network connection drops, the client throws the error "Socket Error #10054 Connection reset by peer". Are there any other properties to set up apart from LifeCycle? Hi Irina, > Communication type is set to HTTP, LifeCycle is set to Invocation. > > Invocation represents a stateless connection, but when the network connection drops, the client throws the error "Socket Error #10054 Connection reset by peer". Are there any other proper...

Can change of connection string reset the connection pool?
Hi, In fact, I already asked a similar question about closing/reset all connections in connection pool. But I want to know clearly about how to do this. I have the following questions for this issue: 1. Suppose some connections are created a connection string (with connection pool settings), if I update the connection string with new password, will ASEConnection know to create a new connections with new connection pool via Open() method? In my case, it will not. But I want to know if someone encounter difficult results? 2. If the above step 1 not work, then sho...

Connection reset by peer
Hello, I changed from an ADSL provider to a Fiber provider. Now I get everytime the exception "Connection reset by peer" when closing the idFTP1 connection: idFTP1.Disconnect (Indy 10) I also tried idFTP1.DisconnectNotifyPeer and idFTP1.Quit, but the exception is still raised. How can I solve this problem ? Thanks, Hubert Anemaat > {quote:title=Hubert Anemaat wrote:}{quote} > Hello, > > I changed from an ADSL provider to a Fiber provider. Now I get everytime the exception "Connection reset by peer" when closing the *idFTP1* connection Is it...

changes not taking effect
This might appear silly but its taking a lot of time. On my local machine i am testing a website. I made some changes to a function definition . Elsewhere when i am trying to call this function, the earlier definition is being referenced and the new arguments that i include shows error.cam someone help me out...Thanks    hope this is what you want:you have a function which is called from other parts. everything is ok. then you modify the definition of function and you have some problems.if changing the definition of function means addding or removing parameters or chang...

Connection reset by peer....
I frequently get a "connection reset by peer" message when connected to the grc groups. It seems to happen after some idle time. Is there some type of time limit that only allows us to be connected for a certain length of time? -- OverSoul Imagination is more important than Knowledge. --Albert Einstein-- OverSoul ... > I frequently get a "connection reset by peer" message when > connected to the grc groups. It seems to happen after some > idle time. Is there some type of time limit that only allows > us to be c...

Connection reset by peer
Jaguar 4.2.2 (build 42211) XP Hi ! I=b4ve a connection cache over Oracle 9i native driver. The database Oracle is in Unix. When I try to do a ping I recieve this message error "java.net.sockectexception: connection reset by peer" and the Jaguar server finish with this message in the error.log "A Fatal NT Exception [EXCEPTION_ACCESS_VIOLATION(0xc0000005)] was received while executing the method 'pingByUser' of the component 'Jaguar/CMPing'." But if I change the native driver by ODBC it=b4s work perfectly. =bf some idea ? ...

Connection reset by peer,
Hi I have a Delphi XE2 Datasnap webbroker ISAPI (IIS 7.5) I get Socket Error #10054 Connection reset by peer constantly just after living the client idle for a couple of minutes. This is not a firewall problem. It's the Datasnap server that closes the connection. What could cuase this problem? regards Mikael ...

Connect reset by peer
I'm doing a migration from SQL Server 10, Open Client 10.0.1 to Server 11.0.3, Open Client 10.0.4 on Solaris 2.4. I've got a C application using CT-Lib functions which was running alright before, but it is quite frequently killed with a message "System error (131) connection reset by peer" after migration. I know that it is a unix system error but I suspect that it was caused by Sybase. Is there any configuration (server config, memory, etc) that possibly cause this error? Any idea would be welcome. ...

Connection reset by peer
<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> I keep getting "Connect reset by peer" messages from Jaguar upon method return.&nbsp; I'm accessing component methods via JAWS and HTTP that return HTML strings.&nbsp; I write debugging messages to the srv.log that report on the progress of the method.&nbsp; The method seems to be exiting as is should.&nbsp; I write a log message just before the return.&nbsp; Any ideas what might be causing these errors?&nbsp; The messages just started to appear...&nbsp;...

changes not taking effect
I changed my gridView Row Wrap property to false and set a field visible to false.  After several runs, my changes have not taken effect.  What am I missing ? Do you mean that you are making changes on your webform and you do not see your changes at run time ? maybe you have a build error .. try to build your project with 0 errors .. and close your Visual Studio ..and then go to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Filesand delete its content ..then from Start menu ..choose run and type cmd .. and then type iisreset ..then open your visual stu...

Peer to peer connection
Hi, I'm trying to make a program to transfer files between my pc and another that is behind a router. My side will act as master and the other just as a slave, serving what master asks without user interference. I know that the easiest way is to run a idTCPserver at the slave side and a idTCPclient at master's side, but this needs to forward the used port at the router. I want to keep out of this. So I try the reverse way. A idTCPclient at slave side and idTCPserver at my side as master (in my side I can forward ports). Starting the slave it connects to master-server. Af...

Connection reset by peer #2
I've created a web application using the html DW control in Powesite. It works very nicely, including a master-detail setup and conditional formatting in the Datawindows rendered into the web pages. The performance is better than I expected. Once in a while I have to restart Jaguar after getting: ---------------------------------------------------- ERROR: Creating Jaguar component 'DataWindow/HTMLGenerator', 'Exception thrown: org.omg.CORBA.COMM_FAILURE: iiop://SOBPC02:9000 - java.net.SocketException: Connection reset by peer in method CreateComponent of class jagc...

#10054 Connection reset by peer
Hi, I upgraded from Indy 10 r3830 to r4103. Now I (very) often get this #10054 exception after I disconnect. The same application using r3830 doesn't have this problem. In the status event of IdFtp: Disconnecting then Disconnected but then this exception (#100054). I found some changes in IdFtp "DisconnectNotifyPeer": - r4103: procedure TIdFTP.DisconnectNotifyPeer; begin if IOHandler.Connected then begin IOHandler.WriteLn('QUIT'); {do not localize} IOHandler.CheckForDataOnSource(100); if not IOHandler.InputBufferIsEmpty then begin ...

I/O Error Connection reset by peer
Hi everyone, I use Net::LDAP in a script that does a daily search on a large LDAP database (~80,000 entries). The expected return from the search is ~2000 entries. One run of the script threw up this error: my $mesg = $ldap->search(base=>...); $mesg->error was "I/O Error Connection reset by peer" I dont think this has anything to do with an ldap search size limit. For one thing, I expect to get a "sizelimit exceeded" error in that case and I have error-handling for that and the other thing is that I dont expect to exceed the size limit. I use...

Connection reset by peer error 10054
Hello, Using Delphi XE3 I developed a Datasnap webbroker ISAPI (IIS 7.5) application which works fine as you works with it... To be more clear If I leave the app inactive and try to use it after 3/4 minutes I receive a "socket error #10054 connection reset by peer" error I'm using a session live cycle on the server and I didn't changed any session default timeout (which should be 20mins.). Is there any kind of inactivity timeout I have to set up for a longer period ? Is there a way to intercept this error to try reconnecting to the server ? Thanks, Davide Hi, ...

Web resources about - Connection Reset by Peer - Timeout changes not taking effect? - embarcadero.delphi.webservices

Connection - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

iMedia Connection: Interactive Marketing News, Features, Podcasts and Video - iMediaConnection.com
High-quality data, if not used properly, can still lead marketers to make bad decisions. Consider these common ways that numbers are used to ...

HTTP persistent connection - Wikipedia, the free encyclopedia
... tacked on to an existing protocol. If the browser supports keep-alive, it adds an additional header to the request: Following this, the connection ...

CareerSonar Turns Facebook Friends Into Job Connections
Looking for a job ? Among your Facebook friends lies the potential for employment. CareerSonar , a new service, brings together a person’s connections ...

Sydney's beauty relies on its visual and physical connection to nature
Landowners, custodians and developers must collaborate to create a healthy environment, happy residents and a more productive city.

Adam Savage from 'MythBusters' has an incredible connection to the 'Star Wars' franchise
Adam Savage, co-host of the popular " MythBusters " television show, soured on the plot of "Interstellar." But when it comes to the newest films ...

Heavyset woman with facial hair arrested in connection to downto - CBS News 8 - San Diego, CA News Station ...
Police were on the lookout Thursday for a heavyset woman with facial hair who stabbed a man in the East Village.

10th person arrested in connection with Paris attacks
CNN 10th person arrested in connection with Paris attacks CNN (CNN) Belgian police have arrested a 10th person in connection with last month's ...

Should auld connections be forgot...
This environmental testing company has strict data-retention requirements and they go beyond the data, reports a pilot fish on the scene. "Per ...

Test Claims To Show T-Mobile’s YouTube “Optimization” Is Just Connection Throttling
... on the same network, and at the same time of day. They tested video streaming against three other kinds of downloads and measured the connection ...

Resources last updated: 1/6/2016 3:25:37 AM