PDA

View Full Version : udp send and receive on same port (the data i sent out is received on my port as well



kleinwulf
13th March 2013, 09:32
hi,
im learning to use the udp socket in QT4

what happened was when i tried to send and receive on the same port using the same QUDPsocket
whatever i send out i receive on my port and my client on the other end doesnt receive anything.
however when i disable the binding and signal readyRead() it works fine

my code is

udpsock = new QUdpSocket(this)
udpsock->bind(20000,QUdpSocket::ReuseAddressHint)
connect(udpsock,SIGNAL(readyRead()), this, SLOT(processPendingDatagrams())

is there something i did wrong here?

thanks for yr help

wysota
13th March 2013, 09:44
How are you sending datagrams?