Re: write() udp socket
From: ZHOU Xiaobo <hidden>
Date: 2011-07-26 05:35:31
------------------
Sincerely yours
ZHOU Xiaobo
------------------ Original ------------------
From: "Rick Jones"<redacted>;
Date: Tue, Jul 26, 2011 01:38 AM
To: "Huajun Li"<redacted>;
Cc: "ZHOU Xiaobo"<redacted>; "netdev"<redacted>;
Subject: Re: write() udp socket
On 07/24/2011 01:33 AM, Huajun Li wrote:2011/7/23 ZHOU Xiaobo[off-list ref]:quoted
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?