EnriqCG / rcon-srcds

A zero-dependency Typescript library for the Source/Minecraft RCON Protocol
https://www.npmjs.com/package/rcon-srcds
MIT License
61 stars 20 forks source link

Server Connection Timeout Config #12

Open Ubunfu opened 3 years ago

Ubunfu commented 3 years ago

Is there a way to configure a connection timeout to the server? Since setting the constructor's timeout parameter doesn't seem to take care of this, I'm thinking it's probably specifically a command response timeout? If there's a connection issue to the server, the request seems to hang there for a while. If this isn't currently a feature, I think it'd be really nice to have.

Taraman17 commented 3 years ago

Sometimes, when something fails on authentication, the library is not giving an answer at all. I had that problem when encountering Issue #13. Also when the Server responds in a wrong way (Issue #9).

I worked around this by setting a Timeout with setTimeout and cancelling that when authentication passes.

menix1337 commented 2 years ago

Sometimes, when something fails on authentication, the library is not giving an answer at all. I had that problem when encountering Issue #13. Also when the Server responds in a wrong way (Issue #9).

I worked around this by setting a Timeout with setTimeout and cancelling that when authentication passes.

Would you be able to show an example with the setTimeout part?

Taraman17 commented 2 years ago

@menix1337: Sure, you can find it here: https://github.com/Taraman17/nodejs-csgo-api/blob/ffac995d1ce6db4fc9a438abcf3a65c4fe12f147/serverControl.js#L268

Taraman17 commented 1 year ago

I think, this can be closed as well...