jonnydee/nzmqt

ReqRep client does not receive response

yisding opened this issue · 5 comments

I built nzmqt with zmq 2.1.11 on Windows 7 using the Qt SDK (Qt 4.7.4).

When running your Req-Rep example, there's no message received (only sent) and it just hangs there.

client output:
ReqRepClient::sendRequest> ("REQUEST[1: 2012-01-25T12:38:08]", "ping")

server output:
ReqRepServer::requestReceived> ("REQUEST[1: 2012-01-25T12:38:08]", "ping")
ReqRepServer::sendReply> ("REPLY[1: 2012-01-25T12:38:12]", "ping", "REQUEST[1: 2012-01-25T12:38:08]", "ping")

Doing a little bit of digging, it appears that socketReadActivity never gets called on the requester side even after a message comes in.

This may be related to this thread:

http://lists.zeromq.org/pipermail/zeromq-dev/2011-December/014688.html

but I'll do some more digging.

You're right, I can reproduce this behaviour on OS X, too. It seems like this bug was introduced with the bugfix for gh-1 (changeset 1102204).

Hmm... I'm kind of new to Qt so I can't quite figure out how that change would have introduced the bug. I have found a workaround though, which is to call receiveMessage after every time we send a message on the request socket.

Besides the QSocketNotifier solution for listening to incoming messages I've implemented a new polling-based solution which seems to work without problems. I've changed the examples accordingly. They use the new implementation now. The old implementation is still available (see the commit 2a2d79e message for more details). I'd appreciate to get feedback for the new one... :)

Hi,

I've implemented a new polling-based integration into Qt's event loop.
It would be great if you could try it and check if it works for you. See
the examples on how to use it.

Best regards,
Jonny

On 25.01.12 20:35, yisding wrote:

Hmm... I'm kind of new to Qt so I can't quite figure out how that change would have introduced the bug. I have found a workaround though, which is to call receiveMessage after every time we send a message on the request socket.


Reply to this email directly or view it on GitHub:
#2 (comment)

I'll check it out. Thanks for making the change.

On Mon, Jan 30, 2012 at 6:17 PM, Jonny Dee <
reply@reply.github.com

wrote:

Hi,

I've implemented a new polling-based integration into Qt's event loop.
It would be great if you could try it and check if it works for you. See
the examples on how to use it.

Best regards,
Jonny

On 25.01.12 20:35, yisding wrote:

Hmm... I'm kind of new to Qt so I can't quite figure out how that change
would have introduced the bug. I have found a workaround though, which is
to call receiveMessage after every time we send a message on the request
socket.


Reply to this email directly or view it on GitHub:
#2 (comment)


Reply to this email directly or view it on GitHub:
#2 (comment)