AppleTalk / C Programming Problem

Bruce.Hoult at bbs.actrix.gen.nz Bruce.Hoult at bbs.actrix.gen.nz
Fri Jan 11 21:43:43 AEST 1991


Peter A. Steinauer writes:
>	I'm trying to write a simple program which will compose a packet
>	and send it from one socket to another on the same machine (or to
>	a socket on a different machine)... I'm able to open both the source
>	and desination sockets but when I try to compose and send the packet
>	DDPWrite returns a -91 in errCode which is supposed to say that the 
>	source socket isn't open... I don't understand... Could some one 
>	take a look at the following code and let me know what I'm missing.
>	I would really appreciate it...

Without actually trying to get the code running (OK, Ok, I'm lazy), I see
several possible problems:
 
1) you didn't use PSetSelfSend to allow you to send to yourself (what else?)

2) You need to have an outstanding read on the receiving socket when you do
   the send, otherwise it will miss the packet.


... and now the friendly advice, that you're free to ignore ...

3) It's a waste of time using the ABusRecord interface -- do as IM vol 5
   tells you and use the paramBlock interface.  It's much easier.  Really.

4) Unless you've got a good reason to use DPP (i.e. you're doing something
   *really* clever), don't bother and just use ATP (possibly with an empty
   response packet) instead.  It's easier still -- even I got something
   working using ATP.  This last point may be just prejudice on my part,
   because I confess that I haven't actually tried to get DDP working.
   ATP with the paramBlock interface really *was* easy though...

-- Bruce
-- 
Bruce.Hoult at bbs.actrix.gen.nz   Twisted pair: +64 4 772 116
BIX: brucehoult                 Last Resort:  PO Box 4145 Wellington, NZ



More information about the Comp.lang.c mailing list