protected function close($connectionId)
{
if (isset($this->_handshakes[$connectionId])) {
unset($this->_handshakes[$connectionId]);
} elseif (isset($this->clients[$connectionId])) {
$this->onClose($connectionId);
//call user handler
} elseif (isset($this->services[$connectionId])) {
$this->onServiceClose($connectionId);
//call user handler
} elseif ($this->getIdByConnection($this->_master) == $connectionId) {
$this->onMasterClose($connectionId);
//call user handler
}
parent::close($connectionId);
if (isset($this->clients[$connectionId])) {
unset($this->clients[$connectionId]);
} elseif (isset($this->services[$connectionId])) {
unset($this->services[$connectionId]);
} elseif ($this->getIdByConnection($this->_server) == $connectionId) {
$this->_server = null;
} elseif ($this->getIdByConnection($this->_service) == $connectionId) {
$this->_service = null;
} elseif ($this->getIdByConnection($this->_master) == $connectionId) {
$this->_master = null;
}
unset($this->_write[$connectionId]);
unset($this->_read[$connectionId]);
}