ghedipunk / PHP-Websockets

A Websockets server written in PHP.
BSD 3-Clause "New" or "Revised" License
917 stars 375 forks source link

client disconnects #84

Open zenmanenergy opened 8 years ago

zenmanenergy commented 8 years ago

I can't seem to get the "closed" function to fire when a client disconnects. Has anyone successfully made this work?

franciscojuan1974 commented 7 years ago

Yes, with javascript

socket = new WebSocket(host); log('WebSocket - status ' + socket.readyState);

socket.onclose = function(msg) { log("Disconnected - status "+this.readyState); };