PDA

View Full Version : QUdpSocket binding



db
13th March 2008, 11:24
I have a situation where I'm connecting to another application via ethernet. I am required to send UDP to their specified port number and read from the same port number on my box. To further compliacte things it is required the I send the data out the exact same port number. So my sending port is 18888 and receiving port is 18888. When I bind to the smae por in both my receive and send threads I have issues.

I can send using the port but not receive. Anyone have a suggestion?

code used is

QUdpSocket udpSend = new QUdpSocket();
updSend->bind( 18888, (bind flags for share address & reuse hint) );
.....

and

QUdpSocket udpRecv = new QUdpSocket();
updRecv->bind( 18888, (bind flags for share address & reuse hint) );

Thanks