public function rotateIp() {
        if(sizeof($this->ipAddresses) == 1) {
            return true;
        }

        $this->ipIndex   = ($this->ipIndex + 1) % sizeof($this->ipAddresses);
        $this->ipAddress = $this->ipAddresses[$this->ipIndex];

        $this->initSocket();

        return $this->ipIndex == 0;
    }
public function rotateIp() {
        if(sizeof($this->ipAddresses) == 1) {
            return true;
        }

        $this->ipIndex   = ($this->ipIndex + 1) % sizeof($this->ipAddresses);
        $this->ipAddress = $this->ipAddresses[$this->ipIndex];

        $this->initSocket();

        return $this->ipIndex == 0;
    }
public function rotateIp ( ) { if ( sizeof ( $ this -> ipAddresses ) == 1 ) { return true ; } $ this -> ipIndex = ( $ this -> ipIndex + 1 ) % sizeof ( $ this -> ipAddresses ) ; $ this -> ipAddress = $ this -> ipAddresses [ $ this -> ipIndex ] ; $ this -> initSocket ( ) ; return $ this -> ipIndex == 0 ; }
Rotate this server's IP address to the next one in the IP list

If this method returns <var>true</var>, it indicates that all IP
addresses have been used, hinting at the server(s) being unreachable. An
appropriate action should be taken to inform the user.

Servers with only one IP address will always cause this method to return
<var>true</var> and the sockets will not be reinitialized.

@return bool <var>true</var>, if the IP list reached its end. If the
list contains only one IP address, this method will instantly
return <var>true</var>
@see initSocket()
Rotate this server s IP address to the next one in the IP list