tags:

views:

28

answers:

1

Hi, I am using web socket using PHP5 and chrome browser as client. I have taken the code from this site (http://code.google.com/p/phpwebsocket/)

I run the server and client is also connected. I can chat as well. Now when I restart the server ( by killing it and starting it again ). Client gets the disconnected information but automatically doesn't reconnect with server when I send the message.

How to achieve this. Like when I get the dis-connected information. I should check-it and send it to java-script to refresh the page or reconnect ?

A: 

I actually made another button ( Reconnect ) and then on clicking that I am calling init() to reconnect. But this button should be enabled only when there is dis-connection. I don't want to enable it when the client is already connected.

siddhusingh