[Qt-interest] QUdpSocket's writeDatagram source port
Valentin Iliu
valentiniliu at yahoo.com
Wed Oct 28 13:09:30 CET 2009
Funny enough, if I do udpSocket->bind(), I get the response in the callback function, precisely from the side where I wrote the packets towards with writeDatagrams.
But calling bind() with no arguments is actually calling bind(0), which means "listen to any port"?! If so, that's not acceptable for me, because I want the callback function to deal with only the other side's response, not with any message coming to my app via UDP...
--- On Tue, 10/27/09, Markus Goetz <Markus.Goetz at nokia.com> wrote:
From: Markus Goetz <Markus.Goetz at nokia.com>
Subject: Re: [Qt-interest] QUdpSocket's writeDatagram source port
To: "ext Valentin Iliu" <valentiniliu at yahoo.com>
Cc: "qt-interest at trolltech.com" <qt-interest at trolltech.com>
Date: Tuesday, October 27, 2009, 11:22 AM
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091028/2f313fb9/attachment.html
More information about the Qt-interest-old
mailing list