GithubHelp home page GithubHelp logo

Comments (6)

Coriou avatar Coriou commented on August 24, 2024

The error is pretty clear : the request timed out

With the current implementation, the timeout is fixed at 1 second and you can't really change it globally. I opened a PR to support this (#72)

Your problem is either that the server is actually down, or that it's too slow (could be too far way from you too) to reply in under 1 second

from node-gamedig.

omarAjmi avatar omarAjmi commented on August 24, 2024

sorry for late reply.
after almost 2 weeks dealing with this module i can't really rely on it for my huge project..it works for 3/10 queries for the same server. i know most of the time it's because of the servers that i query but i can't find a better solution.
any suggestions for a reliable solution?

from node-gamedig.

Coriou avatar Coriou commented on August 24, 2024

I'm not the author of the module, all the magic and the actual work here is in parsing the responses from the servers. It's an ancient protocol, that can vary greatly between games. The underlying technology provided by Steam is - to be a bit blunt about it - quite shit.

I think the inconsistencies you're experiencing are due in part to that, and I don't think there's another solution (no other - more modern - protocol that I know of, and based on my research, this is already one of the most comprehensive library out there).

I would however increase the global timeout to see if it fixes some of your problems, for me it did very significantly. For instance, when pinging 10k servers at a 1s timeout I will get something like 6k replies. With a 2s timeout, I'll get 8 or 9k. Maybe it's your problem too, just servers taking a while to reply.

If you want to try this right now without messing around to much, uninstall the official Gamedig (npm uninstall gamedig) and install my version which has all the PRs currently opened merged into main (npm i git+https://github.com/Coriou/node-gamedig.git). It just will give you a few more options, but won't break your existing code. Then, increase the timeout globally (GameDig.query({ type: 'XXX', host: 'xxx.xxx.xxx.xxx', port: xxx, timeout: 2000})) and try again. If you don't see a real improvement after doing that, then maybe you can open a new issue with the extensive logs from Gamedig in debug mode and maybe the real problem will be identified.

from node-gamedig.

mmorrisontx avatar mmorrisontx commented on August 24, 2024

Hi, sorry for the delayed reply. You can actually already increase the udp watchdog timeout by passing socketTimeout: 3000 (or even higher) along with your query options. Feel free to re-open if this does not solve your problem.

from node-gamedig.

omarAjmi avatar omarAjmi commented on August 24, 2024

thank you all for the detailed answers, you guys are awesome and this module is awesome, i'll try to do all your recommendations mentioned above. you are a great team.

from node-gamedig.

Vistril avatar Vistril commented on August 24, 2024

Apologise in advance for the bump a year later, but mine still doesn't work even after passing socketTimeout: 5000. I'm attempting to query a Garry's Mod server.
Error: Failed all 1 attempts at QueryRunner.run (/home/runner/node_modules/gamedig/lib/QueryRunner.js:88:21) Attempt #1 - Port=27015 Retry=0: Error: UDP - Timed out after 5000ms
Let me know what you've got, thanks. 👍

from node-gamedig.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.