Add socketTimeout and attemptTimeout

This commit is contained in:
mmorrison 2018-01-31 04:03:13 -06:00
parent 3a96e00508
commit b5f49fe343
3 changed files with 25 additions and 17 deletions

View file

@ -45,13 +45,22 @@ function(e,state) {
> npm install sonicsnes/node-gamedig
> ```
### Input Parameters
### Query Options
**Typical**
* **type**: One of the game IDs listed in the game list below
* **host**
* **host**: Hostname or IP of the game server
* **port**: (optional) Uses the protocol default if not set
* **notes**: (optional) Passed through to output
* **maxAttempts**: (optional) Number of attempts to query server in case of failure (default 1)
**Advanced**
* **notes**: (optional) An object passed through in the return value.
* **maxAttempts**: (optional) Number of attempts to query server in case of failure. (default 1)
* **socketTimeout**: (optional) Milliseconds to wait for a single packet. Beware that increasing this
will cause many queries to take longer even if the server is online. (default 1000)
* **attemptTimeout**: (optional) Milliseconds allowed for an entire query attempt. This timeout is not commonly hit,
as the socketTimeout typically fires first. (default 10000)
### Return Value