diff --git a/src/wormhole/_boss.py b/src/wormhole/_boss.py index dbe59fa..2b5d0a0 100644 --- a/src/wormhole/_boss.py +++ b/src/wormhole/_boss.py @@ -55,7 +55,7 @@ class Boss(object): self._O.wire(self._K, self._R) self._K.wire(self, self._M, self._R) self._R.wire(self, self._K, self._S) - self._RC.wire(self, self._M, self._C, self._NL) + self._RC.wire(self, self._N, self._M, self._C, self._NL, self._T) self._NL.wire(self._RC, self._C) self._C.wire(self, self._RC, self._NL) self._T.wire(self, self._RC, self._N, self._M) diff --git a/src/wormhole/_mailbox.py b/src/wormhole/_mailbox.py index b6a6f5d..89eccba 100644 --- a/src/wormhole/_mailbox.py +++ b/src/wormhole/_mailbox.py @@ -154,7 +154,7 @@ class Mailbox(object): @m.output() def record_mood_and_RC_tx_close(self, mood): self._mood = mood - self._RC_rx_close() + self._RC_tx_close() @m.output() def ignore_mood_and_T_mailbox_done(self, mood): self._T.mailbox_done() diff --git a/src/wormhole/_nameplate.py b/src/wormhole/_nameplate.py index ddc6ac8..0b9ef8c 100644 --- a/src/wormhole/_nameplate.py +++ b/src/wormhole/_nameplate.py @@ -142,3 +142,5 @@ class Nameplate(object): S5A.upon(connected, enter=S5B, outputs=[]) S5B.upon(lost, enter=S5A, outputs=[]) + S5.upon(release, enter=S5, outputs=[]) # mailbox is lazy + S5.upon(close, enter=S5, outputs=[]) diff --git a/src/wormhole/_rendezvous.py b/src/wormhole/_rendezvous.py index 0e7ab4d..44d7b75 100644 --- a/src/wormhole/_rendezvous.py +++ b/src/wormhole/_rendezvous.py @@ -84,11 +84,13 @@ class RendezvousConnector(object): # TODO: Tor goes here return endpoints.HostnameEndpoint(self._reactor, hostname, port) - def wire(self, boss, mailbox, code, nameplate_lister): + def wire(self, boss, nameplate, mailbox, code, nameplate_lister, terminator): self._B = _interfaces.IBoss(boss) + self._N = _interfaces.INameplate(nameplate) self._M = _interfaces.IMailbox(mailbox) self._C = _interfaces.ICode(code) self._NL = _interfaces.INameplateLister(nameplate_lister) + self._T = _interfaces.ITerminator(terminator) # from Boss def start(self): @@ -133,6 +135,7 @@ class RendezvousConnector(object): self._ws = proto self._tx("bind", appid=self._appid, side=self._side) self._C.connected() + self._N.connected() self._M.connected() self._NL.connected() @@ -157,12 +160,13 @@ class RendezvousConnector(object): dmsg(self._side, "R.lost") self._ws = None self._C.lost() + self._N.lost() self._M.lost() self._NL.lost() # internal def _stopped(self, res): - self._M.stopped() + self._T.stopped() def _tx(self, mtype, **kwargs): assert self._ws @@ -208,7 +212,7 @@ class RendezvousConnector(object): def _response_handle_claimed(self, msg): mailbox = msg["mailbox"] assert isinstance(mailbox, type("")), type(mailbox) - self._M.rx_claimed(mailbox) + self._N.rx_claimed(mailbox) def _response_handle_message(self, msg): side = msg["side"] @@ -218,7 +222,7 @@ class RendezvousConnector(object): self._M.rx_message(side, phase, body) def _response_handle_released(self, msg): - self._M.rx_released() + self._N.rx_released() def _response_handle_closed(self, msg): self._M.rx_closed()