private class JoinHostFunction extends ScriptableFunctionBase {
protected Object execute(Object thiz, Object[] args) throws Exception {
final int hostPIN = (int)(Long.parseLong((String) args[0], 16) & 0x0FFFFFFFFL);
final String hostPPID = (String) args[1];
final ScriptableFunction onComplete = (ScriptableFunction) args[2];
final ScriptableFunction onHostAccepted = (ScriptableFunction) args[3];
final ScriptableFunction onHostDeclined = (ScriptableFunction) args[4];
final String cookie;
if(args.length >= 6) {
cookie = (String) args[5];
} else {
cookie = null;