Reconnect.

@param int $after
@return void
427107
public function reconnect($after = 0)
    {
        $this->_status                   = self::STATUS_INITIAL;
        static::$connections[$this->_id] = $this;
        if ($this->_reconnectTimer) {
            Timer::del($this->_reconnectTimer);
        }
        if ($after > 0) {
            $this->_reconnectTimer = Timer::add($after, array($this, 'connect'), null, false);
            return;
        }
        $this->connect();
    }
829384
public void reConnect() throws IOException {
	try {
	    if (client != null && client.isConnected()) client.disconnect();
	}
	catch (IOException ioe) {}
	connect();
    }
1331975
public function reconnect() {
        $this->dialect = $this->dialect->reset();
        if (!$this->dialect instanceof DatabaseDialect) {
            throw new \Exception('cannot reconnect to the database.');
        }
    }
1048599
private function reconnect()
    {
        if (0 === (int) $this->getOption(self::OPT_MAX_RECONNECT_ATTEMPTS)) {
            throw new MaxConnectAttempsException("Connection lost.");
        } elseif ($this->reconnectAttempts === (int) $this->getOption(self::OPT_MAX_RECONNECT_ATTEMPTS)) {
            throw new MaxConnectAttempsException("Max attempts to connect to database has been reached.");
        }

        if (null === $this->credentials) {
            throw new AccessDeniedException("Unable to reconnect: credentials not provided.");
        }

        try {
            if (0 !== $this->reconnectAttempts) {
                usleep((int) $this->getOption(self::OPT_USLEEP_AFTER_FIRST_ATTEMPT));
            }
            $this->cnx = self::createLink($this->getCredentials(), $this->options);
            if ($this->isConnected()) {
                $this->reconnectAttempts = 0;
            } else {
                $this->reconnect();
            }
        } catch (Throwable $e) {
            $this->reconnectAttempts++;
        }
    }
360487
public function afterDelete()
    {
        parent::afterDelete();
        Question::decrementAnswers($this->question_id);
        Vote::removeRelation($this);
    }
881907
def reconnect():
    
    post_save.connect(node_created_handler, sender=Node)
    node_status_changed.connect(node_status_changed_handler)
    pre_delete.connect(node_deleted_handler, sender=Node)
1032128
public function reconnect() {
        $this->disconnect();
        $this->connect();
        $stats = $this->stats();
        return $stats === false ? false : true;
    }
224763
public function reconnect()
    {
        if ($this->getMaxReconnects() < $this->getReconnectCount()) {
            return false;
        }

        $this->increaseReconnectCount();
        // returns the state if the ping was possible
        return $this->ping();
    }
982665
public function reconnect()
    {
        // remember in which channels we are joined
        $channels = array();
        foreach ($this->_channels as $value) {
            if (empty($value->key)) {
                $channels[] = array('name' => $value->name);
            } else {
                $channels[] = array('name' => $value->name, 'key' => $value->key);
            }
        }

        $this->disconnect(true);

        while ($this->_autoretry === true
            && ($this->_autoretrymax == 0 || $this->_autoretrycount < $this->_autoretrymax)
            && $this->_updatestate() != SMARTIRC_STATE_CONNECTED
        ) {
            $this->_autoretrycount++;

            if ($this->_reconnectdelay > 0) {
                $this->log(SMARTIRC_DEBUG_CONNECTION, 'DEBUG_CONNECTION: delaying '
                    .'reconnect for '.$this->_reconnectdelay.' ms',
                    __FILE__, __LINE__
                );

                for ($i = 0; $i < $this->_reconnectdelay; $i++) {
                    $this->_callTimeHandlers();
                    usleep(1000);
                }
            }

            $this->_callTimeHandlers();
            $this->log(SMARTIRC_DEBUG_CONNECTION, 'DEBUG_CONNECTION: reconnecting...',
                __FILE__, __LINE__
            );

            if ($this->connect($this->_address, $this->_port, true) !== false) {
                break;
            }
        }

        if ($this->_updatestate() != SMARTIRC_STATE_CONNECTED) {
            return false;
        }

        $this->login($this->_nick, $this->_realname, $this->_usermode,
            $this->_username, $this->_password
        );

        // rejoin the channels
        foreach ($channels as $value) {
            if (isset($value['key'])) {
                $this->join($value['name'], $value['key']);
            } else {
                $this->join($value['name']);
            }
        }

        return $this;
    }
456115
function reconnect()
    {
        // Connect to MySQL
        // $this->db = new \mysqli($this->config['host'], $this->config['user'], $this->config['password'], $this->config['dbname'], $this->config['port']);
        $db = \mysqli_init();
        if ( !$db->options(MYSQLI_OPT_CONNECT_TIMEOUT, $this->config['timeout']) ) {
            \throw_error('Setting MYSQLI_OPT_CONNECT_TIMEOUT failed', $db->errno);
        }

        if ( !$db->real_connect($this->config['host'], $this->config['user'], $this->config['password'], $this->config['dbname'], $this->config['port']) ) {
            \throw_error('Can not real_connect to MySQL server, message: ' . $db->connect_error);
        }

        if ($db->connect_errno) {
            \throw_error('Can not connect to MySQL server, message: ' . $db->connect_error, $db->errno);
        }

        // Set charset
        $db->set_charset(isset($this->config['charset']));

        $this->db = $db;
    }
883339
public function after($event = []) {
		$modelDynSchema = ClassRegistry::init('CakeLdap.DynSchema');
		$modelDynSchema->updateSchema($event, $this->connection);
	}
197623
protected function lookForChild($item, $after)
    {
        if (str_contains($after, '.')) {
            $found = [];
            $this->lookInDeep($this->items, $after, $item, $found);
            if (!empty($found)) {
                $this->items[key($found)]->childs = current($found);
                return $item;
            }
        }
        return false;
    }
1210491
def _reconnect(self):
        """"""
        log.debug("Reconnecting to JLigier...")
        self._disconnect()
        self._connect()
        self._update_subscriptions()
764710
public function reconnect()
    {
        if (is_callable($this->reconnector)) {
            $this->doctrineConnection = null;

            return call_user_func($this->reconnector, $this);
        }

        throw new LogicException('Lost connection and no reconnector available.');
    }
244446
public function setCancelAfter($cancel_after) {

        $this->checkInArray($cancel_after, GDAXConstants::$cancelAfterValues);
        $this->cancel_after = $cancel_after;
        return $this;

    }
753399
def after(self, context):
        ""
        self._invoke(self._after, context)
        run.after_each.execute(context)
1095135
public function after(AfterEvent $event)
    {
        $pagination = $event->getPaginationView();

        if (!$pagination instanceof SlidingPagination) {
            return;
        }

        $page = $pagination->getPage();

        if (null === $page) {
            $page = 1;
        } else {
            $pageNumber = (int)$page;

            if ((string)$pageNumber !== (string)$page || $pageNumber < 0 || $pageNumber > $pagination->getPageCount()) {
                throw new PageNotFoundException();
            }
        }

        $request = $this->requestStack->getCurrentRequest();

        if (!empty($request)) {
            if ($page > 1) {
                $request->attributes->set(self::REQUEST_ATTR_PAGE_PREV, $page - 1);
            }
            if ($page < $pagination->getPageCount()) {
                $request->attributes->set(self::REQUEST_ATTR_PAGE_NEXT, $page + 1);
            }
        }
    }