Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!uunet!overload!dillon From: dillon@overload.Berkeley.CA.US (Matthew Dillon) Newsgroups: comp.sys.amiga.datacomm Subject: Re: DNET Programming Message-ID: Date: 12 May 91 18:03:04 GMT References: <1991May11.140241.626@nic.csu.net> Organization: Not an Organization Lines: 61 In article <1991May11.140241.626@nic.csu.net> rkent@sparc1.sparc1.csubak.edu (Rick Kent) writes: >Has anyone tried programming some client/server programs to utilize >DNET? I'm attempting to write a graphical, window-based, mouse-driven >bulletin board system that will use DNET as the underlying communication >protocol. The only problem is that some of the functions are missing >from Matt's original code. I've been trying to write these routines >based soley on what I believe they're supposed to do, but so far haven't >had much luck. The missing functions include the following: > > BCmp(), WaitMsg(), BMov(), GetHead(), GetDEnv(), etc. > >The WaitMsg() function is the one giving me the trouble right now. If >anyone else has attempted to write any DNET clients or servers, then >they will have to have rewritten these missing functions. I've asked >Matt if there is perhaps a new version coming soon, but it appears that >it may be about 6 months before he has the time to revise it and he no >longer has these missing routines. He's real busy right now with Amiga >UUCP. If anybody has coded up or has a copy of these missing routines, >I could sure use them! > >-- >Rick Kent // Only >California State University, Bakersfield \X/ Amiga! >Internet: rkent@sparc1.csubak.edu >AOL: RickK10 Here's WaitMsg() .. .this works for messages passed between tasks which is all DNet does. To make it work w/ messages passed from interrupts you have to use Disable()/Enable(). -Matt #include #include #include #include typedef struct Message Message; typedef struct MsgPort MsgPort; void WaitMsg(Message *); void WaitMsg(msg) Message *msg; { while (msg->mn_Node.ln_Type != NT_REPLYMSG) Wait(1 << msg->mn_ReplyPort->mp_SigBit); Forbid(); Remove(&msg->mn_Node); Permit(); } -- Matthew Dillon dillon@Overload.Berkeley.CA.US 891 Regal Rd. uunet.uu.net!overload!dillon Berkeley, Ca. 94708 USA