home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 2 / amigaformatcd02.iso / comms / netsoftware / nethandler.lha / NetHandler / server / dispatch.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-16  |  1.4 KB  |  40 lines

  1. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
  2. * |_o_o|\\ Copyright (c) 1988 The Software Distillery.  All Rights Reserved *
  3. * |. o.| ||          Written by Doug Walker                                 *
  4. * | .  | ||          The Software Distillery                                *
  5. * | o  | ||          235 Trillingham Lane                                   *
  6. * |  . |//           Cary, NC 27513                                         *
  7. * ======             BBS:(919)-471-6436                                     *
  8. \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  9.  
  10. #include "server.h"
  11.  
  12. void Dispatch(global)
  13. GLOBAL global;
  14. {
  15.    BUG(("Dispatch: Entry\n"))
  16.  
  17.    /* This must be done each time - do not try to move it to InitDevice */
  18.    global->stdpkt->sp_Pkt.dp_Port = global->n.port;
  19.  
  20. #if 1
  21.    if(global->RP.RDevice == NULL || global->RP.RDevice == (RPTR)1)
  22.       global->RP.RDevice = (RPTR)global->dosport;
  23.  
  24.    PutMsg((struct MsgPort *)global->RP.RDevice, 
  25.           (struct Message *)global->stdpkt);
  26. #else
  27.    PutMsg(global->dosport, (struct Message *)global->stdpkt);
  28. #endif
  29.  
  30.    WaitPort(global->n.port);
  31.  
  32.    GetMsg(global->n.port);
  33.  
  34.    BUG(("Dispatch: local RC = %lx, %lx\n", 
  35.          global->pkt->dp_Res1, global->pkt->dp_Res2));
  36.    global->RP.Arg1 = global->pkt->dp_Res1;
  37.    global->RP.Arg2 = global->pkt->dp_Res2;
  38.  
  39.    return;
  40. }