You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Ken Giusti <kg...@redhat.com> on 2014/01/11 00:48:25 UTC

[Proton] Should engine allow links to be re-opened?

Hi,

While playing around with the proton-c engine, I tried to re-open a link that I had previously closed.  The link failed to come up - but no error state was returned.

Should the engine allow a previously closed link to be re-opened?  IOW, should the engine allow the following Link test to pass (code refactored from tests/python/proton_tests/engine.py LinkTests):

  def test_open_close_reopen(self):

    self.snd.open()
    self.pump()
    self.rcv.open()
    self.pump()

    print "both open"
    print "SEND STATE %s" % hex(self.snd.state)
    print "RCV STATE %s" % hex(self.rcv.state)
    assert self.snd.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE
    assert self.rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE

    self.snd.close()
    self.pump()
    self.rcv.close()
    self.pump()

    print "both closed"
    print "SEND STATE %s" % hex(self.snd.state)
    print "RCV STATE %s" % hex(self.rcv.state)
    assert self.snd.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED
    assert self.rcv.state == Endpoint.LOCAL_CLOSED | Endpoint.REMOTE_CLOSED

    self.rcv.session.connection._transport.trace(Transport.TRACE_FRM)
    self.snd.session.connection._transport.trace(Transport.TRACE_FRM)

    print "Re opening..."
    self.rcv.open()
    self.pump()
    self.snd.open()
    self.pump()
    assert self.snd.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE
    assert self.rcv.state == Endpoint.LOCAL_ACTIVE | Endpoint.REMOTE_ACTIVE

-- 
-K

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org