From owner-freebsd-questions Thu Aug 14 22:51:24 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id WAA10007 for questions-outgoing; Thu, 14 Aug 1997 22:51:24 -0700 (PDT) Received: from obie.softweyr.ml.org ([199.104.124.49]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id WAA10002 for ; Thu, 14 Aug 1997 22:51:19 -0700 (PDT) Received: (from wes@localhost) by obie.softweyr.ml.org (8.7.5/8.6.12) id XAA17415; Thu, 14 Aug 1997 23:56:08 -0600 (MDT) Date: Thu, 14 Aug 1997 23:56:08 -0600 (MDT) Message-Id: <199708150556.XAA17415@obie.softweyr.ml.org> From: Wes Peters To: 0000-Administrator CC: questions@freebsd.org Subject: A small buffer question.. In-Reply-To: References: Sender: owner-freebsd-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk root@acromail.ml.org writes: > > If the low level write() call is used to write to a data file then unlike > fwrite() where you must do an fflush to make sure that info is on disk I > am assuming that some type of flush is not necessary (can someone fill me > in on how to insure when using write() and read() calls that the data > actually gets to the disk), more importantly though if I open a socket and > then use a connect call to connect to a remote system and use write() to > write a block of data, is that block of data sent entirely as soon as > possible? Not necessary. The man page for 'setsockopt' will tell you many interesting things about the behavior of sockets. In general, network sockets have an input and an output buffer, like any other communication port, and the real I/O does not happen until the buffer is full or a timeout period has expired. Getsockopt will show you these settings and setsockopt will allow you to change them. -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC http://www.xmission.com/~softweyr softweyr@xmission.com