How to Socket.io Specifying Heartbeat
Here we Learn Method of Set Ping Timeout & ping interval.
There Are Several Way to Set Ping interval & Ping Time out.
Please Remember Some note : ping interval is alway small then ping Timeout.
Always Set Same ping timeout & ping Interval for both side. (Client side & Server Side) When You Develop any Client Server Application.
Following Are some Pattern Which most Case Peopele use.
1) Type One
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http, {
'pingInterval': 2000,
'pingTimeout': 5000
});
2) Type Two
For package dependency versions:
"express": "^4.12.3",
"socket.io": "1.0"
ex :
var app = express();
var server = require('http').createServer(app);
var io = require('socket.io')(server);
io.set('heartbeat timeout', 5000);
io.set('heartbeat interval', 2000);
3) Type Three
When we Define Config File for socket.js
[{
pingInterval: 2000,
pingTimeout: 5000
}]
Thanks.
The Best of the Node JS Blogs You have Mentioned here.
ReplyDeleteMEAN Stack Training in Hyderabad
Thanks for sharing the useful blog about Set Ping Timeout & Ping Interval in Socket.IO Package of Node JS.
ReplyDeleteCustom Web Application Development Company in Coimbatore
Thank you for sharing such a nice and interesting blog with us.
ReplyDeleteFull Stack Online Training
The information which you have provided is very good. It is very useful who is looking for
ReplyDeleteBest nodejs Training Institute
Thanks for such kind of Information. Must visit at Node.JS web application development comapny
ReplyDeleteEnjoyed reading the article above, really explains everything in detail, the article is very interesting and effective. Thank you and good luck for the upcoming articles learn Node JS training
ReplyDeleteThanks for this post this is a very useful post , For more information about the Nodejs development company here is the list of Top 10 Node.js Development Companies . Thanks for the post .
ReplyDeleteHiii.....Thanks for sharing Great information....Nice post....Keep move on....
ReplyDeleteAngular JS Training in Hyderabad
Nice post useful for everyone.Keep on sharing
ReplyDeleteFull Stack online Training
Full Stack Training
Full Stack Developer Online Training
Full Stack Training in Hyderabad
Full Stack Training in Ameerpet
Full Stack Training Institute
What a brilliant information you are sharing here about the relevant technology. I really appreciate your effort. I’ll visit your blog again to get some more nice information about other technologies too. Keep up the good work buddy!!
ReplyDeleteNode js Development Company Texas
Thanks for sharing this blog.
ReplyDeleteAWS Training in Hyderabad
Best AWS Training in Hyderabad
ExpressTech Software Solutions is a nodejs Development Company, where we provide the leading Node JS web development services to our clients across the globe. Contact us: +91-9806724185 or Contact@expresstechsoftwares.com
ReplyDeleteEnjoyed reading the article above, really explains everything in detail, the article is very interesting and effective. Thank you and good luck for the upcoming articles nodejs training
ReplyDeleteIt has been great for me to read such great information about Node JS. Keep on sharing.
ReplyDeleteNode JS Online training
Node JS training in Hyderabad
cloudkeeda
ReplyDeletewhat is microsoft azure
azure free tier account
azure adf
adf interview questions
azure certifications
SMM PANEL
ReplyDeleteSmm panel
Https://isilanlariblog.com/
İnstagram takipçi satın al
HIRDAVAT
beyazesyateknikservisi.com.tr
servis
tiktok jeton hilesi