[comp.sys.mac.programmer] ATPGetRequest

shane@chianti.cc.umich.edu (Shane Looker) (07/30/88)

This is a desparate plea for help.  Another programmer and I have been
trying to get this to work for two days.  He just left on vacation and
it still won't work.  So it isn't him...

I can't get ATPGetRequest to acknowlege ever receiving data sent by 
ATPRequest.  (These are paired aren't they?)  I am registering a Mac
using NBPRegister.  That works fine.  I do a lookup using NBPLookup
from another Mac, and get the AddrBlock back.  This works fine and I
then use the following code to send my request:

	HLock(myName);
	(**myName).atpProto.abUserReference = 0;
	(**myName).atpProto.atpAddress = adBlk;
	(**myName).atpProto.atpReqCount = 255;
	(**myName).atpProto.atpDataPtr = &Packet[0];
	(**myName).atpProto.atpUserData = 0x01020304;
	(**myName).atpProto.atpXO = FALSE;
	(**myName).atpProto.atpTimeOut = 2;
	(**myName).atpProto.atpRetries = 2;
	(**myName).atpProto.atpRspBuf = &Packet[0];
	(**myName).atpProto.atpRspSize = 255;
	
	err = ATPRequest(myName, FALSE);


----------------------------------------

It always returns with a -1096 in err.  (ATPSndRequest failed: retry count
exceeded).

The listening Mac uses the following code:

	ABRecHandle		Mine;
	short			err;
	char			Packet[256];
	
	Mine = (ABRecHandle) NewHandle(sizeof(ABusRecord));
	
	(**Mine).atpProto.abUserReference = 0;
	(**Mine).atpProto.atpSocket = theSocket;
	(**Mine).atpProto.atpReqCount = 255;
	(**Mine).atpProto.atpDataPtr = &Packet[0];
	
	err = ATPGetRequest(Mine, FALSE);

------------------------------------------

theSocket is a short passed into the routine which does this.

Any Help would be greatly appreciated.

Shane Looker
Looker@um.cc.umich.edu