Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Mar 2001 14:14:34 -0600
From:      "Jim King" <jim@jimking.net>
To:        "Nate Williams" <nate@yogotech.com>
Cc:        "Paul Marquis" <pmarquis@pobox.com>, "Nate Williams" <nate@yogotech.com>, "Brian Matthews" <blm@actzero.com>, "Allen Landsidel" <all@biosys.net>, <freebsd-stable@FreeBSD.ORG>
Subject:   Re: Threads vs. blocking sockets
Message-ID:  <012101c0b88c$e31a7cb0$524c8486@jking>
References:  <F0D64494733BD411BB9A00D0B74A0264021C9E@cpe-24-221-167-196.ca.sprintbbd.net><15043.35980.669828.971544@nomad.yogotech.com><00dd01c0b886$d8510250$524c8486@jking><3AC390FD.6C03BF8F@pobox.com><00f201c0b889$c4ff4d30$524c8486@jking> <15043.38276.757742.729671@nomad.yogotech.com>

next in thread | previous in thread | raw e-mail | index | archive | help
"Nate Williams" <nate@yogotech.com> wrote:

> > None of the documented values for errno as set by send(2) indicate "only
> > part of the data was sent", at least by my reading.  Which value of
errno
> > indicates that I need to resend part of the data?  How do I tell how
many
> > bytes were sent?
>
> Again, from the manpage:
>
>      [EMSGSIZE]    The socket requires that message be sent atomically,
and
>                    the size of the message to be sent made this
impossible.
>
> From reading this, you can safely imply that it is possible that part of
> a message can be sent, unless a socket is specically created to force
> all messages to be sent atomically.

I don't think this has anything to do with the partial sends we've been
discussing.  From earlier in the man page:

     The address of the target is given by to with tolen specifying its
size.
     The length of the message is given by len.  If the message is too long
to
     pass atomically through the underlying protocol, the error EMSGSIZE is
     returned, and the message is not transmitted.

I take this to mean that if send() returns -1 and errno is EMSGSIZE  then
*no* data was sent, and to fix this you'd have to either change the socket
to allow non-atomic sends or pass a smaller buffer to send().

Jim



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?012101c0b88c$e31a7cb0$524c8486>