Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!bu.edu!dartvax!Michael.J.Glenn From: Michael.J.Glenn@dartmouth.edu (Michael J. Glenn) Newsgroups: comp.sys.next Subject: write() problem with Mach 2.0 Summary: A network game of mine exits occasionally on a call to write(), and I can't figure it out. Help! Keywords: Mach 2.0, LPMud, write() Message-ID: <1991Apr5.162455.24305@dartvax.dartmouth.edu> Date: 5 Apr 91 16:24:55 GMT Sender: news@dartvax.dartmouth.edu (The News Manager) Reply-To: Fermat@Dartmouth.edu Organization: Dartmouth College, Hanover, NH Lines: 25 I run an LPMud (a network game) on a NeXT running Mach 2.0, and I seem to have a few problems that I didn't have with Mach 1.0. The main problem is, there is a write() statement in the C source code that occasionally fails (randomly) and causes the program to exit. What could cause this? It seems to happen most often when there is a large network load (30 to 40 users playing at a time), but I have trapped it even with a smaller network load. The line reads if ((n = write (ip->socket, buff2 + offset, chunk)) == -1) { ... } where the ... checks errno. This problem never seemed to happen with Mach 1.0, or on other machines. (I have run on Vax, IBM) One thing only I changed when compiling in 2.0, and that is I had to add the "-bsd" option, otherwise it seemed to have some problem with inet_ntoa(). The -bsd made it compile (and seem to run) fine. Does anyone know what could cause this write() to force the program to exit, and does this -bsd option have anything to do with it? I'd be very appreciative of any help/advice. Fermat@Dartmouth.edu (admin. Dartmouth LP, telnet wings.dartmouth.edu 2000, 129.170,16.22)