Quantcast
Channel: Send content at intervals in JavaScript/Node.js - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Ivan Velichko for Send content at intervals in JavaScript/Node.js

The code res.write("") not necessary will send something to the wire, since the payload is empty. What you might need is TCP keepalive functionality. res.connection.setKeepAlive(true, 20000)

View Article



Answer by Joel Lord for Send content at intervals in JavaScript/Node.js

You can use setIntervalhttps://developer.mozilla.org/fr/docs/Web/API/WindowTimers/setIntervalsetInterval(() => res.write(""), 20000);

View Article

Send content at intervals in JavaScript/Node.js

I want to execute a particular line of code at timed intervals. The line will be res.write(""), to keep a connection alive.This is similar to hardware interrupts in embedded systems.Is it possible to...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images