anchor.diff:        _socket
         .transform(new RawFrameParser(tuningSettings).transformer)
         .transform(new AmqpMessageDecoder().transformer)
  -      .listen(_handleMessage, onError : _handleException, onDone : _onSocketClosed);
  +      .listen(
  +          _handleMessage,
  +          onError : _handleException,
  +          onDone : () => _handleException(new SocketException("Socket closed"))
  +      );
   
         // Allocate channel 0 for handshaking and transmit the AMQP header to bootstrap the handshake
         _channels.clear();
  
positive.code:   }
  
    void _handleException(ex) {
      // Ignore exceptions while shutting down
      if (_clientClosed != null) {
        return;
      }
  
      connectionLogger.severe(ex);
  
negative.code:    * Shutdown any open channels and disconnect the socket. Return a [Future] to be completed
     * when the client has shut down
     */
    Future close(){
        if (_socket == null) {
          return new Future.value();
        }
  
        // Already shutting down
        if (_clientClosed != null) {
          return _clientClosed.future;
        }
  
        // Close all channels in reverse order so we send a connection close message when we close channel 0
        _clientClosed = new Completer();
        Future.wait(
            _channels
            .values
            .toList()
            .reversed
            .map((_ChannelImpl channel) => channel.close())
        )
        .then((_) => _socket.flush())
        .then((_) => _socket.close(), onError : (e){
          // Mute exception as the socket may be already closed
        })
        .whenComplete(() {
          _socket.destroy();
          _socket = null;
          _connected = null;
          _clientClosed.complete();
        });
  
        return _clientClosed.future;
    }
  
    Future<Channel> channel() {
      return open()
  