JAXL::get_socket_path PHP Method

get_socket_path() public method

public get_socket_path ( )
    public function get_socket_path()
    {
        if ($this->cfg['protocol'] !== null) {
            $protocol = $this->cfg['protocol'];
        } else {
            $protocol = $this->cfg['port'] == 5223 ? "ssl" : "tcp";
        }
        return $protocol . "://" . $this->cfg['host'] . ":" . $this->cfg['port'];
    }

Usage Example

Example #1
0
 public function testProtocolOption()
 {
     $config = array('host' => 'domain.tld', 'port' => 5223, 'protocol' => 'tcp', 'strict' => false);
     $jaxl = new JAXL($config);
     $this->assertEquals('tcp://domain.tld:5223', $jaxl->get_socket_path());
     $this->assertInstanceOf('JAXLSocketClient', $jaxl->getTransport());
 }
All Usage Examples Of JAXL::get_socket_path