Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Aug 1997 23:56:08 -0600 (MDT)
From:      Wes Peters <softweyr@xmission.com>
To:        0000-Administrator  <root@acromail.ml.org>
Cc:        questions@freebsd.org
Subject:   A small buffer question..
Message-ID:  <199708150556.XAA17415@obie.softweyr.ml.org>
In-Reply-To: <Pine.BSF.3.96.970813163130.2479A-100000@acromail.ml.org>
References:  <Pine.BSF.3.96.970813163130.2479A-100000@acromail.ml.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708150556.XAA17415>