From owner-freebsd-hackers Tue Oct 23 18:22:33 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from po3.wam.umd.edu (po3.wam.umd.edu [128.8.10.165]) by hub.freebsd.org (Postfix) with ESMTP id 023F237B403 for ; Tue, 23 Oct 2001 18:22:31 -0700 (PDT) Received: from rac1.wam.umd.edu (IDENT:root@rac1.wam.umd.edu [128.8.10.141]) by po3.wam.umd.edu (8.9.3/8.9.3) with ESMTP id VAA02799 for ; Tue, 23 Oct 2001 21:22:29 -0400 (EDT) Received: from rac1.wam.umd.edu (IDENT:sendmail@localhost [127.0.0.1]) by rac1.wam.umd.edu (8.9.3/8.9.3) with SMTP id VAA14904 for ; Tue, 23 Oct 2001 21:22:29 -0400 (EDT) Received: from localhost (culverk@localhost) by rac1.wam.umd.edu (8.9.3/8.9.3) with ESMTP id VAA14900 for ; Tue, 23 Oct 2001 21:22:29 -0400 (EDT) X-Authentication-Warning: rac1.wam.umd.edu: culverk owned process doing -bs Date: Tue, 23 Oct 2001 21:22:29 -0400 (EDT) From: Kenneth Wayne Culver To: freebsd-hackers@freebsd.org Subject: domain sockets question (don't laugh) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG While I've been coding for a long time, and am fairly decent at coding in the kernel, I've never really had a chance to get into sockets programming. So I thought I'd write a simple set of programs to see how things work. From what I understand, when you read on a socket, you have to do it in a loop because it won't block and wait for the total amount of data specified, while write will not return until all specified data has been written. My problem is that I've set up a read loop to read in chunks that are the size of the recv/send buffers (16384 bytes) from the socket (until the end of course, when it reads only what's left), then when I write from one program to the socket for the other program to read, the program that's writing exits with the message "broken pipe" while the program that's reading doesn't think there was any error, reads the amount of data it should have read (although I'm not sure if there's any data there). Can anyone tell me what's going on? Ken To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message