[comp.sys.mac.programmer] Appletalk Transaction Protocol

set@teddy.UUCP (Sean E. Trowbridge) (07/23/88)

Help!

I'm writing a program which uses Appletalk Transaction Protocol to send data
packets around.  I'm using ATP because I need the guaranteed delivery.

However, I don't need the multi-packet responses.  So, I specify the number
of responses expected as zero, give the BDS pointer as null, and just send the
info in the request packet.

And, you guessed it, it doesn't work. The request arrives fine at the other
end, but I always get a timeout error from the ATPSendRequest call.

Questions:  What conditions specify a successful ATPSendRequest completion?
Do I need to send any kind of SendResponse?  (I tried sending one with zero
messages and the EOM flag set, but it didn't help.)

If anybody can give me some pointers to possible causes of my problem, please
do!!!  I just went over the procedures with my new LSC 3.0 debugger, hoping to
find the problem, but everything looks OK.

Thanks a million!
Sean (set@teddy.UUCP)

P.S.  I'm using the new parameter block (nAppletalk) interface from LSC. but,
I don't think the problem is language-specific.

erics@eleazar.dartmouth.edu (Eric Schlegel) (07/24/88)

In article <4902@teddy.UUCP> set@teddy.UUCP (Sean E. Trowbridge) writes:
>
>I'm writing a program which uses Appletalk Transaction Protocol to send data
>packets around.  I'm using ATP because I need the guaranteed delivery.
>
>However, I don't need the multi-packet responses.  So, I specify the number
>of responses expected as zero, give the BDS pointer as null, and just send the
>info in the request packet.
>
>And, you guessed it, it doesn't work. The request arrives fine at the other
>end, but I always get a timeout error from the ATPSendRequest call.
>

Sounds familiar to me...

I ran into the same problem a few weeks ago when I was just starting to learn
AppleTalk. When you send a request, you have to expect at least one response.]
The trick is that the response length can be zero. So set the expected number
of responses to 1, allocate one BDS element, and set the BDS pointer to point
at that element. Then set the bds element buffptr to nil and the bds element
length to 0. Now you shouldn't have any problems.

I'm by no means an expert on AppleTalk, but I would guess that the rational
behind this behavior is that when you send a request, a TReq packet goes out.
In order for the transaction to complete, and TResp packet has to come back.
But your code says that you don't want any responses; so the TResp packet 
never comes back and SendRequest times out.

Good luck!

Eric 
------
Eric Schlegel                 |  DISCLAIMER: I'm just a poor college student,
eric.schlegel@dartmouth.edu   |  which means I'm not responsible for what I
eric.schlegel@dartvax.uucp    |  say and I can't pay you if you sue me anyway.