I am using web socket using PHP5 and the Chrome browser as client. I have taken the code from the site http://code.google.com/p/phpwebsocket/.
I run the server, and
GitHub hosts a small JavaScript library that decorates the WebSocket API to provide a WebSocket connection that will automatically reconnect if the connection is dropped.
Minified library with gzip compression is less than 600 bytes.
The official repository is available here:
https://github.com/joewalnes/reconnecting-websocket
If a high number of clients are connected to the server when it reboots. It may be worthwhile to manage the reconnect timings of the clients by using an Exponential Backoff algorithm.
The algorithm works like this:
Référence:
http://blog.johnryding.com/post/78544969349/how-to-reconnect-web-sockets-in-a-realtime-web-app
ReconnectingWebSocket does not handle reconnections by using this algorithm.