home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18335 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  1.8 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!phys.ksu.edu!epa
  2. From: epa@phys.ksu.edu (Eric P. Armstrong)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Enough talk. FILE: server.c
  5. Date: 8 Jan 1993 08:18:42 GMT
  6. Organization: Kansas State University
  7. Lines: 46
  8. Message-ID: <1ijdd2INNo6c@moe.ksu.ksu.edu>
  9. References: <C0IyF5.9Gv@usenet.ucs.indiana.edu>
  10. NNTP-Posting-Host: bohr.phys.ksu.edu
  11.  
  12. In <C0IyF5.9Gv@usenet.ucs.indiana.edu> shulick@navajo.ucs.indiana.edu (Sam Hulick) writes:
  13.  
  14. >Well, I've complained enough about memory leaks.  =u)  Here's the server
  15. >I wrote that is faulty.  About 8k bytes are not freed, and I can't
  16. >figure out why.
  17.  
  18. >   while (!done) {
  19. >      WaitPort(myport); /* Wait for an incoming message. */
  20. >      while ((msg = (struct FooMsg *)GetMsg(myport)))  /* Got one...! */
  21. >      {
  22. >  /* Ignore the catmsg stuff.  I have a 'send' program where you */
  23. >  /* can send strings to the server, which keeps concatenating them. */
  24. >  /* In this case, the 'send' client is irrelevant. */
  25. >         if (strlen(catmsg) + strlen(msg->message) > 30)
  26. >         {
  27. >            if (EasyRequest(NULL, &ereq[SERVER_FULL], NULL))
  28. >               strcpy(catmsg, "\0");
  29. >            else
  30. >               done = TRUE;
  31. >         }
  32. >         else
  33. >         {
  34. >            if (!(win = (struct Window *)OpenWindow(&newwin)))
  35. >            {
  36. >               Alert(AN_OpenWindow);
  37. >               exit(0);
  38. >            }
  39. >            strcat(catmsg, msg->message);
  40. >            Move(win->RPort, 10, 20);
  41. >            Text(win->RPort, catmsg, strlen(catmsg));
  42. >            sleep(3);
  43. >            CloseWindow(win);
  44. >            if (!strcmp(msg->message, "QUIT"))
  45. >               done = TRUE;
  46. >         }
  47.  
  48. You seem to have forgotten to ReplyMsg your message....
  49. Try adding....  
  50.  
  51.       ReplyMsg(msg);
  52.  
  53.  
  54. >      }
  55.  
  56. --
  57. Eric P. Armstrong                 epa@phys.ksu.edu
  58.