[Qt-interest] QUdpSocket's writeDatagram source port

Markus Goetz Markus.Goetz at nokia.com
Tue Oct 27 10:22:46 CET 2009


ext Valentin Iliu wrote:
> Hello everyone.
>
> I need to find a way to detect what source port is writeDatagram using 
> when it runs, so I can bind to that port and listen for responses to 
> what writeDatagram is sending out.
>
> I notice it would usually pick 5060, but if it cannot use that one, it 
> picks some different port in what looks to me like random fashion.
>
> It seems like Wireshark knows both the source and the destination port 
> of a packet. Which means it's not impossible to detect that source 
> port. How do I do that in Qt?
>
> Thanks!
>
>
Does http://doc.trolltech.com/4.5/qabstractsocket.html#localPort return 
the correct port?

Markus



More information about the Qt-interest-old mailing list