protected function checkConnectionsPerIp($connection)
    {
        $ip = $connection->getIp();

        if (!$ip) {
            $this->logger->warning('Cannot check connections per IP');
            return;
        }

        if (!isset($this->ips[$ip])) {
            $this->ips[$ip] = 1;
        } else {
            $this->ips[$ip] = min(
                $this->options['connections_per_ip'],
                $this->ips[$ip] + 1
            );
        }

        if ($this->ips[$ip] > $this->options['connections_per_ip']) {
            $this->limit($connection, 'Connections per IP');
        }
    }
protected function checkConnectionsPerIp($connection)
    {
        $ip = $connection->getIp();

        if (!$ip) {
            $this->logger->warning('Cannot check connections per IP');
            return;
        }

        if (!isset($this->ips[$ip])) {
            $this->ips[$ip] = 1;
        } else {
            $this->ips[$ip] = min(
                $this->options['connections_per_ip'],
                $this->ips[$ip] + 1
            );
        }

        if ($this->ips[$ip] > $this->options['connections_per_ip']) {
            $this->limit($connection, 'Connections per IP');
        }
    }
protected function checkConnectionsPerIp ( $ connection ) { $ ip = $ connection -> getIp ( ) ; if ( ! $ ip ) { $ this -> logger -> warning ( 'Cannot check connections per IP' ) ; return ; } if ( ! isset ( $ this -> ips [ $ ip ] ) ) { $ this -> ips [ $ ip ] = 1 ; } else { $ this -> ips [ $ ip ] = min ( $ this -> options [ 'connections_per_ip' ] , $ this -> ips [ $ ip ] + 1 ) ; } if ( $ this -> ips [ $ ip ] > $ this -> options [ 'connections_per_ip' ] ) { $ this -> limit ( $ connection , 'Connections per IP' ) ; } }
NOT idempotent, call once per connection

@param Connection $connection
NOT idempotent call once per connection