[Qt-interest] How to change QUdpSocket peer port

Laurent Astart laurent.astart at gmail.com
Mon Jan 9 16:13:04 CET 2012


Hi all,

I'm searching for a way to change the peer port of a QUdpSocket, without
loosing my local port (that is no disconnection / reconnection).

I searched through the documentation and saw a protected function called
"setPeerPort" in base class (QAbstractSocket). So, i derived from
QUdpSocket and declared the setPeerPort function public. Unfortunately, it
don't seem to work (it is compiled and executed, but the datagrams seems to
be sent to the old peer port). I suspect this isn't enough. Do you think
it's the right way, but i've done something wrong ? Do you have another
solution to propose ?

Cordially,
Laurent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20120109/900890a7/attachment.html 


More information about the Qt-interest-old mailing list