Hello @NIKHIL_ANAND
As we know, " A persistent connection is a network connection between the client and the server that remains open for future requests and responses, as opposed to being closed after a single communication."
How to maintain the client and server persistent connection with the heartbeat? Heartbeat is blank requests between client and author.
Suppose every connection is automatically closed after 10 seconds. We keep the connection persistent by sending a blank request every 9.5 seconds. The connection will stay open for the next 10 seconds and repeat, sending a heartbeat after 9.5 seconds making it a persistent connection.
I hope it will help.
Happy Learning.