From owner-freebsd-hackers Sun Nov 17 13:56:03 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA16971 for hackers-outgoing; Sun, 17 Nov 1996 13:56:03 -0800 (PST) Received: from www.sdf.se (www.sdf.se [194.218.219.11]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id NAA16964 for ; Sun, 17 Nov 1996 13:55:46 -0800 (PST) Received: from what.sdf.se (matte@what [192.168.1.15]) by www.sdf.se (8.8.2/8.8.2) with ESMTP id WAA20627; Sun, 17 Nov 1996 22:55:04 +0100 (MET) Received: (from matte@localhost) by what.sdf.se (8.8.2/8.8.2) id WAA19161; Sun, 17 Nov 1996 22:52:57 +0100 (MET) From: Mattias Karlsson Message-Id: <199611172152.WAA19161@what.sdf.se> Subject: Re: Hate to ask more about sockets...but... To: scrappy@ki.net (Marc G. Fournier) Date: Sun, 17 Nov 1996 22:52:56 +0100 (MET) Cc: hackers@freefall.freebsd.org In-Reply-To: from "Marc G. Fournier" at Nov 16, 96 03:13:04 pm X-Mailer: ELM [version 2.4 PL24 ME7] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > if( (fd = open(TESTFILE, O_RDONLY)) != -1) { > fstat(fd, &fi); > fp = mmap(NULL, fi.st_size, PROT_READ, MAP_PRIVATE, fd, 0); > if(fp == (caddr_t) -1) { > fprintf(stderr, "MMAP() failed\n"); > exit(1); > } > close(fd); > while(cnt-- != 0) { /* set to 1 for initial test */ > start = time(0); > nwritten = write(newsockfd, START, strlen(START)); Does this file you are trying to send contain NULL chars? in that case you probably have the problem here ... then the strlen call only return to the number of bytes to the NULL char .. /Matte