[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Apple Events over TCP/IP



I was working a little bit on this today (with Mac OS 9, of course).

I think I have most of it down, but I cannot figure out the TYPE part.  In
old-style PPC ports, it was simply 'PPCToolbox'.  Does anyone have any info
on how to pack this thing?  Maybe someone who works at Apple?  :-)

Here is what I have now in Mac::AppleEvents::Simple.  It works fine, but
not with the TCP/IP addresses.  Everything up to the LocationNameRec is
fine, I think.  I am not sure what PPCLocationKind should be, and the rest
is just a mess ... any clues are welcome.

sub pack_ppc {
    my $format = 'lsca33sca33sca33ca33ca33';
    my $type   = 'PPCToolbox';
    my($id, $name, $server, $zone) = @_;
    $zone ||= '*';
    my @ppcdata = (
        0,                          # session id
        0,                          # script code (smRoman English?)
        length($name), $name,       # as in PPC Chooser
        2,                          # portKindSelector, ppcByCreatorAndType
                                    # should be 1, is 2?
        8,                          # length of port string
        $id . 'ep01',               # port string, why "ep01"?
        1,                          # PPCLocationKind, PPCNBPLocation
        length($server), $server,   # server name
        length($type), $type,       # port type
        length($zone), $zone,       # zone
    );
    my $targ = pack $format, @ppcdata;
    print unpack $format, $targ if $DEBUG > 1;
    return $targ;
}

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org