PDA

View Full Version : Setting Source Port for QUdpSocket



MSUdom5
12th April 2012, 14:15
I'm successfully able to use QUdpSocket to send and receive datagrams. When I receive a datagram, I can retrieve the source IP and Port. However, I don't immediately see a way to set the source port. For instance, if I send a datagram from Client A (with IP_A:PORT_A) to Client B (with IP_B:PORT_B), Client B can be bound to PORT_B and sends a signal when the datagram arrives. However, the source IP_A:PORT_A that I get from the readDatagram function has a random PORT_A. How to I control this source when I send a datagram from Client A?