mbroadst / qamqp

AMQP 0.9.1 implementation for Qt
Other
151 stars 128 forks source link

Fix problem of ms vs seconds for heartbeat #10

Closed redkite127 closed 9 years ago

redkite127 commented 9 years ago

In the tune packet from the server, we receive 580s by default. In the packet we return to the server, we also need to return seconds. The only place where we need to adapt ms & s is when we set the interval on the QTimer. Everywhere else, we only use seconds. Even when affecting heartbeatDelay.

coveralls commented 9 years ago

Coverage Status

Coverage remained the same at 88.22% when pulling 7cd07f49833c8dd2e02da324a5523b64806ac061 on TaDaweb:master into 31d8affc84ac72dd71ee1f2453a8974f0ebb6f87 on mbroadst:master.

coveralls commented 9 years ago

Coverage Status

Coverage remained the same at 88.22% when pulling 7cd07f49833c8dd2e02da324a5523b64806ac061 on TaDaweb:master into 31d8affc84ac72dd71ee1f2453a8974f0ebb6f87 on mbroadst:master.

mbroadst commented 9 years ago

well thats an annoying little coveralls feature :smile:

thanks for the contribution!

redkite127 commented 9 years ago

You're welcome :) Thanks YOU for updating this lib!

Btw, can you point me to a document which can explain this : https://github.com/mbroadst/qamqp/blob/cac9d94491581ca16481fd88ce2eebca7db98a47/src/qamqpclient.cpp#L404

Why couldn't I put an heartbeat delay lower than the one given by the server?

mbroadst commented 9 years ago

Because it's up to the server. The tune frame is a negotiation where the client initially sends what it wants, and the server responds with either "0/I don't care", "specifiedHeartbeat/Okay whatever you want", or "somethingDifferent/I'm dealing with too many clients, you're going to have to play by my rules"

I don't have an exact link to the documentation, but you should be able to find the pdf for the spec pretty easily

redkite127 commented 9 years ago

Ok, thanks for the fast and brief explanation. I may look further ;-)

mbroadst commented 9 years ago

@redkite1 yeah absolutely. Obviously I could be wrong in my interpretation, and patches are always welcome.