Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heartbeat mechanism makes coilmq unusable with heartbeats enabled #26

Open
miyoyo opened this issue Feb 18, 2019 · 1 comment
Open

Heartbeat mechanism makes coilmq unusable with heartbeats enabled #26

miyoyo opened this issue Feb 18, 2019 · 1 comment

Comments

@miyoyo
Copy link

miyoyo commented Feb 18, 2019

According to this part of the STOMP specification, an ERROR must then be followed by the server closing the connection.

I am writing a client and am therefore assuming that servers follow this part of the spec, as soon as an ERROR frame is received, I disconnect and garbage collect my client.

This line should probably just send a "\n" trough the socket.

@mrjbq7
Copy link

mrjbq7 commented May 9, 2024

Perhaps

diff --git a/coilmq/protocol/__init__.py b/coilmq/protocol/__init__.py
index 7bb98f6..8f85e30 100644
--- a/coilmq/protocol/__init__.py
+++ b/coilmq/protocol/__init__.py
@@ -264,8 +264,7 @@ class STOMP11(STOMP10):
         self.timer.stop()
 
     def send_heartbeat(self):
-        # screw it, just send an error frame
-        self.engine.connection.send_frame(ErrorFrame('heartbeat'))
+        self.engine.connection.request.sendall(b'\n')
 
     def receive_heartbeat(self):
         ago = datetime.datetime.now() - self.last_hb

But there appears to be another issue which is if heartbeats are enabled somehow messages stop getting received by the client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants