Android Question HTTP Request connection oddity

Derek Jee

Active Member
Licensed User
Longtime User
Hi There

My app makes many requests to my server, only on one of them it has an issue with the following message. I retry the request immediately and have success most times but definitely after a third time is sends ok.. The message is

The client failed to send a complete request on this REUSED connection before the timeout period elapsed; 0 bytes were read from client.

It appears to happen and the request never gets sent out giving me a null pointer error on the HTTPUtils2 lib.. All of the other requests never have this happen to them. It is odd..

Any ideas anyone? It is a bit vague I guess but an oddity just the same..

Thank you,


Derek.
 

Derek Jee

Active Member
Licensed User
Longtime User
Are you destroying the service?

Are you reusing the same HttpJob object (without calling Dim again)?

If no then it should work properly.

Hi Erel

I am not destroying the service but calling the same service over and over again.. How would I destroy them? Just in case I am doing it without knowing..

I am reusing the same HTTP job but do dim it each time..

It is very strange as it only seems to happen on certain requests.. I have another set of requests which are very speedy indeed which have no issues
 
Upvote 0

Derek Jee

Active Member
Licensed User
Longtime User
Hello @Derek Jee

I've just been catching up on the progress so far...what is the server path you're using? Is it a domain name or an IP address? The reason I ask is that if it's a domain name then it could be DNS related and it might be worth trying the IP address directly. If you ping the domain name several times in succession do you consistently get the same IP address pinging back? If not then you may be facing an issue with a DNS server fresh issue. If that is the case you may need to update the DNS server IPs to another DNS provider. Another possibility is the use of a web farm where a load balancer sends requests to different servers that can lead to timeouts if the load balancer is not configured correctly (I've had this issue before with IIS servers).

I'm throwing these ideas/thoughts out there as it looks as though just about everything else has been tried.


Hi Ed

Thank you.. I really appreciate your comments. The server I am using is our own and I am using a domain name. I ping this without any issue. I would expect timeouts server timeouts to manifest themselves differently in the error response. This error seems to be the device not sending the request and it timing out.. I could be wrong of course. If I could find out whether it was sending or timing out not sending it may help but I do not know how to determine that..

Thanks again..
 
Upvote 0

Ed Brown

Active Member
Licensed User
Longtime User
Hi @Derek Jee

Have you tried installing a packet sniffer like Wireshark on the server to see if the packets are coming in from the device/s? If you're on a unix/Linux machine you can download it from the web site at this page - just scroll down the bottom to see a list of the 3rd party packages. This will let you see what is coming out and what the server is sending back.
 
Upvote 0

Derek Jee

Active Member
Licensed User
Longtime User
Hi Ed

I have Fiddler4 on my pc which shows the traffic coming back I think, and my IIS log is showing the same trace. The problematic request does not seem to be sending anything out from the device..
 
Upvote 0

Derek Jee

Active Member
Licensed User
Longtime User
So, I am not sure if I mentioned this error before but I trap the sub (in HTTPUtils2) below and the 'Reason' argument contains the value java.net.SocketException: sendto failed: EPIPE (Broken pipe).. I think this is the actual error I should be concerned about-
Sub hc_ResponseError (Response As HttpResponse, Reason As String, StatusCode As Int, TaskId As Int)
 
Upvote 0

Derek Jee

Active Member
Licensed User
Longtime User
Hi Erel

I am pretty sure if I do that it would work knowing my luck.. Is there a chance I could get the whole project to you somehow? I am happy to let you remote to my pc too if you'd provide a service like that.. happy to pay for your time too..

Kind regards


Derek.
 
Upvote 0

Derek Jee

Active Member
Licensed User
Longtime User
Thank you Erel, I appreciate that. It is not particularly big, but the bit I have trouble with is a bit complex which is why I can't create a small project.. I guess I could do it but it will take more time than I have right now. Thank you though.

Kind regards,


Derek.
 
Upvote 0
Top