netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "ZHOU Xiaobo" <xb.zhou@qq.com>
To: "Rick Jones" <rick.jones2@hp.com>, "Huajun Li" <huajun.li.lee@gmail.com>
Cc: netdev <netdev@vger.kernel.org>
Subject: Re: write() udp socket
Date: Tue, 26 Jul 2011 13:32:23 +0800	[thread overview]
Message-ID: <tencent_388496926EE0228075FA6B3D@qq.com> (raw)

------------------
Sincerely yours
                         ZHOU Xiaobo
 
 
 
------------------ Original ------------------
From:  "Rick Jones"<rick.jones2@hp.com>;
Date:  Tue, Jul 26, 2011 01:38 AM
To:  "Huajun Li"<huajun.li.lee@gmail.com>;
Cc:  "ZHOU Xiaobo"<xb.zhou@qq.com>; "netdev"<netdev@vger.kernel.org>;
Subject:  Re: write() udp socket
 
On 07/24/2011 01:33 AM, Huajun Li wrote:
> 2011/7/23 ZHOU Xiaobo<xb.zhou@qq.com>:
>> question No1:
>> When I call
>> ssize_t write(int fd, const void *buf, size_t count);
>>
>>
>> on a nonblocking UDP socket, is the return value  always equal to 'count'?
>>
>>
>
> I don't think so.  The function may be interrupt by signal or return
> due to other reason, so the return value only represents the size it
> writes successfully to the fd.

I believe it should either appaear to succeed or fail.  write() best not 
be sending partial UDP datagrams.  That would be "bad."



yeah, the same as I think. If so the answer of Question No.2 is 'yes' too?

             reply	other threads:[~2011-07-26  5:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-26  5:32 ZHOU Xiaobo [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-07-26  5:39 write() udp socket ZHOU Xiaobo
2011-07-23  9:29 ZHOU Xiaobo
2011-07-24  8:33 ` Huajun Li
2011-07-25 17:38   ` Rick Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_388496926EE0228075FA6B3D@qq.com \
    --to=xb.zhou@qq.com \
    --cc=huajun.li.lee@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=rick.jones2@hp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).