Hello,

Since MSG_NOSIGNAL and MSG_DONTWAIT are non-POSIX using these flags can make
code non-portable. I had a quick look at how these flags are used. Can
anyone comment on the following:
- As far as I know setting MSG_NOSIGNAL only makes sense for stream
(connected) sockets and not for UDP sockets, so it should be fine to remove
all uses of MSG_NOSIGNAL in snmplib/transports/snmpUDPBaseDomain.c.
- In apps/sshtosnmp.c using MSG_NOSIGNAL makes sense but is nonportable. A
possible approach here is to remove MSG_NOSIGNAL and make the OS ignore
SIGPIPE. That should help on OS/X where MSG_NOSIGNAL is not available but
where SIGPIPE can be generated by the kernel.
- The use of MSG_DONTWAIT in apps/sshtosnmp.c looks dangerous to me since
there is no guarantee that all data gets sent if this flag is specified. How
about removing that flag and setting the socket option SO_SNDTIMEO instead ?
At least on Linux that option works for Unix sockets.

Bart.
------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to