From owner-freebsd-stable Thu Mar 29 12:14:56 2001 Delivered-To: freebsd-stable@freebsd.org Received: from flounder.jimking.net (flounder.jimking.net [209.205.176.18]) by hub.freebsd.org (Postfix) with ESMTP id A4B8D37B71B for ; Thu, 29 Mar 2001 12:14:52 -0800 (PST) (envelope-from jim@jimking.net) Received: from jking (jking.lgc.com [134.132.76.82]) (authenticated) by flounder.jimking.net (8.11.2/8.11.2) with ESMTP id f2TKEYO67611 (using TLSv1/SSLv3 with cipher RC4-MD5 (128 bits) verified NO); Thu, 29 Mar 2001 14:14:41 -0600 (CST) (envelope-from jim@jimking.net) Message-ID: <012101c0b88c$e31a7cb0$524c8486@jking> From: "Jim King" To: "Nate Williams" Cc: "Paul Marquis" , "Nate Williams" , "Brian Matthews" , "Allen Landsidel" , References: <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> Subject: Re: Threads vs. blocking sockets Date: Thu, 29 Mar 2001 14:14:34 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG "Nate Williams" 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