Net/Notifier/Client.php
public function parseAddress($address)
    {
        $exp = '!^wss?://([\w-.]+?)(?::(\d+))?(/.*)?$!';
        $matches = array();
        if (!preg_match($exp, $address, $matches)) {
            throw new Net_Notifier_ClientException(
                sprintf(
                    'Invalid WebSocket address: %s. Should be in the form '
                    . 'ws://host[:port][/resource]',
                    $address
                )
            );
        }

        if (isset($matches[1])) {
            $this->setHost($matches[1]);
        }

        if (isset($matches[2])) {
            $this->setPort($matches[2]);
        }

        if (isset($matches[3])) {
            $this->setResource($matches[3]);
        }

        return $this;
    }
public function parseAddress($address)
    {
        $exp = '!^wss?://([\w-.]+?)(?::(\d+))?(/.*)?$!';
        $matches = array();
        if (!preg_match($exp, $address, $matches)) {
            throw new Net_Notifier_ClientException(
                sprintf(
                    'Invalid WebSocket address: %s. Should be in the form '
                    . 'ws://host[:port][/resource]',
                    $address
                )
            );
        }

        if (isset($matches[1])) {
            $this->setHost($matches[1]);
        }

        if (isset($matches[2])) {
            $this->setPort($matches[2]);
        }

        if (isset($matches[3])) {
            $this->setResource($matches[3]);
        }

        return $this;
    }
public function parseAddress ( $ address ) { $ exp = '!^wss?://([\w-.]+?)(?::(\d+))?(/.*)?$!' ; $ matches = array ( ) ; if ( ! preg_match ( $ exp , $ address , $ matches ) ) { throw new Net_Notifier_ClientException ( sprintf ( 'Invalid WebSocket address: %s. Should be in the form ' . 'ws://host[:port][/resource]' , $ address ) ) ; } if ( isset ( $ matches [ 1 ] ) ) { $ this -> setHost ( $ matches [ 1 ] ) ; } if ( isset ( $ matches [ 2 ] ) ) { $ this -> setPort ( $ matches [ 2 ] ) ; } if ( isset ( $ matches [ 3 ] ) ) { $ this -> setResource ( $ matches [ 3 ] ) ; } return $ this ; }
Parses a WebSocket address and sets the constituent parts for this
client

A WebSocket address looks like 'ws://hostname:port/resource-name'. If
present, the host, port and resource of this client are set from the
parsed values.

@param string $address the address to parse.

@return Net_Notifier_Client the current object, for fluent interface.

@throws Net_Notifier_ClientException if the specified address is not a
properly formatted WebSocket address.
Parses a WebSocket address and sets the constituent parts for this client