ghedipunk / PHP-Websockets

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

The web socket cannot be closed by client #36

Closed jxngai closed 8 years ago

jxngai commented 9 years ago

At the client side if I try to close the web socket. it does not close immediately. There is a bug in websocket.php

Instead of

if ($user->hasSentClose)
{
     $this->disconnect($user);
}

It should be

if ($user->hasSentClose)
{
     $this->disconnect($user->socket);
}
hopeseekr commented 9 years ago

+1 The fix worked for me.