EInternalPort port = cid_arg.testInternalPort();
if (port == null) {
throw ERT.badarg(node_arg, cid_arg, type_arg);
}
ETuple t = type_arg.testTuple();
if (t.arity() != 4) {
throw ERT.badarg(node_arg, cid_arg, type_arg);
}
ESmall flags = t.elm(1).testSmall();
ESmall version = t.elm(2).testSmall();
if (flags == null || version == null) {
throw ERT.badarg(node_arg, cid_arg, type_arg);
}
EPeer n = EPeer.get_or_create(node, creation, port, flags.value, version.value);