Page 1 of 1
help
Posted: Fri Aug 07, 2009 12:57 pm
by ConvertFromOldNGs
by sam >> Wed, 8 Mar 2006 23:01:45 GMT
help
Re: help
Posted: Fri Aug 07, 2009 12:57 pm
by ConvertFromOldNGs
by sam >> Wed, 8 Mar 2006 23:13:14 GMT
I am a rookie in Jade , and I doing Tcp POST using Jade. What I currently met is that is the response time. I must wait 20-30 seconds to get response. I had wrote a Java program to test , it just cost 1 second less.
So it is not the network problem. I attach my program . Any help will be appreciated
Re: help
Posted: Fri Aug 07, 2009 12:57 pm
by ConvertFromOldNGs
by Torrie >> Thu, 9 Mar 2006 0:01:50 GMT
I'm guessing your problem is due to the line
response := oTCPConnection.readBinary(2000).String;write response;
Jade expects to receive 2000 bytes of data and will wait until the timeout expires before continuing. You could try reducing the timeout value but this may cause problems on the slow links. I'm not familar with the response to a POST but does it have a header that includes the amount of data returned? If so then I would suggest the following (assume the first 4 bytes of the response is the length)
iDataLength := oTCPConnection.readBinary(4).String.Integer;
respone := oTCPConnection.readBinary(iDataLength).String;
This way you are not waiting for more data than you expect to receive.