Issue #6 resolved

Does disconnect not work?

Tristan Zajonc
created an issue

It seems that disconnect is not working. Here's what I get, python 2.6.4/OSX connecting to Orbited/RabbitMQ.



import stompy stomp = stompy.Client() stomp.connect() stomp.disconnect() stomp.connect() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "stompy/", line 95, in connect self.stomp.connect(username=username, password=password) File "stompy/", line 51, in connect raise self.ConnectionError(*exc.args) stompy.stomp.ConnectionError: [Errno 56] Socket is already connected }}}

Comments (4)

  1. Benjamin Smith repo owner

    This was resolved long ago.. Relevant code:

        def connect(self, username=None, password=None, clientid=None):
            """Connect to STOMP server.
            :keyword username: Username for connection
            :keyword password: Password for connection
            :keyword clientid: Client identification for persistent connections
                self.sock.connect((, self.port))
                self.frame.connect(self.sock, username=username, password=password, clientid=clientid)
            except socket.timeout, exc:
                raise self.ConnectionTimeoutError(*exc.args)
            except socket.error, exc:
                raise self.ConnectionError(*exc.args)
            self.connected = True
        def disconnect(self, conf=None):
            """Disconnect from the server."""
                for destination in self._subscribed_to.keys():
                    self.unsubscribe({"destination": destination})
                self._send_command("DISCONNECT", conf)
            except self.NotConnectedError:
            except socket.error, exc:
                # likely wasn't connected
            self.connected = False
  2. Log in to comment