JSteunou / webstomp-client

Stomp client over websocket for browsers
Apache License 2.0
299 stars 59 forks source link

Diferences between Firefox and Chrome #41

Closed luisclaudiogama closed 7 years ago

luisclaudiogama commented 7 years ago

Hi, first at all, congrats for this job.

I observed a difference between Firefox and Chrome after lost connection ( this can be view at broadcast.html example ). Using Chrome, onError is called after several PINGS sent and Firefox calls onError after the first PING to change status ( disconnnected ). For me the Chrome´s behavior is better.

thanks

JSteunou commented 7 years ago

I'm sorry, I did not understand what is the question or the issue exactly here?

luisclaudiogama commented 7 years ago

Excuse me for my issue explanation is not so clear. I changed the heart-beat to {30000,30000} .

When I´m using Chrome, and lost internet connection...Chrome continue sending PING bytes ( each 30s according heart-beat ) until to confirm the lost connection and calls onError. It´s ok! So when I´m change to firefox and lost connection...it´s close the connection 10 seconds after and do not respect heart-beat "PING" byte. Firefox close the connection before it send the next PING. It seems the Firefox don´t check "PONG" bytes. Look this using chrome: chrome_webstomp Now using Firefox: firefox_webstomp

I hope I have been clearer than before.

Thank you very much

JSteunou commented 7 years ago

It seems Chrome try to keep the socket open in case of future reconnection while firefox detect it sooner. But again, what are you expecting me to do?

luisclaudiogama commented 7 years ago

I think heartbeat was necessary to check if server is alive, but I´m commited a mistake. Thanks for your response and congrats for your job.

JSteunou commented 7 years ago

no problem