Correct me if I'm wrong, but my understanding of sending a raw packet inevitably is defined as buffering an array of bytes in an array, and writing it to a socket. However, most example code I've seen so far tend towards sendto
, rarely is send
used, and I've never seen code other than my own use write
. Am I missing something? What is with this apparent preoccupation with complicating code like this?
Why use send
and sendto
when write
seems to me to be the obvious choice when dealing with raw sockets?