LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   udp packets (http://www.linuxquestions.org/questions/programming-9/udp-packets-251261/)

m00t00 11-04-2004 05:23 PM

udp packets
 
Uhm. Was wondering, how do you make and send an arbitrary udp packet? To make it simple(r), say I want to send a blank udp packet to 127.0.0.1. How would I accomplish this? Would I just open up a raw socket and send some quirky binary code?

CroMagnon 11-04-2004 09:20 PM

Use socket() to create a SOCK_DGRAM socket, then use sendto() to send a packet... I think it will accept a 0 length buffer, but if not just send a single character.


All times are GMT -5. The time now is 03:56 AM.