writev() on a blocking Unix-domain SOCK_STREAM socket



Hello,

do I need to retry writev() (or write()) on a blocking Unix-domain
SOCK_STREAM
socket or will it always write out the exact number of bytes I wanted?

I.e. I have code like this (and a similar code with writev() too):

if (write(fd, (const char *) presp, resp_size) != resp_size) {
warn("Writing %lu bytes failed\n", resp_size);
return;
}

and they seem to work, but I'm worried if they will always work
reliably.

And another question: is it possible to find out that a Unix-domain
socket has
been disconnected before I call writev() on it (so that I reconnect it
first)?

Thanks
Alex

.



Relevant Pages

  • Re: writev() on a blocking Unix-domain SOCK_STREAM socket
    ... do I need to retry writev() ) on a blocking Unix-domain ... socket or will it always write out the exact number of bytes I wanted? ... I am not yet able to understand first query, ...
    (comp.unix.programmer)
  • Re: writev() on a blocking Unix-domain SOCK_STREAM socket
    ... do I need to retry writev() ) on a blocking Unix-domain ... socket or will it always write out the exact number of bytes I wanted? ... I am not yet able to understand first query, ...
    (comp.unix.programmer)
  • writev() on a SOCK_STREAM socket
    ... Do I need to retry writev() on a blocking Unix-domain SOCK_STREAM socket, ... or will it always write out the exact number of bytes I asked for? ...
    (comp.lang.c)
  • Re: writev() on a blocking Unix-domain SOCK_STREAM socket
    ... do I need to retry writev() ) on a blocking Unix-domain ... socket or will it always write out the exact number of bytes I wanted? ... It is impossible for a write to a datagram socket to send part of the ...
    (comp.unix.programmer)
  • Re: writev() on a SOCK_STREAM socket
    ... Do I need to retry writev() on a blocking Unix-domain SOCK_STREAM socket, ... or will it always write out the exact number of bytes I asked for? ...
    (comp.lang.c)