This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Possible bug with multiple fetch?
#1
Hello

I sit on a windows 10 machine.
I am doing multiple 'basic' get with 'http://192.168.0.5:8080/get?acc_time=0.41327542&accX=0.41327542|acc_time' in Postman and using curl. Works fine every time.

But when i use Node.Js ( tested the following: node-fetch, axios, native etc) and in the same code (with proper async/await) hit the same url multiple times ( also tried with 5sec delay), the first request goes ok, the second and so on error with ECONNRESET. 

I have also tested similar setting with C#/Java. Similar story ( little different error messages but deep down there socket hang up :-)

I can do multiple accX=full requests and so on without error. I have looked at the master branch for the Java remote server and cant see any specific reason.

Please, tell me that i am missing something obvious :-)

Best regards
Kaj
Reply
#2
Sounds odd. Since the main difference seems to be that you are using properly threaded code in your non-working example, I could imagine that your code is running too efficient. A thing to know about the web server implementation in phyphox is that it is not multi-threaded. This in particular means that the phyphox web server will not handle any request until the previous connection has been closed. On most simple implementations this is not a problem and typical parallel requests from webbrowsers are patient and wait until their requests are being handled.

So, my first theory would be that your proper implementation sends a request just when the last one has been closed but before the poor phone had the time to open back up for business. Just a first thought, but without aby node.js experience or the code I cannot really say more... On the other hand it is weird that the full requests come through just fine.
Reply
#3
Hello again

And thanx for the fast response! Yes it could be something like that, first i suspected that i was doing something wrong in node.js, therefore i tested with the other language.

Yes 2, the full request works, even in loop upto 5 times. Havent tested with more. I have to investigate some more, at least i now know that i am on the track at least.


Students by the way like you product, it's a great way to make them program/do datahandling/timeseries/fft and so on with real data :-) So keep up the good work.

Best regards
Kaj
Reply
#4
Seems I also have the same case.
Reply


Forum Jump: