From owner-freebsd-hackers Tue Feb 25 10:33:10 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id KAA07361 for hackers-outgoing; Tue, 25 Feb 1997 10:33:10 -0800 (PST) Received: from ns.newreach.net (root@ns.newreach.net [206.25.170.1]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id KAA07350 for ; Tue, 25 Feb 1997 10:32:59 -0800 (PST) Received: from phoenix.aristar.com (inetgw.aristar.com [206.25.171.180]) by ns.newreach.net (8.8.4/8.6.9) with SMTP id NAA13618 for ; Tue, 25 Feb 1997 13:32:51 -0500 (EST) Message-ID: <3313307E.41C67EA6@aristar.com> Date: Tue, 25 Feb 1997 13:33:34 -0500 From: "Matthew A. Gessner" Organization: Aristar, Inc. X-Mailer: Mozilla 3.01Gold (X11; I; FreeBSD 2.1.0-RELEASE i386) MIME-Version: 1.0 To: hackers Subject: Writing a daemon... Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hello, hackers, I'm looking for some really good information on writing a daemon for a) FreeBSD and b) DEC ALPHA OSF/1. I've got Stevens' _Unix_Network_Programming_, and have read that, but in the past have had some problems getting the code to compile properly under FreeBSD. I just want to make sure that nothing's really 'changed' in the 'art' of daemon writing since his book was published. If anyone can add any tips or recommendations (specifically, if anyone has a good source for OSF), please let me know. Maybe you're wondering why I'm doing this? I'll explain quickly. Stevens has a socket server example in his book. It runs fine on FreeBSD, but under OSF, when the first client disconnects, accept() keeps returning a new socket for the old IP address. In /usr/examples/network_programming, I found a file called socketserver.c. The only, ONLY, _O_N_L_Y_ difference in calls is that when the child terminates, it calls return(0) instead of exit(0). Don't you know, that made ALL the difference. Why? "Don't know; can't tell ya." So I'm a little bit suspicious. Thanks, folks, Matt -- Matthew Gessner, Computer Scientist, Aristar, Inc. 302 N. Cleveland-Massillon Rd. Akron, OH 44333 Voice (330) 668-2267, Fax (330) 668-2961