peb_connect

peb_connectOpen a connection to an Erlang node

Description

resource peb_connect ( string $server , string $cookie )

Open a connection to an Erlang node.

Parameters

server

The Erlang node. e.g. "nodename@host.domain"

cookie

The cookie for communicate with this Erlang node.

Return Values

Returns an Erlang node link identifier on success, or FALSE on failure.

Examples

Example #1 peb_connect() example

<?php
$link 
peb_connect('node@host.domain' 'secret_cookie');
if (!
$link) {
    die(
'Could not connect: ' peb_error());
}
echo 
'Connected successfully';
peb_close($link);
?>

The above example will output:

Connected successfully

Notes

Note: The link to the server will be closed as soon as the execution of the script ends, unless it's closed earlier by explicitly calling peb_close().

See Also