public function stop($blockEvent = false)
{
if (!$this->isStarted()) {
return false;
}
$this->stopHeartbeat();
$this->stopTimeRegister();
if (!$this->stopConnection()) {
$this->emit('error', [new ExecutionException('socket not disconnected.')]);
}
$this->isConnected = false;
if (!$blockEvent) {
$this->emit('stop');
}
return true;
}