PDA

View Full Version : QUdpSocket not getting responses



mhoover
8th July 2009, 00:37
I've had some success getting QUdp servers and clients to talk to each other.

But for some reason, when I call this code:


writeDatagram( buffer, host_address, port_number );
this->waitForReadyRead( 5000 );
while ( this->hasPendingDatagrams() == true ) {
cout << "received a response!" << endl;
}

The server sees the buffer (and netcat can see it also), but the client never sees the response.

I have gotten a response before (when using a QUdpSocket server), but for some reason it doesn't seem to see the response when I use a scheme server.

Using netcat and a small example, it looks like the scheme server is sending a response, but the QUdpSocket isn't detecting there is something to read.

Any suggestions?

mhoover
8th July 2009, 00:48
Even more confusing is I've got a slot connected to readyRead() that never gets called when I use the scheme server but does get called when I use the Qt server.

mhoover
8th July 2009, 01:40
I shouldn't have to call bind() on the temporary port that gets used for writeDatagram should I? I'm not using that with my Qt-based server and it works fine. I'm not sure how I would even get access to that port number.

I've successfully used Scheme's udp-send-to command to send ASCII text to my Qt server, but when I have a Qt client it can send the ASCII text to my scheme server but when the scheme server returns it, the Qt client doesn't detect it.

I'm continually checking pendingDatagramSize() and it's always -1.