Description
The problem is that the transport layer is not being closed down properly if output is pending when the connection is severed and a messenger stop is requested. pn_messenger_stop needs to send out an AMQP close message any will only do this when there is an event to say that it can write (i.e pn_messenger_process gets a PN_WRITABLE event from pn_selector_next, which examines the pollfd and sets PN_WRITABLE event if POLLOUT is set in revents). Because this event is never generated it seems to loop forever.