View Full Version : What's difference between sendto and sendmsg?
XRainbow
04-29-2003, 02:03 AM
sendto() and sendmsg() looks very similar.But what's difference between them?
Is sendmsg() more reliable than sendto()? :roll:
RobSeace
04-29-2003, 01:33 PM
No, I doubt there's any difference in reliability... The only real
difference is in the API and the functionality... You can implement
the functionality of sendto() using sendmsg(), but sendmsg()
also lets you do lots of other nifty stuff you can't do via sendto()...
Eg: send control/ancillary messages, or send multiple seperate
chunks of data in a single operation (via iovec scatter/gather
arrays)... Basically, sendmsg() is the ultimate low-level socket
sending function, and really the only one that a system actually
need implement, since the rest can all be built on top of it easily...
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.