Re: [Newbie] send() blocks or not

From: Villy Kruse (vek_at_station02.ohout.pharmapartners.nl)
Date: 08/29/03

  • Next message: Loic Domaigne: "Re: 4GB VM for 32 bit processes"
    Date: 29 Aug 2003 08:44:20 GMT
    
    

    On Thu, 28 Aug 2003 15:40:10 GMT,
        Barry Margolin <barry.margolin@level3.com> wrote:

    >In article <3F4D8264.997609B0@adcc.alcatel.be>,
    >Senthilraja <senthil.raja@adcc.alcatel.be> wrote:
    >>Solaris man page says that send() blocks (provided, the socket option is not
    >>set to non-blocking) until all the bytes are written to the send buffer.
    >>
    >>However, in a tutorial document found in the web it is mentioned that send()
    >>is non-blocking and returns the number of bytes it managed to send. So, this
    >>document nust be wrong then.
    >
    >Yes, the tutorial is wrong.
    >

    It doesn't hurt to allow for incomplete write() or send(). If a blocked
    write is interrupted by write it usualy becomes a partial write returning
    the number of bytes actualy written, or it may return with an EINTR error.
    This behaviour is system dependent and is one of the things that makes
    SystemV and BSD signal handling different.

    Villy


  • Next message: Loic Domaigne: "Re: 4GB VM for 32 bit processes"