0

I want to know whether socket io provides the keep-alive connection for the connected client or it closes the connection once client gets some response from server.

1 Answers1

1

It is always open.

It uses AJAX long polling and then upgrades to WebSocket if available.

Long polling may disconnect and reconnect but it is transparent to your code. From the point of view of your code the connection is always open.

See this answer for more details:

Community
  • 1
  • 1
rsp
  • 107,747
  • 29
  • 201
  • 177