hozn  committed 8ab9aab

Changed the PublishSubscribeClient to not attempt to disconnect/reconnect on send error. This caused the listener loop to puke.

  • Participants
  • Parent commits 948042a
  • Branches default

Comments (0)

Files changed (1)

File stompclient/

     def disconnect(self, extra_headers=None):
-        Disconnect from the server.
+        Sends DISCONNECT frame and disconnect from the server.
             with self.subscription_lock:
 class QueueingDuplexClient(BaseBlockingDuplexClient):
     A STOMP client that supports both producer and consumer roles, depositing received
         Send a frame to the STOMP server.
-        This implementation does support the 'receipt' header, blocking on the
+        This implementation *does* support the 'receipt' header, blocking on the
         receipt queue until a receipt frame is received.
+        This implementation does NOT attempt to disconnect/reconnect if connection error
+        received, because disconnecting the socket royally pisses off the listen_forever blocking
+        loop.
         @param frame: The frame instance to send.
         @type frame: L{stomp.frame.Frame}
         if need_receipt and not self.listening_event.is_set():
             raise Exception("Receipt requested, but cannot deliver; listening loop is not running.")
-        try:
-            self.connection.send(frame)
-        except ConnectionError:
-            self.log.warning("Error sending frame, attempting to resend.", exc_info=True)
-            self.connection.disconnect()
-            self.connection.send(str(frame))
+        self.connection.send(frame)
         if need_receipt:
                 return self.receipt_queue.get(timeout=self.queue_timeout)