Monday 23 July 2018

Node.js Help: How do I set the pingTimeout in Socket.io

n my Node.js + Socket.io application, I'm trying to set the ping timeout to 63 seconds (63 seconds of inactivity allowed until the connection between the server and the client(s) is considered closed). Unfortunately, when I run my code below, I get the following error:socket.set("pingTimeout", 63000); ^ TypeError: socket.set is not a function Below is my code:var express = require("express"); var socket = require("socket.io"); socket.set("pingTimeout", 63000); var app = express(); var server = app.listen(3000); app.use(express.static("public")); var io = socket(server);

Submitted July 24, 2018 at 03:37AM by ferarri488

No comments:

Post a Comment