[comp.protocols.appletalk] Appletalk sockets in Lightspeed C

mmc@well.UUCP (Matthew McClure) (12/29/88)

apTlkErr is always zero, and mySocket also ends up as zero.  Why doesn't
the ATPOpenSocket routine dynamically assign a socket number to mySocket
or return some kind of error?  This same thing happens if I use the DDP
protocol instead of ATP.

Thanks in advance for any help...

/*************************************************************************
*
*       InitNetStuff()
*
*       initialize the AppleTalk network stuff
*
*************************************************************************/
Boolean InitNetStuff()
{
        OSErr apTlkErr;
        AddrBlock addrRcvd;
        
        if(apTlkErr = ATPLoad())
                return(FALSE);
        mySocket = 0;
        addrRcvd.aNet = 0;
        addrRcvd.aNode = 0;
        addrRcvd.aSocket = 0;
        if(apTlkErr = ATPOpenSocket(addrRcvd, &mySocket))
                return(FALSE);
        return(TRUE);
} /* InitNetStuff

Matthew McClure			{pacbell,lll-crg,apple,hplabs}!well!mmc
International Technology Development Corporation
1990 Lombard Street, #250, San Francisco, CA 94123	   415-929-0924

beard@ux1.lbl.gov (Patrick C Beard) (12/30/88)

mySocket should be declared as an int.  Then it will work.  Don't
know why exactly, must be a bug in appletalk interface that uses
MOVE.W instead of MOVE.B.  Time to break out TMON...

Patrick Beard
Lawrence Berkeley Laboratory