*BSD News Article 25791


Return to BSD News archive

Xref: sserve comp.unix.programmer:14199 comp.unix.bsd:13242
Path: sserve!newshost.anu.edu.au!munnari.oz.au!constellation!paladin.american.edu!howland.reston.ans.net!agate!ames!koriel!rutgers!noao!rstevens
From: rstevens@noao.edu (W. Richard Stevens)
Newsgroups: comp.unix.programmer,comp.unix.bsd
Subject: Re: Can vread be used with UDP?
Message-ID: <1994Jan10.130118.22057@noao.edu>
Date: 10 Jan 94 13:01:18 GMT
References: <1523@minya.UUCP>
Sender: news@noao.edu
Organization: National Optical Astronomy Observatories, Tucson, AZ, USA
Lines: 16
Nntp-Posting-Host: gemini.tuc.noao.edu

> The Suns have these  extra  read()  and  write()  calls,  vread()  and
> vwrite(), which handle multiple messages in a single system call. This
> is enticing, and looks like the obvious  solution  to  the  throughput
> limit.  But there's a big gotcha:  The vread() call, while it can read
> multiple messages, seems to have no provision  for  saying  where  the
> data came from.  The programs all use recvfrom() now, so they can send
> a reply.  There seems to be no (documented) version of recvfrom() that
> can deliver more than one message and also indicate the origins of all
> the messages.

I assume you referring to readv() and writev()?  (Older BSD systems did
indeed have a vread() and vwrite(), but they were totally different beasts.)
If so, look at recvmsg(2) and sendmsg(2)--they provide the i/o vectors from
readv/writev with the peer address from recvfrom/sendto (and other stuff).

	Rich Stevens  (rstevens@noao.edu)