home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!phys.ksu.edu!epa
- From: epa@phys.ksu.edu (Eric P. Armstrong)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Enough talk. FILE: server.c
- Date: 8 Jan 1993 08:18:42 GMT
- Organization: Kansas State University
- Lines: 46
- Message-ID: <1ijdd2INNo6c@moe.ksu.ksu.edu>
- References: <C0IyF5.9Gv@usenet.ucs.indiana.edu>
- NNTP-Posting-Host: bohr.phys.ksu.edu
-
- In <C0IyF5.9Gv@usenet.ucs.indiana.edu> shulick@navajo.ucs.indiana.edu (Sam Hulick) writes:
-
- >Well, I've complained enough about memory leaks. =u) Here's the server
- >I wrote that is faulty. About 8k bytes are not freed, and I can't
- >figure out why.
-
- > while (!done) {
- > WaitPort(myport); /* Wait for an incoming message. */
- > while ((msg = (struct FooMsg *)GetMsg(myport))) /* Got one...! */
- > {
- > /* Ignore the catmsg stuff. I have a 'send' program where you */
- > /* can send strings to the server, which keeps concatenating them. */
- > /* In this case, the 'send' client is irrelevant. */
- > if (strlen(catmsg) + strlen(msg->message) > 30)
- > {
- > if (EasyRequest(NULL, &ereq[SERVER_FULL], NULL))
- > strcpy(catmsg, "\0");
- > else
- > done = TRUE;
- > }
- > else
- > {
- > if (!(win = (struct Window *)OpenWindow(&newwin)))
- > {
- > Alert(AN_OpenWindow);
- > exit(0);
- > }
- > strcat(catmsg, msg->message);
- > Move(win->RPort, 10, 20);
- > Text(win->RPort, catmsg, strlen(catmsg));
- > sleep(3);
- > CloseWindow(win);
- > if (!strcmp(msg->message, "QUIT"))
- > done = TRUE;
- > }
-
- You seem to have forgotten to ReplyMsg your message....
- Try adding....
-
- ReplyMsg(msg);
-
-
- > }
-
- --
- Eric P. Armstrong epa@phys.ksu.edu
-