I have a node acs server running and used net.iamyellow.tiws 0.9.16 for client. Socket IO communication works great but I am having problems configuring heartbeats. I would like to disable heartbeats or set heartbeats to more than an hour.
- I tried io.disable("heartbeats") on server but then the client reconnects all the time
- I played around with io.set pingTimeout, pingInterval, polling duration, heartbeat timeout, heartbeat interval, close timeout but it never worked the way I wanted. Also I am not sure whether I need to use the new parameters pingTimeout, pingInterval or the old ones.
server
package.json
"main": "app.js", "dependencies": { "acs-node": ">=0.9.2" },
app.js
var sio = require('socket.io'); var app = require('http'); var ACS = require('acs-node'); ACS.init(ACSkey); var server = app.createServer(); var io = sio.listen(server); /* io.disable("heartsbeats"); io.set('pingTimeout',0); io.set('pingInterval',0); io.set('heartbeat interval', 250); io.set('heartbeat timeout', 500); io.set("polling duration", 0); io.set("heartbeat timeout", 0); io.set("heartbeat interval", 0); io.set("close timeout", 0); */ var port=8006; server.listen(port);
client
tiapp.xml
<module platform="iphone" version="0.5">net.iamyellow.tiws</module> <module platform="android" version="0.1.2">net.iamyellow.tiws</module>