Files
cell/tests/contact.js
John Alanbrook efd98460c5
Some checks failed
Build and Deploy / build-macos (push) Failing after 4s
Build and Deploy / build-windows (CLANG64) (push) Has been cancelled
Build and Deploy / package-dist (push) Has been cancelled
Build and Deploy / deploy-itch (push) Has been cancelled
Build and Deploy / deploy-gitea (push) Has been cancelled
Build and Deploy / build-linux (push) Has been cancelled
-u is no longer available as a global, only within the running actor code; enable passing args to use
2025-05-22 18:59:57 -05:00

36 lines
598 B
JavaScript

// Test to connect to a portal
function contact_fn(actor,reason) {
if (actor) {
console.log(`Got an actor: ${json.encode(actor)}`)
send(actor, {greet: "Hello!"}, e => {
console.log(`Got the response ${json.encode(e)}. Goodbye!`);
$_.stop()
})
}
else
console.log(`Did not get an actor: ${json.encode(reason)}`)
}
$_.contact(contact_fn,
{
address: "localhost",
port: 5678,
password: "abc123"
});
/*$_.contact(contact_fn, {
address: "localhost",
port: 5678,
password: "123abc"
})
$_.contact(contact_fn, {
address: "localhost",
port:1111,
})
*/