This commit is contained in:
Chris Boden 2012-07-11 11:00:44 -04:00
parent d2294fa6a4
commit 145de0d407
2 changed files with 1 additions and 5 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "cboden/Ratchet" "name": "cboden/Ratchet"
, "type": "library" , "type": "library"
, "description": "PHP WebSocket server component library" , "description": "PHP WebSocket library"
, "keywords": ["WebSockets", "Server", "Ratchet", "Sockets"] , "keywords": ["WebSockets", "Server", "Ratchet", "Sockets"]
, "website": "http://socketo.me" , "website": "http://socketo.me"
, "repository": "https://github.com/cboden/Ratchet" , "repository": "https://github.com/cboden/Ratchet"

View File

@ -130,11 +130,7 @@ class WsServer implements MessageComponentInterface {
if ($this->connections->contains($conn)) { if ($this->connections->contains($conn)) {
$decor = $this->connections[$conn]; $decor = $this->connections[$conn];
$this->connections->detach($conn); $this->connections->detach($conn);
}
// WS::onOpen is not called when the socket connects, it's call when the handshake is done
// The socket could close before WS calls onOpen, so we need to check if we've "opened" it for the developer yet
if (isset($decor)) {
$this->_decorating->onClose($decor); $this->_decorating->onClose($decor);
} }
} }