get_socket_path() public méthode

public get_socket_path ( )
Exemple #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());
 }
function on_presence_stanza($client, $stanza)
{
    global $client;
    $type = $stanza->type ? $stanza->type : "available";
    $show = $stanza->show ? $stanza->show : "???";
    _info($stanza->from . " is now " . $type . " ({$show})");
    if ($type == "available") {
        // fetch vcard
        $client->get_vcard($stanza->from);
    }
}
function on_disconnect($client)
{
    _info("got on_disconnect cb");
}
//
// bootstrap all account instances
//
foreach ($accounts as $account) {
    $client = new JAXL(array('jid' => $account[0], 'pass' => $account[1], 'log_level' => JAXL_DEBUG));
    $client->add_cb('on_auth_success', 'on_auth_success');
    $client->add_cb('on_auth_failure', 'on_auth_failure');
    $client->add_cb('on_chat_message', 'on_chat_message');
    $client->add_cb('on_presence_stanza', 'on_presence_stanza');
    $client->add_cb('on_disconnect', 'on_disconnect');
    $client->connect($client->get_socket_path());
    $client->start_stream();
}
// start core loop
JAXLLoop::run();
echo "done\n";
            case 'unsubscribe':
                roster_remove($jid->node);
                send_status($stanza->to, $stanza->from, 'unsubscribed');
                break;
            case 'unavailable':
                roster_resource_set($jid->node, $jid->resource);
                break;
            case NULL:
                $status = $stanza->show ? $stanza->show : 'available';
                $message = $stanza->status;
                roster_resource_set($jid->node, $jid->resource, $status, $message);
                break;
        }
    });
    // connect to the destination host/port
    if ($comp->connect($comp->get_socket_path())) {
        $comp->emit('on_connect');
        JAXLLoop::run(2, 0);
        $comp->emit('on_disconnect');
    }
    sleep(2);
    unset($comp);
}
function manager_read()
{
    global $astman;
    $response = $astman->wait_response(true);
    $reconnects = $astman->reconnects;
    $oldsocket = $astman->socket;
    while ($response === false && $reconnects > 0) {
        $astman->disconnect();