Chat with nodejs and mysql [closed]

1

I created a chat with nodejs and MySQL to fetch information from the user ... but I have a following problem: when the connection drops or restart the nodejs server, back logging in username and password. Does anyone have a clue how to do this that when he falls back logging?

NOTE: I was able to get him to access MySQL and enter the room ... except that when he returns nick it becomes NULL he can not find this data when he returns. Anyone have a suggestion?

    
asked by anonymous 30.06.2015 / 17:15

1 answer

0

pass parameter reconect like this:

io.connect(                                                             // CRIVAR UM SOCKET
            $("#socket").val(),{                                            // ENDERECO DO SOCKET
            'reconnect': true                                               // que irá informar se o socket irá tentar se conectar caso perca a conexão com o Server.
           ,'reconnection delay': 500                                       // informa o tempo em milissegundos que será o delay da tentativa de conexão.
           ,'max reconnection attempts': 1000                               // informa o valor máximo de tentativas de conexão com o Server.
           ,'secure': false                                                 // informando se a conexão com o Server irá utilizar criptografia (conexões HTTPS).
    });
    
30.06.2015 / 19:00