I want to send the two different packets in different port numbers parallely using UDP. Can I achive this using single socket() or should I create another socket?? Can anbody give me some idea on this.
Thanks in advance
You can use a single socket, you will be using the system calls sendto(2)
and recvfrom(2)
to send and receive data over the datagram sockets.
Take a look at https://beej.us/guide/bgnet/html/multi/syscalls.html for more information (the entire guide is definitely worth the read).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.