On Wed, Aug 3, 2011 at 6:02 PM, Wes Hardaker <[email protected]
> wrote:

> >>>>> On Sun, 31 Jul 2011 09:04:42 +0200, Bart Van Assche <
> [email protected]> said:
>
BVA> - The use of MSG_DONTWAIT in apps/sshtosnmp.c looks dangerous to me
> BVA> since there is no guarantee that all data gets sent if this flag is
> BVA> specified. How about removing that flag and setting the socket
> BVA> option SO_SNDTIMEO instead ?  At least on Linux that option works
> BVA> for Unix sockets.
>
> The data will all get sent or the session will break at some point in
> the future.  I'm not sure I agree it's dangerous.  I'm not sure
> SO_SNDTIMEO is portable either (based on some quick (lame) header
> searches).  We could, again, do both?
>

I'm not sure the above is correct. My interpretation is that MSG_DONTWAIT
returns as soon as the send buffer is full, hence using that flag in
apps/sshtosnmp.c is dangerous.

What I know about SO_SNDTIMEO is that some operating systems implement this
socket option and other operating systems (ignore it). My opinion is that
it's safer that a timeout is ignored than that some data is lost due to
specifying MSG_DONTWAIT.

Bart.
------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to