ghedipunk / PHP-Websockets

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

Server doesn't recognize disconnect #70

Closed Nakroma closed 8 years ago

Nakroma commented 8 years ago

Hey, I have the issue that my clients don't get disconnected. I recently found this piece of software and wanted to try it out. This is btw the exact same repo straight out of the box. It recognizes the client connecting, but not disconnecting http://puu.sh/n1GCQ/a1fa43fe3b.png Anyone know how to fix this issue, is it maybe something with my setup? Regards

Edit: I encircled the problem a bit. When quitting, the numBytes that arrive isn't 0 (thats required for the "official" disconnect) but 6 when leaving via Quit button and 8 when leaving via tab closing.

Xaraknid commented 8 years ago

Short answer : it's only not display the disconnection server side.

The fact that you see "disconnected - status 3" mean the connection has been disconnected.

Websocket protocol sit on TCP protocol. The server will display the disconnection when it happens due to a TCP "error" unclean close handshake.

With this fix you'll see when the client disconnect (normal and abnormal close handshake.)

Nakroma commented 8 years ago

That solved it, thanks.