Sets max_allowed_packet globally for new connections (not current!).
179022
def _SetPacketSizeForFollowingConnections(cursor):
  """"""
  cur_packet_size = int(_ReadVariable("max_allowed_packet", cursor))

  if cur_packet_size < MAX_PACKET_SIZE:
    logging.warning(
        "MySQL max_allowed_packet of %d is required, got %d. Overwriting.",
        MAX_PACKET_SIZE, cur_packet_size)
    _SetGlobalVariable("max_allowed_packet", MAX_PACKET_SIZE, cursor)
1213070
def maybe_rate_limit(client, headers, atexit=False):
    """"""
    # pylint: disable=fixme
    # pylint: disable=global-statement
    # FIXME: Yes, I know this is not great. We'll fix it later. :-)
    global LAST_CLIENT, LAST_HEADERS

    if LAST_CLIENT and LAST_HEADERS:
        # Wait based on previous client/headers
        rate_limit(LAST_CLIENT, LAST_HEADERS, atexit=atexit)

    LAST_CLIENT = copy.copy(client)
    LAST_HEADERS = copy.copy(headers)
1322497
def setUploadRateLimit(infoHash, bytesPerSecond)
      raise "upload rate limit must be an Integer, not a #{bytesPerSecond.class}" if bytesPerSecond && ! bytesPerSecond.is_a?(Integer)
      @handler.setUploadRateLimit(infoHash, bytesPerSecond)
    end
295016
public void resetLimits() {
        maxLength = Long.MAX_VALUE;
        timeoutMs = Long.MAX_VALUE;
        maxRateBytesPerMs = Long.MAX_VALUE;
    }
1103807
def set_idlemax(self, idlemax):
        

        is_running = yield from self.is_running()
        if is_running:  # router is running
            yield from self._hypervisor.send('vm set_idle_max "{name}" 0 {idlemax}'.format(name=self._name, idlemax=idlemax))

        log.info('Router "{name}" [{id}]: idlemax updated from {old_idlemax} to {new_idlemax}'.format(name=self._name,
                                                                                                      id=self._id,
                                                                                                      old_idlemax=self._idlemax,
                                                                                                      new_idlemax=idlemax))

        self._idlemax = idlemax
285889
def set_max_size(cls, pid, size):
        
        with cls._lock:
            cls._ensure_pool_exists(pid)
            cls._pools[pid].set_max_size(size)
1315
def set_buffer_limits(self, high=None, low=None):
        """"""
        if high is None:
            high = self.default_buffer_size
        if low is None:
            low = high // 2
        self._buffer_high = high
        self._buffer_low = low
1013663
private function setLimit()
    {
        if (isset($this->requestParams['start']) && -1 != $this->requestParams['length']) {
            $this->qb->setFirstResult($this->requestParams['start'])->setMaxResults($this->requestParams['length']);
        }

        return $this;
    }
1157126
public void setMaxRetryTimeMillis(long maxRetryTimeMillis) {
        if (this.httpClient instanceof DefaultHttpClient) {
            ((DefaultHttpClient) this.httpClient).setMaxRetryTimeMillis(maxRetryTimeMillis);
        }
        else
            throw new UnsupportedOperationException("Invalid operation for class " + this.httpClient.getClass());
    }
450392
def disable_rate_limit_forward
      headers[Protocol::HEADER_API_KEY] = api_key
      headers.delete(Protocol::HEADER_FORWARDED_IP)
      headers.delete(Protocol::HEADER_FORWARDED_API_KEY)
    end
801445
def _set_max_value(self, max_value):
        """"""

        self._external_max_value = max_value

        # Check that the current value of the parameter is still within the boundaries. If not, issue a warning

        if self._external_max_value is not None and self.value > self._external_max_value:

            warnings.warn("The current value of the parameter %s (%s) "
                          "was above the new maximum %s." % (self.name, self.value, self._external_max_value),
                          exceptions.RuntimeWarning)
            self.value = self._external_max_value
910859
public function getMaxAllowedPacket()
    {
        if ($this->maxAllowedPacket === null) {
            $statement = $this->prepare('SELECT @@global.max_allowed_packet');
            $statement->execute();

            $this->maxAllowedPacket = (int) $statement->fetchColumn();
        }

        return $this->maxAllowedPacket;
    }
64890
def set_limits(self, min_=None, max_=None):
        
        self._min, self._max = min_, max_
615879
public void sessionMaxInactiveTimeSet(ISession session, int old, int newval) {
        _sessionStateEventDispatcher.sessionMaxInactiveTimeSet(session, old, newval);

    }
861169
protected function limit()
    {
        if (($connectionLimit = config('ratchet.connectionLimit')) && $this->connections - 1 >= $connectionLimit) {
            $this->console->info(sprintf('To many connections: %d of %d', $this->connections - 1, $connectionLimit));
            $this->conn->send(trans('ratchet::messages.tooManyConnections'));
            $this->conn->close();
        }

        return $this;
    }
408818
public void updateMaxConnections (final int max) {

        try {
            Connection conn = taskBalancer.getConnection();
            int update = 0;
            int targetMaxC = connections.peek().getSettingAsInt(OperationalTextKey.MAX_CONNECTIONS);
            if (targetMaxC <= max) {
                if (targetMaxC > maxConnections) {
                    update = targetMaxC - maxConnections;
                    maxConnections = targetMaxC;
                }
            } else {
                if (max >= maxConnections) {
                    update = max - maxConnections;
                    maxConnections = max;
                }
            }

            SettingsMap sm = new SettingsMap();
            sm.add(OperationalTextKey.MAX_CONNECTIONS, String.valueOf(maxConnections));
            conn.update(sm);
            taskBalancer.releaseConnection(conn);

            if (update > 0) {
                addConnections(update);
            } else {
                for (int i = -1; i >= update; i--) {
                    taskBalancer.getConnection().close();
                }
            }

        } catch (Exception e) {
            // DO Nothing
        }

    }
1279856
public static function getMaxAllowedPacket(): int
  {
    if (!isset(self::$maxAllowedPacket))
    {
      $query              = "show variables like 'max_allowed_packet'";
      $max_allowed_packet = self::executeRow1($query);

      self::$maxAllowedPacket = $max_allowed_packet['Value'];

      // Note: When setting $chunkSize equal to $maxAllowedPacket it is not possible to transmit a LOB
      // with size $maxAllowedPacket bytes (but only $maxAllowedPacket - 8 bytes). But when setting the size of
      // $chunkSize less than $maxAllowedPacket than it is possible to transmit a LOB with size
      // $maxAllowedPacket bytes.
      self::$chunkSize = (int)min(self::$maxAllowedPacket - 8, 1024 * 1024);
    }

    return (int)self::$maxAllowedPacket;
  }