private function stopConnection()
{
if ($this->socket === null) {
return false;
}
$socket = null;
$ex = null;
try {
switch ($this->type) {
case Channel::CONNECTOR:
$this->destroyConnector();
break;
case Channel::BINDER:
$this->destroyBinder();
break;
default:
return false;
}
} catch (Error $ex) {
} catch (Exception $ex) {
}
if ($ex !== null) {
return false;
}
$this->socket->close();
unset($this->socket);
$this->socket = null;
return true;
}