I want to send packets through single socket() but using two different port numbers in UDP. Anybody give some idea on this.
Thanks in advance.
I want to send packets through single socket() but using two different port numbers in UDP. Anybody give some idea on this.
Thanks in advance.
Using, as it originating from two different ports? Internet protocol doesn't work that way; one socket, one port. Nothing stops you from opening two ports of course.
Do you mean you want to control the source and destination ports? If so, you can bind() to a local port and then either sendto() the remote port or connect() to it and and write()/send().