PROTON-1385: retain proton-j content only, the rest remains in the other repo at: https://git-wip-us.apache.org/repos/asf/qpid-proton.git
diff --git a/.gitignore b/.gitignore
index aa9bc36..8c5faec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,20 +28,3 @@
 .pydevproject
 # End of Eclipse IDE files
 
-# The usual location for proton-c build files
-proton-c/build
-
-# Executables built by go binding tests
-proton-c/bindings/go/bin
-
-# Testresults from the jenkins build script
-testresults
-
-# Go binding build output
-/proton-c/bindings/go/pkg
-/proton-c/bindings/go/bin
-
-# Python TOX test build output
-/proton-c/bindings/python/MANIFEST
-/proton-c/bindings/python/build
-
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 856e55f..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-os:
-- linux
-sudo: false
-language:
-- python
-python:
-- 2.7
-addons:
-  apt:
-    packages:
-    - cmake
-    - libssl-dev
-    - libsasl2-dev
-    - sasl2-bin
-    - swig
-    - python-dev
-    - valgrind
-    - ruby
-    - ruby-dev
-    - python3-dev
-    - php5
-    - openjdk-7-jdk
-install:
-- pip install --upgrade pip
-- pip install tox
-- gem install rspec
-- gem install simplecov || true
-- gem install minitest
-before_script:
-- export PATH=${HOME}/.local/bin:${PATH}
-- mkdir Build
-- cd Build
-- cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install
-script:
-- cmake --build . --target install && ctest -V
diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100644
index a6cca43..0000000
--- a/CMakeLists.txt
+++ /dev/null
@@ -1,195 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-cmake_minimum_required (VERSION 2.8.7)
-
-project (Proton C)
-
-# Enable C++ now for examples and bindings subdirectories, but make it optional.
-enable_language(CXX OPTIONAL)
-
-# Enable testing
-enable_testing()
-include (CTest)
-
-# Pull in local cmake modules
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/tools/cmake/Modules/")
-
-if (MSVC)
-  # No C99 capability, use C++
-  set(DEFAULT_BUILD_WITH_CXX ON)
-endif (MSVC)
-option(BUILD_WITH_CXX "Compile Proton using C++" ${DEFAULT_BUILD_WITH_CXX})
-
-if (CMAKE_CONFIGURATION_TYPES)
-  # There is no single "build type"...
-  message(STATUS "Build types are ${CMAKE_CONFIGURATION_TYPES}")
-else (CMAKE_CONFIGURATION_TYPES)
-  # There is a single build configuration
-  # If the build type is not set then set the default
-  if (NOT CMAKE_BUILD_TYPE)
-  set (CMAKE_BUILD_TYPE RelWithDebInfo CACHE string
-       "Build type: Debug, Release, RelWithDebInfo, MinSizeRel or Coverage (default RelWithDebInfo)" FORCE)
-  endif ()
-
-  # Set up extra coverage analysis options for gcc and clang
-  if (CMAKE_COMPILER_IS_GNUCC)
-    set (CMAKE_C_FLAGS_COVERAGE "-g -O0 --coverage")
-    set (CMAKE_CXX_FLAGS_COVERAGE "-g -O0 --coverage")
-    set (CMAKE_EXE_LINKER_FLAGS_COVERAGE "--coverage")
-    set (CMAKE_MODULE_LINKER_FLAGS_COVERAGE "--coverage")
-    set (CMAKE_SHARED_LINKER_FLAGS_COVERAGE "--coverage")
-    mark_as_advanced(
-      CMAKE_C_FLAGS_COVERAGE CMAKE_CXX_FLAGS_COVERAGE
-      CMAKE_EXE_LINKER_FLAGS_COVERAGE CMAKE_MODULE_LINKER_FLAGS_COVERAGE
-      CMAKE_SHARED_LINKER_FLAGS_COVERAGE)
-  endif()
-
-  if (CMAKE_BUILD_TYPE MATCHES "Deb")
-    set (has_debug_symbols " (has debug symbols)")
-  endif (CMAKE_BUILD_TYPE MATCHES "Deb")
-  message(STATUS "Build type is \"${CMAKE_BUILD_TYPE}\"${has_debug_symbols}")
-endif (CMAKE_CONFIGURATION_TYPES)
-
-# Add coverage target if we're building for test coverage
-if (CMAKE_BUILD_TYPE MATCHES "Coverage")
-  make_directory(coverage_results)
-  add_custom_target(coverage
-    WORKING_DIRECTORY ./coverage_results
-    COMMAND ${CMAKE_SOURCE_DIR}/bin/record-coverage.sh ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
-endif()
-
-if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-  # Default to universal binary on Mac OS X unless user has overriden
-  if (NOT DEFINED CMAKE_OSX_ARCHITECTURES OR "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "")
-    set(CMAKE_OSX_ARCHITECTURES "i386;x86_64")
-  endif ()
-endif ()
-
-file(READ version.txt PN_VERSION_FILE)
-string(STRIP ${PN_VERSION_FILE} PN_VERSION_LINE)
-string(REPLACE "-" ";" PN_VERSION_SPLIT "${PN_VERSION_LINE}")
-list(GET PN_VERSION_SPLIT 0 PN_VERSION_CLEAN)
-list(REMOVE_AT PN_VERSION_SPLIT 0)
-string(REPLACE ";" "-" PN_VERSION_QUALIFIER "${PN_VERSION_SPLIT}")
-string(REGEX MATCHALL "[0-9]+" PN_VERSION_LIST "${PN_VERSION_CLEAN}")
-
-list(GET PN_VERSION_LIST 0 PN_VERSION_MAJOR)
-list(GET PN_VERSION_LIST 1 PN_VERSION_MINOR)
-
-list(LENGTH PN_VERSION_LIST PN_VERSION_LENGTH)
-if (${PN_VERSION_LENGTH} GREATER 2)
-  list(GET PN_VERSION_LIST 2 PN_VERSION_POINT)
-  set (PN_VERSION "${PN_VERSION_MAJOR}.${PN_VERSION_MINOR}.${PN_VERSION_POINT}")
-else()
-  set (PN_VERSION_POINT 0)
-  set (PN_VERSION "${PN_VERSION_MAJOR}.${PN_VERSION_MINOR}")
-endif()
-
-message(STATUS "PN_VERSION: ${PN_VERSION} (${PN_VERSION_QUALIFIER})")
-
-set (pn_test_root "${CMAKE_CURRENT_SOURCE_DIR}/tests")
-set (pn_test_bin "${CMAKE_CURRENT_BINARY_DIR}/tests")
-
-# In rpm builds the build sets some variables:
-#  CMAKE_INSTALL_PREFIX - this is a standard cmake variable
-#  INCLUDE_INSTALL_DIR
-#  LIB_INSTALL_DIR
-#  SYSCONF_INSTALL_DIR
-#  SHARE_INSTALL_DIR
-# So make these cached variables and the specific variables non cached
-# and derived from them.
-
-if (NOT DEFINED LIB_SUFFIX)
-    get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
-    if ("${LIB64}" STREQUAL "TRUE" AND ${CMAKE_SIZEOF_VOID_P} STREQUAL "8")
-        set(LIB_SUFFIX 64)
-    else()
-        set(LIB_SUFFIX "")
-    endif()
-endif()
-
-# Start of variables used during install
-set (INCLUDE_INSTALL_DIR include CACHE PATH "Include file directory")
-set (LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "Library object file directory")
-set (SYSCONF_INSTALL_DIR etc CACHE PATH "System read only configuration directory")
-set (SHARE_INSTALL_DIR share CACHE PATH "Shared read only data directory")
-set (MAN_INSTALL_DIR share/man CACHE PATH "Manpage directory")
-
-mark_as_advanced (INCLUDE_INSTALL_DIR LIB_INSTALL_DIR SYSCONF_INSTALL_DIR SHARE_INSTALL_DIR MAN_INSTALL_DIR)
-
-## LANGUAGE BINDINGS
-
-# Default directory for language bindings not being installed into
-# system specified locations.
-set (BINDINGS_DIR ${LIB_INSTALL_DIR}/proton/bindings)
-
-set (SYSINSTALL_BINDINGS OFF CACHE BOOL "If SYSINSTALL_BINDINGS is OFF then proton bindings will be installed underneath ${BINDINGS_DIR} and each user will need to modify their interpreter configuration to load the appropriate binding. If SYSINSTALL_BINDINGS is ON, then each language interpreter will be queried for the appropriate directory and proton bindings will be installed and available system wide with no additional per user configuration.")
-
-set (BINDING_LANGS PERL PHP PYTHON RUBY)
-
-foreach (LANG ${BINDING_LANGS})
-  set (SYSINSTALL_${LANG} OFF CACHE BOOL "Install ${LANG} bindings into interpreter specified location.")
-  if (SYSINSTALL_BINDINGS OR SYSINSTALL_${LANG})
-    set (CHECK_SYSINSTALL_${LANG} ON)
-  else ()
-    set (CHECK_SYSINSTALL_${LANG} OFF)
-  endif ()
-endforeach()
-
-set (PROTON_SHARE ${SHARE_INSTALL_DIR}/proton-${PN_VERSION})
-# End of variables used during install
-
-find_package(Java)
-option (BUILD_JAVA "Build proton-j." ${JAVA_FOUND})
-
-if (BUILD_JAVA)
-  add_subdirectory(proton-j)
-endif()
-
-# Check for valgrind here so tests under proton-c/ and examples/ can use it.
-find_program(VALGRIND_EXE valgrind DOC "Location of the valgrind program")
-mark_as_advanced (VALGRIND_EXE)
-
-option(ENABLE_VALGRIND "Use valgrind to detect run-time problems" ON)
-if (ENABLE_VALGRIND)
-  if (NOT VALGRIND_EXE)
-    message(STATUS "Can't locate the valgrind command; no run-time error detection")
-  elseif (CMAKE_BUILD_TYPE MATCHES "Coverage")
-    message(STATUS "Building for coverage analysis; no run-time error detection")
-  else ()
-    set (VALGRIND_ENV "VALGRIND=${VALGRIND_EXE}")
-  endif ()
-endif (ENABLE_VALGRIND)
-
-add_subdirectory(proton-c)
-add_subdirectory(examples)
-
-install (FILES LICENSE README.md
-         DESTINATION ${PROTON_SHARE})
-
-install (DIRECTORY examples
-         DESTINATION ${PROTON_SHARE}
-         REGEX "/examples/CMakeLists.txt$" EXCLUDE
-         PATTERN "*Config.cmake" EXCLUDE)
-
-# Generate test environment settings
-configure_file(${CMAKE_SOURCE_DIR}/config.sh.in
-               ${CMAKE_BINARY_DIR}/config.sh @ONLY)
-configure_file(${CMAKE_SOURCE_DIR}/config.bat.in
-               ${CMAKE_BINARY_DIR}/config.bat @ONLY)
diff --git a/DEVELOPERS.md b/DEVELOPERS.md
deleted file mode 100644
index 7d631e6..0000000
--- a/DEVELOPERS.md
+++ /dev/null
@@ -1,116 +0,0 @@
-Qpid Proton Developer Information
-=================================
-
-Development Environment
------------------------
-
-Developers wishing to work across multiple languages should become
-familiar with the CMake build system as this will build and run all
-available tests and code whereas the maven build system only run Java
-tests.
-
-First you will need to set up your basic build environment with CMake and all
-prerequisites (see the instructions in INSTALL) so that you can build the full
-code base.
-
-To setup shell variables for your development environment, you must source
-the file config.sh from the CMake build directory.
-
-    $ cd build
-    $ source config.sh
-
-This file sets the necessary environment variables for Java, for all supported
-dynamic languages (Python, Perl, Ruby, PHP) and for running the tests.
-
-Testing
--------
-
-As a developer on Proton, it is a good idea to build and test with the
-appropriate dependencies and settings in place so that the complete set of
-language bindings and implementations are present.
-
-Note that there is a common test suite written in python which will run against
-both the proton-c and proton-j implementations to help keep them in sync with
-each other. This can be found under the top level `tests/python` directory.
-This has been integrated into the maven build via Jython (and is hence included
-in the proton-java ctest suite). When you run the python test suite in
-Jython, the swig generated cproton doesn't actually exist since it is a C
-module. Instead, you get the `cproton.py` that resides in the Java source tree
-under `proton-j/src/main/resources`.  This `cproton.py` and its dependent files
-serve as a shim that adapts between the Java API and the C API.
-
-
-### Running tests
-
-To test Proton you should use the CMake build. By default this will invoke the
-maven tests as well, so the maven prerequisites will additionally be required.
-
-By default the unit tests are run using the system's default Python
-interpreter.  However, Proton's Python language bindings support both
-versions of the python language (Python 2.x and Python 3.x).  These
-bindings should be tested using both versions of the Python
-interpreter.  CMake makes this possible by automatically running the
-python unit tests under all versions of python installed on the
-system.
-
-Developers can ensure that Proton remains compatible with both
-versions of Python by installing the following prerequisites:
-
-_Note: currently CMake only supports multi-Python testing in **Linux**
-based environments.  Non-Linux developers may skip the following two
-steps._
-
-1. Installing both Python2.x and Python3.x and their associated
-development environments on your system.  Most modern Linux
-distributions support installing Python 2.x and Python 3.x in
-parallel.
-
-2. Install the **tox** Python testing tool, (e.g. for Fedora):
-
-   $ yum install python-tox
-
-
-To run the tests, cd into your build directory and use the following commands:
-
-    # to run all the tests, summary mode
-    $ ctest
-
-    # to list the available testsuites
-    $ ctest -N
-
-    # to run a single testsuite, verbose output
-    $ ctest -V -R c-engine-tests
-
-Additional packages required for testing the language bindings:
-
-    # ruby dependencies
-    $ yum install rubygem-minitest rubygem-rspec rubygem-simplecov
-
-    # alternatively ruby depedencies on non-RPM based systems
-    $ gem install minitest rspec simplecov
-
-If wishing to run a particular subset of python tests against proton-j, a
-pattern can be set via the Java system property "proton.pythontest.pattern"
-when running the Maven build directly:
-
-    # Run the tests in transport.py class ClientTransportTest against proton-j:
-    $ mvn test -Dproton.pythontest.pattern='proton_tests.transport.ClientTransportTest.*'
-
-
-Mailing list
-------------
-
-Subscribe to the Qpid mailing lists using details at:
-
-  http://qpid.apache.org/discussion.html
-
-
-Patches
--------
-
-The best way to submit patches is to create a bug report or feature request
-on the project's JIRA instance:
-
-  http://issues.apache.org/jira/browse/PROTON
-
-You can attach any patch(es) to the report/request there
diff --git a/INSTALL.md b/INSTALL.md
deleted file mode 100644
index 422b606..0000000
--- a/INSTALL.md
+++ /dev/null
@@ -1,198 +0,0 @@
-Qpid Proton Install Information
-===============================
-
-Proton comes with two separate build systems. The CMake build system can builds
-the entire codebase, including proton-c, all proton-c language bindings, and
-the pure Java proton-j implementation. The maven build system can only build
-the Java portions of the code.
-
-CMake (Linux)
--------------
-
-The following prerequisites are required to do a full build on RPM based systems (RHEL, Fedora etc.).
-If you do not wish to build a given language binding you can omit the devel
-package for that language:
-
-    # required dependencies
-    $ yum install gcc cmake libuuid-devel
-
-    # dependencies needed for ssl support
-    $ yum install openssl-devel
-
-    # dependencies needed for Cyrus SASL support
-    $ yum install cyrus-sasl-devel
-
-    # dependencies needed for bindings
-    $ yum install swig          # Required for all bindings
-    $ yum install python-devel                               # Python
-    $ yum install ruby-devel rubygem-rspec rubygem-simplecov # Ruby
-    $ yum install pphp-devel                                 # PHP
-    $ yum install perl-devel                                 # Perl
-
-    # dependencies needed for java (note that any non-ancient jvm will
-    # work, 1.8.0 is just what is current for fedora 23)
-    $ yum install java-1.8.0-openjdk-devel
-
-    # dependencies needed for python docs
-    $ yum install epydoc
-
-The following prerequisites are required to do a full build on Debian based systems (Ubuntu). 
-If you do not wish to build a given language binding you can omit the dev
-package for that language:
-
-    # Required dependencies 
-    $ apt-get install gcc cmake cmake-curses-gui uuid-dev
-
-    # dependencies needed for ssl support
-    $ apt-get install libssl-dev
-
-    # dependencies needed for Cyrus SASL support
-    $ apt-get install libsasl2-2 libsasl2-dev
-
-    # dependencies needed for bindings
-    $ apt-get install swig python-dev ruby-dev libperl-dev
-
-    # dependencies needed for java (note that any non-ancient jvm will
-    # work, 1.8.0 is just what is current for ubuntu 14)
-    $ apt-get install openjdk-8-jdk
-
-    # dependencies needed for python docs
-    $ apt-get install python-epydoc
-
-From the directory where you found this README file:
-
-    $ mkdir build
-    $ cd build
-
-    # Set the install prefix. You may need to adjust depending on your
-    # system.
-    $ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DSYSINSTALL_BINDINGS=ON
-
-    # Omit the docs target if you do not wish to build or install
-    # documentation.
-    $ make all docs
-
-    # Note that this step will require root privileges.
-    $ make install
-
-When make install completes, all installed files are listed in the
-install_manifest.txt file. The contents of this file may be used to
-uninstall.
-
-Note: When SYSINSTALL_BINDINGS is enabled (ON), the
-CMAKE_INSTALL_PREFIX does not affect the location for where the
-language bindings (Python, Perl, PHP, Ruby) are installed. For those
-elements, the location is determined by the language interpreter
-itself; i.e., each interpreter is queried for the proper location for
-extensions. If you want to constrain where the Proton code is
-installed, set SYSINSTALL_BINDINGS to OFF. This will install all
-bindings to a common location under ${CMAKE_INSTALL_PREFIX}. When
-installed like this, each user will need to manually configure their
-interpreters with the respective binding location.
-
-CMake (Windows)
----------------
-
-This describes how to build the Proton library on Windows using
-Microsoft Visual C++.
-
-The Proton build uses the CMake tool to generate the Visual Studio
-project files. These project files can then be loaded into Visual
-Studio and used to build the Proton library.
-
-The following packages must be installed:
-
-  - Visual Studio 2005 or newer (regular or C++ Express)
-  - Python (www.python.org)
-  - CMake (www.cmake.org)
-
-Additional packages are required for the language bindings
-
-  - swig (www.swig.org)
-  - development headers and libraries for the language of choice
-
-Notes:
-
-  - be sure to install relevant Microsoft Service Packs and updates
-  - python.exe, cmake.exe and swig.exe  _must_ all be added to your PATH
-
-To generate the Visual Studio project files, from the directory where you found
-this README file:
-
-    > mkdir build
-    > cd build
-    > cmake ..
-
-If CMake doesn't guess things correctly, useful additional arguments are:
-
-    -G "Visual Studio 10"
-    -DSWIG_EXECUTABLE=C:\swigwin-2.0.7\swig.exe
-
-Refer to the CMake documentation for more information.
-
-Build and install from a command prompt (using msbuild)
-    > cmake --build . --target install --config RelWithDebInfo
-
-Loading the ALL_BUILD project into Visual Studio
-
-  1. Run the Microsoft Visual Studio IDE
-  2. From within the IDE, open the ALL_BUILD project file or proton
-     solution file - it should be in the 'build' directory you created
-     above.
-  3. Select the appropriate configuration. RelWithDebInfo works best
-     with the included CMake/CTest scripts
-
-Note that if you wish to build debug version of proton for use with
-swig bindings on Windows, you must have the appropriate debug target
-libraries to link against.
-
-Installing Language Bindings
-----------------------------
-
-Most dynamic languages provide a way for asking where to install
-libraries in order to place them in a default search path.
-
-When SYSINSTALL_BINDINGS is disabled (OFF), Proton installs all
-dynamic language bindings into a central, default location:
-
-    BINDINGS=${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/proton/bindings
-
-In order to use these bindings, you'll need to configure your
-interpreter to load the bindings from the appropriate directory:
-
- * Perl   - Add ${BINDINGS}/perl to PERL5LIB
- * PHP    - Set the PHPRC envvar to point to ${BINDINGS}/php/proton.ini
- * Python - Add ${BINDINGS}/python to PYTHONPATH
- * Ruby   - Add ${BINDINGS}/ruby to RUBYLIB
-
-You can configure the build to install a specific binding to the
-location specified by the system interpreter with the
-SYSINSTALL_[LANGUAGE] options, where [LANGUAGE] is one of JAVA, PERL,
-PHP, PYTHON, or RUBY.:
-
-    $ cmake .. -DSYSINSTALL_PHP=ON
-
-Disabling Language Bindings
----------------------------
-
-To disable any given language bindings, you can use the
-BUILD_[LANGUAGE] option where [LANGUAGE] is one of JAVA, PERL, PHP,
-PYTHON or RUBY, e.g.:
-
-    $ cmake .. -DBUILD_PHP=OFF
-
-Maven (All platforms)
----------------------
-
-The following prerequisites are required to do a full build.
-
-  + Apache Maven 3.0 (or higher) (http://maven.apache.org/)
-
-From the directory where you found this README file:
-
-    # To compile and package all Java modules (omitting the tests)
-    $ mvn -DskipTests package
-
-    # To install the packages in the local Maven repository (usually ~/.m2/repo)
-    $ mvn -DskipTests install
-
diff --git a/LICENSE b/LICENSE
index 7d0fda9..6b0b127 100644
--- a/LICENSE
+++ b/LICENSE
@@ -201,15 +201,3 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 
-
-PROTON SUBCOMPONENTS:
-
-Proton includes freegetopt with a separate BSD license.  Your use
-of the source code for freegetopt is subject to the terms and
-conditions of its license in examples/include/pncompat/internal/LICENSE.
-
-The setup scripts for the python bindings include files derived by
-PyZMQ and are licensed with a separate Modified BSD license.  Use of
-the source code in these setup files are subject to the terms and
-conditions in the license:
-proton-c/bindings/python/setuputils/PYZMQ_LICENSE.BSD.
diff --git a/NOTICE b/NOTICE
index 9f6952c..373f02a 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,4 +1,4 @@
-Apache Qpid Proton
+Apache Qpid Proton-J
 Copyright 2012-2016 The Apache Software Foundation
 
 This product includes software developed at
diff --git a/README.md b/README.md
index 9f95939..c0e79a0 100644
--- a/README.md
+++ b/README.md
@@ -1,44 +1,8 @@
-Qpid Proton - AMQP messaging toolkit
-====================================
+Apache Qpid Proton-J
+====================
 
-Linux Build | Windows Build
-------------|--------------
-[![Linux Build Status](https://travis-ci.org/apache/qpid-proton.svg?branch=master)](https://travis-ci.org/apache/qpid-proton) | [![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/apache/qpid-proton?branch=master&svg=true)](https://ci.appveyor.com/project/ke4qqq/qpid-proton/branch/master)
-
-Qpid Proton is a high-performance, lightweight messaging library. It can be
+Qpid Proton-J is a high-performance, lightweight messaging library. It can be
 used in the widest range of messaging applications, including brokers, client
-libraries, routers, bridges, proxies, and more. Proton makes it trivial to
-integrate with the AMQP 1.0 ecosystem from any platform, environment, or
-language
-
-Features
---------
-
-  + A flexible and capable reactive messaging API
-  + Full control of AMQP 1.0 protocol semantics
-  + Portable C implementation with bindings to popular languages
-  + Pure-Java and pure-JavaScript implementations
-  + Peer-to-peer and brokered messaging
-  + Secure communication via SSL and SASL
-
-Universal - Proton is designed to scale both up and down. Equally suitable for
-simple clients or high-powered servers, it can be deployed in simple
-peer-to-peer configurations or as part of a global federated messaging network.
-
-Embeddable - Proton is carefully written to be portable and cross platform. It
-has minimal dependencies, and it is architected to be usable with any threading
-model, as well as with non-threaded applications. These features make it
-uniquely suited for embedding messaging capabilities into existing software.
-
-Standard - Built around the AMQP 1.0 messaging standard, Proton is not only
-ideal for building out your own messaging applications but also for connecting
-them to the broader ecosystem of AMQP 1.0-based messaging applications.
-
-Getting Started
----------------
-
-See the included INSTALL file for build and install instructions and the
-DEVELOPERS file for information on how to modify and test the library code
-itself.
+libraries, routers, bridges, proxies, and more.
 
 Please see http://qpid.apache.org/proton for a more info.
diff --git a/RELEASE.md b/RELEASE.md
deleted file mode 100644
index 232e944..0000000
--- a/RELEASE.md
+++ /dev/null
@@ -1,48 +0,0 @@
-### Building a release for vote:
-
-1. Grab a clean checkout for safety.
-2. Run: "git checkout ${BRANCH}" to switch to a branch of the intended release point.
-3. Update the versions:
-  - Run: "bin/version.sh ${VERSION}", e.g. bin/version.sh 0.17.0
-  - Update the version(s) if needed in file: proton-c/bindings/python/docs/conf.py
-4. Commit the changes, tag them.
-  - Run: "git add ."
-  - Run: 'git commit -m "update versions for ${TAG}"'
-  - Run: 'git tag -m "tag $TAG" $TAG'
-  - Push changes. Optionally save this bit for later.
-5. Run: "bin/export.sh $PWD ${TAG}" to create the qpid-proton-${TAG}.tar.gz release archive.
-6. Rename and create signature and checksums for the archive:
-  - e.g "mv qpid-proton-${TAG}.tar.gz qpid-proton-${VERSION}.tar.gz"
-  - e.g "gpg --detach-sign --armor qpid-proton-${VERSION}.tar.gz"
-  - e.g "sha1sum qpid-proton-${VERSION}.tar.gz > qpid-proton-${VERSION}.tar.gz.sha1"
-  - e.g "md5sum qpid-proton-${VERSION}.tar.gz > qpid-proton-${VERSION}.tar.gz.md5"
-7. Deploy the Java binaries to a staging repo:
-  - Run: "tar -xzf qpid-proton-${VERSION}.tar.gz"
-  - Run: "cd qpid-proton-${VERSION}"
-  - Run: "mvn deploy -Papache-release -DskipTests=true"
-8. Close the staging repo:
-  - Log in at https://repository.apache.org/index.html#stagingRepositories
-  - Find the new 'open' staging repo just created and select its checkbox.
-  - Click the 'close' button, provide a description, e.g "Proton ${TAG}" and close the repo.
-  - Wait a few seconds, hit the 'refresh' button and confirm the repo is now 'closed'.
-  - Click on the repo and find its URL listed in the summary.
-9. Commit artifacts to dist dev repo in https://dist.apache.org/repos/dist/dev/qpid/proton/${TAG} dir.
-10. Send email, provide links to dist dev repo and the staging repo.
-
-
-### After a vote succeeds:
-
-1. Bump the master/branch version to next 0.x.y-SNAPSHOT if it wasnt already.
-2. Tag the RC with the final name/version.
-3. Commit the artifacts to dist release repo in https://dist.apache.org/repos/dist/release/qpid/proton/${RELEASE} dir:
-  - Rename the files to remove the RC suffix.
-  - Fix filename within .sha and .md5 checksums or regenerate.
-4. Update the 'latest' link in https://dist.apache.org/repos/dist/release/qpid/proton/.
-5. Release the staging repo:
-  - Log in at https://repository.apache.org/index.html#stagingRepositories
-  - Find the 'closed' staging repo representing the RC select its checkbox.
-  - Click the 'Release' button and release the repo.
-6. Give the mirrors some time to distribute things.
-7. Update the website with release content.
-8. Update development roadmap.
-9. Send release announcement email.
diff --git a/appveyor.yml b/appveyor.yml
deleted file mode 100644
index fe87f0d..0000000
--- a/appveyor.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-version: '{branch}.{build}'
-configuration: RelWithDebInfo
-install:
-- cinst -y swig
-cache:
-- C:\ProgramData\chocolatey\bin -> appveyor.yml
-- C:\ProgramData\chocolatey\lib -> appveyor.yml
-before_build:
-- mkdir BLD
-- cd BLD
-- cmake -G "Visual Studio 12" -DBUILD_PERL=no -DBUILD_JAVA=no ..
-- cd ..
-build:
-  parallel: true
-  verbosity: normal
-test_script:
-- cd BLD
-- cmake --build . --target install --config %CONFIGURATION%
-- ctest -V -C %CONFIGURATION%
-- cd ..
diff --git a/bin/export.sh b/bin/export.sh
deleted file mode 100755
index 4bad515..0000000
--- a/bin/export.sh
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/bash
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# export.sh - Create a release archive.
-set -e
-trap "cleanup" 0 1 2 3 9 11 13 15
-
-ME=$(basename ${0})
-SRC=$(dirname $(dirname $(readlink -f $0)))
-
-usage()
-{
-    echo
-    echo "Usage: ${ME} [DIR] [TAG]"
-    exit 1
-}
-
-cleanup()
-{
-    trap - 0 1 2 3 9 11 13 15
-    echo
-    [ ${WORKDIR} ] && [ -d ${WORKDIR} ] && rm -rf ${WORKDIR}
-}
-
-DIR=$PWD
-TAG=$(git describe --tags --always)
-
-##
-## Allow overrides to be passed on the cmdline
-##
-if [ $# -gt 2 ]; then
-    usage
-elif [ $# -ge 1 ]; then
-    DIR=$1
-    if [ $# -eq 2 ]; then
-        TAG=$2
-    fi
-fi
-
-# verify the tag exists
-git rev-list -1 tags/${TAG} -- >/dev/null || usage
-
-WORKDIR=$(mktemp -d)
-
-##
-## Create the archive
-##
-(
-    cd ${SRC}
-    MTIME=$(date -d @`git log -1 --pretty=format:%ct tags/${TAG}` '+%Y-%m-%d %H:%M:%S')
-    ARCHIVE=$DIR/qpid-proton-${TAG}.tar.gz
-    VERSION=$(git show tags/${TAG}:version.txt)
-    PREFIX=qpid-proton-${VERSION}
-    [ -d ${WORKDIR} ] || mkdir -p ${WORKDIR}
-    git archive --format=tar --prefix=${PREFIX}/ tags/${TAG} \
-        | tar -x -C ${WORKDIR}
-    cd ${WORKDIR}
-    tar -c -z \
-        --owner=root --group=root --numeric-owner \
-        --mtime="${MTIME}" \
-        -f ${ARCHIVE} ${PREFIX}
-    echo "${ARCHIVE}"
-)
diff --git a/bin/jenkins-proton-c-build.sh b/bin/jenkins-proton-c-build.sh
deleted file mode 100755
index 582a52f..0000000
--- a/bin/jenkins-proton-c-build.sh
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/bash -e
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# This is the continuous delivery build script executed after a git
-# extract by the Jenkins build process located at the following URL:
-# https://builds.apache.org/view/M-R/view/Qpid/job/Qpid-proton-c/
-#
-CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_INSTALL_PREFIX=$PWD/build/ship"
-XMLOUTPUT=../testresults/TEST-protonc.xml
-
-echo Arch: `arch` Uname: `uname -a` lsb_release: `lsb_release -a` User: `whoami`
-echo Java home: $JAVA_HOME
-
-echo =========================
-echo Listing installed packages
-dpkg -l | \
-  awk '/^ii  (cmake |maven |ruby |python |php |.*jdk |swig[0-9]*)/{print $2, $3}'| \
-  sort
-echo =========================
-
-which python || exit 1
-which swig || exit 1
-
-# if python-pip is available, install the python tox test tool
-RUN_TOX=false
-PIP=$(type -p pip || true)
-if [ -n $PIP ] && [ -x "$PIP" ]; then
-    ldir=$(python -c 'import site; print("%s" % site.USER_BASE)')
-    PATH="$ldir/bin:$PATH"
-    echo "PATH=$PATH"
-    if [ $VIRTUAL_ENV ]; then
-      pip install -U tox
-    else
-      pip install --user -U tox
-    fi
-    RUN_TOX=true
-fi
-
-ls
-
-rm -rf build testresults >/dev/null 2>&1
-mkdir build testresults >/dev/null 2>&1
-
-cd build >/dev/null 2>&1
-
-cmake ${CMAKE_FLAGS} ..
-cmake --build . --target install
-
-echo Running tests
-
-$RUN_TOX && ctest -V -R 'python-tox-test'
-
-source config.sh
-
-# proton-c tests via python
-python ../tests/python/proton-test --xml=${XMLOUTPUT}
-
-# proton-c native c-* tests
-ctest -V -R '^c-*'
-
-# proton-j tests via jython
-which mvn && ctest -V -R proton-java
-
-echo 'Build completed'
diff --git a/bin/record-coverage.sh b/bin/record-coverage.sh
deleted file mode 100755
index edc903d..0000000
--- a/bin/record-coverage.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-# /usr/bin/bash
-
-# This script collates coverage data already present from running instrumented code.
-#
-# It requires the lcov tool to be installed (this provides the lcov and genhtml commands)
-#
-# It will produce a coverage analysis for gcc or clang compiled builds and currently for
-# C and C++ parts of the build tree.
-#
-# It takes two command line arguments:
-# - The first is the proton source tree: this is mandatory.
-# - The second is the build tree: this is optional and if not specified is assumed to be the
-#   current directory.
-#
-# The output is in the form of an html report which will be found in the generated html direectory.
-# - There will also be a number of intermediate files left in the current directory.
-#
-# The typical way to use it would be to use the "Coverage" build type to get instrumented
-# code, then to run the tests then to extract the coverage information from running the
-# tests.
-# Something like:
-#   cmake $PROTON_SRC -DCMAKE_BUILD_TYPE=Coverage
-#   make
-#   make test
-#   make coverage
-
-# set -x
-
-# get full path
-function getpath {
-  pushd -n $1 > /dev/null
-  echo $(dirs -0 -l)
-  popd -n > /dev/null
-}
-
-SRC=${1?}
-BLD=${2:-.}
-
-BLDPATH=$(getpath $BLD)
-SRCPATH=$(getpath $SRC)
-
-# Get base profile
-# - this initialises 0 counts for every profiled file
-#   without this step any file with no counts at all wouldn't
-#   show up on the final output.
-lcov -c -i -d $BLDPATH -o proton-base.info
-
-# Get actual coverage data
-lcov -c -d $BLDPATH -o proton-ctest.info
-
-# Total them up
-lcov --add proton-base.info --add proton-ctest.info > proton-total-raw.info
-
-# Snip out stuff in /usr (we don't care about coverage in system code)
-lcov --remove proton-total-raw.info "/usr/include*" "/usr/share*" > proton-total.info
-
-# Generate report
-rm -rf html
-genhtml -p $SRCPATH -p $BLDPATH proton-total.info --title "Proton CTest Coverage" --demangle-cpp -o html
-
diff --git a/bin/release.sh b/bin/release.sh
deleted file mode 100755
index 0c57d30..0000000
--- a/bin/release.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/bash
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# release.sh - Creates a release.
-
-ME=$(basename ${0})
-CURRDIR=$PWD
-SRC=$(dirname $(dirname $(readlink -f $0)))
-
-usage()
-{
-    echo "Usage: ${ME} VERSION TAG"
-    exit 1
-}
-
-if [ $# == 2 ]; then
-    VERSION=$1
-    TAG=$2
-else
-    usage
-fi
-
-die()
-{
-    printf "ERROR: %s\n" "$*"
-    exit 1
-}
-
-##
-## Create the tag
-##
-(
-    cd ${SRC}
-    if [ -n "$(git status -uno --porcelain)" ]; then
-        die must release from a clean checkout
-    fi
-    BRANCH=$(git symbolic-ref -q --short HEAD)
-    if [ -n "${BRANCH}" ]; then
-        REMOTE=$(git config branch.${BRANCH}.remote)
-    else
-        REMOTE="origin"
-    fi
-    git checkout --detach && \
-        bin/version.sh $VERSION && \
-        git commit -a -m "Release $VERSION" && \
-        git tag -m "Release $VERSION" $TAG && \
-        echo "Run 'git push ${REMOTE} ${TAG}' to push the tag upstream."
-)
diff --git a/bin/version.sh b/bin/version.sh
deleted file mode 100755
index d60f211..0000000
--- a/bin/version.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# version.sh - Sets the version of the proton source tree to the given
-#              value.
-
-ME=$(basename ${0})
-usage()
-{
-    echo "Usage: ${ME} [SRC] VERSION"
-    exit 1
-}
-
-if [ $# == 2 ]; then
-    SRC=$1
-    VERSION=$2
-elif [ $# == 1 ]; then
-    SRC=$(dirname $(dirname $(readlink -f $0)))
-    VERSION=$1
-else
-    usage
-fi
-
-echo ${VERSION} > ${SRC}/version.txt && \
-    mvn -q org.codehaus.mojo:versions-maven-plugin:1.2:set org.codehaus.mojo:versions-maven-plugin:1.2:commit -DnewVersion="${VERSION}" -f ${SRC}/pom.xml
diff --git a/config.bat.in b/config.bat.in
deleted file mode 100644
index a73a88e..0000000
--- a/config.bat.in
+++ /dev/null
@@ -1,66 +0,0 @@
-REM
-REM Licensed to the Apache Software Foundation (ASF) under one
-REM or more contributor license agreements.  See the NOTICE file
-REM distributed with this work for additional information
-REM regarding copyright ownership.  The ASF licenses this file
-REM to you under the Apache License, Version 2.0 (the
-REM "License"); you may not use this file except in compliance
-REM with the License.  You may obtain a copy of the License at
-REM
-REM   http://www.apache.org/licenses/LICENSE-2.0
-REM
-REM Unless required by applicable law or agreed to in writing,
-REM software distributed under the License is distributed on an
-REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-REM KIND, either express or implied.  See the License for the
-REM specific language governing permissions and limitations
-REM under the License.
-REM
-
-REM This is a generated file and will be overwritten the next
-REM time that cmake is run.
-
-REM This build may be one of @CMAKE_CONFIGURATION_TYPES@
-REM Choose the configuration this script should reference:
-SET PROTON_BUILD_CONFIGURATION=relwithdebinfo
-
-REM PROTON_HOME  is the root of the proton checkout
-REM PROTON_BUILD is where cmake was run
-
-set PROTON_HOME=@CMAKE_SOURCE_DIR@
-set PROTON_BUILD=@CMAKE_BINARY_DIR@
-
-set PROTON_HOME=%PROTON_HOME:/=\%
-set PROTON_BUILD=%PROTON_BUILD:/=\%
-
-set PROTON_BINDINGS=%PROTON_BUILD%\proton-c\bindings
-set PROTON_JARS=%PROTON_BUILD%\proton-j\proton-j.jar
-
-REM Python & Jython
-set PYTHON_BINDINGS=%PROTON_BINDINGS%\python
-set COMMON_PYPATH=%PROTON_HOME%\tests\python;%PROTON_HOME%\proton-c\bindings\python
-set PYTHONPATH=%COMMON_PYPATH%;%PYTHON_BINDINGS%
-set JYTHONPATH=%COMMON_PYPATH%;%PROTON_HOME%\proton-j\src\main\resources;%PROTON_JARS%
-set CLASSPATH=%PROTON_JARS%
-
-REM PHP
-set PHP_BINDINGS=%PROTON_BINDINGS%\php
-if EXIST %PHP_BINDINGS% (
-    echo include_path="%PHP_BINDINGS%;%PROTON_HOME%\proton-c\bindings\php" >  %PHP_BINDINGS%\php.ini
-    echo extension="%PHP_BINDINGS%\cproton.so"                             >> %PHP_BINDINGS%\php.ini
-    set PHPRC=%PHP_BINDINGS%\php.ini
-)
-
-REM Ruby
-set RUBY_BINDINGS=%PROTON_BINDINGS%\ruby
-set RUBYLIB=%RUBY_BINDINGS%;%PROTON_HOME%\proton-c\bindings\ruby\lib;%PROTON_HOME%\tests\ruby
-
-REM Perl
-set PERL_BINDINGS=%PROTON_BINDINGS%\perl
-set PERL5LIB=%PERL5LIB%;%PERL_BINDINGS%;%PROTON_HOME%\proton-c\bindings\perl\lib
-
-REM test applications
-set PATH=%PATH%;%PROTON_BUILD%\tests\tools\apps\c
-set PATH=%PATH%;%PROTON_HOME%\tests\tools\apps\python
-set PATH=%PATH%;%PROTON_HOME%\tests\python
-set PATH=%PATH%;%PROTON_BUILD%\proton-c\%PROTON_BUILD_CONFIGURATION%
diff --git a/config.sh.in b/config.sh.in
deleted file mode 100755
index edb77e6..0000000
--- a/config.sh.in
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-merge_paths() {
-    # Merge paths, remove duplicates (keep first instance)
-    path=$(echo $* | sed 's/:/ /'g) # Split with spaces.
-    newpath=""
-    for d in $path; do		# Remove duplicates
-	{ echo $newpath | grep -q "\(:\|^\)$d\(:\|$\)"; } || newpath="$newpath:$d"
-    done
-    echo $newpath | sed 's/^://' # Remove leading :
-}
-
-PROTON_HOME=@CMAKE_SOURCE_DIR@
-PROTON_BUILD=@CMAKE_BINARY_DIR@
-
-PROTON_BINDINGS=$PROTON_BUILD/proton-c/bindings
-PROTON_JARS=$PROTON_BUILD/proton-j/proton-j.jar
-
-PYTHON_BINDINGS=$PROTON_BINDINGS/python
-PHP_BINDINGS=$PROTON_BINDINGS/php
-RUBY_BINDINGS=$PROTON_BINDINGS/ruby
-PERL_BINDINGS=$PROTON_BINDINGS/perl
-
-# Python & Jython
-COMMON_PYPATH=$PROTON_HOME/tests/python:$PROTON_HOME/proton-c/bindings/python:$PROTON_HOME/examples
-export PYTHONPATH=$COMMON_PYPATH:$PYTHON_BINDINGS
-export JYTHONPATH=$COMMON_PYPATH:$PROTON_HOME/proton-j/src/main/resources:$PROTON_JARS
-export CLASSPATH=$PROTON_JARS
-
-# PHP
-if [ -d $PHP_BINDINGS ]; then
-    cat <<EOF > $PHP_BINDINGS/php.ini
-include_path="$PHP_BINDINGS:$PROTON_HOME/proton-c/bindings/php"
-extension="$PHP_BINDINGS/cproton.so"
-EOF
-    export PHPRC=$PHP_BINDINGS/php.ini
-fi
-
-# Ruby
-export RUBYLIB=$RUBY_BINDINGS:$PROTON_HOME/proton-c/bindings/ruby/lib:$PROTON_HOME/tests/ruby
-
-# Perl
-export PERL5LIB=$PERL5LIB:$PERL_BINDINGS:$PROTON_HOME/proton-c/bindings/perl/lib
-
-# Go
-export GOPATH="$(merge_paths $PROTON_HOME/proton-c/bindings/go $GOPATH)"
-# Help Go compiler find libraries and include files.
-export C_INCLUDE_PATH="$(merge_paths $PROTON_HOME/proton-c/include $PROTON_BUILD/proton-c/include $C_INCLUDE_PATH)"
-export LIBRARY_PATH="$(merge_paths $PROTON_BUILD/proton-c $LIBRARY_PATH)"
-export LD_LIBRARY_PATH="$(merge_paths $PROTON_BUILD/proton-c $LD_LIBRARY_PATH)"
-
-
-
-# test applications
-export PATH="$(merge_paths $PATH $PROTON_BUILD/tests/tools/apps/c $PROTON_HOME/tests/tools/apps/python $PROTON_HOME/tests/python)"
-
-# can the test harness use valgrind?
-if [[ -x "$(type -p valgrind)" && "@ENABLE_VALGRIND@" == "ON" ]] ; then
-    export VALGRIND=$(type -p valgrind)
-fi
-
-# can the test harness use saslpasswd2?
-if [[ -x "$(type -p saslpasswd2)" ]] ; then
-    export SASLPASSWD=$(type -p saslpasswd2)
-fi
-
-# Location of interop test files.
-export PN_INTEROP_DIR=$PROTON_HOME/tests/interop
diff --git a/design/api-reconciliation/README b/design/api-reconciliation/README
deleted file mode 100644
index 74aec08..0000000
--- a/design/api-reconciliation/README
+++ /dev/null
@@ -1,4 +0,0 @@
-Tool to generate a report mapping proton-c functions to proton-j class methods.
-On Linux, the list of proton-c functions can be generated using generate-c-functions.sh
-
-See pom.xml for more details.
diff --git a/design/api-reconciliation/generate-c-functions.sh b/design/api-reconciliation/generate-c-functions.sh
deleted file mode 100755
index 9820453..0000000
--- a/design/api-reconciliation/generate-c-functions.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Script to generate a list of proton-c functions for use as input to the api-reconciliation tool.
-
-# If you have problems running ctags, note that there are two ctags executables on some Linux
-# distributions. The one required here is from the exuberant-ctags package
-# (http://ctags.sourceforge.net), *not* GNU emacs ctags.
-
-BASE_DIR=`dirname $0`
-INCLUDE_DIR=$BASE_DIR/../../proton-c/include/proton
-OUTPUT_DIR=$BASE_DIR/target
-
-mkdir -p $OUTPUT_DIR
-ctags --c-kinds=p -x $INCLUDE_DIR/*.h | awk '{print $1'} > $OUTPUT_DIR/cfunctions.txt
diff --git a/design/api-reconciliation/pom.xml b/design/api-reconciliation/pom.xml
deleted file mode 100644
index 4622f34..0000000
--- a/design/api-reconciliation/pom.xml
+++ /dev/null
@@ -1,115 +0,0 @@
-<!--
- -
- - Licensed to the Apache Software Foundation (ASF) under one
- - or more contributor license agreements.  See the NOTICE file
- - distributed with this work for additional information
- - regarding copyright ownership.  The ASF licenses this file
- - to you under the Apache License, Version 2.0 (the
- - "License"); you may not use this file except in compliance
- - with the License.  You may obtain a copy of the License at
- -
- -   http://www.apache.org/licenses/LICENSE-2.0
- -
- - Unless required by applicable law or agreed to in writing,
- - software distributed under the License is distributed on an
- - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- - KIND, either express or implied.  See the License for the
- - specific language governing permissions and limitations
- - under the License.
- -
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.apache.qpid</groupId>
-  <artifactId>proton-api-reconciliation</artifactId>
-  <version>1.0-SNAPSHOT</version>
-  <properties>
-    <proton-c-build-dir>${basedir}/../../build/proton-c</proton-c-build-dir>
-    <jni-jar>${proton-c-build-dir}/bindings/java/proton-jni.jar</jni-jar>
-  </properties>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.6</source>
-          <target>1.6</target>
-          <optimize>true</optimize>
-          <showDeprecation>true</showDeprecation>
-          <showWarnings>true</showWarnings>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>exec-maven-plugin</artifactId>
-        <version>1.2.1</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>java</goal>
-            </goals>
-          </execution>
-        </executions>
-        <configuration>
-          <mainClass>org.apache.qpid.proton.apireconciliation.Main</mainClass>
-          <includePluginDependencies>true</includePluginDependencies>
-          <arguments>
-            <argument>org.apache.qpid.proton</argument>
-            <argument>target/cfunctions.txt</argument>
-            <argument>org.apache.qpid.proton.ProtonCEquivalent</argument>
-            <argument>target/apireconciliation.csv</argument>
-          </arguments>
-        </configuration>
-        <dependencies>
-          <dependency>
-            <groupId>org.apache.qpid</groupId>
-            <artifactId>proton-jni</artifactId>
-            <version>${project.version}</version>
-            <scope>system</scope>
-            <systemPath>${jni-jar}</systemPath>
-          </dependency>
-          <dependency>
-            <groupId>org.apache.qpid</groupId>
-            <artifactId>proton-api</artifactId>
-            <version>1.0-SNAPSHOT</version>
-          </dependency>
-        </dependencies>
-      </plugin>
-    </plugins>
-  </build>
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.10</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.reflections</groupId>
-      <artifactId>reflections</artifactId>
-      <version>0.9.8</version>
-    </dependency>
-    <dependency>
-      <groupId>commons-lang</groupId>
-      <artifactId>commons-lang</artifactId>
-      <version>2.6</version>
-    </dependency>
-    <dependency>
-      <groupId>commons-io</groupId>
-      <artifactId>commons-io</artifactId>
-      <version>2.4</version>
-    </dependency>
-  </dependencies>
-  <description>Tool to generate a report mapping proton-c functions to proton-j class methods.
-Uses proton-jni and proton-api at run-time, so these libraries must be available to Maven,
-eg in a local Maven repository.
-Can be run using sensible defaults using &quot;mvn compile exec:java&quot;</description>
-  <parent>
-    <groupId>org.apache</groupId>
-    <artifactId>apache</artifactId>
-    <version>12</version>
-    <relativePath></relativePath>
-  </parent>
-</project>
diff --git a/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/CFunctionNameListReader.java b/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/CFunctionNameListReader.java
deleted file mode 100644
index e726801..0000000
--- a/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/CFunctionNameListReader.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.proton.apireconciliation;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.List;
-
-import org.apache.commons.io.FileUtils;
-
-public class CFunctionNameListReader
-{
-
-    public List<String> readCFunctionNames(String fileContainingFunctionNames) throws IOException
-    {
-        File functionNameFile = new File(fileContainingFunctionNames);
-        if (!functionNameFile.canRead())
-        {
-            throw new FileNotFoundException("File " + functionNameFile + " cannot be found or is not readable.");
-        }
-
-        List<String> cFunctionNames = FileUtils.readLines(functionNameFile);
-        return cFunctionNames;
-    }
-
-}
diff --git a/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/Joiner.java b/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/Joiner.java
deleted file mode 100644
index 9d73308..0000000
--- a/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/Joiner.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.proton.apireconciliation;
-
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.qpid.proton.apireconciliation.reportwriter.AnnotationAccessor;
-
-public class Joiner
-{
-    private final AnnotationAccessor _annotationAccessor;
-
-    public Joiner(AnnotationAccessor annotationAccessor)
-    {
-        _annotationAccessor = annotationAccessor;
-    }
-
-    /**
-     * Does an outer join of the supplied C functions with those named by the
-     * annotations on the Java methods.
-     */
-    public ReconciliationReport join(List<String> protonCFunctions, Set<Method> javaMethods)
-    {
-        ReconciliationReport report = new ReconciliationReport();
-
-        Map<String, Method> cFunctionToJavaMethodMap = createOneToOneMappingBetweenCFunctionNameAndJavaMethodMap(javaMethods);
-
-        Set<Method> unannotatedMethods = new HashSet<Method>(javaMethods);
-        unannotatedMethods.removeAll(cFunctionToJavaMethodMap.values());
-
-        for (Method unannotatedMethod : unannotatedMethods)
-        {
-            report.addRow(null, unannotatedMethod);
-        }
-
-        for (String protonCFunction : protonCFunctions)
-        {
-            Method javaMethod = cFunctionToJavaMethodMap.remove(protonCFunction);
-            report.addRow(protonCFunction, javaMethod);
-        }
-
-        // add anything remaining in annotatedNameToMethod to report as Java methods with an unknown annotation
-        for (Method method : cFunctionToJavaMethodMap.values())
-        {
-            report.addRow(null, method);
-        }
-
-        return report;
-    }
-
-    private Map<String, Method> createOneToOneMappingBetweenCFunctionNameAndJavaMethodMap(Set<Method> javaMethods)
-    {
-        Map<String, Method> annotatedNameToMethod = new HashMap<String, Method>();
-        Set<String> functionsWithDuplicateJavaMappings = new HashSet<String>();
-
-        for (Method method : javaMethods)
-        {
-            String functionName = _annotationAccessor.getAnnotationValue(method);
-            if (functionName != null)
-            {
-                if (annotatedNameToMethod.containsKey(functionName))
-                {
-                    functionsWithDuplicateJavaMappings.add(functionName);
-                }
-                annotatedNameToMethod.put(functionName, method);
-            }
-        }
-
-        // Any functions that had duplicate java method names are removed.
-        for (String functionName : functionsWithDuplicateJavaMappings)
-        {
-            annotatedNameToMethod.remove(functionName);
-        }
-
-        return annotatedNameToMethod;
-    }
-
-}
diff --git a/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/Main.java b/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/Main.java
deleted file mode 100644
index 92557c9..0000000
--- a/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/Main.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.proton.apireconciliation;
-
-import java.util.List;
-
-import org.apache.qpid.proton.apireconciliation.reportwriter.AnnotationAccessor;
-import org.apache.qpid.proton.apireconciliation.reportwriter.ReconciliationReportWriter;
-
-public class Main
-{
-
-    public static void main(String[] args) throws Exception
-    {
-        if (args.length != 4)
-        {
-            System.err.println("Unexpected number of arguments. Usage:");
-            System.err.println("    java " + Main.class.getName() + " packageRootName cFunctionFile annotationClassName outputFile");
-            Runtime.getRuntime().exit(-1);
-        }
-
-        String packageRootName = args[0];
-        String cFunctionFile = args[1];
-        String annotationClassName = args[2];
-        String outputFile = args[3];
-
-        CFunctionNameListReader cFunctionNameListReader = new CFunctionNameListReader();
-
-        AnnotationAccessor annotationAccessor = new AnnotationAccessor(annotationClassName);
-        Reconciliation reconciliation = new Reconciliation(annotationAccessor);
-
-        List<String> cFunctionNames = cFunctionNameListReader.readCFunctionNames(cFunctionFile);
-        ReconciliationReport report = reconciliation.reconcile(cFunctionNames, packageRootName);
-
-        ReconciliationReportWriter writer = new ReconciliationReportWriter(annotationAccessor);
-        writer.write(outputFile, report);
-        System.err.println("Written : " + outputFile);
-    }
-
-}
diff --git a/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/Reconciliation.java b/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/Reconciliation.java
deleted file mode 100644
index 7f27b4d..0000000
--- a/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/Reconciliation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.proton.apireconciliation;
-
-import java.lang.reflect.Method;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.qpid.proton.apireconciliation.packagesearcher.PackageSearcher;
-import org.apache.qpid.proton.apireconciliation.reportwriter.AnnotationAccessor;
-
-public class Reconciliation
-{
-    private final PackageSearcher _packageSearcher = new PackageSearcher();
-    private final Joiner _joiner;
-
-    public Reconciliation(AnnotationAccessor annotationAccessor)
-    {
-        _joiner = new Joiner(annotationAccessor);
-    }
-
-    public ReconciliationReport reconcile(List<String> protonCFunctions, String packageRootName)
-    {
-        Set<Method> javaMethods = _packageSearcher.findMethods(packageRootName);
-        ReconciliationReport report = _joiner.join(protonCFunctions, javaMethods);
-        return report;
-    }
-
-}
diff --git a/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/ReconciliationReport.java b/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/ReconciliationReport.java
deleted file mode 100644
index e5bfbaa..0000000
--- a/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/ReconciliationReport.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.proton.apireconciliation;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-public class ReconciliationReport
-{
-    private List<ReportRow> _reportRows = new ArrayList<ReportRow>();
-
-    public Iterator<ReportRow> rowIterator()
-    {
-        return _reportRows.iterator();
-    }
-
-    public void addRow(String declaredProtonCFunction, Method javaMethod)
-    {
-        _reportRows.add(new ReportRow(declaredProtonCFunction, javaMethod));
-    }
-
-}
diff --git a/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/ReportRow.java b/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/ReportRow.java
deleted file mode 100644
index 23ff7ab..0000000
--- a/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/ReportRow.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.proton.apireconciliation;
-
-import java.lang.reflect.Method;
-
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-public class ReportRow
-{
-    private final String _declaredProtonCFunction;
-    private final Method _javaMethod;
-
-    public ReportRow(String declaredProtonCFunction, Method javaMethod)
-    {
-        _declaredProtonCFunction = declaredProtonCFunction;
-        _javaMethod = javaMethod;
-    }
-
-    public String getCFunction()
-    {
-        return _declaredProtonCFunction;
-    }
-
-    public Method getJavaMethod()
-    {
-        return _javaMethod;
-    }
-
-    @Override
-    public int hashCode()
-    {
-        return new HashCodeBuilder().append(_declaredProtonCFunction)
-                                    .append(_javaMethod)
-                                    .toHashCode();
-    }
-
-    @Override
-    public boolean equals(Object obj)
-    {
-        if (obj == null)
-        {
-            return false;
-        }
-        if (obj == this)
-        {
-            return true;
-        }
-        if (obj.getClass() != getClass())
-        {
-            return false;
-        }
-        ReportRow rhs = (ReportRow) obj;
-        return new EqualsBuilder()
-                      .append(_declaredProtonCFunction, rhs._declaredProtonCFunction)
-                      .append(_javaMethod, rhs._javaMethod)
-                      .isEquals();
-    }
-
-    @Override
-    public String toString()
-    {
-        return new ToStringBuilder(this)
-                .append("_declaredProtonCFunction", _declaredProtonCFunction)
-                .append("_javaMethod", _javaMethod)
-                .toString();
-    }
-
-}
diff --git a/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/packagesearcher/PackageSearcher.java b/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/packagesearcher/PackageSearcher.java
deleted file mode 100644
index 6a824ae..0000000
--- a/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/packagesearcher/PackageSearcher.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.proton.apireconciliation.packagesearcher;
-
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.logging.Logger;
-
-import org.reflections.Reflections;
-import org.reflections.scanners.SubTypesScanner;
-
-public class PackageSearcher
-{
-    private final static Logger LOGGER = Logger.getLogger(PackageSearcher.class.getName());
-
-    public Set<Method> findMethods(String packageName)
-    {
-        Reflections reflections = new Reflections(packageName, new SubTypesScanner(false));
-
-        Set<Class<?>> allInterfaces = getAllApiInterfaces(reflections);
-
-        Set<Method> allImplMethods = new HashSet<Method>();
-        for (Class<?> apiInterface : allInterfaces)
-        {
-            List<Method> apiMethodList = Arrays.asList(apiInterface.getMethods());
-            Set<?> impls = reflections.getSubTypesOf(apiInterface);
-            if (impls.size() == 0)
-            {
-                // In the case where there are no implementations of apiInterface, we add the methods of
-                // apiInterface so they appear on the final report.
-                for (Method apiMethod : apiMethodList)
-                {
-                    allImplMethods.add(apiMethod);
-                }
-            }
-            else
-            {
-                for (Object implementingClassObj : impls)
-                {
-                    Class implementingClass = (Class) implementingClassObj;
-                    LOGGER.fine("Found implementation " + implementingClass.getName() + " for " + apiInterface.getName());
-
-                    for (Method apiMethod : apiMethodList)
-                    {
-                        Method implMethod = findImplMethodOfApiMethod(apiMethod, implementingClass);
-                        allImplMethods.add(implMethod);
-                    }
-                }
-            }
-        }
-        return allImplMethods;
-    }
-
-    private Method findImplMethodOfApiMethod(Method apiMethod, Class<?> impl)
-    {
-        try
-        {
-            Method implMethod = impl.getMethod(apiMethod.getName(), apiMethod.getParameterTypes());
-            return implMethod;
-        }
-        catch (Exception e)
-        {
-            // Should not happen
-            throw new IllegalStateException("Could not find implementation of method " + apiMethod
-                    + " on the impl. " + impl, e);
-        }
-    }
-
-    @SuppressWarnings("rawtypes")
-    private Set<Class<?>> getAllApiInterfaces(Reflections reflections)
-    {
-        Set<Class<?>> classes = reflections.getSubTypesOf(Object.class);
-        Set<Class<?>> interfaces = new HashSet<Class<?>>();
-
-        for (Class clazz : classes)
-        {
-            if(clazz.isInterface())
-            {
-                interfaces.add(clazz);
-            }
-        }
-
-        return interfaces;
-    }
-
-}
diff --git a/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/reportwriter/AnnotationAccessor.java b/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/reportwriter/AnnotationAccessor.java
deleted file mode 100644
index 71a1a91..0000000
--- a/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/reportwriter/AnnotationAccessor.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.proton.apireconciliation.reportwriter;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-public class AnnotationAccessor
-{
-    private static final String VALUE_METHOD = "value";
-    private final Class<Annotation> _annotationClass;
-    private final Method _functionNameMethod;
-
-    @SuppressWarnings("unchecked")
-    public AnnotationAccessor(String annotationClassName)
-    {
-        try
-        {
-            _annotationClass = (Class<Annotation>) Class.forName(annotationClassName);
-        }
-        catch (ClassNotFoundException e)
-        {
-            throw new IllegalArgumentException("Couldn't find annotation class " + annotationClassName, e);
-        }
-
-        try
-        {
-            _functionNameMethod = _annotationClass.getMethod(VALUE_METHOD);
-        }
-        catch (SecurityException e)
-        {
-            throw new IllegalArgumentException("Couldn't find method " + VALUE_METHOD + " on annotation " + _annotationClass, e);
-        }
-        catch (NoSuchMethodException e)
-        {
-            throw new IllegalArgumentException("Couldn't find method " + VALUE_METHOD + " on annotation " + _annotationClass, e);
-        }
-    }
-
-    public String getAnnotationValue(Method javaMethod)
-    {
-        Annotation annotation = javaMethod.getAnnotation(_annotationClass);
-        if (javaMethod != null && annotation != null)
-        {
-            return getProtonCFunctionName(annotation);
-        }
-        else
-        {
-            return null;
-        }
-    }
-
-    private String getProtonCFunctionName(Annotation annotation)
-    {
-        try
-        {
-            return String.valueOf(_functionNameMethod.invoke(annotation));
-        }
-        catch (IllegalArgumentException e)
-        {
-            throw new RuntimeException("Couldn't invoke method " + _functionNameMethod + " on annotation " + annotation, e);
-        }
-        catch (IllegalAccessException e)
-        {
-            throw new RuntimeException("Couldn't invoke method " + _functionNameMethod + " on annotation " + annotation, e);
-        }
-        catch (InvocationTargetException e)
-        {
-            throw new RuntimeException("Couldn't invoke method " + _functionNameMethod + " on annotation " + annotation, e);
-        }
-    }
-}
diff --git a/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/reportwriter/ReconciliationReportWriter.java b/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/reportwriter/ReconciliationReportWriter.java
deleted file mode 100644
index efb4cce..0000000
--- a/design/api-reconciliation/src/main/java/org/apache/qpid/proton/apireconciliation/reportwriter/ReconciliationReportWriter.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.proton.apireconciliation.reportwriter;
-
-import static java.lang.String.format;
-import static org.apache.commons.lang.StringUtils.defaultString;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.qpid.proton.apireconciliation.ReconciliationReport;
-import org.apache.qpid.proton.apireconciliation.ReportRow;
-
-public class ReconciliationReportWriter
-{
-    private static final String ROW_FORMAT="%s,%s,%s";
-    private static final String REPORT_TITLE = format(ROW_FORMAT, "C function","Java Method","Java Annotation");
-    private final AnnotationAccessor _annotationAccessor;
-
-    public ReconciliationReportWriter(AnnotationAccessor annotationAccessor)
-    {
-        _annotationAccessor = annotationAccessor;
-    }
-
-    public void write(String outputFile, ReconciliationReport report) throws IOException
-    {
-        File output = new File(outputFile);
-        List<String> reportLines = new ArrayList<String>();
-
-        reportLines.add(REPORT_TITLE);
-
-        Iterator<ReportRow> itr = report.rowIterator();
-        while (itr.hasNext())
-        {
-            ReportRow row = itr.next();
-            Method javaMethod = row.getJavaMethod();
-            String cFunction = defaultString(row.getCFunction());
-
-            String fullyQualifiedMethodName = "";
-            String annotationCFunction = "";
-            if (javaMethod != null)
-            {
-                fullyQualifiedMethodName = createFullyQualifiedJavaMethodName(javaMethod);
-                annotationCFunction = defaultString(_annotationAccessor.getAnnotationValue(javaMethod));
-            }
-            reportLines.add(format(ROW_FORMAT, cFunction, fullyQualifiedMethodName, annotationCFunction));
-        }
-
-        FileUtils.writeLines(output, reportLines);
-    }
-
-    private String createFullyQualifiedJavaMethodName(Method javaMethod)
-    {
-        return javaMethod.getDeclaringClass().getName() +  "#" + javaMethod.getName();
-    }
-
-}
diff --git a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/CFunctionNameListReaderTest.java b/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/CFunctionNameListReaderTest.java
deleted file mode 100644
index 4e36a90..0000000
--- a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/CFunctionNameListReaderTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.proton.apireconciliation;
-
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.commons.io.FileUtils;
-import org.junit.Test;
-
-public class CFunctionNameListReaderTest
-{
-
-    private CFunctionNameListReader _cFunctionDeclarationReader = new CFunctionNameListReader();
-
-    @Test
-    public void testReadFileContainingSingleCFunction() throws Exception
-    {
-        String declarationFile = createTestFileContaining("function1", "function2", "function3");
-
-        List<String> functions = _cFunctionDeclarationReader.readCFunctionNames(declarationFile);
-        assertEquals(3, functions.size());
-        assertEquals("function1", functions.get(0));
-        assertEquals("function3", functions.get(2));
-    }
-
-    private String createTestFileContaining(String... functionNames) throws Exception
-    {
-        File file = File.createTempFile(CFunctionNameListReader.class.getSimpleName(), "txt");
-        file.deleteOnExit();
-        FileUtils.writeLines(file, Arrays.asList(functionNames));
-        return file.getAbsolutePath();
-    }
-}
diff --git a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/JoinerTest.java b/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/JoinerTest.java
deleted file mode 100644
index 134d4fe..0000000
--- a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/JoinerTest.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.proton.apireconciliation;
-
-import static java.util.Arrays.asList;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-
-import java.lang.reflect.Method;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.qpid.proton.apireconciliation.reportwriter.AnnotationAccessor;
-import org.junit.Before;
-import org.junit.Test;
-
-public class JoinerTest
-{
-    private static final String C_FUNCTION1 = "cFunction1";
-    private static final String C_FUNCTION2 = "cFunction2";
-    private Joiner _joiner;
-    private Method _method1 = null;
-    private Method _method2 = null;
-    private Method _methodSharingFunctionNameAnnotationWithMethod2 = null;
-    private Method _methodWithoutAnnotation;
-
-    @Before
-    public void setUp() throws Exception
-    {
-        _method1 = getClass().getMethod("javaMethodWithMapping1");
-        _method2 = getClass().getMethod("javaMethodWithMapping2");
-        _methodSharingFunctionNameAnnotationWithMethod2 = getClass().getMethod("javaMethodSharingFunctionNameAnnotationWithMethod2");
-        _methodWithoutAnnotation = getClass().getMethod("javaMethodWithoutAnnotation");
-
-        AnnotationAccessor annotationAccessor = new AnnotationAccessor(TestAnnotation.class.getName());
-
-        _joiner = new Joiner(annotationAccessor);
-    }
-
-    @Test
-    public void testSingleRowReport() throws Exception
-    {
-        List<String> protonCFunctions = asList(C_FUNCTION1);
-        Set<Method> javaMethods = new HashSet<Method>(asList(_method1));
-
-        ReconciliationReport reconciliationReport = _joiner.join(protonCFunctions, javaMethods);
-        assertSingleRowEquals(reconciliationReport, C_FUNCTION1, _method1);
-    }
-
-    @Test
-    public void testCFunctionWithoutCorrespondingAnnotatedJavaMethod() throws Exception
-    {
-        List<String> protonCFunctions = asList("functionX");
-        Set<Method> javaMethods = Collections.emptySet();
-
-        ReconciliationReport reconciliationReport = _joiner.join(protonCFunctions, javaMethods);
-        assertSingleRowEquals(reconciliationReport, "functionX", null);
-    }
-
-    @Test
-    public void testJavaMethodAnnotatedWithUnknownCFunctionName() throws Exception
-    {
-        List<String> protonCFunctions = Collections.emptyList();
-        Set<Method> javaMethods = new HashSet<Method>(asList(_method1));
-
-        ReconciliationReport reconciliationReport = _joiner.join(protonCFunctions, javaMethods);
-        assertSingleRowEquals(reconciliationReport, null, _method1);
-    }
-
-    @Test
-    public void testJavaMethodWithoutAnnotation() throws Exception
-    {
-        List<String> protonCFunctions = Collections.emptyList();
-        Set<Method> javaMethods = new HashSet<Method>(asList(_methodWithoutAnnotation));
-
-        ReconciliationReport reconciliationReport = _joiner.join(protonCFunctions, javaMethods);
-        assertSingleRowEquals(reconciliationReport, null, _methodWithoutAnnotation);
-    }
-
-    @Test
-    public void testJavaMethodsWithAnnotationToSameFunction() throws Exception
-    {
-        List<String> protonCFunctions = asList(C_FUNCTION2);
-        Set<Method> javaMethods = new HashSet<Method>(asList(_method2, _methodSharingFunctionNameAnnotationWithMethod2));
-
-        ReconciliationReport reconciliationReport = _joiner.join(protonCFunctions, javaMethods);
-        Set<ReportRow> rowSet = TestUtils.getReportRowsFrom(reconciliationReport);
-
-        Set<ReportRow> expectedRowSet = new HashSet<ReportRow>(asList(
-                new ReportRow(C_FUNCTION2, null),
-                new ReportRow(null, _method2),
-                new ReportRow(null, _methodSharingFunctionNameAnnotationWithMethod2)));
-
-        assertEquals(expectedRowSet, rowSet);
-    }
-
-    @Test
-    public void testMultipleRowReport() throws Exception
-    {
-        List<String> protonCFunctions = asList(C_FUNCTION1, C_FUNCTION2);
-        Set<Method> javaMethods = new HashSet<Method>(asList(_method1, _method2));
-
-        ReconciliationReport reconciliationReport = _joiner.join(protonCFunctions, javaMethods);
-
-        Set<ReportRow> rowSet = TestUtils.getReportRowsFrom(reconciliationReport);
-
-        Set<ReportRow> expectedRowSet = new HashSet<ReportRow>(asList(
-                new ReportRow(C_FUNCTION1, _method1),
-                new ReportRow(C_FUNCTION2, _method2)));
-
-        assertEquals(expectedRowSet,rowSet);
-    }
-
-    private void assertSingleRowEquals(ReconciliationReport reconciliationReport, String expectedCFunctionName, Method expectedJavaMethod)
-    {
-        Iterator<ReportRow> rowIterator = reconciliationReport.rowIterator();
-        ReportRow row = rowIterator.next();
-        assertReportRowEquals(row, expectedCFunctionName, expectedJavaMethod);
-
-        assertFalse(rowIterator.hasNext());
-    }
-
-    private void assertReportRowEquals(ReportRow row, String expectedCFunctionName, Method expectedMethod)
-    {
-        assertEquals(expectedCFunctionName, row.getCFunction());
-        assertEquals(expectedMethod, row.getJavaMethod());
-    }
-
-    @TestAnnotation(C_FUNCTION1)
-    public void javaMethodWithMapping1()
-    {
-    }
-
-    @TestAnnotation(C_FUNCTION2)
-    public void javaMethodWithMapping2()
-    {
-    }
-
-    @TestAnnotation(C_FUNCTION2)
-    public void javaMethodSharingFunctionNameAnnotationWithMethod2()
-    {
-    }
-
-    public void javaMethodWithoutAnnotation()
-    {
-    }
-}
diff --git a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/ReportRowTest.java b/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/ReportRowTest.java
deleted file mode 100644
index 65613d3..0000000
--- a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/ReportRowTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.proton.apireconciliation;
-
-import static org.junit.Assert.*;
-
-import java.lang.reflect.Method;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class ReportRowTest
-{
-
-    private Method _javaMethod1;
-    private Method _javaMethod2;
-
-    @Before
-    public void setUp() throws Exception
-    {
-        _javaMethod1 = getClass().getMethod("javaMethod1");
-        _javaMethod2 = getClass().getMethod("javaMethod2");
-    }
-
-    @Test
-    public void testSames() throws Exception
-    {
-
-        ReportRow reportRow = new ReportRow("cfunction", _javaMethod1);
-        Object other = new Object();
-
-        assertTrue(reportRow.equals(reportRow));
-        assertFalse(reportRow.equals(other));
-    }
-
-    @Test
-    public void testEquals() throws Exception
-    {
-
-        assertTrue(new ReportRow("cfunction", _javaMethod1).equals(new ReportRow("cfunction", _javaMethod1)));
-
-        assertFalse(new ReportRow("cfunction", _javaMethod1).equals(new ReportRow("cfunction2", _javaMethod1)));
-        assertFalse(new ReportRow("cfunction2", _javaMethod1).equals(new ReportRow("cfunction2", _javaMethod2)));
-
-        assertFalse(new ReportRow("cfunction", _javaMethod1).equals(null));
-
-    }
-
-    @Test
-    public void testEqualsWithNulls() throws Exception
-    {
-        assertTrue(new ReportRow("cfunction", null).equals(new ReportRow("cfunction", null)));
-        assertTrue(new ReportRow(null, _javaMethod1).equals(new ReportRow(null, _javaMethod1)));
-
-        assertFalse(new ReportRow("cfunction", _javaMethod1).equals(new ReportRow("cfunction", null)));
-        assertFalse(new ReportRow("cfunction", _javaMethod1).equals(new ReportRow(null, _javaMethod1)));
-    }
-
-    // Used by reflection by test methods
-    public void javaMethod1()
-    {
-    }
-
-    // Used by reflection by test methods
-    public void javaMethod2()
-    {
-    }
-}
diff --git a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/TestAnnotation.java b/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/TestAnnotation.java
deleted file mode 100644
index 146e397..0000000
--- a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/TestAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.proton.apireconciliation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-public @interface TestAnnotation
-{
-    String value();
-}
\ No newline at end of file
diff --git a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/TestUtils.java b/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/TestUtils.java
deleted file mode 100644
index 19ba849..0000000
--- a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/TestUtils.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.proton.apireconciliation;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-public class TestUtils
-{
-    public static Set<ReportRow> getReportRowsFrom(ReconciliationReport reconciliationReport)
-    {
-        Iterator<ReportRow> rowIterator = reconciliationReport.rowIterator();
-        Set<ReportRow> rows = new HashSet<ReportRow>();
-        while (rowIterator.hasNext())
-        {
-            rows.add(rowIterator.next());
-        }
-        return rows;
-    }
-}
diff --git a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/PackageSearcherTest.java b/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/PackageSearcherTest.java
deleted file mode 100644
index b85cacb..0000000
--- a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/PackageSearcherTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.proton.apireconciliation.packagesearcher;
-
-import static org.junit.Assert.assertEquals;
-
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.qpid.proton.apireconciliation.packagesearcher.testdata.manyimpls.Impl1;
-import org.apache.qpid.proton.apireconciliation.packagesearcher.testdata.manyimpls.Impl2;
-import org.apache.qpid.proton.apireconciliation.packagesearcher.testdata.manyimpls.InterfaceWithManyImpls;
-import org.apache.qpid.proton.apireconciliation.packagesearcher.testdata.noimpl.InterfaceWithoutImpl;
-import org.apache.qpid.proton.apireconciliation.packagesearcher.testdata.tree.ImplAtTreeTop;
-import org.apache.qpid.proton.apireconciliation.packagesearcher.testdata.tree.InterfaceAtTreeTop;
-import org.apache.qpid.proton.apireconciliation.packagesearcher.testdata.tree.leaf.ImplAtLeaf;
-import org.junit.Test;
-
-public class PackageSearcherTest
-{
-    private PackageSearcher _packageSearcher = new PackageSearcher();
-
-    @Test
-    public void testFindDescendsPackageTree() throws Exception
-    {
-        String testDataPackage = InterfaceAtTreeTop.class.getPackage().getName();
-        Set<Method> actualMethods = _packageSearcher.findMethods(testDataPackage);
-        assertEquals(2, actualMethods.size());
-
-        Set<Method> expectedMethods = new HashSet<Method>(Arrays.asList(
-                ImplAtTreeTop.class.getMethod("method"),
-                ImplAtLeaf.class.getMethod("method")));
-
-        assertEquals(expectedMethods, actualMethods);
-    }
-
-    @Test
-    public void testZeroImplenentationsOfInterface() throws Exception
-    {
-        String testDataPackage = InterfaceWithoutImpl.class.getPackage().getName();
-
-        Method expectedMethod = InterfaceWithoutImpl.class.getMethod("method");
-
-        Set<Method> actualMethods = _packageSearcher.findMethods(testDataPackage);
-        assertEquals(1, actualMethods.size());
-
-        Method actualMethod = actualMethods.iterator().next();
-        assertEquals(expectedMethod, actualMethod);
-    }
-
-    @Test
-    public void testManyImplenentationsOfInterface() throws Exception
-    {
-        String testDataPackage = InterfaceWithManyImpls.class.getPackage().getName();
-
-        Set<Method> actualMethods = _packageSearcher.findMethods(testDataPackage);
-        assertEquals(2, actualMethods.size());
-
-        String methodName = "method";
-        Set<Method> expectedMethods = new HashSet<Method>(Arrays.asList(
-                Impl1.class.getMethod(methodName),
-                Impl2.class.getMethod(methodName)));
-
-        assertEquals(expectedMethods, actualMethods);
-    }
-}
diff --git a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/manyimpls/Impl1.java b/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/manyimpls/Impl1.java
deleted file mode 100644
index 6f9c539..0000000
--- a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/manyimpls/Impl1.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.proton.apireconciliation.packagesearcher.testdata.manyimpls;
-
-public class Impl1 implements InterfaceWithManyImpls
-{
-
-    public void method()
-    {
-    }
-
-}
diff --git a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/manyimpls/Impl2.java b/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/manyimpls/Impl2.java
deleted file mode 100644
index 97ac514..0000000
--- a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/manyimpls/Impl2.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.proton.apireconciliation.packagesearcher.testdata.manyimpls;
-
-public class Impl2 implements InterfaceWithManyImpls
-{
-
-    public void method()
-    {
-    }
-
-}
diff --git a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/manyimpls/InterfaceWithManyImpls.java b/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/manyimpls/InterfaceWithManyImpls.java
deleted file mode 100644
index d5f01fa..0000000
--- a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/manyimpls/InterfaceWithManyImpls.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.proton.apireconciliation.packagesearcher.testdata.manyimpls;
-
-public interface InterfaceWithManyImpls
-{
-    void method();
-
-}
diff --git a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/noimpl/InterfaceWithoutImpl.java b/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/noimpl/InterfaceWithoutImpl.java
deleted file mode 100644
index 8d8302f..0000000
--- a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/noimpl/InterfaceWithoutImpl.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.proton.apireconciliation.packagesearcher.testdata.noimpl;
-
-public interface InterfaceWithoutImpl
-{
-    void method();
-}
diff --git a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/subpackage/InterfaceInSubPackage.java b/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/subpackage/InterfaceInSubPackage.java
deleted file mode 100644
index c2b5530..0000000
--- a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/subpackage/InterfaceInSubPackage.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.qpid.proton.apireconciliation.packagesearcher.testdata.subpackage;
-
-public interface InterfaceInSubPackage
-{
-    void methodWithinSubpackage();
-}
diff --git a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/subpackage/impl/ImplOfInterfaceInSubPackage.java b/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/subpackage/impl/ImplOfInterfaceInSubPackage.java
deleted file mode 100644
index dfda90d..0000000
--- a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/subpackage/impl/ImplOfInterfaceInSubPackage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.proton.apireconciliation.packagesearcher.testdata.subpackage.impl;
-
-import org.apache.qpid.proton.apireconciliation.TestAnnotation;
-import org.apache.qpid.proton.apireconciliation.packagesearcher.testdata.subpackage.InterfaceInSubPackage;
-
-public class ImplOfInterfaceInSubPackage implements InterfaceInSubPackage
-{
-
-    public static final String VALUE_WITHIN_SUBPACKAGE = "subpackageFunction";
-    public static final String METHOD_WITHIN_SUBPACKAGE = "methodWithinSubpackage";
-
-    @TestAnnotation(VALUE_WITHIN_SUBPACKAGE)
-    public void methodWithinSubpackage()
-    {
-    }
-
-}
diff --git a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/tree/ImplAtTreeTop.java b/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/tree/ImplAtTreeTop.java
deleted file mode 100644
index 8660d68..0000000
--- a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/tree/ImplAtTreeTop.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.proton.apireconciliation.packagesearcher.testdata.tree;
-
-public class ImplAtTreeTop implements InterfaceAtTreeTop
-{
-
-    public void method()
-    {
-    }
-
-}
diff --git a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/tree/InterfaceAtTreeTop.java b/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/tree/InterfaceAtTreeTop.java
deleted file mode 100644
index 9b85666..0000000
--- a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/tree/InterfaceAtTreeTop.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.proton.apireconciliation.packagesearcher.testdata.tree;
-
-public interface InterfaceAtTreeTop
-{
-    void method();
-
-}
diff --git a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/tree/leaf/ImplAtLeaf.java b/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/tree/leaf/ImplAtLeaf.java
deleted file mode 100644
index 511cd76..0000000
--- a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/tree/leaf/ImplAtLeaf.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.proton.apireconciliation.packagesearcher.testdata.tree.leaf;
-
-public class ImplAtLeaf implements InterfaceAtLeaf
-{
-
-    public void method()
-    {
-    }
-
-}
diff --git a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/tree/leaf/InterfaceAtLeaf.java b/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/tree/leaf/InterfaceAtLeaf.java
deleted file mode 100644
index b12d794..0000000
--- a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/packagesearcher/testdata/tree/leaf/InterfaceAtLeaf.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.proton.apireconciliation.packagesearcher.testdata.tree.leaf;
-
-public interface InterfaceAtLeaf
-{
-    void method();
-}
diff --git a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/reportwriter/AnnotationAccessorTest.java b/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/reportwriter/AnnotationAccessorTest.java
deleted file mode 100644
index 7df2640..0000000
--- a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/reportwriter/AnnotationAccessorTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.proton.apireconciliation.reportwriter;
-
-import static org.junit.Assert.*;
-
-import java.lang.reflect.Method;
-
-import org.apache.qpid.proton.apireconciliation.TestAnnotation;
-import org.junit.Before;
-import org.junit.Test;
-
-public class AnnotationAccessorTest
-{
-    private static final String ANNOTATION_VALUE_1 = "value1";
-    private static final String ANNOTATED_METHOD_NAME = "annotatedMethod";
-    private static final String UNANNOTATED_METHOD_NAME = "unannotatedMethod";
-
-    private Method _annotatedMethod;
-    private Method _unannotatedMethod;
-
-    private String _annotationClassName;
-
-    private AnnotationAccessor _annotationAccessor;
-
-    @Before
-    public void setUp() throws Exception
-    {
-        _annotatedMethod = getClass().getMethod(ANNOTATED_METHOD_NAME);
-        _unannotatedMethod = getClass().getMethod(UNANNOTATED_METHOD_NAME);
-        _annotationClassName = TestAnnotation.class.getName();
-        _annotationAccessor = new AnnotationAccessor(_annotationClassName);
-    }
-
-    @Test
-    public void testGetAnnotationValue()
-    {
-        assertEquals(ANNOTATION_VALUE_1, _annotationAccessor.getAnnotationValue(_annotatedMethod));
-    }
-
-    @Test
-    public void testGetAnnotationValueWithoutAnnotationReturnsNull()
-    {
-        assertNull(_annotationAccessor.getAnnotationValue(_unannotatedMethod));
-    }
-
-    @TestAnnotation(ANNOTATION_VALUE_1)
-    public void annotatedMethod()
-    {
-    }
-
-    public void unannotatedMethod()
-    {
-    }
-}
diff --git a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/reportwriter/ReconciliationReportWriterTest.java b/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/reportwriter/ReconciliationReportWriterTest.java
deleted file mode 100644
index 331c9fe..0000000
--- a/design/api-reconciliation/src/test/java/org/apache/qpid/proton/apireconciliation/reportwriter/ReconciliationReportWriterTest.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.proton.apireconciliation.reportwriter;
-
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.qpid.proton.apireconciliation.ReconciliationReport;
-import org.apache.qpid.proton.apireconciliation.TestAnnotation;
-import org.junit.Before;
-import org.junit.Test;
-
-
-public class ReconciliationReportWriterTest
-{
-    private ReconciliationReportWriter _writer;
-    private ReconciliationReport _report = new ReconciliationReport();
-
-    @Before
-    public void setUp()
-    {
-        _writer = new ReconciliationReportWriter(new AnnotationAccessor(TestAnnotation.class.getName()));
-    }
-
-    @Test
-    public void testReportWithSingleFullyMappedRow() throws Exception
-    {
-        File expectedReport = getClasspathResource("expectedsingle.csv");
-        File outputFile = createTemporaryFile();
-
-        _report.addRow("function1", getClass().getMethod("methodWithMapping"));
-        _writer.write(outputFile.getAbsolutePath(), _report);
-
-        assertFilesSame(expectedReport, outputFile);
-    }
-
-    @Test
-    public void testReportWithManyRowsSomeUnmapped() throws Exception
-    {
-        File expectedReport = getClasspathResource("expectedmany.csv");
-        File outputFile = createTemporaryFile();
-
-        _report.addRow("function1", getClass().getMethod("methodWithMapping"));
-        _report.addRow("function2", getClass().getMethod("anotherMethodWithMapping"));
-        _report.addRow(null, getClass().getMethod("methodWithoutMapping"));
-        _report.addRow("function4", null);
-        _writer.write(outputFile.getAbsolutePath(), _report);
-
-        assertFilesSame(expectedReport, outputFile);
-    }
-
-    private File getClasspathResource(String filename) throws URISyntaxException
-    {
-        URL resource = getClass().getResource(filename);
-        assertNotNull("Resource " + filename + " could not be found",resource);
-        return new File(resource.toURI());
-    }
-
-    private File createTemporaryFile() throws Exception
-    {
-        File tmpFile = File.createTempFile(getClass().getSimpleName(), "csv");
-        tmpFile.deleteOnExit();
-        return tmpFile;
-    }
-
-    private void assertFilesSame(File expectedReport, File actualReport) throws IOException
-    {
-        assertTrue(expectedReport.canRead());
-        assertTrue(actualReport.canRead());
-        assertEquals("Report contents unexpected",
-                FileUtils.readFileToString(expectedReport),
-                FileUtils.readFileToString(actualReport));
-    }
-
-    @TestAnnotation("function1")
-    public void methodWithMapping()
-    {
-    }
-
-    @TestAnnotation("function2")
-    public void anotherMethodWithMapping()
-    {
-    }
-
-    public void methodWithoutMapping()
-    {
-    }
-}
diff --git a/design/api-reconciliation/src/test/resources/org/apache/qpid/proton/apireconciliation/reportwriter/expectedmany.csv b/design/api-reconciliation/src/test/resources/org/apache/qpid/proton/apireconciliation/reportwriter/expectedmany.csv
deleted file mode 100644
index 8c8ba3e..0000000
--- a/design/api-reconciliation/src/test/resources/org/apache/qpid/proton/apireconciliation/reportwriter/expectedmany.csv
+++ /dev/null
@@ -1,5 +0,0 @@
-C function,Java Method,Java Annotation
-function1,org.apache.qpid.proton.apireconciliation.reportwriter.ReconciliationReportWriterTest#methodWithMapping,function1
-function2,org.apache.qpid.proton.apireconciliation.reportwriter.ReconciliationReportWriterTest#anotherMethodWithMapping,function2
-,org.apache.qpid.proton.apireconciliation.reportwriter.ReconciliationReportWriterTest#methodWithoutMapping,
-function4,,
diff --git a/design/api-reconciliation/src/test/resources/org/apache/qpid/proton/apireconciliation/reportwriter/expectedsingle.csv b/design/api-reconciliation/src/test/resources/org/apache/qpid/proton/apireconciliation/reportwriter/expectedsingle.csv
deleted file mode 100644
index 082f623..0000000
--- a/design/api-reconciliation/src/test/resources/org/apache/qpid/proton/apireconciliation/reportwriter/expectedsingle.csv
+++ /dev/null
@@ -1,2 +0,0 @@
-C function,Java Method,Java Annotation
-function1,org.apache.qpid.proton.apireconciliation.reportwriter.ReconciliationReportWriterTest#methodWithMapping,function1
diff --git a/design/build.xml b/design/build.xml
deleted file mode 100644
index e884b68..0000000
--- a/design/build.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-<project name="Qpid Proton Design" default="dist" basedir=".">
-  <description>
-    simple example build file
-  </description>
-
-  <!-- global properties for this build -->
-  <property name="src" location="src"/>
-  <property name="build" location="build"/>
-  <property name="dist"  location="dist"/>
-  <property name="classes" location="${build}/classes"/>
-  <property name="docs" location="${build}/docs"/>
-  <property name="umlgraph.jar" location="/usr/share/java/umlgraph.jar"/>
-
-  <target name="init">
-    <tstamp/>
-    <mkdir dir="${classes}"/>
-  </target>
-
-  <target name="compile" depends="init" description="compile the source ">
-    <javac srcdir="${src}" destdir="${classes}"/>
-  </target>
-
-  <target name="uml">
-    <property name="uml.dir" value="${docs}/uml"/>
-    <mkdir dir="${uml.dir}"/>
-    <path id="uml.source.path">
-      <pathelement path="${src}/"/>
-    </path>
-    <javadoc sourcepathref="uml.source.path" packagenames="*" package="true">
-      <doclet name="org.umlgraph.doclet.UmlGraph" path="${umlgraph.jar}">
-        <param name="-d" value="${uml.dir}"/>
-      </doclet>
-    </javadoc>
-    <apply executable="dot" dest="${uml.dir}" parallel="false">
-      <arg value="-Tpng"/>
-      <arg value="-o"/>
-      <targetfile/>
-      <srcfile/>
-      <fileset dir="${uml.dir}" includes="*.dot"/>
-      <mapper type="glob" from="*.dot" to="*.png"/>
-    </apply>
-  </target>
-
-  <target name="apidoc">
-    <javadoc destdir="${docs}/api" author="true" version="true" use="true"
-             windowtitle="Qpid Proton API">
-
-      <fileset dir="src" defaultexcludes="yes">
-        <include name="proton/**.java"/>
-      </fileset>
-
-      <doctitle><![CDATA[<h1>Qpid Proton</h1>]]></doctitle>
-      <bottom><![CDATA[<i>Copyright &#169; 2011 Rafael Schloming All Rights Reserved.</i>]]></bottom>
-      <tag name="todo" scope="all" description="To do:"/>
-      <link offline="true" href="http://download.oracle.com/javase/6/docs/api/" packagelistLoc="C:\tmp"/>
-      <link href="http://developer.java.sun.com/developer/products/xml/docs/api/"/>
-    </javadoc>
-  </target>
-
-  <target name="doc" depends="uml,apidoc"/>
-
-  <target name="dist" depends="compile,doc" description="generate the distribution">
-    <mkdir dir="${dist}/lib"/>
-
-    <jar jarfile="${dist}/lib/qpidproton.jar" basedir="${classes}"/>
-    <zip destfile="${dist}/docs.zip" basedir="${docs}"/>
-    <zip destfile="${dist}/srcs.zip" basedir="${basedir}" excludes="build/**,dist/**"/>
-  </target>
-
-  <target name="clean" description="clean up" >
-    <delete dir="${build}"/>
-    <delete dir="${dist}"/>
-  </target>
-</project>
diff --git a/design/proton_objects.dia b/design/proton_objects.dia
deleted file mode 100644
index 4fc2634..0000000
--- a/design/proton_objects.dia
+++ /dev/null
Binary files differ
diff --git a/design/src/proton/Accepted.java b/design/src/proton/Accepted.java
deleted file mode 100644
index 246eb6c..0000000
--- a/design/src/proton/Accepted.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package proton;
-
-
-/**
- * Accepted
- *
- * @hidden
- *
- */
-
-public interface Accepted extends Outcome
-{
-
-}
diff --git a/design/src/proton/Connection.java b/design/src/proton/Connection.java
deleted file mode 100644
index a7f4af7..0000000
--- a/design/src/proton/Connection.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package proton;
-
-import java.util.Iterator;
-
-
-/**
- * Connection
- *
- * @opt operations
- * @opt types
- *
- * @composed 1 - "0..n" Session
- * @composed 1 - "0..?" Transport
- *
- */
-
-public interface Connection extends Endpoint
-{
-
-    /**
-     * transition local state to ACTIVE
-     */
-    public void open();
-
-    /**
-     * transition local state to CLOSED
-     */
-    public void close();
-
-    /**
-     * @return a newly created session
-     */
-    public Session session();
-
-    /**
-     * @return a newly created transport
-     */
-    public Transport transport();
-
-    /**
-     * @return iterator for endpoints matching the specified local and
-     *         remote states
-     */
-    public Iterator<Endpoint> endpoints(Endpoint.State local, Endpoint.State remote);
-
-    /**
-     * @return iterator for incoming link endpoints with pending
-     *         transfers
-     */
-    public Iterator<Receiver> incoming();
-
-    /**
-     * @return iterator for unblocked outgoing link endpoints with
-     *         offered credits
-     */
-    public Iterator<Sender> outgoing();
-
-}
diff --git a/design/src/proton/Delivery.java b/design/src/proton/Delivery.java
deleted file mode 100644
index f68b020..0000000
--- a/design/src/proton/Delivery.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package proton;
-
-
-/**
- * Delivery
- *
- * @opt operations
- * @opt types
- *
- * @assoc - local 0..1 DeliveryState
- * @assoc - remote 0..1 DeliveryState
- *
- * @todo deliveries need to track important link state (source and
- *       targets) at the point that they were created
- *
- */
-
-public interface Delivery
-{
-
-    public byte[] getTag();
-
-    public Link getLink();
-
-    public DeliveryState getLocalState();
-
-    public DeliveryState getRemoteState();
-
-    public boolean remoteSettled();
-
-    public int getMessageFormat();
-
-    /**
-     * updates the state of the delivery
-     *
-     * @param state the new delivery state
-     */
-    public void disposition(DeliveryState state);
-
-    /**
-     * settle the delivery
-     */
-    public void settle();
-
-}
diff --git a/design/src/proton/DeliveryBuffer.java b/design/src/proton/DeliveryBuffer.java
deleted file mode 100644
index bdd592e..0000000
--- a/design/src/proton/DeliveryBuffer.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package proton;
-
-
-/**
- * DeliveryBuffer
- *
- * @opt operations
- * @opt attributes
- * @opt types
- *
- * @composed 1 - "0..n" Delivery
- *
- */
-
-public interface DeliveryBuffer
-{
-
-    int next = 0;
-
-    public int getCapacity();
-
-    public int getSize();
-
-}
diff --git a/design/src/proton/DeliveryState.java b/design/src/proton/DeliveryState.java
deleted file mode 100644
index 50d23e3..0000000
--- a/design/src/proton/DeliveryState.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package proton;
-
-
-/**
- * DeliveryState
- *
- */
-
-public interface DeliveryState
-{
-
-}
diff --git a/design/src/proton/Endpoint.java b/design/src/proton/Endpoint.java
deleted file mode 100644
index 6d7a997..0000000
--- a/design/src/proton/Endpoint.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package proton;
-
-
-/**
- * Endpoint
- *
- * @opt operations
- * @opt types
- *
- * @assoc - local 1 Endpoint.State
- * @assoc - remote 1 Endpoint.State
- * @assoc - local 0..1 Endpoint.Error
- * @assoc - remote 0..1 Endpoint.Error
- */
-
-public interface Endpoint
-{
-
-    /**
-     * Represents the state of a communication endpoint.
-     */
-    public static final class State {
-
-        private String name;
-
-        private State(String name)
-        {
-            this.name = name;
-        }
-
-        public String toString()
-        {
-            return name;
-        }
-
-    };
-
-    public static final State UNINIT = new State("UNINIT");
-    public static final State ACTIVE = new State("ACTIVE");
-    public static final State CLOSED = new State("CLOSED");
-
-    /**
-     * Holds information about an endpoint error.
-     */
-    public static final class Error {
-
-        private String name;
-        private String description;
-
-        public Error(String name, String description)
-        {
-            this.name = name;
-            this.description = description;
-        }
-
-        public Error(String name)
-        {
-            this(name, null);
-        }
-
-        public String toString()
-        {
-            if (description == null)
-            {
-                return name;
-            }
-            else
-            {
-                return String.format("%s -- %s", name, description);
-            }
-        }
-    }
-
-    /**
-     * @return the local endpoint state
-     */
-    public State getLocalState();
-
-    /**
-     * @return the remote endpoint state (as last communicated)
-     */
-    public State getRemoteState();
-
-    /**
-     * @return the local endpoint error, or null if there is none
-     */
-    public Error getLocalError();
-
-    /**
-     * @return the remote endpoint error, or null if there is none
-     */
-    public Error getRemoteError();
-
-    /**
-     * free the endpoint and any associated resources
-     */
-    public void free();
-
-}
diff --git a/design/src/proton/Link.java b/design/src/proton/Link.java
deleted file mode 100644
index ec80b62..0000000
--- a/design/src/proton/Link.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package proton;
-
-import java.util.Iterator;
-
-
-/**
- * Link
- *
- * @opt operations
- * @opt types
- *
- * @assoc 1 - n Delivery
- *
- * @todo make links able to exist independently from
- *       sessions/connections and allow to migrate
- *
- */
-
-public interface Link extends Endpoint
-{
-
-    /**
-     * transition local state to ACTIVE
-     */
-    public void attach();
-
-    /**
-     * transition local state to CLOSED
-     */
-    public void detach();
-
-    /**
-     * @param tag a tag for the delivery
-     *
-     * @return a Delivery object
-     */
-    public Delivery delivery(byte[] tag);
-
-    /**
-     * @return the unsettled deliveries for this link
-     */
-    public Iterator<Delivery> unsettled();
-
-    /**
-     * Advances the current delivery to the next delivery on the link.
-     *
-     * @return the next delivery or null if there is none
-     */
-    public Delivery next();
-
-}
diff --git a/design/src/proton/Modified.java b/design/src/proton/Modified.java
deleted file mode 100644
index 1f07cb0..0000000
--- a/design/src/proton/Modified.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package proton;
-
-
-/**
- * Modified
- *
- * @hidden
- *
- */
-
-public interface Modified extends Outcome
-{
-
-}
diff --git a/design/src/proton/Outcome.java b/design/src/proton/Outcome.java
deleted file mode 100644
index d0a4064..0000000
--- a/design/src/proton/Outcome.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package proton;
-
-
-/**
- * Outcome
- *
- * @hidden
- *
- */
-
-public interface Outcome extends DeliveryState
-{
-
-}
diff --git a/design/src/proton/Received.java b/design/src/proton/Received.java
deleted file mode 100644
index 37856bf..0000000
--- a/design/src/proton/Received.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package proton;
-
-
-/**
- * Received
- *
- * @hidden
- *
- */
-
-public interface Received extends DeliveryState
-{
-
-}
diff --git a/design/src/proton/Receiver.java b/design/src/proton/Receiver.java
deleted file mode 100644
index f46bfa4..0000000
--- a/design/src/proton/Receiver.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package proton;
-
-
-/**
- * Receiver
- *
- * @opt operations
- * @opt types
- *
- */
-
-public interface Receiver extends Link
-{
-
-    /**
-     * issue the specified number of credits
-     */
-    public void flow(int credits);
-
-    /**
-     * Receive message data for the current delivery.
-     *
-     * @param bytes the destination array where the message data is written
-     * @param offset the index to begin writing into the array
-     * @param size the maximum number of bytes to write
-     *
-     * @return the number of bytes written or -1 if there is no more
-     *         message data for the current delivery
-     */
-    public int recv(byte[] bytes, int offset, int size);
-
-}
diff --git a/design/src/proton/Rejected.java b/design/src/proton/Rejected.java
deleted file mode 100644
index 92f1ec4..0000000
--- a/design/src/proton/Rejected.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package proton;
-
-
-/**
- * Rejected
- *
- * @hidden
- *
- */
-
-public interface Rejected extends Outcome
-{
-
-}
diff --git a/design/src/proton/Released.java b/design/src/proton/Released.java
deleted file mode 100644
index e480ef7..0000000
--- a/design/src/proton/Released.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package proton;
-
-
-/**
- * Released
- *
- * @hidden
- *
- */
-
-public interface Released extends Outcome
-{
-
-}
diff --git a/design/src/proton/Sender.java b/design/src/proton/Sender.java
deleted file mode 100644
index 36bd68d..0000000
--- a/design/src/proton/Sender.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package proton;
-
-
-/**
- * Sender
- *
- * @opt operations
- * @opt types
- *
- */
-
-public interface Sender extends Link
-{
-
-    /**
-     * indicates pending deliveries
-     *
-     * @param credits the number of pending deliveries
-     * @todo is this absolute or cumulative?
-     */
-    public void offer(int credits);
-
-    /**
-     * Sends message data for the current delivery.
-     *
-     * @param bytes the message data
-     */
-    public void send(byte[] bytes);
-
-    /**
-     * Abort the current delivery.
-     */
-    public void abort();
-
-}
diff --git a/design/src/proton/Session.java b/design/src/proton/Session.java
deleted file mode 100644
index b6ae6f9..0000000
--- a/design/src/proton/Session.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package proton;
-
-import java.util.Iterator;
-
-
-/**
- * Session
- *
- * @opt operations
- * @opt types
- *
- * @composed 1 - "0..n" Link
- * @composed 1 incoming 1 DeliveryBuffer
- * @composed 1 outgoing 1 DeliveryBuffer
- *
- */
-
-public interface Session extends Endpoint
-{
-
-    /**
-     * transition local state to ACTIVE
-     */
-    public void begin();
-
-    /**
-     * transition local state to CLOSED
-     */
-    public void end();
-
-    /**
-     * @return a newly created outgoing link
-     */
-    public Sender sender();
-
-    /**
-     * @return a newly created incoming link
-     */
-    public Receiver receiver();
-
-    /**
-     * @see Connection#endpoints(Endpoint.State, Endpoint.State)
-     */
-    public Iterator<Endpoint> endpoints(Endpoint.State local, Endpoint.State remote);
-
-    /**
-     * @see Connection#incoming()
-     */
-    public Iterator<Receiver> incoming();
-
-    /**
-     * @see Connection#outgoing()
-     */
-    public Iterator<Sender> outgoing();
-
-}
diff --git a/design/src/proton/Transport.java b/design/src/proton/Transport.java
deleted file mode 100644
index 0ff89ac..0000000
--- a/design/src/proton/Transport.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package proton;
-
-
-/**
- * Transport
- *
- * @opt operations
- * @opt types
- *
- */
-
-public interface Transport extends Endpoint
-{
-
-    /**
-     * @param bytes input bytes for consumption
-     * @param offset the offset within bytes where input begins
-     * @param size the number of bytes available for input
-     *
-     * @return the number of bytes consumed
-     */
-    public int input(byte[] bytes, int offset, int size);
-
-    /**
-     * @param bytes array for output bytes
-     * @param offset the offset within bytes where output begins
-     * @param size the number of bytes available for output
-     *
-     * @return the number of bytes written
-     */
-    public int output(byte[] bytes, int offset, int size);
-
-}
diff --git a/design/src/proton/package.html b/design/src/proton/package.html
deleted file mode 100644
index c72c78f..0000000
--- a/design/src/proton/package.html
+++ /dev/null
@@ -1,122 +0,0 @@
-<html>
-  <body>
-    <p>
-      Connections are the primary unit of resource management.
-      Sessions and Links are components of connections. When the
-      Connection is freed/discarded, any resources associated with
-      the Sessions and Links are automatically destroyed or discarded
-      as well.
-    </p>
-
-    <p>
-      Each of the Connection, Session, and Link endpoints share a
-      common state model. Note that although this follows the same
-      pattern as the protocol state model for open/close, begin/end,
-      and attach/detach, this does not necessarily correspond one to
-      one to the protocol state model for endpoints. For example the
-      engine implementation may detach/reattach a link endpoint
-      without visibly changing the external state.
-    </p>
-
-    <p>
-      The state of each endpoint is divided into two parts, one
-      reflecting the state of the local endpoint, and the other
-      reflecting the state of the remote endpoint as last
-      communicated.
-    </p>
-
-    <pre>
-     LOCAL:
-       UNINIT
-       ACTIVE
-       CLOSED
-
-     REMOTE:
-       UNINIT
-       ACTIVE
-       CLOSED
-    </pre>
-
-    <p>In total there are 9 possible states:</p>
-
-    <pre>
-     LOCAL             REMOTE             Example
-     -------------------------------------------------------------------------
-     UNINIT            UNINIT             A newly created connection.
-
-     UNINIT            ACTIVE             A remotely initiated connection
-                                          prior to full establishment.
-
-     UNINIT            CLOSED             A remotely initiated connection that
-                                          has been closed prior to full
-                                          establishment.
-
-     ACTIVE            UNINIT             A locally initiated connection prior
-                                          to full establishment.
-
-     ACTIVE            ACTIVE             A fully established connection.
-
-     ACTIVE            CLOSED             A remotely terminated connection.
-
-     CLOSED            UNINIT             A locally initiated connection that
-                                          has been closed prior to full
-                                          establishment.
-
-     CLOSED            ACTIVE             A locally terminated connection.
-
-     CLOSED            CLOSED             A fully terminated connection.
-  </pre>
-
-  <p>
-    Additionally each endpoint has an error slot which may be filled
-    with additional information regarding error conditions, e.g. why
-    the remote endpoint was transitioned to CLOSED.
-  </p>
-
-  <h3>Questions:</h3>
-
-  <ul>
-    <li>The transfer buffer class may not necessarily be explicitly part
-      of the external interface, e.g. it could be absorbed into the
-      session interface.</li>
-    <li>how do we confirm acheiving active/active without iterating
-      over all active/active endpoints?
-      <ul>
-        <li>add an ignore/interest flag as part of generic endpoint state?</li>
-        <li>add pending state to local state?</li>
-      </ul>
-    </li>
-    <li>what are credits exactly?
-      <ul>
-        <li>how does synchronous get work?
-          <ul><li>implies credit unit needs to be messages?</li></ul>
-        <li>credits may not correspond exactly with on-the-wire credits due
-          to local buffering</li>
-      </ul>
-    </li>
-    <li>how would 0-x impls work given that we're passing bytes directly to send?
-      <ul>
-        <li>have a generic property get/set API?
-          <ul><li>this could address per transfer flags as well</li></ul>
-        </li>
-      </ul>
-    </li>
-    <li>how do large messages work?
-      <ul><li>does send need a done flag for multiple transfers?</li></ul>
-    </li>
-    <li>how does resume work?</li>
-    <li>how does abort work?</li>
-    <li>how do we send settled?
-      <ul>
-        <li>just call settle on the returned transfer, the engine MUST optimize</li>
-      </ul>
-    </li>
-    <li>
-      how do we deal with send and receive modes on individual transfers?
-      <ul><li>could just twiddle the link ones and set them on the
-          transfer frame if they differ from what they were when the
-          attach was made</li></ul>
-    </li>
-  </ul>
-  </body>
-</html>
diff --git a/docs/markdown/engine/engine.md b/docs/markdown/engine/engine.md
deleted file mode 100644
index b1a6f60..0000000
--- a/docs/markdown/engine/engine.md
+++ /dev/null
@@ -1,74 +0,0 @@
-Proton's Engine is a stateful component with a low-level API that allows an
-application to communicate using AMQP. This document gives a high level overview
-of the Engine's design, intended to be read by application developers intending
-to use it.
-
-The Engine is built around the concept of a protocol engine. The idea behind a
-protocol engine is to capture all the complex details of implementing a given
-protocol in a way that is as decoupled as possible from OS details such as I/O
-and threading models. The result is a highly portable and easily embedded
-component that provides a full protocol implementation. 
-
-
-The Engine API
---------------
-
-The Engine contains in-memory representations of AMQP entities such as
-Connection, Session and Delivery. These are manipulated via its API, which
-consists of two main parts.
-
-- The *control and query API*, commonly referred to as *The Top Half*, which
-  offers functions to directly create, modify and query the Connections,
-  Sessions etc.
-
-- The *transport API*, commonly referred to as *The Bottom Half*, which contains
-  a small set of functions to operate on the AMQP entities therein by accepting
-  binary AMQP input and producing binary AMQP output. The Engine's transport
-  layer can be thought of as transforming a *queue of bytes*, therefore the API
-  is expressed in terms of input appended to the *tail* and output fetched from
-  the *head*.
-
-
-Typical Engine usage
---------------------
-
-The diagram below shows how the Engine is typically used by an application.  The
-socket's remote peer is serviced by another AMQP application, which may (or may
-not) use Proton.
-
-<pre>
-<![CDATA[
-
-                              +------------ +          +---------------+
-                              |             |          |               |
-                              | Application |--------->| Engine        |
-                              | business    |          | "Top Half"    |
-                              | logic       |          | Control and   |
-                              |             |<---------| query API     |
-                              |             |          |               |
-                              |             |          +---------------+
-                              |             |                 |
-     +-------------+          +-------------+          +---------------+
-     |             |  Input   |             |  Tail    | Engine        |
-     |             |--------->|             |--------->| "Bottom half" |
-     |   Socket    |          | Application |          | Transport API |
-     |             |<---------| I/O layer   |<---------|               |
-     |             |  Output  |             |  Head    |               |
-     +-------------+          +-------------+          +---------------+
-]]>
-</pre>
-
-For maximum flexibility, the Engine is not multi-threaded. It is therefore
-typical for an application thread to loop continuously, repeatedly calling the
-Top Half and Bottom Half functions.
-
-
-Implementations
----------------
-
-Implementations of the Engine currently exist in C and Java. Bindings exist from
-several languages (e.g. Ruby, Python, Java Native Interface) to the C Engine.
-
-For more information see the documentation in the code.
-
-
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
deleted file mode 100644
index 4d744d2..0000000
--- a/examples/CMakeLists.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-set (Proton_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-set (ProtonCpp_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-
-# Set result to a native search path
-macro(set_search_path result)  # args after result are directories or search paths.
-  set(${result} ${ARGN})
-  if (UNIX)
-    string(REPLACE ";" ":" ${result} "${${result}}") # native search path separators.
-  endif()
-  file(TO_NATIVE_PATH "${${result}}" ${result}) # native slash separators
-endmacro()
-
-# Some non-python examples use exampletest.py to drive their self-tests.
-set_search_path(EXAMPLE_PYTHONPATH "${CMAKE_CURRENT_SOURCE_DIR}" "$ENV{PYTHON_PATH}")
-set(EXAMPLE_ENV "PYTHONPATH=${EXAMPLE_PYTHONPATH}")
-
-add_subdirectory(c)
-add_subdirectory(go)
-if (BUILD_CPP)
-  add_subdirectory(cpp)
-endif()
diff --git a/examples/ProtonConfig.cmake b/examples/ProtonConfig.cmake
deleted file mode 100644
index e910082..0000000
--- a/examples/ProtonConfig.cmake
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Note that this file is used *only* when building the examples within
-# the proton source tree not when the examples are installed separately
-# from it (for example in an OS distribution package).
-#
-# So if you find this file installed on your system something went wrong
-# with the packaging and/or package installation.
-#
-# For a packaged installation the equivalent file is created by the source
-# tree build and installed in the appropriate place for cmake on that system.
-
-set (Proton_VERSION       ${PN_VERSION})
-set (Proton_INCLUDE_DIRS  ${CMAKE_SOURCE_DIR}/proton-c/include)
-set (Proton_LIBRARIES     qpid-proton)
-set (Proton_FOUND True)
diff --git a/examples/ProtonCppConfig.cmake b/examples/ProtonCppConfig.cmake
deleted file mode 100644
index e23d134..0000000
--- a/examples/ProtonCppConfig.cmake
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Note that this file is used *only* when building the examples within
-# the proton source tree not when the examples are installed separately
-# from it (for example in an OS distribution package).
-#
-# So if you find this file installed on your system something went wrong
-# with the packaging and/or package installation.
-#
-# For a packaged installation the equivalent file is created by the source
-# tree build and installed in the appropriate place for cmake on that system.
-
-set (ProtonCpp_VERSION       ${PN_VERSION})
-set (ProtonCpp_INCLUDE_DIRS  ${CMAKE_SOURCE_DIR}/proton-c/include ${CMAKE_SOURCE_DIR}/proton-c/bindings/cpp/include)
-set (ProtonCpp_LIBRARIES     qpid-proton-cpp)
-set (ProtonCpp_FOUND True)
diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt
deleted file mode 100644
index 0d0c7e9..0000000
--- a/examples/c/CMakeLists.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-find_package(Proton REQUIRED)
-include(CheckCCompilerFlag)
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
-
-add_subdirectory(proactor)
-add_subdirectory(messenger)
-add_subdirectory(reactor)
diff --git a/examples/c/include/pncompat/internal/LICENSE b/examples/c/include/pncompat/internal/LICENSE
deleted file mode 100644
index 99efb42..0000000
--- a/examples/c/include/pncompat/internal/LICENSE
+++ /dev/null
@@ -1,33 +0,0 @@
-Free Getopt
-Copyright (c)2002-2003 Mark K. Kim
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-  * Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-
-  * Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in
-    the documentation and/or other materials provided with the
-    distribution.
-
-  * Neither the original author of this software nor the names of its
-    contributors may be used to endorse or promote products derived
-    from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
-THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGE.
-
diff --git a/examples/c/include/pncompat/internal/getopt.c b/examples/c/include/pncompat/internal/getopt.c
deleted file mode 100644
index 7ef9a68..0000000
--- a/examples/c/include/pncompat/internal/getopt.c
+++ /dev/null
@@ -1,250 +0,0 @@
-/*****************************************************************************
-* getopt.c - competent and free getopt library.
-* $Header: /cvsroot/freegetopt/freegetopt/getopt.c,v 1.2 2003/10/26 03:10:20 vindaci Exp $
-*
-* Copyright (c)2002-2003 Mark K. Kim
-* All rights reserved.
-* 
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions
-* are met:
-*
-*   * Redistributions of source code must retain the above copyright
-*     notice, this list of conditions and the following disclaimer.
-*
-*   * Redistributions in binary form must reproduce the above copyright
-*     notice, this list of conditions and the following disclaimer in
-*     the documentation and/or other materials provided with the
-*     distribution.
-*
-*   * Neither the original author of this software nor the names of its
-*     contributors may be used to endorse or promote products derived
-*     from this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
-* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-* DAMAGE.
-*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "getopt.h"
-
-
-static const char* ID = "$Id: getopt.c,v 1.2 2003/10/26 03:10:20 vindaci Exp $";
-
-
-char* optarg = NULL;
-int optind = 0;
-int opterr = 1;
-int optopt = '?';
-
-
-static char** prev_argv = NULL;        /* Keep a copy of argv and argc to */
-static int prev_argc = 0;              /*    tell if getopt params change */
-static int argv_index = 0;             /* Option we're checking */
-static int argv_index2 = 0;            /* Option argument we're checking */
-static int opt_offset = 0;             /* Index into compounded "-option" */
-static int dashdash = 0;               /* True if "--" option reached */
-static int nonopt = 0;                 /* How many nonopts we've found */
-
-static void increment_index()
-{
-	/* Move onto the next option */
-	if(argv_index < argv_index2)
-	{
-		while(prev_argv[++argv_index] && prev_argv[argv_index][0] != '-'
-				&& argv_index < argv_index2+1);
-	}
-	else argv_index++;
-	opt_offset = 1;
-}
-
-
-/*
-* Permutes argv[] so that the argument currently being processed is moved
-* to the end.
-*/
-static int permute_argv_once()
-{
-	/* Movability check */
-	if(argv_index + nonopt >= prev_argc) return 1;
-	/* Move the current option to the end, bring the others to front */
-	else
-	{
-		char* tmp = prev_argv[argv_index];
-
-		/* Move the data */
-		memmove(&prev_argv[argv_index], &prev_argv[argv_index+1],
-				sizeof(char**) * (prev_argc - argv_index - 1));
-		prev_argv[prev_argc - 1] = tmp;
-
-		nonopt++;
-		return 0;
-	}
-}
-
-
-int getopt(int argc, char** argv, char* optstr)
-{
-	int c = 0;
-
-	/* If we have new argv, reinitialize */
-	if(prev_argv != argv || prev_argc != argc)
-	{
-		/* Initialize variables */
-		prev_argv = argv;
-		prev_argc = argc;
-		argv_index = 1;
-		argv_index2 = 1;
-		opt_offset = 1;
-		dashdash = 0;
-		nonopt = 0;
-	}
-
-	/* Jump point in case we want to ignore the current argv_index */
-	getopt_top:
-
-	/* Misc. initializations */
-	optarg = NULL;
-
-	/* Dash-dash check */
-	if(argv[argv_index] && !strcmp(argv[argv_index], "--"))
-	{
-		dashdash = 1;
-		increment_index();
-	}
-
-	/* If we're at the end of argv, that's it. */
-	if(argv[argv_index] == NULL)
-	{
-		c = -1;
-	}
-	/* Are we looking at a string? Single dash is also a string */
-	else if(dashdash || argv[argv_index][0] != '-' || !strcmp(argv[argv_index], "-"))
-	{
-		/* If we want a string... */
-		if(optstr[0] == '-')
-		{
-			c = 1;
-			optarg = argv[argv_index];
-			increment_index();
-		}
-		/* If we really don't want it (we're in POSIX mode), we're done */
-		else if(optstr[0] == '+' || getenv("POSIXLY_CORRECT"))
-		{
-			c = -1;
-
-			/* Everything else is a non-opt argument */
-			nonopt = argc - argv_index;
-		}
-		/* If we mildly don't want it, then move it back */
-		else
-		{
-			if(!permute_argv_once()) goto getopt_top;
-			else c = -1;
-		}
-	}
-	/* Otherwise we're looking at an option */
-	else
-	{
-		char* opt_ptr = NULL;
-
-		/* Grab the option */
-		c = argv[argv_index][opt_offset++];
-
-		/* Is the option in the optstr? */
-		if(optstr[0] == '-') opt_ptr = strchr(optstr+1, c);
-		else opt_ptr = strchr(optstr, c);
-		/* Invalid argument */
-		if(!opt_ptr)
-		{
-			if(opterr)
-			{
-				fprintf(stderr, "%s: invalid option -- %c\n", argv[0], c);
-			}
-
-			optopt = c;
-			c = '?';
-
-			/* Move onto the next option */
-			increment_index();
-		}
-		/* Option takes argument */
-		else if(opt_ptr[1] == ':')
-		{
-			/* ie, -oARGUMENT, -xxxoARGUMENT, etc. */
-			if(argv[argv_index][opt_offset] != '\0')
-			{
-				optarg = &argv[argv_index][opt_offset];
-				increment_index();
-			}
-			/* ie, -o ARGUMENT (only if it's a required argument) */
-			else if(opt_ptr[2] != ':')
-			{
-				/* One of those "you're not expected to understand this" moment */
-				if(argv_index2 < argv_index) argv_index2 = argv_index;
-				while(argv[++argv_index2] && argv[argv_index2][0] == '-');
-				optarg = argv[argv_index2];
-
-				/* Don't cross into the non-option argument list */
-				if(argv_index2 + nonopt >= prev_argc) optarg = NULL;
-
-				/* Move onto the next option */
-				increment_index();
-			}
-			else
-			{
-				/* Move onto the next option */
-				increment_index();
-			}
-
-			/* In case we got no argument for an option with required argument */
-			if(optarg == NULL && opt_ptr[2] != ':')
-			{
-				optopt = c;
-				c = '?';
-
-				if(opterr)
-				{
-					fprintf(stderr,"%s: option requires an argument -- %c\n",
-							argv[0], optopt);
-				}
-			}
-		}
-		/* Option does not take argument */
-		else
-		{
-			/* Next argv_index */
-			if(argv[argv_index][opt_offset] == '\0')
-			{
-				increment_index();
-			}
-		}
-	}
-
-	/* Calculate optind */
-	if(c == -1)
-	{
-		optind = argc - nonopt;
-	}
-	else
-	{
-		optind = argv_index;
-	}
-
-	return c;
-}
-
-
-/* vim:ts=3
-*/
diff --git a/examples/c/include/pncompat/internal/getopt.h b/examples/c/include/pncompat/internal/getopt.h
deleted file mode 100644
index 0b78650..0000000
--- a/examples/c/include/pncompat/internal/getopt.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*****************************************************************************
-* getopt.h - competent and free getopt library.
-* $Header: /cvsroot/freegetopt/freegetopt/getopt.h,v 1.2 2003/10/26 03:10:20 vindaci Exp $
-*
-* Copyright (c)2002-2003 Mark K. Kim
-* All rights reserved.
-* 
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions
-* are met:
-*
-*   * Redistributions of source code must retain the above copyright
-*     notice, this list of conditions and the following disclaimer.
-*
-*   * Redistributions in binary form must reproduce the above copyright
-*     notice, this list of conditions and the following disclaimer in
-*     the documentation and/or other materials provided with the
-*     distribution.
-*
-*   * Neither the original author of this software nor the names of its
-*     contributors may be used to endorse or promote products derived
-*     from this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
-* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-* DAMAGE.
-*/
-#ifndef GETOPT_H_
-#define GETOPT_H_
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-extern char* optarg;
-extern int optind;
-extern int opterr;
-extern int optopt;
-
-int getopt(int argc, char** argv, char* optstr);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* GETOPT_H_ */
-
-
-/* vim:ts=3
-*/
diff --git a/examples/c/include/pncompat/misc_defs.h b/examples/c/include/pncompat/misc_defs.h
deleted file mode 100644
index 90b0d4e..0000000
--- a/examples/c/include/pncompat/misc_defs.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef PNCOMAPT_MISC_DEFS_H
-#define PNCOMAPT_MISC_DEFS_H
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#if defined(qpid_proton_EXPORTS)
-#error This include file is not for use in the main proton library
-#endif
-
-/*
- * Platform neutral definitions. Only intended for use by Proton
- * examples and test/debug programs.
- *
- * This file and any related support files may change or be removed
- * at any time.
- */
-
-// getopt()
-
-#include <proton/types.h>
-
-#if defined(__IBMC__)
-#  include <stdlib.h>
-#elif !defined(_WIN32) || defined (__CYGWIN__)
-#  include <getopt.h>
-#else
-#  include "internal/getopt.h"
-#endif
-
-pn_timestamp_t time_now(void);
-
-#endif /* PNCOMPAT_MISC_DEFS_H */
diff --git a/examples/c/include/pncompat/misc_funcs.inc b/examples/c/include/pncompat/misc_funcs.inc
deleted file mode 100644
index 821aaf4..0000000
--- a/examples/c/include/pncompat/misc_funcs.inc
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*
- * This file provides the functions for "misc_defs.h" in the form of
- * included code, as opposed to a separate library or object
- * dependency.  In the absence of portable "pragma weak" compiler
- * directives, this provides a simple workaround.
- *
- * Usage for a single compilation unit:
- *
- *  #include "pncompat/misc_funcs.inc"
- *
- * Usage for multiple combined compilation units: chose one to include
- * "pncompat/misc_funcs.inc" as above and in each other unit needing the
- * definitions use
- *
- *  #include "pncompat/misc_defs.h"
- *
- */
-
-#include "misc_defs.h"
-
-#if defined(_WIN32) && ! defined(__CYGWIN__)
-#include "pncompat/internal/getopt.c"
-#endif
-
-#if defined(_WIN32) && ! defined(__CYGWIN__)
-#include <windows.h>
-pn_timestamp_t time_now(void)
-{
-  FILETIME now;
-  ULARGE_INTEGER t;
-  GetSystemTimeAsFileTime(&now);
-  t.u.HighPart = now.dwHighDateTime;
-  t.u.LowPart = now.dwLowDateTime;
-  // Convert to milliseconds and adjust base epoch
-  return t.QuadPart / 10000 - 11644473600000;
-}
-#else
-#include <sys/time.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-pn_timestamp_t time_now(void)
-{
-  struct timeval now;
-  if (gettimeofday(&now, NULL)) {fprintf(stderr, "gettimeofday failed\n"); abort();}
-  return ((pn_timestamp_t)now.tv_sec) * 1000 + (now.tv_usec / 1000);
-}
-#endif
diff --git a/examples/c/messenger/CMakeLists.txt b/examples/c/messenger/CMakeLists.txt
deleted file mode 100644
index d4fec71..0000000
--- a/examples/c/messenger/CMakeLists.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-find_package(Proton REQUIRED)
-
-set (messenger-examples
-  recv.c
-  send.c
-  recv-async.c
-  send-async.c
-  )
-
-set_source_files_properties (
-  ${messenger-examples}
-  PROPERTIES
-  COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_LANGUAGE_FLAGS} ${LINK_TIME_OPTIMIZATION}"
-  )
-
-if (BUILD_WITH_CXX)
-  set_source_files_properties (
-    ${messenger-examples}
-    PROPERTIES LANGUAGE CXX
-    )
-endif (BUILD_WITH_CXX)
-
-add_executable(recv recv.c)
-add_executable(send send.c)
-add_executable(recv-async recv-async.c)
-add_executable(send-async send-async.c)
-
-include_directories(${Proton_INCLUDE_DIRS})
-
-target_link_libraries(recv ${Proton_LIBRARIES})
-target_link_libraries(send ${Proton_LIBRARIES})
-target_link_libraries(recv-async ${Proton_LIBRARIES})
-target_link_libraries(send-async ${Proton_LIBRARIES})
diff --git a/examples/c/messenger/recv-async.c b/examples/c/messenger/recv-async.c
deleted file mode 100644
index 1f49166..0000000
--- a/examples/c/messenger/recv-async.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-// This is a re-implementation of recv.c using non-blocking/asynchronous calls.
-
-#include "proton/message.h"
-#include "proton/messenger.h"
-
-#include "pncompat/misc_funcs.inc"
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#if EMSCRIPTEN
-#include <emscripten.h>
-#endif
-
-pn_message_t * message;
-pn_messenger_t * messenger;
-
-#define check(messenger)                                                     \
-  {                                                                          \
-    if(pn_messenger_errno(messenger))                                        \
-    {                                                                        \
-      die(__FILE__, __LINE__, pn_error_text(pn_messenger_error(messenger))); \
-    }                                                                        \
-  }                                                                          \
-
-void die(const char *file, int line, const char *message)
-{
-    fprintf(stderr, "%s:%i: %s\n", file, line, message);
-    exit(1);
-}
-
-void usage(void)
-{
-    printf("Usage: recv [options] <addr>\n");
-    printf("-c    \tPath to the certificate file.\n");
-    printf("-k    \tPath to the private key file.\n");
-    printf("-p    \tPassword for the private key.\n");
-    printf("<addr>\tAn address.\n");
-    exit(0);
-}
-
-void process(void) {
-    while(pn_messenger_incoming(messenger))
-    {
-        pn_messenger_get(messenger, message);
-        check(messenger);
-
-        {
-        pn_tracker_t tracker = pn_messenger_incoming_tracker(messenger);
-        char buffer[1024];
-        size_t buffsize = sizeof(buffer);
-        const char* subject = pn_message_get_subject(message);
-        pn_data_t* body = pn_message_body(message);
-        pn_data_format(body, buffer, &buffsize);
-
-        printf("Address: %s\n", pn_message_get_address(message));
-        printf("Subject: %s\n", subject ? subject : "(no subject)");
-        printf("Content: %s\n", buffer);
-
-        pn_messenger_accept(messenger, tracker, 0);
-        }
-    }
-}
-
-#if EMSCRIPTEN // For emscripten C/C++ to JavaScript compiler.
-void pump(int fd, void* userData) {
-    while (pn_messenger_work(messenger, 0) >= 0) {
-        process();
-    }
-}
-
-void onclose(int fd, void* userData) {
-    process();
-}
-
-void onerror(int fd, int errno, const char* msg, void* userData) {
-    printf("error callback fd = %d, errno = %d, msg = %s\n", fd, errno, msg);
-}
-#endif
-
-int main(int argc, char** argv)
-{
-    char* certificate = NULL;
-    char* privatekey = NULL;
-    char* password = NULL;
-    char* address = (char *) "amqp://~0.0.0.0";
-    int c;
-
-    message = pn_message();
-    messenger = pn_messenger(NULL);
-    pn_messenger_set_blocking(messenger, false); // Needs to be set non-blocking to behave asynchronously.
-
-    opterr = 0;
-
-    while((c = getopt(argc, argv, "hc:k:p:")) != -1)
-    {
-        switch(c)
-        {
-            case 'h':
-                usage();
-                break;
-
-            case 'c': certificate = optarg; break;
-            case 'k': privatekey = optarg; break;
-            case 'p': password = optarg; break;
-
-            case '?':
-                if (optopt == 'c' ||
-                    optopt == 'k' ||
-                    optopt == 'p')
-                {
-                    fprintf(stderr, "Option -%c requires an argument.\n", optopt);
-                }
-                else if(isprint(optopt))
-                {
-                    fprintf(stderr, "Unknown option `-%c'.\n", optopt);
-                }
-                else
-                {
-                    fprintf(stderr, "Unknown option character `\\x%x'.\n", optopt);
-                }
-                return 1;
-            default:
-                abort();
-        }
-    }
-
-    if (optind < argc)
-    {
-        address = argv[optind];
-    }
-
-    /* load the various command line options if they're set */
-    if(certificate)
-    {
-        pn_messenger_set_certificate(messenger, certificate);
-    }
-
-    if(privatekey)
-    {
-        pn_messenger_set_private_key(messenger, privatekey);
-    }
-
-    if(password)
-    {
-        pn_messenger_set_password(messenger, password);
-    }
-
-    pn_messenger_start(messenger);
-    check(messenger);
-
-    pn_messenger_subscribe(messenger, address);
-    check(messenger);
-
-    pn_messenger_recv(messenger, -1); // Set to receive as many messages as messenger can buffer.
-
-#if EMSCRIPTEN // For emscripten C/C++ to JavaScript compiler.
-    emscripten_set_socket_error_callback(NULL, onerror);
-
-    emscripten_set_socket_open_callback(NULL, pump);
-    emscripten_set_socket_connection_callback(NULL, pump);
-    emscripten_set_socket_message_callback(NULL, pump);
-    emscripten_set_socket_close_callback(NULL, onclose);
-#else // For native compiler.
-    while (1) {
-        pn_messenger_work(messenger, -1); // Block indefinitely until there has been socket activity.
-        process();
-    }
-#endif
-
-    return 0;
-}
-
diff --git a/examples/c/messenger/recv.c b/examples/c/messenger/recv.c
deleted file mode 100644
index 16e8321..0000000
--- a/examples/c/messenger/recv.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/message.h"
-#include "proton/messenger.h"
-
-#include "pncompat/misc_funcs.inc"
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#define check(messenger)                                                     \
-  {                                                                          \
-    if(pn_messenger_errno(messenger))                                        \
-    {                                                                        \
-      die(__FILE__, __LINE__, pn_error_text(pn_messenger_error(messenger))); \
-    }                                                                        \
-  }                                                                          \
-
-void die(const char *file, int line, const char *message)
-{
-  fprintf(stderr, "%s:%i: %s\n", file, line, message);
-  exit(1);
-}
-
-void usage(void)
-{
-  printf("Usage: recv [options] <addr>\n");
-  printf("-c    \tPath to the certificate file.\n");
-  printf("-k    \tPath to the private key file.\n");
-  printf("-p    \tPassword for the private key.\n");
-  printf("<addr>\tAn address.\n");
-  exit(0);
-}
-
-int main(int argc, char** argv)
-{
-  char* certificate = NULL;
-  char* privatekey = NULL;
-  char* password = NULL;
-  char* address = (char *) "amqp://~0.0.0.0";
-  int c;
-
-  pn_message_t * message;
-  pn_messenger_t * messenger;
-
-  message = pn_message();
-  messenger = pn_messenger(NULL);
-
-  opterr = 0;
-
-  while((c = getopt(argc, argv, "hc:k:p:")) != -1)
-  {
-    switch(c)
-    {
-    case 'h':
-      usage();
-      break;
-
-    case 'c': certificate = optarg; break;
-    case 'k': privatekey = optarg; break;
-    case 'p': password = optarg; break;
-
-    case '?':
-      if(optopt == 'c' ||
-         optopt == 'k' ||
-         optopt == 'p')
-      {
-        fprintf(stderr, "Option -%c requires an argument.\n", optopt);
-      }
-      else if(isprint(optopt))
-      {
-        fprintf(stderr, "Unknown option `-%c'.\n", optopt);
-      }
-      else
-      {
-        fprintf(stderr, "Unknown option character `\\x%x'.\n", optopt);
-      }
-      return 1;
-    default:
-      abort();
-    }
-  }
-
-  if (optind < argc)
-  {
-    address = argv[optind];
-  }
-
-  /* load the various command line options if they're set */
-  if(certificate)
-  {
-    pn_messenger_set_certificate(messenger, certificate);
-  }
-
-  if(privatekey)
-  {
-    pn_messenger_set_private_key(messenger, privatekey);
-  }
-
-  if(password)
-  {
-    pn_messenger_set_password(messenger, password);
-  }
-
-  pn_messenger_start(messenger);
-  check(messenger);
-
-  pn_messenger_subscribe(messenger, address);
-  check(messenger);
-
-  for(;;)
-  {
-    pn_messenger_recv(messenger, 1024);
-    check(messenger);
-
-    while(pn_messenger_incoming(messenger))
-    {
-      pn_messenger_get(messenger, message);
-      check(messenger);
-
-      {
-      char buffer[1024];
-      size_t buffsize = sizeof(buffer);
-      const char* subject = pn_message_get_subject(message);
-      pn_data_t *body = pn_message_body(message);
-      pn_data_format(body, buffer, &buffsize);
-
-      printf("Address: %s\n", pn_message_get_address(message));
-      printf("Subject: %s\n", subject ? subject : "(no subject)");
-      printf("Content: %s\n", buffer);
-      }
-    }
-  }
-
-  return 0;
-}
diff --git a/examples/c/messenger/send-async.c b/examples/c/messenger/send-async.c
deleted file mode 100644
index de9b023..0000000
--- a/examples/c/messenger/send-async.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-// This is a re-implementation of send.c using non-blocking/asynchronous calls.
-
-#include "proton/message.h"
-#include "proton/messenger.h"
-
-#include "pncompat/misc_funcs.inc"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#if EMSCRIPTEN
-#include <emscripten.h>
-#endif
-
-pn_message_t * message;
-pn_messenger_t * messenger;
-pn_tracker_t tracker;
-int running = 1;
-
-#define check(messenger)                                                     \
-  {                                                                          \
-    if(pn_messenger_errno(messenger))                                        \
-    {                                                                        \
-      die(__FILE__, __LINE__, pn_error_text(pn_messenger_error(messenger))); \
-    }                                                                        \
-  }                                                                          \
-
-void die(const char *file, int line, const char *message)
-{
-    fprintf(stderr, "%s:%i: %s\n", file, line, message);
-    exit(1);
-}
-
-void usage(void)
-{
-    printf("Usage: send [-a addr] [message]\n");
-    printf("-a     \tThe target address [amqp[s]://domain[/name]]\n");
-    printf("message\tA text string to send.\n");
-    exit(0);
-}
-
-void process(void) {
-    pn_status_t status = pn_messenger_status(messenger, tracker);
-    if (status != PN_STATUS_PENDING) {
-        if (running) {
-            pn_messenger_stop(messenger);
-            running = 0;
-        } 
-    }
-
-    if (pn_messenger_stopped(messenger)) {
-        pn_message_free(message);
-        pn_messenger_free(messenger);
-        message = NULL;
-        messenger = NULL;
-    }
-}
-
-#if EMSCRIPTEN // For emscripten C/C++ to JavaScript compiler.
-void pump(int fd, void* userData) {
-    while (pn_messenger_work(messenger, 0) >= 0) {
-        process();
-    }
-}
-
-void onclose(int fd, void* userData) {
-    process();
-}
-
-void onerror(int fd, int errno, const char* msg, void* userData) {
-    printf("error callback fd = %d, errno = %d, msg = %s\n", fd, errno, msg);
-}
-#endif
-
-int main(int argc, char** argv)
-{
-    int c;
-    char * address = (char *) "amqp://0.0.0.0";
-    char * msgtext = (char *) "Hello World!";
-    pn_data_t* body;
-
-    opterr = 0;
-
-    while((c = getopt(argc, argv, "ha:b:c:")) != -1)
-    {
-        switch(c)
-        {
-            case 'a': address = optarg; break;
-            case 'h': usage(); break;
-
-            case '?':
-                if(optopt == 'a')
-                {
-                    fprintf(stderr, "Option -%c requires an argument.\n", optopt);
-                }
-                else if(isprint(optopt))
-                {
-                    fprintf(stderr, "Unknown option `-%c'.\n", optopt);
-                }
-                else
-                {
-                    fprintf(stderr, "Unknown option character `\\x%x'.\n", optopt);
-                }
-                return 1;
-            default:
-                abort();
-        }
-    }
-
-    if (optind < argc) msgtext = argv[optind];
-
-    message = pn_message();
-    messenger = pn_messenger(NULL);
-    pn_messenger_set_blocking(messenger, false); // Needs to be set non-blocking to behave asynchronously.
-    pn_messenger_set_outgoing_window(messenger, 1024); 
-
-    pn_messenger_start(messenger);
-
-    pn_message_set_address(message, address);
-    body = pn_message_body(message);
-    pn_data_put_string(body, pn_bytes(strlen(msgtext), msgtext));
-
-    pn_messenger_put(messenger, message);
-    check(messenger);
-
-    tracker = pn_messenger_outgoing_tracker(messenger);
-
-#if EMSCRIPTEN // For emscripten C/C++ to JavaScript compiler.
-    emscripten_set_socket_error_callback(NULL, onerror);
-
-    emscripten_set_socket_open_callback(NULL, pump);
-    emscripten_set_socket_connection_callback(NULL, pump);
-    emscripten_set_socket_message_callback(NULL, pump);
-    emscripten_set_socket_close_callback(NULL, onclose);
-#else // For native compiler.
-    while (running) {
-        pn_messenger_work(messenger, -1); // Block indefinitely until there has been socket activity.
-        process();
-    }
-
-    while (messenger && !pn_messenger_stopped(messenger)) {
-        pn_messenger_work(messenger, 0);
-        process();
-    }
-#endif
-
-    return 0;
-}
-
diff --git a/examples/c/messenger/send.c b/examples/c/messenger/send.c
deleted file mode 100644
index 11b47ff..0000000
--- a/examples/c/messenger/send.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/message.h"
-#include "proton/messenger.h"
-
-#include "pncompat/misc_funcs.inc"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#define check(messenger)                                                     \
-  {                                                                          \
-    if(pn_messenger_errno(messenger))                                        \
-    {                                                                        \
-      die(__FILE__, __LINE__, pn_error_text(pn_messenger_error(messenger))); \
-    }                                                                        \
-  }                                                                          \
-
-void die(const char *file, int line, const char *message)
-{
-  fprintf(stderr, "%s:%i: %s\n", file, line, message);
-  exit(1);
-}
-
-void usage(void)
-{
-  printf("Usage: send [-a addr] [message]\n");
-  printf("-a     \tThe target address [amqp[s]://domain[/name]]\n");
-  printf("message\tA text string to send.\n");
-  exit(0);
-}
-
-int main(int argc, char** argv)
-{
-  int c;
-  char * address = (char *) "amqp://0.0.0.0";
-  char * msgtext = (char *) "Hello World!";
-  opterr = 0;
-
-  while((c = getopt(argc, argv, "ha:b:c:")) != -1)
-  {
-    switch(c)
-    {
-    case 'a': address = optarg; break;
-    case 'h': usage(); break;
-
-    case '?':
-      if(optopt == 'a')
-      {
-        fprintf(stderr, "Option -%c requires an argument.\n", optopt);
-      }
-      else if(isprint(optopt))
-      {
-        fprintf(stderr, "Unknown option `-%c'.\n", optopt);
-      }
-      else
-      {
-        fprintf(stderr, "Unknown option character `\\x%x'.\n", optopt);
-      }
-      return 1;
-    default:
-      abort();
-    }
-  }
-
-  if (optind < argc) msgtext = argv[optind];
-
-  {
-  pn_message_t * message;
-  pn_messenger_t * messenger;
-  pn_data_t * body;
-
-  message = pn_message();
-  messenger = pn_messenger(NULL);
-
-  pn_messenger_start(messenger);
-
-  pn_message_set_address(message, address);
-  body = pn_message_body(message);
-  pn_data_put_string(body, pn_bytes(strlen(msgtext), msgtext));
-  pn_messenger_put(messenger, message);
-  check(messenger);
-  pn_messenger_send(messenger, -1);
-  check(messenger);
-
-  pn_messenger_stop(messenger);
-  pn_messenger_free(messenger);
-  pn_message_free(message);
-  }
-
-  return 0;
-}
diff --git a/examples/c/proactor/CMakeLists.txt b/examples/c/proactor/CMakeLists.txt
deleted file mode 100644
index f701651..0000000
--- a/examples/c/proactor/CMakeLists.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-find_package(Proton REQUIRED)
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${Proton_INCLUDE_DIRS})
-
-add_definitions(${COMPILE_WARNING_FLAGS} ${WERROR} ${COMPILE_PLATFORM_FLAGS} ${LINK_TIME_OPTIMIZATION})
-
-find_package(Libuv)
-if (Libuv_FOUND)
-  foreach(name broker send receive)
-    add_executable(libuv_${name} ${name}.c libuv_proactor.c)
-    target_link_libraries(libuv_${name} ${Proton_LIBRARIES} ${Libuv_LIBRARIES})
-    set_target_properties(libuv_${name} PROPERTIES
-      COMPILE_DEFINITIONS  "PN_PROACTOR_INCLUDE=\"libuv_proactor.h\"")
-  endforeach()
-
-  # Add a test with the correct environment to find test executables and valgrind.
-  if(WIN32)
-    set(test_path "$<TARGET_FILE_DIR:libuv_broker>;$<TARGET_FILE_DIR:qpid-proton>")
-  else(WIN32)
-    set(test_path "${CMAKE_CURRENT_BINARY_DIR}:$ENV{PATH}")
-  endif(WIN32)
-  set(run_env ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/proton-c/env.py ${EXAMPLE_ENV} "PATH=${test_path}" ${VALGRIND_ENV})
-  add_test(c-proactor-libuv ${run_env} -- ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test.py)
-endif()
diff --git a/examples/c/proactor/README.dox b/examples/c/proactor/README.dox
deleted file mode 100644
index 4b09cb7..0000000
--- a/examples/c/proactor/README.dox
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * @example send.c
- *
- * Send a fixed number of messages to the "example" node.
- *
- * @example receive.c
- *
- * Subscribes to the 'example' node and prints the message bodies
- * received.
- *
- * @example broker.c
- *
- * A simple multithreaded broker that works with the send and receive
- * examples.
- *
- * __Requires C++11__
- */
diff --git a/examples/c/proactor/broker.c b/examples/c/proactor/broker.c
deleted file mode 100644
index ca52336..0000000
--- a/examples/c/proactor/broker.c
+++ /dev/null
@@ -1,488 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <proton/connection_driver.h>
-#include <proton/proactor.h>
-#include <proton/engine.h>
-#include <proton/sasl.h>
-#include <proton/transport.h>
-#include <proton/url.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-/* TODO aconway 2016-10-14: this example does not require libuv IO,
-   it uses uv.h only for portable mutex and thread functions.
-*/
-#include <uv.h>
-
-bool enable_debug = false;
-
-void debug(const char* fmt, ...) {
-  if (enable_debug) {
-    va_list(ap);
-    va_start(ap, fmt);
-    vfprintf(stderr, fmt, ap);
-    fputc('\n', stderr);
-    fflush(stderr);
-  }
-}
-
-void check(int err, const char* s) {
-  if (err != 0) {
-    perror(s);
-    exit(1);
-  }
-}
-
-void pcheck(int err, const char* s) {
-  if (err != 0) {
-    fprintf(stderr, "%s: %s", s, pn_code(err));
-    exit(1);
-  }
-}
-
-/* Simple re-sizable vector that acts as a queue */
-#define VEC(T) struct { T* data; size_t len, cap; }
-
-#define VEC_INIT(V)                             \
-  do {                                          \
-    V.len = 0;                                  \
-    V.cap = 16;                                 \
-    void **vp = (void**)&V.data;                \
-    *vp = malloc(V.cap * sizeof(*V.data));      \
-  } while(0)
-
-#define VEC_FINAL(V) free(V.data)
-
-#define VEC_PUSH(V, X)                                  \
-  do {                                                  \
-    if (V.len == V.cap) {                               \
-      V.cap *= 2;                                       \
-      void **vp = (void**)&V.data;                      \
-      *vp = realloc(V.data, V.cap * sizeof(*V.data));   \
-    }                                                   \
-    V.data[V.len++] = X;                                \
-  } while(0)                                            \
-
-#define VEC_POP(V)                                              \
-  do {                                                          \
-    if (V.len > 0)                                              \
-      memmove(V.data, V.data+1, (--V.len)*sizeof(*V.data));     \
-  } while(0)
-
-/* Simple thread-safe queue implementation */
-typedef struct queue_t {
-  uv_mutex_t lock;
-  char* name;
-  VEC(pn_rwbytes_t) messages;   /* Messages on the queue_t */
-  VEC(pn_connection_t*) waiting; /* Connections waiting to send messages from this queue */
-  struct queue_t *next;            /* Next queue in chain */
-  size_t sent;                     /* Count of messages sent, used as delivery tag */
-} queue_t;
-
-static void queue_init(queue_t *q, const char* name, queue_t *next) {
-  debug("created queue %s", name);
-  uv_mutex_init(&q->lock);
-  q->name = strdup(name);
-  VEC_INIT(q->messages);
-  VEC_INIT(q->waiting);
-  q->next = next;
-  q->sent = 0;
-}
-
-static void queue_destroy(queue_t *q) {
-  uv_mutex_destroy(&q->lock);
-  free(q->name);
-  for (size_t i = 0; i < q->messages.len; ++i)
-    free(q->messages.data[i].start);
-  VEC_FINAL(q->messages);
-  for (size_t i = 0; i < q->waiting.len; ++i)
-    pn_decref(q->waiting.data[i]);
-  VEC_FINAL(q->waiting);
-}
-
-/* Send a message on s, or record s as eating if no messages.
-   Called in s dispatch loop, assumes s has credit.
-*/
-static void queue_send(queue_t *q, pn_link_t *s) {
-  pn_rwbytes_t m = { 0 };
-  size_t tag = 0;
-  uv_mutex_lock(&q->lock);
-  if (q->messages.len == 0) { /* Empty, record connection as waiting */
-    debug("queue is empty %s", q->name);
-    /* Record connection for wake-up if not already on the list. */
-    pn_connection_t *c = pn_session_connection(pn_link_session(s));
-    size_t i = 0;
-    for (; i < q->waiting.len && q->waiting.data[i] != c; ++i)
-      ;
-    if (i == q->waiting.len) {
-      VEC_PUSH(q->waiting, c);
-    }
-  } else {
-    debug("sending from queue %s", q->name);
-    m = q->messages.data[0];
-    VEC_POP(q->messages);
-    tag = ++q->sent;
-  }
-  uv_mutex_unlock(&q->lock);
-  if (m.start) {
-    pn_delivery_t *d = pn_delivery(s, pn_dtag((char*)&tag, sizeof(tag)));
-    pn_link_send(s, m.start, m.size);
-    pn_link_advance(s);
-    pn_delivery_settle(d);  /* Pre-settled: unreliable, there will bea no ack/ */
-    free(m.start);
-  }
-}
-
-/* Data associated with each broker connection */
-typedef struct broker_data_t {
-  bool check_queues;          /* Check senders on the connection for available data in queues. */
-} broker_data_t;
-
-/* Use the context pointer as a boolean flag to indicate we need to check queues */
-void pn_connection_set_check_queues(pn_connection_t *c, bool check) {
-  pn_connection_set_context(c, (void*)check);
-}
-
-bool pn_connection_get_check_queues(pn_connection_t *c) {
-  return (bool)pn_connection_get_context(c);
-}
-
-/* Put a message on the queue, called in receiver dispatch loop.
-   If the queue was previously empty, notify waiting senders.
-*/
-static void queue_receive(pn_proactor_t *d, queue_t *q, pn_rwbytes_t m) {
-  debug("received to queue %s", q->name);
-  uv_mutex_lock(&q->lock);
-  VEC_PUSH(q->messages, m);
-  if (q->messages.len == 1) { /* Was empty, notify waiting connections */
-    for (size_t i = 0; i < q->waiting.len; ++i) {
-      pn_connection_t *c = q->waiting.data[i];
-      pn_connection_set_check_queues(c, true);
-      pn_connection_wake(c); /* Wake the connection */
-    }
-    q->waiting.len = 0;
-  }
-  uv_mutex_unlock(&q->lock);
-}
-
-/* Thread safe set of queues */
-typedef struct queues_t {
-  uv_mutex_t lock;
-  queue_t *queues;
-  size_t sent;
-} queues_t;
-
-void queues_init(queues_t *qs) {
-  uv_mutex_init(&qs->lock);
-  qs->queues = NULL;
-}
-
-void queues_destroy(queues_t *qs) {
-  for (queue_t *q = qs->queues; q; q = q->next) {
-    queue_destroy(q);
-    free(q);
-  }
-  uv_mutex_destroy(&qs->lock);
-}
-
-/** Get or create the named queue. */
-queue_t* queues_get(queues_t *qs, const char* name) {
-  uv_mutex_lock(&qs->lock);
-  queue_t *q;
-  for (q = qs->queues; q && strcmp(q->name, name) != 0; q = q->next)
-    ;
-  if (!q) {
-    q = (queue_t*)malloc(sizeof(queue_t));
-    queue_init(q, name, qs->queues);
-    qs->queues = q;
-  }
-  uv_mutex_unlock(&qs->lock);
-  return q;
-}
-
-/* The broker implementation */
-typedef struct broker_t {
-  pn_proactor_t *proactor;
-  queues_t queues;
-  const char *container_id;     /* AMQP container-id */
-  size_t threads;
-  pn_millis_t heartbeat;
-  bool finished;
-} broker_t;
-
-void broker_init(broker_t *b, const char *container_id, size_t threads, pn_millis_t heartbeat) {
-  memset(b, 0, sizeof(*b));
-  b->proactor = pn_proactor();
-  queues_init(&b->queues);
-  b->container_id = container_id;
-  b->threads = threads;
-  b->heartbeat = 0;
-}
-
-void broker_stop(broker_t *b) {
-  /* In this broker an interrupt stops a thread, stopping all threads stops the broker */
-  for (size_t i = 0; i < b->threads; ++i)
-    pn_proactor_interrupt(b->proactor);
-}
-
-/* Try to send if link is sender and has credit */
-static void link_send(broker_t *b, pn_link_t *s) {
-  if (pn_link_is_sender(s) && pn_link_credit(s) > 0) {
-    const char *qname = pn_terminus_get_address(pn_link_source(s));
-    queue_t *q = queues_get(&b->queues, qname);
-    queue_send(q, s);
-  }
-}
-
-static void queue_unsub(queue_t *q, pn_connection_t *c) {
-  uv_mutex_lock(&q->lock);
-  for (size_t i = 0; i < q->waiting.len; ++i) {
-    if (q->waiting.data[i] == c){
-      q->waiting.data[i] = q->waiting.data[0]; /* save old [0] */
-      VEC_POP(q->waiting);
-      break;
-    }
-  }
-  uv_mutex_unlock(&q->lock);
-}
-
-/* Unsubscribe from the queue of interest to this link. */
-static void link_unsub(broker_t *b, pn_link_t *s) {
-  if (pn_link_is_sender(s)) {
-    const char *qname = pn_terminus_get_address(pn_link_source(s));
-    if (qname) {
-      queue_t *q = queues_get(&b->queues, qname);
-      queue_unsub(q, pn_session_connection(pn_link_session(s)));
-    }
-  }
-}
-
-/* Called in connection's event loop when a connection is woken for messages.*/
-static void connection_unsub(broker_t *b, pn_connection_t *c) {
-  for (pn_link_t *l = pn_link_head(c, 0); l != NULL; l = pn_link_next(l, 0))
-    link_unsub(b, l);
-}
-
-static void session_unsub(broker_t *b, pn_session_t *ssn) {
-  pn_connection_t *c = pn_session_connection(ssn);
-  for (pn_link_t *l = pn_link_head(c, 0); l != NULL; l = pn_link_next(l, 0)) {
-    if (pn_link_session(l) == ssn)
-      link_unsub(b, l);
-  }
-}
-
-static void check_condition(pn_event_t *e, pn_condition_t *cond) {
-  if (pn_condition_is_set(cond)) {
-    const char *ename = e ? pn_event_type_name(pn_event_type(e)) : "UNKNOWN";
-    fprintf(stderr, "%s: %s: %s\n", ename,
-            pn_condition_get_name(cond), pn_condition_get_description(cond));
-  }
-}
-
-const int WINDOW=10;            /* Incoming credit window */
-
-static void handle(broker_t* b, pn_event_t* e) {
-  pn_connection_t *c = pn_event_connection(e);
-
-  switch (pn_event_type(e)) {
-
-   case PN_LISTENER_ACCEPT:
-    pn_listener_accept(pn_event_listener(e), pn_connection());
-    break;
-
-   case PN_CONNECTION_INIT: 
-     pn_connection_set_container(c, b->container_id);
-     break;
-
-   case PN_CONNECTION_BOUND: {
-     /* Turn off security */
-     pn_transport_t *t = pn_connection_transport(c);
-     pn_transport_require_auth(t, false);
-     pn_sasl_allowed_mechs(pn_sasl(t), "ANONYMOUS");
-     pn_transport_set_idle_timeout(t, 2 * b->heartbeat);
-   }
-   case PN_CONNECTION_REMOTE_OPEN: {
-     pn_connection_open(pn_event_connection(e)); /* Complete the open */
-     break;
-   }
-   case PN_CONNECTION_WAKE: {
-     if (pn_connection_get_check_queues(c)) {
-       pn_connection_set_check_queues(c, false);
-       int flags = PN_LOCAL_ACTIVE&PN_REMOTE_ACTIVE;
-       for (pn_link_t *l = pn_link_head(c, flags); l != NULL; l = pn_link_next(l, flags))
-         link_send(b, l);
-     }
-     break;
-   }
-   case PN_SESSION_REMOTE_OPEN: {
-     pn_session_open(pn_event_session(e));
-     break;
-   }
-   case PN_LINK_REMOTE_OPEN: {
-     pn_link_t *l = pn_event_link(e);
-     if (pn_link_is_sender(l)) {
-       const char *source = pn_terminus_get_address(pn_link_remote_source(l));
-       pn_terminus_set_address(pn_link_source(l), source);
-     } else {
-       const char* target = pn_terminus_get_address(pn_link_remote_target(l));
-       pn_terminus_set_address(pn_link_target(l), target);
-       pn_link_flow(l, WINDOW);
-     }
-     pn_link_open(l);
-     break;
-   }
-   case PN_LINK_FLOW: {
-     link_send(b, pn_event_link(e));
-     break;
-   }
-   case PN_DELIVERY: {
-     pn_delivery_t *d = pn_event_delivery(e);
-     pn_link_t *r = pn_delivery_link(d);
-     if (pn_link_is_receiver(r) &&
-         pn_delivery_readable(d) && !pn_delivery_partial(d))
-     {
-       size_t size = pn_delivery_pending(d);
-       /* The broker does not decode the message, just forwards it. */
-       pn_rwbytes_t m = { size, (char*)malloc(size) };
-       pn_link_recv(r, m.start, m.size);
-       const char *qname = pn_terminus_get_address(pn_link_target(r));
-       queue_receive(b->proactor, queues_get(&b->queues, qname), m);
-       pn_delivery_update(d, PN_ACCEPTED);
-       pn_delivery_settle(d);
-       pn_link_flow(r, WINDOW - pn_link_credit(r));
-     }
-     break;
-   }
-
-   case PN_TRANSPORT_CLOSED:
-    connection_unsub(b, pn_event_connection(e));
-    check_condition(e, pn_transport_condition(pn_event_transport(e)));
-    break;
-
-   case PN_CONNECTION_REMOTE_CLOSE:
-    check_condition(e, pn_connection_remote_condition(pn_event_connection(e)));
-    connection_unsub(b, pn_event_connection(e));
-    pn_connection_close(pn_event_connection(e));
-    break;
-
-   case PN_SESSION_REMOTE_CLOSE:
-    check_condition(e, pn_session_remote_condition(pn_event_session(e)));
-    session_unsub(b, pn_event_session(e));
-    pn_session_close(pn_event_session(e));
-    pn_session_free(pn_event_session(e));
-    break;
-
-   case PN_LINK_REMOTE_CLOSE:
-    check_condition(e, pn_link_remote_condition(pn_event_link(e)));
-    link_unsub(b, pn_event_link(e));
-    pn_link_close(pn_event_link(e));
-    pn_link_free(pn_event_link(e));
-    break;
-
-   case PN_LISTENER_CLOSE:
-    check_condition(e, pn_listener_condition(pn_event_listener(e)));
-    break;
-
-   case PN_PROACTOR_INACTIVE: /* listener and all connections closed */
-    broker_stop(b);
-    break;
-
-   case PN_PROACTOR_INTERRUPT:
-    b->finished = true;
-    break;
-
-   default:
-    break;
-  }
-}
-
-static void broker_thread(void *void_broker) {
-  broker_t *b = (broker_t*)void_broker;
-  do {
-    pn_event_batch_t *events = pn_proactor_wait(b->proactor);
-    pn_event_t *e;
-    while ((e = pn_event_batch_next(events))) {
-      handle(b, e);
-    }
-    pn_proactor_done(b->proactor, events);
-  } while(!b->finished);
-}
-
-static void usage(const char *arg0) {
-  fprintf(stderr, "Usage: %s [-d] [-a url] [-t thread-count]\n", arg0);
-  exit(1);
-}
-
-int main(int argc, char **argv) {
-  /* Command line options */
-  char *urlstr = NULL;
-  char container_id[256];
-  /* Default container-id is program:pid */
-  snprintf(container_id, sizeof(container_id), "%s:%d", argv[0], getpid());
-  size_t nthreads = 4;
-  pn_millis_t heartbeat = 0;
-  int opt;
-  while ((opt = getopt(argc, argv, "a:t:dh:c:")) != -1) {
-    switch (opt) {
-     case 'a': urlstr = optarg; break;
-     case 't': nthreads = atoi(optarg); break;
-     case 'd': enable_debug = true; break;
-     case 'h': heartbeat = atoi(optarg); break;
-     case 'c': strncpy(container_id, optarg, sizeof(container_id)); break;
-     default: usage(argv[0]); break;
-    }
-  }
-  if (optind < argc)
-    usage(argv[0]);
-
-  broker_t b;
-  broker_init(&b, container_id, nthreads, heartbeat);
-
-  /* Parse the URL or use default values */
-  pn_url_t *url = urlstr ? pn_url_parse(urlstr) : NULL;
-  /* Listen on IPv6 wildcard. On systems that do not set IPV6ONLY by default,
-     this will also listen for mapped IPv4 on the same port.
-  */
-  const char *host = url ? pn_url_get_host(url) : "::";
-  const char *port = url ? pn_url_get_port(url) : "amqp";
-  pn_proactor_listen(b.proactor, pn_listener(), host, port, 16);
-  printf("listening on '%s:%s' %zd threads\n", host, port, b.threads);
-
-  if (url) pn_url_free(url);
-  if (b.threads <= 0) {
-    fprintf(stderr, "invalid value -t %zu, threads must be > 0\n", b.threads);
-    exit(1);
-  }
-  /* Start n-1 threads and use main thread */
-  uv_thread_t* threads = (uv_thread_t*)calloc(sizeof(uv_thread_t), b.threads);
-  for (size_t i = 0; i < b.threads-1; ++i) {
-    check(uv_thread_create(&threads[i], broker_thread, &b), "pthread_create");
-  }
-  broker_thread(&b);            /* Use the main thread too. */
-  for (size_t i = 0; i < b.threads-1; ++i) {
-    check(uv_thread_join(&threads[i]), "pthread_join");
-  }
-  pn_proactor_free(b.proactor);
-  free(threads);
-  return 0;
-}
diff --git a/examples/c/proactor/libuv_proactor.c b/examples/c/proactor/libuv_proactor.c
deleted file mode 100644
index 42bbfab..0000000
--- a/examples/c/proactor/libuv_proactor.c
+++ /dev/null
@@ -1,873 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <uv.h>
-
-#include <proton/condition.h>
-#include <proton/connection_driver.h>
-#include <proton/engine.h>
-#include <proton/message.h>
-#include <proton/object.h>
-#include <proton/proactor.h>
-#include <proton/transport.h>
-#include <proton/url.h>
-
-#include <assert.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/*
-  libuv loop functions are thread unsafe. The only exception is uv_async_send()
-  which is a thread safe "wakeup" that can wake the uv_loop from another thread.
-
-  To provide concurrency the proactor uses a "leader-worker-follower" model,
-  threads take turns at the roles:
-
-  - a single "leader" calls libuv functions and runs the uv_loop in short bursts
-    to generate work. When there is work available it gives up leadership and
-    becomes a "worker"
-
-  - "workers" handle events concurrently for distinct connections/listeners
-    They do as much work as they can get, when none is left they become "followers"
-
-  - "followers" wait for the leader to generate work and become workers.
-    When the leader itself becomes a worker, one of the followers takes over.
-
-  This model is symmetric: any thread can take on any role based on run-time
-  requirements. It also allows the IO and non-IO work associated with an IO
-  wake-up to be processed in a single thread with no context switches.
-
-  Function naming:
-  - on_ - called in leader thread via uv_run().
-  - leader_ - called in leader thread, while processing the leader_q.
-  - owner_ - called in owning thread, leader or worker but not concurrently.
-
-  Note on_ and leader_ functions can call each other, the prefix indicates the
-  path they are most often called on.
-*/
-
-const char *COND_NAME = "proactor";
-const char *AMQP_PORT = "5672";
-const char *AMQP_PORT_NAME = "amqp";
-const char *AMQPS_PORT = "5671";
-const char *AMQPS_PORT_NAME = "amqps";
-
-PN_HANDLE(PN_PROACTOR)
-
-/* pn_proactor_t and pn_listener_t are plain C structs with normal memory management.
-   Class definitions are for identification as pn_event_t context only.
-*/
-PN_STRUCT_CLASSDEF(pn_proactor, CID_pn_proactor)
-PN_STRUCT_CLASSDEF(pn_listener, CID_pn_listener)
-
-/* common to connection and listener */
-typedef struct psocket_t {
-  /* Immutable */
-  pn_proactor_t *proactor;
-
-  /* Protected by proactor.lock */
-  struct psocket_t* next;
-  void (*wakeup)(struct psocket_t*); /* interrupting action for leader */
-
-  /* Only used by leader */
-  uv_tcp_t tcp;
-  void (*action)(struct psocket_t*); /* deferred action for leader */
-  bool is_conn:1;
-  char host[NI_MAXHOST];
-  char port[NI_MAXSERV];
-} psocket_t;
-
-/* Special value for psocket.next pointer when socket is not on any any list. */
-psocket_t UNLISTED;
-
-static void psocket_init(psocket_t* ps, pn_proactor_t* p, bool is_conn, const char *host, const char *port) {
-  ps->proactor = p;
-  ps->next = &UNLISTED;
-  ps->is_conn = is_conn;
-  ps->tcp.data = ps;
-
-  /* For platforms that don't know about "amqp" and "amqps" service names. */
-  if (strcmp(port, AMQP_PORT_NAME) == 0)
-    port = AMQP_PORT;
-  else if (strcmp(port, AMQPS_PORT_NAME) == 0)
-    port = AMQPS_PORT;
-  /* Set to "\001" to indicate a NULL as opposed to an empty string "" */
-  strncpy(ps->host, host ? host : "\001", sizeof(ps->host));
-  strncpy(ps->port, port ? port : "\001", sizeof(ps->port));
-}
-
-/* Turn "\001" back to NULL */
-static inline const char* fixstr(const char* str) {
-  return str[0] == '\001' ? NULL : str;
-}
-
-typedef struct pconnection_t {
-  psocket_t psocket;
-
-  /* Only used by owner thread */
-  pn_connection_driver_t driver;
-
-  /* Only used by leader */
-  uv_connect_t connect;
-  uv_timer_t timer;
-  uv_write_t write;
-  uv_shutdown_t shutdown;
-  size_t writing;
-  bool reading:1;
-  bool server:1;                /* accept, not connect */
-} pconnection_t;
-
-struct pn_listener_t {
-  psocket_t psocket;
-
-  /* Only used by owner thread */
-  pconnection_t *accepting;     /* accept in progress */
-  pn_condition_t *condition;
-  pn_collector_t *collector;
-  pn_event_batch_t batch;
-  pn_record_t *attachments;
-  void *context;
-  size_t backlog;
-};
-
-
-typedef struct queue { psocket_t *front, *back; } queue;
-
-struct pn_proactor_t {
-  /* Leader thread  */
-  uv_cond_t cond;
-  uv_loop_t loop;
-  uv_async_t async;
-  uv_timer_t timer;
-
-  /* Owner thread: proactor collector and batch can belong to leader or a worker */
-  pn_collector_t *collector;
-  pn_event_batch_t batch;
-
-  /* Protected by lock */
-  uv_mutex_t lock;
-  queue start_q;
-  queue worker_q;
-  queue leader_q;
-  size_t interrupt;             /* pending interrupts */
-  pn_millis_t timeout;
-  size_t count;                 /* psocket count */
-  bool inactive:1;
-  bool timeout_request:1;
-  bool timeout_elapsed:1;
-  bool has_leader:1;
-  bool batch_working:1;          /* batch belongs to a worker.  */
-};
-
-static bool push_lh(queue *q, psocket_t *ps) {
-  if (ps->next != &UNLISTED)  /* Don't move if already listed. */
-    return false;
-  ps->next = NULL;
-  if (!q->front) {
-    q->front = q->back = ps;
-  } else {
-    q->back->next = ps;
-    q->back =  ps;
-  }
-  return true;
-}
-
-static psocket_t* pop_lh(queue *q) {
-  psocket_t *ps = q->front;
-  if (ps) {
-    q->front = ps->next;
-    ps->next = &UNLISTED;
-  }
-  return ps;
-}
-
-static inline pconnection_t *as_pconnection_t(psocket_t* ps) {
-  return ps->is_conn ? (pconnection_t*)ps : NULL;
-}
-
-static inline pn_listener_t *as_listener(psocket_t* ps) {
-  return ps->is_conn ? NULL: (pn_listener_t*)ps;
-}
-
-/* Put ps on the leader queue for processing. Thread safe. */
-static void to_leader_lh(psocket_t *ps) {
-  push_lh(&ps->proactor->leader_q, ps);
-  uv_async_send(&ps->proactor->async); /* Wake leader */
-}
-
-static void to_leader(psocket_t *ps) {
-  uv_mutex_lock(&ps->proactor->lock);
-  to_leader_lh(ps);
-  uv_mutex_unlock(&ps->proactor->lock);
-}
-
-/* Detach from IO and put ps on the worker queue */
-static void leader_to_worker(psocket_t *ps) {
-  if (ps->is_conn) {
-    pconnection_t *pc = as_pconnection_t(ps);
-    /* Don't detach if there are no events yet. */
-    if (pn_connection_driver_has_event(&pc->driver)) {
-      if (pc->writing) {
-        pc->writing  = 0;
-        uv_cancel((uv_req_t*)&pc->write);
-      }
-      if (pc->reading) {
-        pc->reading = false;
-        uv_read_stop((uv_stream_t*)&pc->psocket.tcp);
-      }
-      if (pc->timer.data && !uv_is_closing((uv_handle_t*)&pc->timer)) {
-        uv_timer_stop(&pc->timer);
-      }
-    }
-  } else {
-    pn_listener_t *l = as_listener(ps);
-    uv_read_stop((uv_stream_t*)&l->psocket.tcp);
-  }
-  uv_mutex_lock(&ps->proactor->lock);
-  push_lh(&ps->proactor->worker_q, ps);
-  uv_mutex_unlock(&ps->proactor->lock);
-}
-
-/* Set a deferred action for leader, if not already set. */
-static void owner_to_leader(psocket_t *ps, void (*action)(psocket_t*)) {
-  uv_mutex_lock(&ps->proactor->lock);
-  if (!ps->action) {
-    ps->action = action;
-  }
-  to_leader_lh(ps);
-  uv_mutex_unlock(&ps->proactor->lock);
-}
-
-/* Owner thread send to worker thread. Set deferred action if not already set. */
-static void owner_to_worker(psocket_t *ps, void (*action)(psocket_t*)) {
-  uv_mutex_lock(&ps->proactor->lock);
-  if (!ps->action) {
-    ps->action = action;
-  }
-  push_lh(&ps->proactor->worker_q, ps);
-  uv_async_send(&ps->proactor->async); /* Wake leader */
-  uv_mutex_unlock(&ps->proactor->lock);
-}
-
-
-/* Re-queue for further work */
-static void worker_requeue(psocket_t* ps) {
-  uv_mutex_lock(&ps->proactor->lock);
-  push_lh(&ps->proactor->worker_q, ps);
-  uv_async_send(&ps->proactor->async); /* Wake leader */
-  uv_mutex_unlock(&ps->proactor->lock);
-}
-
-static pconnection_t *new_pconnection_t(pn_proactor_t *p, pn_connection_t *c, bool server, const char *host, const char *port) {
-  pconnection_t *pc = (pconnection_t*)calloc(1, sizeof(*pc));
-  if (!pc) return NULL;
-  if (pn_connection_driver_init(&pc->driver, c, NULL) != 0) {
-    return NULL;
-  }
-  psocket_init(&pc->psocket, p,  true, host, port);
-  if (server) {
-    pn_transport_set_server(pc->driver.transport);
-  }
-  pn_record_t *r = pn_connection_attachments(pc->driver.connection);
-  pn_record_def(r, PN_PROACTOR, PN_VOID);
-  pn_record_set(r, PN_PROACTOR, pc);
-  return pc;
-}
-
-static pn_event_t *listener_batch_next(pn_event_batch_t *batch);
-static pn_event_t *proactor_batch_next(pn_event_batch_t *batch);
-
-static inline pn_proactor_t *batch_proactor(pn_event_batch_t *batch) {
-  return (batch->next_event == proactor_batch_next) ?
-    (pn_proactor_t*)((char*)batch - offsetof(pn_proactor_t, batch)) : NULL;
-}
-
-static inline pn_listener_t *batch_listener(pn_event_batch_t *batch) {
-  return (batch->next_event == listener_batch_next) ?
-    (pn_listener_t*)((char*)batch - offsetof(pn_listener_t, batch)) : NULL;
-}
-
-static inline pconnection_t *batch_pconnection(pn_event_batch_t *batch) {
-  pn_connection_driver_t *d = pn_event_batch_connection_driver(batch);
-  return d ? (pconnection_t*)((char*)d - offsetof(pconnection_t, driver)) : NULL;
-}
-
-static void leader_count(pn_proactor_t *p, int change) {
-  uv_mutex_lock(&p->lock);
-  p->count += change;
-  p->inactive = (p->count == 0);
-  uv_mutex_unlock(&p->lock);
-}
-
-/* Free if there are no uv callbacks pending and no events */
-static void leader_pconnection_t_maybe_free(pconnection_t *pc) {
-    if (pn_connection_driver_has_event(&pc->driver)) {
-      leader_to_worker(&pc->psocket);         /* Return to worker */
-    } else if (!(pc->psocket.tcp.data || pc->write.data || pc->shutdown.data || pc->timer.data)) {
-      /* All UV requests are finished */
-      pn_connection_driver_destroy(&pc->driver);
-      leader_count(pc->psocket.proactor, -1);
-      free(pc);
-    }
-}
-
-/* Free if there are no uv callbacks pending and no events */
-static void leader_listener_maybe_free(pn_listener_t *l) {
-    if (pn_collector_peek(l->collector)) {
-      leader_to_worker(&l->psocket);         /* Return to worker */
-    } else if (!l->psocket.tcp.data) {
-      pn_condition_free(l->condition);
-      leader_count(l->psocket.proactor, -1);
-      free(l);
-    }
-}
-
-/* Free if there are no uv callbacks pending and no events */
-static void leader_maybe_free(psocket_t *ps) {
-  if (ps->is_conn) {
-    leader_pconnection_t_maybe_free(as_pconnection_t(ps));
-  } else {
-    leader_listener_maybe_free(as_listener(ps));
-  }
-}
-
-static void on_close(uv_handle_t *h) {
-  psocket_t *ps = (psocket_t*)h->data;
-  h->data = NULL;               /* Mark closed */
-  leader_maybe_free(ps);
-}
-
-static void on_shutdown(uv_shutdown_t *shutdown, int err) {
-  psocket_t *ps = (psocket_t*)shutdown->data;
-  shutdown->data = NULL;        /* Mark closed */
-  leader_maybe_free(ps);
-}
-
-static inline void leader_close(psocket_t *ps) {
-  if (ps->tcp.data && !uv_is_closing((uv_handle_t*)&ps->tcp)) {
-    uv_close((uv_handle_t*)&ps->tcp, on_close);
-  }
-  pconnection_t *pc = as_pconnection_t(ps);
-  if (pc) {
-    pn_connection_driver_close(&pc->driver);
-    if (pc->timer.data && !uv_is_closing((uv_handle_t*)&pc->timer)) {
-      uv_timer_stop(&pc->timer);
-      uv_close((uv_handle_t*)&pc->timer, on_close);
-    }
-  }
-  leader_maybe_free(ps);
-}
-
-static pconnection_t *get_pconnection_t(pn_connection_t* c) {
-  if (!c) return NULL;
-  pn_record_t *r = pn_connection_attachments(c);
-  return (pconnection_t*) pn_record_get(r, PN_PROACTOR);
-}
-
-static void leader_error(psocket_t *ps, int err, const char* what) {
-  if (ps->is_conn) {
-    pn_connection_driver_t *driver = &as_pconnection_t(ps)->driver;
-    pn_connection_driver_bind(driver); /* Bind so errors will be reported */
-    pn_connection_driver_errorf(driver, COND_NAME, "%s %s:%s: %s",
-                                what, fixstr(ps->host), fixstr(ps->port),
-                                uv_strerror(err));
-    pn_connection_driver_close(driver);
-  } else {
-    pn_listener_t *l = as_listener(ps);
-    pn_condition_format(l->condition, COND_NAME, "%s %s:%s: %s",
-                        what, fixstr(ps->host), fixstr(ps->port),
-                        uv_strerror(err));
-    pn_collector_put(l->collector, pn_listener__class(), l, PN_LISTENER_CLOSE);
-  }
-  leader_to_worker(ps);               /* Worker to handle the error */
-}
-
-/* uv-initialization */
-static int leader_init(psocket_t *ps) {
-  leader_count(ps->proactor, +1);
-  int err = uv_tcp_init(&ps->proactor->loop, &ps->tcp);
-  if (!err) {
-    pconnection_t *pc = as_pconnection_t(ps);
-    if (pc) {
-      pc->connect.data = ps;
-      int err = uv_timer_init(&ps->proactor->loop, &pc->timer);
-      if (!err) {
-        pc->timer.data = pc;
-      }
-    }
-  }
-  if (err) {
-    leader_error(ps, err, "initialization");
-  }
-  return err;
-}
-
-/* Common logic for on_connect and on_accept */
-static void leader_connect_accept(pconnection_t *pc, int err, const char *what) {
-  if (!err) {
-    leader_to_worker(&pc->psocket);
-  } else {
-    leader_error(&pc->psocket, err, what);
-  }
-}
-
-static void on_connect(uv_connect_t *connect, int err) {
-  leader_connect_accept((pconnection_t*)connect->data, err, "on connect");
-}
-
-static void on_accept(uv_stream_t* server, int err) {
-  pn_listener_t *l = (pn_listener_t*) server->data;
-  if (err) {
-    leader_error(&l->psocket, err, "on accept");
-  }
-  pn_collector_put(l->collector, pn_listener__class(), l, PN_LISTENER_ACCEPT);
-  leader_to_worker(&l->psocket); /* Let user call pn_listener_accept */
-}
-
-static void leader_accept(psocket_t *ps) {
-  pn_listener_t * l = as_listener(ps);
-  pconnection_t *pc = l->accepting;
-  l->accepting = NULL;
-  if (pc) {
-    int err = leader_init(&pc->psocket);
-    if (!err) err = uv_accept((uv_stream_t*)&l->psocket.tcp, (uv_stream_t*)&pc->psocket.tcp);
-    leader_connect_accept(pc, err, "on accept");
-  }
-}
-
-static int leader_resolve(psocket_t *ps, uv_getaddrinfo_t *info, bool server) {
-  int err = leader_init(ps);
-  struct addrinfo hints = { 0 };
-  if (server) hints.ai_flags = AI_PASSIVE;
-  if (!err) {
-    err = uv_getaddrinfo(&ps->proactor->loop, info, NULL, fixstr(ps->host), fixstr(ps->port), &hints);
-  }
-  return err;
-}
-
-static void leader_connect(psocket_t *ps) {
-  pconnection_t *pc = as_pconnection_t(ps);
-  uv_getaddrinfo_t info;
-  int err = leader_resolve(ps, &info, false);
-  if (!err) {
-    err = uv_tcp_connect(&pc->connect, &pc->psocket.tcp, info.addrinfo->ai_addr, on_connect);
-    uv_freeaddrinfo(info.addrinfo);
-  }
-  if (err) {
-    leader_error(ps, err, "connect to");
-  }
-}
-
-static void leader_listen(psocket_t *ps) {
-  pn_listener_t *l = as_listener(ps);
-   uv_getaddrinfo_t info;
-  int err = leader_resolve(ps, &info, true);
-  if (!err) {
-    err = uv_tcp_bind(&l->psocket.tcp, info.addrinfo->ai_addr, 0);
-    uv_freeaddrinfo(info.addrinfo);
-  }
-  if (!err) err = uv_listen((uv_stream_t*)&l->psocket.tcp, l->backlog, on_accept);
-  if (err) {
-    leader_error(ps, err, "listen on ");
-  }
-}
-
-static void on_tick(uv_timer_t *timer) {
-  pconnection_t *pc = (pconnection_t*)timer->data;
-  pn_transport_t *t = pc->driver.transport;
-  if (pn_transport_get_idle_timeout(t) || pn_transport_get_remote_idle_timeout(t)) {
-    uv_timer_stop(&pc->timer);
-    uint64_t now = uv_now(pc->timer.loop);
-    uint64_t next = pn_transport_tick(t, now);
-    if (next) {
-      uv_timer_start(&pc->timer, on_tick, next - now, 0);
-    }
-  }
-}
-
-static void on_read(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) {
-  pconnection_t *pc = (pconnection_t*)stream->data;
-  if (nread >= 0) {
-    pn_connection_driver_read_done(&pc->driver, nread);
-    on_tick(&pc->timer);         /* check for tick changes. */
-    leader_to_worker(&pc->psocket);
-    /* Reading continues automatically until stopped. */
-  } else if (nread == UV_EOF) { /* hangup */
-    pn_connection_driver_read_close(&pc->driver);
-    leader_maybe_free(&pc->psocket);
-  } else {
-    leader_error(&pc->psocket, nread, "on read from");
-  }
-}
-
-static void on_write(uv_write_t* write, int err) {
-  pconnection_t *pc = (pconnection_t*)write->data;
-  write->data = NULL;
-  if (err == 0) {
-    pn_connection_driver_write_done(&pc->driver, pc->writing);
-    leader_to_worker(&pc->psocket);
-  } else if (err == UV_ECANCELED) {
-    leader_maybe_free(&pc->psocket);
-  } else {
-    leader_error(&pc->psocket, err, "on write to");
-  }
-  pc->writing = 0;              /* Need to send a new write request */
-}
-
-static void on_timeout(uv_timer_t *timer) {
-  pn_proactor_t *p = (pn_proactor_t*)timer->data;
-  uv_mutex_lock(&p->lock);
-  p->timeout_elapsed = true;
-  uv_mutex_unlock(&p->lock);
-}
-
-// Read buffer allocation function for uv, just returns the transports read buffer.
-static void alloc_read_buffer(uv_handle_t* stream, size_t size, uv_buf_t* buf) {
-  pconnection_t *pc = (pconnection_t*)stream->data;
-  pn_rwbytes_t rbuf = pn_connection_driver_read_buffer(&pc->driver);
-  *buf = uv_buf_init(rbuf.start, rbuf.size);
-}
-
-static void leader_rewatch(psocket_t *ps) {
-  int err = 0;
-  if (ps->is_conn) {
-    pconnection_t *pc = as_pconnection_t(ps);
-    if (pc->timer.data) {         /* uv-initialized */
-      on_tick(&pc->timer);        /* Re-enable ticks if required */
-    }
-    pn_rwbytes_t rbuf = pn_connection_driver_read_buffer(&pc->driver);
-    pn_bytes_t wbuf = pn_connection_driver_write_buffer(&pc->driver);
-
-    /* Ticks and checking buffers can generate events, process before proceeding */
-    if (pn_connection_driver_has_event(&pc->driver)) {
-      leader_to_worker(ps);
-    } else {                      /* Re-watch for IO */
-      if (wbuf.size > 0 && !pc->writing) {
-        pc->writing = wbuf.size;
-        uv_buf_t buf = uv_buf_init((char*)wbuf.start, wbuf.size);
-        pc->write.data = ps;
-        uv_write(&pc->write, (uv_stream_t*)&pc->psocket.tcp, &buf, 1, on_write);
-      } else if (wbuf.size == 0 && pn_connection_driver_write_closed(&pc->driver)) {
-        pc->shutdown.data = ps;
-        uv_shutdown(&pc->shutdown, (uv_stream_t*)&pc->psocket.tcp, on_shutdown);
-      }
-      if (rbuf.size > 0 && !pc->reading) {
-        pc->reading = true;
-        err = uv_read_start((uv_stream_t*)&pc->psocket.tcp, alloc_read_buffer, on_read);
-      }
-    }
-  } else {
-    pn_listener_t *l = as_listener(ps);
-    err = uv_listen((uv_stream_t*)&l->psocket.tcp, l->backlog, on_accept);
-  }
-  if (err) {
-    leader_error(ps, err, "rewatch");
-  }
-}
-
-/* Set the event in the proactor's batch  */
-static pn_event_batch_t *proactor_batch_lh(pn_proactor_t *p, pn_event_type_t t) {
-  pn_collector_put(p->collector, pn_proactor__class(), p, t);
-  p->batch_working = true;
-  return &p->batch;
-}
-
-/* Return the next event batch or 0 if no events are ready */
-static pn_event_batch_t* get_batch_lh(pn_proactor_t *p) {
-  if (!p->batch_working) {       /* Can generate proactor events */
-    if (p->inactive) {
-      p->inactive = false;
-      return proactor_batch_lh(p, PN_PROACTOR_INACTIVE);
-    }
-    if (p->interrupt > 0) {
-      --p->interrupt;
-      return proactor_batch_lh(p, PN_PROACTOR_INTERRUPT);
-    }
-    if (p->timeout_elapsed) {
-      p->timeout_elapsed = false;
-      return proactor_batch_lh(p, PN_PROACTOR_TIMEOUT);
-    }
-  }
-  for (psocket_t *ps = pop_lh(&p->worker_q); ps; ps = pop_lh(&p->worker_q)) {
-    if (ps->is_conn) {
-      pconnection_t *pc = as_pconnection_t(ps);
-      return &pc->driver.batch;
-    } else {                    /* Listener */
-      pn_listener_t *l = as_listener(ps);
-      return &l->batch;
-    }
-    to_leader(ps);      /* No event, back to leader */
-  }
-  return 0;
-}
-
-/* Called in any thread to set a wakeup action. Replaces any previous wakeup action. */
-static void wakeup(psocket_t *ps, void (*action)(psocket_t*)) {
-  uv_mutex_lock(&ps->proactor->lock);
-  ps->wakeup = action;
-  to_leader_lh(ps);
-  uv_mutex_unlock(&ps->proactor->lock);
-}
-
-pn_listener_t *pn_event_listener(pn_event_t *e) {
-  return (pn_event_class(e) == pn_listener__class()) ? (pn_listener_t*)pn_event_context(e) : NULL;
-}
-
-pn_proactor_t *pn_event_proactor(pn_event_t *e) {
-  if (pn_event_class(e) == pn_proactor__class()) return (pn_proactor_t*)pn_event_context(e);
-  pn_listener_t *l = pn_event_listener(e);
-  if (l) return l->psocket.proactor;
-  pn_connection_t *c = pn_event_connection(e);
-  if (c) return pn_connection_proactor(pn_event_connection(e));
-  return NULL;
-}
-
-void pn_proactor_done(pn_proactor_t *p, pn_event_batch_t *batch) {
-  pconnection_t *pc = batch_pconnection(batch);
-  if (pc) {
-    if (pn_connection_driver_has_event(&pc->driver)) {
-      /* Process all events before going back to IO. */
-      worker_requeue(&pc->psocket);
-    } else if (pn_connection_driver_finished(&pc->driver)) {
-      owner_to_leader(&pc->psocket, leader_close);
-    } else {
-      owner_to_leader(&pc->psocket, leader_rewatch);
-    }
-    return;
-  }
-  pn_listener_t *l = batch_listener(batch);
-  if (l) {
-    owner_to_leader(&l->psocket, leader_rewatch);
-    return;
-  }
-  pn_proactor_t *bp = batch_proactor(batch);
-  if (bp == p) {
-    uv_mutex_lock(&p->lock);
-    p->batch_working = false;
-    uv_async_send(&p->async); /* Wake leader */
-    uv_mutex_unlock(&p->lock);
-    return;
-  }
-}
-
-/* Run follower/leader loop till we can return an event and be a worker */
-pn_event_batch_t *pn_proactor_wait(struct pn_proactor_t* p) {
-  uv_mutex_lock(&p->lock);
-  /* Try to grab work immediately. */
-  pn_event_batch_t *batch = get_batch_lh(p);
-  if (batch == NULL) {
-    /* No work available, follow the leader */
-    while (p->has_leader) {
-      uv_cond_wait(&p->cond, &p->lock);
-    }
-    /* Lead till there is work to do. */
-    p->has_leader = true;
-    while (batch == NULL) {
-      if (p->timeout_request) {
-        p->timeout_request = false;
-        if (p->timeout) {
-          uv_timer_start(&p->timer, on_timeout, p->timeout, 0);
-        } else {
-          uv_timer_stop(&p->timer);
-        }
-      }
-      for (psocket_t *ps = pop_lh(&p->leader_q); ps; ps = pop_lh(&p->leader_q)) {
-        void (*action)(psocket_t*) = ps->action;
-        void (*wakeup)(psocket_t*) = ps->wakeup;
-        ps->action = NULL;
-        ps->wakeup = NULL;
-        if (action || wakeup) {
-          uv_mutex_unlock(&p->lock);
-          if (action) action(ps);
-          if (wakeup) wakeup(ps);
-          uv_mutex_lock(&p->lock);
-        }
-      }
-      batch = get_batch_lh(p);
-      if (batch == NULL) {
-        uv_mutex_unlock(&p->lock);
-        uv_run(&p->loop, UV_RUN_ONCE);
-        uv_mutex_lock(&p->lock);
-      }
-    }
-    /* Signal the next leader and return to work */
-    p->has_leader = false;
-    uv_cond_signal(&p->cond);
-  }
-  uv_mutex_unlock(&p->lock);
-  return batch;
-}
-
-void pn_proactor_interrupt(pn_proactor_t *p) {
-  uv_mutex_lock(&p->lock);
-  ++p->interrupt;
-  uv_async_send(&p->async);   /* Interrupt the UV loop */
-  uv_mutex_unlock(&p->lock);
-}
-
-void pn_proactor_set_timeout(pn_proactor_t *p, pn_millis_t t) {
-  uv_mutex_lock(&p->lock);
-  p->timeout = t;
-  p->timeout_request = true;
-  uv_async_send(&p->async);   /* Interrupt the UV loop */
-  uv_mutex_unlock(&p->lock);
-}
-
-int pn_proactor_connect(pn_proactor_t *p, pn_connection_t *c, const char *host, const char *port) {
-  pconnection_t *pc = new_pconnection_t(p, c, false, host, port);
-  if (!pc) {
-    return PN_OUT_OF_MEMORY;
-  }
-  /* Process PN_CONNECTION_INIT before binding */
-  owner_to_worker(&pc->psocket, leader_connect);
-  return 0;
-}
-
-int pn_proactor_listen(pn_proactor_t *p, pn_listener_t *l, const char *host, const char *port, int backlog)
-{
-  psocket_init(&l->psocket, p, false, host, port);
-  l->backlog = backlog;
-  owner_to_leader(&l->psocket, leader_listen);
-  return 0;
-}
-
-pn_proactor_t *pn_connection_proactor(pn_connection_t* c) {
-  pconnection_t *pc = get_pconnection_t(c);
-  return pc ? pc->psocket.proactor : NULL;
-}
-
-void leader_wake_connection(psocket_t *ps) {
-  pconnection_t *pc = as_pconnection_t(ps);
-  pn_connection_t *c = pc->driver.connection;
-  pn_collector_put(pn_connection_collector(c), PN_OBJECT, c, PN_CONNECTION_WAKE);
-  leader_to_worker(ps);
-}
-
-void pn_connection_wake(pn_connection_t* c) {
-  wakeup(&get_pconnection_t(c)->psocket, leader_wake_connection);
-}
-
-pn_proactor_t *pn_proactor() {
-  pn_proactor_t *p = (pn_proactor_t*)calloc(1, sizeof(*p));
-  p->collector = pn_collector();
-  p->batch.next_event = &proactor_batch_next;
-  if (!p->collector) return NULL;
-  uv_loop_init(&p->loop);
-  uv_mutex_init(&p->lock);
-  uv_cond_init(&p->cond);
-  uv_async_init(&p->loop, &p->async, NULL);
-  uv_timer_init(&p->loop, &p->timer); /* Just wake the loop */
-  p->timer.data = p;
-  return p;
-}
-
-static void on_stopping(uv_handle_t* h, void* v) {
-  uv_close(h, NULL);           /* Close this handle */
-  if (!uv_loop_alive(h->loop)) /* Everything closed */
-    uv_stop(h->loop);        /* Stop the loop, pn_proactor_destroy() can return */
-}
-
-void pn_proactor_free(pn_proactor_t *p) {
-  uv_walk(&p->loop, on_stopping, NULL); /* Close all handles */
-  uv_run(&p->loop, UV_RUN_DEFAULT);     /* Run till stop, all handles closed */
-  uv_loop_close(&p->loop);
-  uv_mutex_destroy(&p->lock);
-  uv_cond_destroy(&p->cond);
-  pn_collector_free(p->collector);
-  free(p);
-}
-
-static pn_event_t *listener_batch_next(pn_event_batch_t *batch) {
-  pn_listener_t *l = batch_listener(batch);
-  pn_event_t *handled = pn_collector_prev(l->collector);
-  if (handled && pn_event_type(handled) == PN_LISTENER_CLOSE) {
-    owner_to_leader(&l->psocket, leader_close); /* Close event handled, do close */
-  }
-  return pn_collector_next(l->collector);
-}
-
-static pn_event_t *proactor_batch_next(pn_event_batch_t *batch) {
-  return pn_collector_next(batch_proactor(batch)->collector);
-}
-
-static void pn_listener_free(pn_listener_t *l) {
-  if (l) {
-    if (!l->collector) pn_collector_free(l->collector);
-    if (!l->condition) pn_condition_free(l->condition);
-    if (!l->attachments) pn_free(l->attachments);
-    free(l);
-  }
-}
-
-pn_listener_t *pn_listener() {
-  pn_listener_t *l = (pn_listener_t*)calloc(1, sizeof(pn_listener_t));
-  if (l) {
-    l->batch.next_event = listener_batch_next;
-    l->collector = pn_collector();
-    l->condition = pn_condition();
-    l->attachments = pn_record();
-    if (!l->condition || !l->collector || !l->attachments) {
-      pn_listener_free(l);
-      return NULL;
-    }
-  }
-  return l;
-}
-
-void pn_listener_close(pn_listener_t* l) {
-  wakeup(&l->psocket, leader_close);
-}
-
-pn_proactor_t *pn_listener_proactor(pn_listener_t* l) {
-  return l ? l->psocket.proactor : NULL;
-}
-
-pn_condition_t* pn_listener_condition(pn_listener_t* l) {
-  return l->condition;
-}
-
-void *pn_listener_get_context(pn_listener_t *l) {
-  return l->context;
-}
-
-void pn_listener_set_context(pn_listener_t *l, void *context) {
-  l->context = context;
-}
-
-pn_record_t *pn_listener_attachments(pn_listener_t *l) {
-  return l->attachments;
-}
-
-int pn_listener_accept(pn_listener_t *l, pn_connection_t *c) {
-  if (l->accepting) {
-    return PN_STATE_ERR;        /* Only one at a time */
-  }
-  l->accepting = new_pconnection_t(
-      l->psocket.proactor, c, true, l->psocket.host, l->psocket.port);
-  if (!l->accepting) {
-    return UV_ENOMEM;
-  }
-  owner_to_leader(&l->psocket, leader_accept);
-  return 0;
-}
-
diff --git a/examples/c/proactor/receive.c b/examples/c/proactor/receive.c
deleted file mode 100644
index b8edcd6..0000000
--- a/examples/c/proactor/receive.c
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/connection.h>
-#include <proton/connection_driver.h>
-#include <proton/delivery.h>
-#include <proton/proactor.h>
-#include <proton/link.h>
-#include <proton/message.h>
-#include <proton/session.h>
-#include <proton/transport.h>
-#include <proton/url.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-typedef char str[1024];
-
-typedef struct app_data_t {
-  str address;
-  str container_id;
-  pn_rwbytes_t message_buffer;
-  int message_count;
-  int received;
-  pn_proactor_t *proactor;
-  bool finished;
-} app_data_t;
-
-static const int BATCH = 100; /* Batch size for unlimited receive */
-
-static int exit_code = 0;
-
-static void check_condition(pn_event_t *e, pn_condition_t *cond) {
-  if (pn_condition_is_set(cond)) {
-    exit_code = 1;
-    fprintf(stderr, "%s: %s: %s\n", pn_event_type_name(pn_event_type(e)),
-            pn_condition_get_name(cond), pn_condition_get_description(cond));
-  }
-}
-
-#define MAX_SIZE 1024
-
-static void decode_message(pn_delivery_t *dlv) {
-  static char buffer[MAX_SIZE];
-  ssize_t len;
-  // try to decode the message body
-  if (pn_delivery_pending(dlv) < MAX_SIZE) {
-    // read in the raw data
-    len = pn_link_recv(pn_delivery_link(dlv), buffer, MAX_SIZE);
-    if (len > 0) {
-      // decode it into a proton message
-      pn_message_t *m = pn_message();
-      if (PN_OK == pn_message_decode(m, buffer, len)) {
-        pn_string_t *s = pn_string(NULL);
-        pn_inspect(pn_message_body(m), s);
-        printf("%s\n", pn_string_get(s));
-        pn_free(s);
-      }
-      pn_message_free(m);
-    }
-  }
-}
-
-static void handle(app_data_t* app, pn_event_t* event) {
-  switch (pn_event_type(event)) {
-
-   case PN_CONNECTION_INIT: {
-     pn_connection_t* c = pn_event_connection(event);
-     pn_connection_set_container(c, app->container_id);
-     pn_connection_open(c);
-     pn_session_t* s = pn_session(c);
-     pn_session_open(s);
-     pn_link_t* l = pn_receiver(s, "my_receiver");
-     pn_terminus_set_address(pn_link_source(l), app->address);
-     pn_link_open(l);
-     /* cannot receive without granting credit: */
-     pn_link_flow(l, app->message_count ? app->message_count : BATCH);
-   } break;
-
-   case PN_DELIVERY: {
-     /* A message has been received */
-     pn_link_t *link = NULL;
-     pn_delivery_t *dlv = pn_event_delivery(event);
-     if (pn_delivery_readable(dlv) && !pn_delivery_partial(dlv)) {
-       link = pn_delivery_link(dlv);
-       decode_message(dlv);
-       /* Accept the delivery */
-       pn_delivery_update(dlv, PN_ACCEPTED);
-       /* done with the delivery, move to the next and free it */
-       pn_link_advance(link);
-       pn_delivery_settle(dlv);  /* dlv is now freed */
-
-       if (app->message_count == 0) {
-         /* receive forever - see if more credit is needed */
-         if (pn_link_credit(link) < BATCH/2) {
-           /* Grant enough credit to bring it up to BATCH: */
-           pn_link_flow(link, BATCH - pn_link_credit(link));
-         }
-       } else if (++app->received >= app->message_count) {
-         /* done receiving, close the endpoints */
-         printf("%d messages received\n", app->received);
-         pn_session_t *ssn = pn_link_session(link);
-         pn_link_close(link);
-         pn_session_close(ssn);
-         pn_connection_close(pn_session_connection(ssn));
-       }
-     }
-   } break;
-
-   case PN_TRANSPORT_ERROR:
-    check_condition(event, pn_transport_condition(pn_event_transport(event)));
-    break;
-
-   case PN_CONNECTION_REMOTE_CLOSE:
-    check_condition(event, pn_connection_remote_condition(pn_event_connection(event)));
-    pn_connection_close(pn_event_connection(event));
-    break;
-
-   case PN_SESSION_REMOTE_CLOSE:
-    check_condition(event, pn_session_remote_condition(pn_event_session(event)));
-    pn_connection_close(pn_event_connection(event));
-    break;
-
-   case PN_LINK_REMOTE_CLOSE:
-   case PN_LINK_REMOTE_DETACH:
-    check_condition(event, pn_link_remote_condition(pn_event_link(event)));
-    pn_connection_close(pn_event_connection(event));
-    break;
-
-   case PN_PROACTOR_INACTIVE:
-    app->finished = true;
-    break;
-
-   default: break;
-  }
-}
-
-static void usage(const char *arg0) {
-  fprintf(stderr, "Usage: %s [-a url] [-m message-count]\n", arg0);
-  exit(1);
-}
-
-int main(int argc, char **argv) {
-  /* Default values for application and connection. */
-  app_data_t app = {{0}};
-  app.message_count = 100;
-  const char* urlstr = NULL;
-
-  int opt;
-  while((opt = getopt(argc, argv, "a:m:")) != -1) {
-    switch(opt) {
-     case 'a': urlstr = optarg; break;
-     case 'm': app.message_count = atoi(optarg); break;
-     default: usage(argv[0]); break;
-    }
-  }
-  if (optind < argc)
-    usage(argv[0]);
-
-  snprintf(app.container_id, sizeof(app.container_id), "%s:%d", argv[0], getpid());
-
-  /* Parse the URL or use default values */
-  pn_url_t *url = urlstr ? pn_url_parse(urlstr) : NULL;
-  const char *host = url ? pn_url_get_host(url) : NULL;
-  const char *port = url ? pn_url_get_port(url) : "amqp";
-  strncpy(app.address, (url && pn_url_get_path(url)) ? pn_url_get_path(url) : "example", sizeof(app.address));
-
-  /* Create the proactor and connect */
-  app.proactor = pn_proactor();
-  pn_proactor_connect(app.proactor, pn_connection(), host, port);
-  if (url) pn_url_free(url);
-
-  do {
-    pn_event_batch_t *events = pn_proactor_wait(app.proactor);
-    pn_event_t *e;
-    while ((e = pn_event_batch_next(events))) {
-      handle(&app, e);
-    }
-    pn_proactor_done(app.proactor, events);
-  } while(!app.finished);
-
-  pn_proactor_free(app.proactor);
-  free(app.message_buffer.start);
-  return exit_code;
-}
diff --git a/examples/c/proactor/send.c b/examples/c/proactor/send.c
deleted file mode 100644
index d611b3d..0000000
--- a/examples/c/proactor/send.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/connection.h>
-#include <proton/connection_driver.h>
-#include <proton/delivery.h>
-#include <proton/proactor.h>
-#include <proton/link.h>
-#include <proton/message.h>
-#include <proton/session.h>
-#include <proton/transport.h>
-#include <proton/url.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-typedef char str[1024];
-
-typedef struct app_data_t {
-  str address;
-  str container_id;
-  pn_rwbytes_t message_buffer;
-  int message_count;
-  int sent;
-  int acknowledged;
-  pn_proactor_t *proactor;
-  pn_millis_t delay;
-  bool delaying;
-  pn_link_t *sender;
-  bool finished;
-} app_data_t;
-
-int exit_code = 0;
-
-static void check_condition(pn_event_t *e, pn_condition_t *cond) {
-  if (pn_condition_is_set(cond)) {
-    exit_code = 1;
-    fprintf(stderr, "%s: %s: %s\n", pn_event_type_name(pn_event_type(e)),
-            pn_condition_get_name(cond), pn_condition_get_description(cond));
-  }
-}
-
-/* Create a message with a map { "sequence" : number } encode it and return the encoded buffer. */
-static pn_bytes_t encode_message(app_data_t* app) {
-  /* Construct a message with the map { "sequence": app.sent } */
-  pn_message_t* message = pn_message();
-  pn_data_put_int(pn_message_id(message), app->sent); /* Set the message_id also */
-  pn_data_t* body = pn_message_body(message);
-  pn_data_put_map(body);
-  pn_data_enter(body);
-  pn_data_put_string(body, pn_bytes(sizeof("sequence")-1, "sequence"));
-  pn_data_put_int(body, app->sent); /* The sequence number */
-  pn_data_exit(body);
-
-  /* encode the message, expanding the encode buffer as needed */
-  if (app->message_buffer.start == NULL) {
-    static const size_t initial_size = 128;
-    app->message_buffer = pn_rwbytes(initial_size, (char*)malloc(initial_size));
-  }
-  /* app->message_buffer is the total buffer space available. */
-  /* mbuf wil point at just the portion used by the encoded message */
-  pn_rwbytes_t mbuf = pn_rwbytes(app->message_buffer.size, app->message_buffer.start);
-  int status = 0;
-  while ((status = pn_message_encode(message, mbuf.start, &mbuf.size)) == PN_OVERFLOW) {
-    app->message_buffer.size *= 2;
-    app->message_buffer.start = (char*)realloc(app->message_buffer.start, app->message_buffer.size);
-    mbuf.size = app->message_buffer.size;
-  }
-  if (status != 0) {
-    fprintf(stderr, "error encoding message: %s\n", pn_error_text(pn_message_error(message)));
-    exit(1);
-  }
-  pn_message_free(message);
-  return pn_bytes(mbuf.size, mbuf.start);
-}
-
-static void send(app_data_t* app) {
-  while (pn_link_credit(app->sender) > 0 && app->sent < app->message_count) {
-    ++app->sent;
-    // Use sent counter bytes as unique delivery tag.
-    pn_delivery(app->sender, pn_dtag((const char *)&app->sent, sizeof(app->sent)));
-    pn_bytes_t msgbuf = encode_message(app);
-    pn_link_send(app->sender, msgbuf.start, msgbuf.size);
-    pn_link_advance(app->sender);
-    if (app->delay && app->sent < app->message_count) {
-      /* If delay is set, wait for TIMEOUT event to send more */
-      app->delaying = true;
-      pn_proactor_set_timeout(app->proactor, app->delay);
-      break;
-    }
-  }
-}
-
-static void handle(app_data_t* app, pn_event_t* event) {
-  switch (pn_event_type(event)) {
-
-   case PN_CONNECTION_INIT: {
-     pn_connection_t* c = pn_event_connection(event);
-     pn_connection_set_container(c, app->container_id);
-     pn_connection_open(c);
-     pn_session_t* s = pn_session(c);
-     pn_session_open(s);
-     pn_link_t* l = pn_sender(s, "my_sender");
-     pn_terminus_set_address(pn_link_target(l), app->address);
-     pn_link_open(l);
-   } break;
-
-   case PN_LINK_FLOW:
-    /* The peer has given us some credit, now we can send messages */
-    if (!app->delaying) {
-      app->sender = pn_event_link(event);
-      send(app);
-    }
-    break;
-
-   case PN_PROACTOR_TIMEOUT:
-    /* Wake the sender's connection */
-    pn_connection_wake(pn_session_connection(pn_link_session(app->sender)));
-    break;
-
-   case PN_CONNECTION_WAKE:
-    /* Timeout, we can send more. */
-    app->delaying = false;
-    send(app);
-    break;
-
-   case PN_DELIVERY: {
-     /* We received acknowledgedment from the peer that a message was delivered. */
-     pn_delivery_t* d = pn_event_delivery(event);
-     if (pn_delivery_remote_state(d) == PN_ACCEPTED) {
-       if (++app->acknowledged == app->message_count) {
-         printf("%d messages sent and acknowledged\n", app->acknowledged);
-         pn_connection_close(pn_event_connection(event));
-       }
-     }
-   } break;
-
-   case PN_TRANSPORT_CLOSED:
-    check_condition(event, pn_transport_condition(pn_event_transport(event)));
-    break;
-
-   case PN_CONNECTION_REMOTE_CLOSE:
-    check_condition(event, pn_connection_remote_condition(pn_event_connection(event)));
-    pn_connection_close(pn_event_connection(event));
-    break;
-
-   case PN_SESSION_REMOTE_CLOSE:
-    check_condition(event, pn_session_remote_condition(pn_event_session(event)));
-    pn_connection_close(pn_event_connection(event));
-    break;
-
-   case PN_LINK_REMOTE_CLOSE:
-   case PN_LINK_REMOTE_DETACH:
-    check_condition(event, pn_link_remote_condition(pn_event_link(event)));
-    pn_connection_close(pn_event_connection(event));
-    break;
-
-   case PN_PROACTOR_INACTIVE:
-    app->finished = true;
-    break;
-
-   default: break;
-  }
-}
-
-static void usage(const char *arg0) {
-  fprintf(stderr, "Usage: %s [-a url] [-m message-count] [-d delay-ms]\n", arg0);
-  exit(1);
-}
-
-int main(int argc, char **argv) {
-  /* Default values for application and connection. */
-  app_data_t app = {{0}};
-  app.message_count = 100;
-  const char* urlstr = NULL;
-
-  int opt;
-  while((opt = getopt(argc, argv, "a:m:d:")) != -1) {
-    switch(opt) {
-     case 'a': urlstr = optarg; break;
-     case 'm': app.message_count = atoi(optarg); break;
-     case 'd': app.delay = atoi(optarg); break;
-     default: usage(argv[0]); break;
-    }
-  }
-  if (optind < argc)
-    usage(argv[0]);
-
-  snprintf(app.container_id, sizeof(app.container_id), "%s:%d", argv[0], getpid());
-
-  /* Parse the URL or use default values */
-  pn_url_t *url = urlstr ? pn_url_parse(urlstr) : NULL;
-  const char *host = url ? pn_url_get_host(url) : NULL;
-  const char *port = url ? pn_url_get_port(url) : "amqp";
-  strncpy(app.address, (url && pn_url_get_path(url)) ? pn_url_get_path(url) : "example", sizeof(app.address));
-
-  /* Create the proactor and connect */
-  app.proactor = pn_proactor();
-  pn_proactor_connect(app.proactor, pn_connection(), host, port);
-  if (url) pn_url_free(url);
-
-  do {
-    pn_event_batch_t *events = pn_proactor_wait(app.proactor);
-    pn_event_t *e;
-    while ((e = pn_event_batch_next(events))) {
-      handle(&app, e);
-    }
-    pn_proactor_done(app.proactor, events);
-  } while(!app.finished);
-
-  pn_proactor_free(app.proactor);
-  free(app.message_buffer.start);
-  return exit_code;
-}
diff --git a/examples/c/proactor/test.py b/examples/c/proactor/test.py
deleted file mode 100644
index a86425d..0000000
--- a/examples/c/proactor/test.py
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License
-#
-
-# This is a test script to run the examples and verify that they behave as expected.
-
-from exampletest import *
-
-import unittest
-import sys
-
-def python_cmd(name):
-    dir = os.path.dirname(__file__)
-    return [sys.executable, os.path.join(dir, "..", "..", "python", name)]
-
-def receive_expect(n):
-    return ''.join('{"sequence"=%s}\n'%i for i in xrange(1, n+1)) + "%s messages received\n"%n
-
-class CExampleTest(BrokerTestCase):
-    broker_exe = ["libuv_broker"]
-
-    def test_send_receive(self):
-        """Send first then receive"""
-        s = self.proc(["libuv_send", "-a", self.addr])
-        self.assertEqual("100 messages sent and acknowledged\n", s.wait_out())
-        r = self.proc(["libuv_receive", "-a", self.addr])
-        self.assertEqual(receive_expect(100), r.wait_out())
-
-    def test_receive_send(self):
-        """Start receiving  first, then send."""
-        r = self.proc(["libuv_receive", "-a", self.addr]);
-        s = self.proc(["libuv_send", "-a", self.addr]);
-        self.assertEqual("100 messages sent and acknowledged\n", s.wait_out())
-        self.assertEqual(receive_expect(100), r.wait_out())
-
-    def test_timed_send(self):
-        """Send with timed delay"""
-        s = self.proc(["libuv_send", "-a", self.addr, "-d100", "-m3"])
-        self.assertEqual("3 messages sent and acknowledged\n", s.wait_out())
-        r = self.proc(["libuv_receive", "-a", self.addr, "-m3"])
-        self.assertEqual(receive_expect(3), r.wait_out())
-
-
-if __name__ == "__main__":
-    unittest.main()
diff --git a/examples/c/reactor/CMakeLists.txt b/examples/c/reactor/CMakeLists.txt
deleted file mode 100644
index bd6163f..0000000
--- a/examples/c/reactor/CMakeLists.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-find_package(Proton REQUIRED)
-
-set (reactor-examples
-  sender.c
-  receiver.c
-  )
-
-set_source_files_properties (
-  ${reactor-examples}
-  PROPERTIES
-  COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_LANGUAGE_FLAGS} ${LINK_TIME_OPTIMIZATION}"
-  )
-
-if (BUILD_WITH_CXX)
-  set_source_files_properties (
-    ${reactor-examples}
-    PROPERTIES LANGUAGE CXX
-    )
-endif (BUILD_WITH_CXX)
-
-include_directories(${Proton_INCLUDE_DIRS})
-add_executable(sender sender.c)
-add_executable(receiver receiver.c)
-target_link_libraries(sender ${Proton_LIBRARIES})
-target_link_libraries(receiver ${Proton_LIBRARIES})
-
diff --git a/examples/c/reactor/README b/examples/c/reactor/README
deleted file mode 100644
index 8d61893..0000000
--- a/examples/c/reactor/README
+++ /dev/null
@@ -1,30 +0,0 @@
-These example clients require a broker or similar intermediary that
-supports the AMQP 1.0 protocol, allows anonymous connections and
-accepts links to and from a node named 'examples'.
-
-------------------------------------------------------------------
-
-sender.c
-
-A simple message sending client.  This example sends all messages but
-the last as pre-settled (no ack required).  It then pends waiting for
-an ack for the last message sent before exiting.
-
-Use the '-h' command line option for a list of supported parameters.
-
-------------------------------------------------------------------
-
-receiver.c
-
-A simple message consuming client.  This example receives messages
-from a target (default 'examples').  Received messages are
-acknowledged if they are sent un-settled.  The client will try to
-decode the message payload assuming it has been generated by the
-sender example.
-
-Use the '-h' command line option for a list of supported parameters.
-
-
-
-
-
diff --git a/examples/c/reactor/receiver.c b/examples/c/reactor/receiver.c
deleted file mode 100644
index 35c5a70..0000000
--- a/examples/c/reactor/receiver.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "pncompat/misc_funcs.inc"
-
-#include "proton/reactor.h"
-#include "proton/message.h"
-#include "proton/connection.h"
-#include "proton/session.h"
-#include "proton/link.h"
-#include "proton/delivery.h"
-#include "proton/event.h"
-#include "proton/handlers.h"
-#include "proton/transport.h"
-#include "proton/url.h"
-
-static int quiet = 0;
-
-// Credit batch if unlimited receive (-c 0)
-static const int CAPACITY = 100;
-#define MAX_SIZE 512
-
-// Example application data.  This data will be instantiated in the event
-// handler, and is available during event processing.  In this example it
-// holds configuration and state information.
-//
-typedef struct {
-    int count;          // # of messages to receive before exiting
-    const char *source;     // name of the source node to receive from
-    pn_message_t *message;  // holds the received message
-} app_data_t;
-
-// helper to pull pointer to app_data_t instance out of the pn_handler_t
-//
-#define GET_APP_DATA(handler) ((app_data_t *)pn_handler_mem(handler))
-
-// Called when reactor exits to clean up app_data
-//
-static void delete_handler(pn_handler_t *handler)
-{
-    app_data_t *d = GET_APP_DATA(handler);
-    if (d->message) {
-        pn_decref(d->message);
-        d->message = NULL;
-    }
-}
-
-
-/* Process each event posted by the reactor.
- */
-static void event_handler(pn_handler_t *handler,
-                          pn_event_t *event,
-                          pn_event_type_t type)
-{
-    app_data_t *data = GET_APP_DATA(handler);
-
-    switch (type) {
-
-    case PN_CONNECTION_INIT: {
-        // Create and open all the endpoints needed to send a message
-        //
-        pn_connection_t *conn;
-        pn_session_t *ssn;
-        pn_link_t *receiver;
-
-        conn = pn_event_connection(event);
-        pn_connection_open(conn);
-        ssn = pn_session(conn);
-        pn_session_open(ssn);
-        receiver = pn_receiver(ssn, "MyReceiver");
-        pn_terminus_set_address(pn_link_source(receiver), data->source);
-        pn_link_open(receiver);
-        // cannot receive without granting credit:
-        pn_link_flow(receiver, data->count ? data->count : CAPACITY);
-    } break;
-
-    case PN_DELIVERY: {
-        // A message has been received
-        //
-        pn_link_t *link = NULL;
-        pn_delivery_t *dlv = pn_event_delivery(event);
-        if (pn_delivery_readable(dlv) && !pn_delivery_partial(dlv)) {
-            // A full message has arrived
-            if (!quiet) {
-                static char buffer[MAX_SIZE];
-                ssize_t len;
-                pn_bytes_t bytes;
-                bool found = false;
-
-                // try to decode the message body
-                if (pn_delivery_pending(dlv) < MAX_SIZE) {
-                    // read in the raw data
-                    len = pn_link_recv(pn_delivery_link(dlv), buffer, MAX_SIZE);
-                    if (len > 0) {
-                        // decode it into a proton message
-                        pn_message_clear(data->message);
-                        if (PN_OK == pn_message_decode(data->message, buffer,
-                                                       len)) {
-                            // Assuming the message came from the sender
-                            // example, try to parse out a single string from
-                            // the payload
-                            //
-                            pn_data_scan(pn_message_body(data->message), "?S",
-                                         &found, &bytes);
-                        }
-                    }
-                }
-                if (found) {
-                    fprintf(stdout, "Message: [%.*s]\n", (int)bytes.size,
-                            bytes.start);
-                } else {
-                    fprintf(stdout, "Message received!\n");
-                }
-            }
-
-            link = pn_delivery_link(dlv);
-
-            if (!pn_delivery_settled(dlv)) {
-                // remote has not settled, so it is tracking the delivery.  Ack
-                // it.
-                pn_delivery_update(dlv, PN_ACCEPTED);
-            }
-
-            // done with the delivery, move to the next and free it
-            pn_link_advance(link);
-            pn_delivery_settle(dlv);  // dlv is now freed
-
-            if (data->count == 0) {
-                // send forever - see if more credit is needed
-                if (pn_link_credit(link) < CAPACITY/2) {
-                    // Grant enough credit to bring it up to CAPACITY:
-                    pn_link_flow(link, CAPACITY - pn_link_credit(link));
-                }
-            } else if (--data->count == 0) {
-                // done receiving, close the endpoints
-                pn_session_t *ssn = pn_link_session(link);
-				pn_link_close(link);
-                pn_session_close(ssn);
-                pn_connection_close(pn_session_connection(ssn));
-            }
-        }
-    } break;
-
-    case PN_TRANSPORT_ERROR: {
-        // The connection to the peer failed.
-        //
-        pn_transport_t *tport = pn_event_transport(event);
-        pn_condition_t *cond = pn_transport_condition(tport);
-        fprintf(stderr, "Network transport failed!\n");
-        if (pn_condition_is_set(cond)) {
-            const char *name = pn_condition_get_name(cond);
-            const char *desc = pn_condition_get_description(cond);
-            fprintf(stderr, "    Error: %s  Description: %s\n",
-                    (name) ? name : "<error name not provided>",
-                    (desc) ? desc : "<no description provided>");
-        }
-        // pn_reactor_process() will exit with a false return value, stopping
-        // the main loop.
-    } break;
-
-    default:
-        break;
-    }
-}
-
-static void usage(void)
-{
-  printf("Usage: receiver <options>\n");
-  printf("-a      \tThe host address [localhost:5672]\n");
-  printf("-c      \t# of messages to receive, 0=receive forever [1]\n");
-  printf("-s      \tSource address [examples]\n");
-  printf("-i      \tContainer name [ReceiveExample]\n");
-  printf("-q      \tQuiet - turn off stdout\n");
-  exit(1);
-}
-
-int main(int argc, char** argv)
-{
-    const char *address = "localhost";
-    const char *container = "ReceiveExample";
-    int c;
-    pn_reactor_t *reactor = NULL;
-    pn_url_t *url = NULL;
-    pn_connection_t *conn = NULL;
-
-    /* create a handler for the connection's events.
-     * event_handler will be called for each event.  The handler will allocate
-     * a app_data_t instance which can be accessed when the event_handler is
-     * called.
-     */
-    pn_handler_t *handler = pn_handler_new(event_handler,
-                                           sizeof(app_data_t),
-                                           delete_handler);
-
-    /* set up the application data with defaults */
-    app_data_t *app_data = GET_APP_DATA(handler);
-    memset(app_data, 0, sizeof(app_data_t));
-    app_data->count = 1;
-    app_data->source = "examples";
-    app_data->message = pn_message();
-
-    /* Attach the pn_handshaker() handler.  This handler deals with endpoint
-     * events from the peer so we don't have to.
-     */
-    {
-        pn_handler_t *handshaker = pn_handshaker();
-        pn_handler_add(handler, handshaker);
-        pn_decref(handshaker);
-    }
-
-    /* command line options */
-    opterr = 0;
-    while((c = getopt(argc, argv, "i:a:c:s:qh")) != -1) {
-        switch(c) {
-        case 'h': usage(); break;
-        case 'a': address = optarg; break;
-        case 'c':
-            app_data->count = atoi(optarg);
-            if (app_data->count < 0) usage();
-            break;
-        case 's': app_data->source = optarg; break;
-        case 'i': container = optarg; break;
-        case 'q': quiet = 1; break;
-        default:
-            usage();
-            break;
-        }
-    }
-
-    reactor = pn_reactor();
-
-    url = pn_url_parse(address);
-    if (url == NULL) {
-        fprintf(stderr, "Invalid host address %s\n", address);
-        exit(1);
-    }
-    conn = pn_reactor_connection_to_host(reactor,
-                                         pn_url_get_host(url),
-                                         pn_url_get_port(url),
-                                         handler);
-    pn_decref(url);
-    pn_decref(handler);
-
-    // the container name should be unique for each client
-    pn_connection_set_container(conn, container);
-
-    // wait up to 5 seconds for activity before returning from
-    // pn_reactor_process()
-    pn_reactor_set_timeout(reactor, 5000);
-
-    pn_reactor_start(reactor);
-
-    while (pn_reactor_process(reactor)) {
-        /* Returns 'true' until the connection is shut down.
-         * pn_reactor_process() will return true at least once every 5 seconds
-         * (due to the timeout).  If no timeout was configured,
-         * pn_reactor_process() returns as soon as it finishes processing all
-         * pending I/O and events. Once the connection has closed,
-         * pn_reactor_process() will return false.
-         */
-    }
-    pn_decref(reactor);
-
-    return 0;
-}
diff --git a/examples/c/reactor/sender.c b/examples/c/reactor/sender.c
deleted file mode 100644
index 6c3cdb3..0000000
--- a/examples/c/reactor/sender.c
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "pncompat/misc_funcs.inc"
-
-#include "proton/reactor.h"
-#include "proton/message.h"
-#include "proton/connection.h"
-#include "proton/session.h"
-#include "proton/link.h"
-#include "proton/delivery.h"
-#include "proton/event.h"
-#include "proton/handlers.h"
-#include "proton/transport.h"
-#include "proton/url.h"
-
-
-static int quiet = 0;
-
-// Example application data.  This data will be instantiated in the event
-// handler, and is available during event processing.  In this example it
-// holds configuration and state information.
-//
-typedef struct {
-    int count;           // # messages to send
-    int anon;            // use anonymous link if true
-    const char *target;  // name of destination target
-    char *msg_data;      // pre-encoded outbound message
-    size_t msg_len;      // bytes in msg_data
-} app_data_t;
-
-// helper to pull pointer to app_data_t instance out of the pn_handler_t
-//
-#define GET_APP_DATA(handler) ((app_data_t *)pn_handler_mem(handler))
-
-// Called when reactor exits to clean up app_data
-//
-static void delete_handler(pn_handler_t *handler)
-{
-    app_data_t *d = GET_APP_DATA(handler);
-    if (d->msg_data) {
-        free(d->msg_data);
-        d->msg_data = NULL;
-    }
-}
-
-/* Process each event posted by the reactor.
- */
-static void event_handler(pn_handler_t *handler,
-                          pn_event_t *event,
-                          pn_event_type_t type)
-{
-    app_data_t *data = GET_APP_DATA(handler);
-
-    switch (type) {
-
-    case PN_CONNECTION_INIT: {
-        // Create and open all the endpoints needed to send a message
-        //
-        pn_connection_t *conn;
-        pn_session_t *ssn;
-        pn_link_t *sender;
-
-        conn = pn_event_connection(event);
-        pn_connection_open(conn);
-        ssn = pn_session(conn);
-        pn_session_open(ssn);
-        sender = pn_sender(ssn, "MySender");
-        // we do not wait for ack until the last message
-        pn_link_set_snd_settle_mode(sender, PN_SND_MIXED);
-        if (!data->anon) {
-            pn_terminus_set_address(pn_link_target(sender), data->target);
-        }
-        pn_link_open(sender);
-    } break;
-
-    case PN_LINK_FLOW: {
-        // the remote has given us some credit, now we can send messages
-        //
-        static long tag = 0;  // a simple tag generator
-        pn_delivery_t *delivery;
-        pn_link_t *sender = pn_event_link(event);
-        int credit = pn_link_credit(sender);
-        while (credit > 0 && data->count > 0) {
-            --credit;
-            --data->count;
-            ++tag;
-            delivery = pn_delivery(sender,
-                                   pn_dtag((const char *)&tag, sizeof(tag)));
-            pn_link_send(sender, data->msg_data, data->msg_len);
-            pn_link_advance(sender);
-            if (data->count > 0) {
-                // send pre-settled until the last one, then wait for an ack on
-                // the last sent message. This allows the sender to send
-                // messages as fast as possible and then exit when the consumer
-                // has dealt with the last one.
-                //
-                pn_delivery_settle(delivery);
-            }
-        }
-    } break;
-
-    case PN_DELIVERY: {
-        // Since the example sends all messages but the last pre-settled
-        // (pre-acked), only the last message's delivery will get updated with
-        // the remote state (acked/nacked).
-        //
-        pn_delivery_t *dlv = pn_event_delivery(event);
-        if (pn_delivery_updated(dlv) && pn_delivery_remote_state(dlv)) {
-            uint64_t rs = pn_delivery_remote_state(dlv);
-            int done = 1;
-            switch (rs) {
-            case PN_RECEIVED:
-                // This is not a terminal state - it is informational, and the
-                // peer is still processing the message.
-                done = 0;
-                break;
-            case PN_ACCEPTED:
-                pn_delivery_settle(dlv);
-                if (!quiet) fprintf(stdout, "Send complete!\n");
-                break;
-            case PN_REJECTED:
-            case PN_RELEASED:
-            case PN_MODIFIED:
-                pn_delivery_settle(dlv);
-                fprintf(stderr, "Message not accepted - code:%lu\n", (unsigned long)rs);
-                break;
-            default:
-                // ??? no other terminal states defined, so ignore anything else
-                pn_delivery_settle(dlv);
-                fprintf(stderr, "Unknown delivery failure - code=%lu\n", (unsigned long)rs);
-                break;
-            }
-
-            if (done) {
-                // initiate clean shutdown of the endpoints
-                pn_link_t *link = pn_delivery_link(dlv);
-                pn_session_t *ssn = pn_link_session(link);
-                pn_link_close(link);
-                pn_session_close(ssn);
-                pn_connection_close(pn_session_connection(ssn));
-            }
-        }
-    } break;
-
-    case PN_TRANSPORT_ERROR: {
-        // The connection to the peer failed.
-        //
-        pn_transport_t *tport = pn_event_transport(event);
-        pn_condition_t *cond = pn_transport_condition(tport);
-        fprintf(stderr, "Network transport failed!\n");
-        if (pn_condition_is_set(cond)) {
-            const char *name = pn_condition_get_name(cond);
-            const char *desc = pn_condition_get_description(cond);
-            fprintf(stderr, "    Error: %s  Description: %s\n",
-                    (name) ? name : "<error name not provided>",
-                    (desc) ? desc : "<no description provided>");
-        }
-        // pn_reactor_process() will exit with a false return value, stopping
-        // the main loop.
-    } break;
-
-    default:
-        break;
-    }
-}
-
-static void usage(void)
-{
-  printf("Usage: send <options> <message>\n");
-  printf("-a      \tThe host address [localhost:5672]\n");
-  printf("-c      \t# of messages to send [1]\n");
-  printf("-t      \tTarget address [examples]\n");
-  printf("-n      \tUse an anonymous link [off]\n");
-  printf("-i      \tContainer name [SendExample]\n");
-  printf("-q      \tQuiet - turn off stdout\n");
-  printf("message \tA text string to send.\n");
-  exit(1);
-}
-
-int main(int argc, char** argv)
-{
-    const char *address = "localhost";
-    const char *msgtext = "Hello World!";
-    const char *container = "SendExample";
-    int c;
-    pn_message_t *message = NULL;
-    pn_data_t *body = NULL;
-    pn_reactor_t *reactor = NULL;
-    pn_url_t *url = NULL;
-    pn_connection_t *conn = NULL;
-
-    /* Create a handler for the connection's events.  event_handler() will be
-     * called for each event and delete_handler will be called when the
-     * connection is released.  The handler will allocate an app_data_t
-     * instance which can be accessed when the event_handler is called.
-     */
-    pn_handler_t *handler = pn_handler_new(event_handler,
-                                           sizeof(app_data_t),
-                                           delete_handler);
-
-    /* set up the application data with defaults */
-    app_data_t *app_data = GET_APP_DATA(handler);
-    memset(app_data, 0, sizeof(app_data_t));
-    app_data->count = 1;
-    app_data->target = "examples";
-
-    /* Attach the pn_handshaker() handler.  This handler deals with endpoint
-     * events from the peer so we don't have to.
-     */
-    {
-        pn_handler_t *handshaker = pn_handshaker();
-        pn_handler_add(handler, handshaker);
-        pn_decref(handshaker);
-    }
-
-    /* command line options */
-    opterr = 0;
-    while((c = getopt(argc, argv, "i:a:c:t:nhq")) != -1) {
-        switch(c) {
-        case 'h': usage(); break;
-        case 'a': address = optarg; break;
-        case 'c':
-            app_data->count = atoi(optarg);
-            if (app_data->count < 1) usage();
-            break;
-        case 't': app_data->target = optarg; break;
-        case 'n': app_data->anon = 1; break;
-        case 'i': container = optarg; break;
-        case 'q': quiet = 1; break;
-        default:
-            usage();
-            break;
-        }
-    }
-    if (optind < argc) msgtext = argv[optind];
-
-
-    // create a single message and pre-encode it so we only have to do that
-    // once.  All transmits will use the same pre-encoded message simply for
-    // speed.
-    //
-    message = pn_message();
-    pn_message_set_address(message, app_data->target);
-    body = pn_message_body(message);
-    pn_data_clear(body);
-
-    // This message's body contains a single string
-    if (pn_data_fill(body, "S", msgtext)) {
-        fprintf(stderr, "Error building message!\n");
-        exit(1);
-    }
-    pn_data_rewind(body);
-    {
-        // encode the message, expanding the encode buffer as needed
-        //
-        size_t len = 128;
-        char *buf = (char *)malloc(len);
-        int rc = 0;
-        do {
-            rc = pn_message_encode(message, buf, &len);
-            if (rc == PN_OVERFLOW) {
-                free(buf);
-                len *= 2;
-                buf = (char *)malloc(len);
-            }
-        } while (rc == PN_OVERFLOW);
-        app_data->msg_len = len;
-        app_data->msg_data = buf;
-    }
-    pn_decref(message);   // message no longer needed
-
-    reactor = pn_reactor();
-
-    url = pn_url_parse(address);
-    if (url == NULL) {
-        fprintf(stderr, "Invalid host address %s\n", address);
-        exit(1);
-    }
-    conn = pn_reactor_connection_to_host(reactor,
-                                         pn_url_get_host(url),
-                                         pn_url_get_port(url),
-                                         handler);
-    pn_decref(url);
-    pn_decref(handler);
-
-    // the container name should be unique for each client
-    pn_connection_set_container(conn, container);
-
-    // wait up to 5 seconds for activity before returning from
-    // pn_reactor_process()
-    pn_reactor_set_timeout(reactor, 5000);
-
-    pn_reactor_start(reactor);
-
-    while (pn_reactor_process(reactor)) {
-        /* Returns 'true' until the connection is shut down.
-         * pn_reactor_process() will return true at least once every 5 seconds
-         * (due to the timeout).  If no timeout was configured,
-         * pn_reactor_process() returns as soon as it finishes processing all
-         * pending I/O and events. Once the connection has closed,
-         * pn_reactor_process() will return false.
-         */
-    }
-    pn_decref(reactor);
-
-    return 0;
-}
diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt
deleted file mode 100644
index 304d899..0000000
--- a/examples/cpp/CMakeLists.txt
+++ /dev/null
@@ -1,83 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-find_package(ProtonCpp REQUIRED)
-
-include_directories(${ProtonCpp_INCLUDE_DIRS})
-link_libraries(${ProtonCpp_LIBRARIES})
-add_definitions(${CXX_WARNING_FLAGS})
-
-# Add a test with the correct environment to find test executables and valgrind.
-macro(add_cpp_test name)
-  if(WIN32)
-    set(test_path "$<TARGET_FILE_DIR:broker>;$<TARGET_FILE_DIR:qpid-proton>;$<TARGET_FILE_DIR:qpid-proton-cpp>")
-  else(WIN32)
-    set(test_path "$<TARGET_FILE_DIR:broker>:$ENV{PATH}")
-  endif(WIN32)
-  set(run_env ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/proton-c/env.py)
-  add_test(NAME ${name} COMMAND ${run_env} "PATH=${test_path}" ${VALGRIND_ENV} -- ${ARGN})
-endmacro()
-
-# Single-threaded examples that work on C++03
-foreach(example
-    broker
-    helloworld
-    helloworld_direct
-    simple_recv
-    simple_send
-    scheduled_send_03
-    direct_recv
-    direct_send
-    client
-    server
-    server_direct
-    connection_options
-    queue_browser
-    selected_recv
-    flow_control
-    ssl
-    ssl_client_cert
-    service_bus
-    encode_decode)
-  add_executable(${example} ${example}.cpp)
-endforeach()
-
-if(HAS_CPP11)
-  # Single-threaded examples that require C++11
-  foreach(example
-      scheduled_send)
-    add_executable(${example} ${example}.cpp)
-  endforeach()
-
-  # Linux-only multi-threaded examples (TODO make these portable)
-#   if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
-#     set(container_src mt/epoll_container.cpp)
-#     foreach(example
-#         broker)
-#       add_executable(mt_${example} mt/${example}.cpp ${container_src})
-#       target_link_libraries(mt_${example} pthread)
-#     endforeach()
-#     add_cpp_test(cpp-example-mt ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example_test.py -v MtBrokerTest)
-#   endif()
-endif()
-
-add_cpp_test(cpp-example-container ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example_test.py -v ContainerExampleTest)
-
-
-
diff --git a/examples/cpp/README.dox b/examples/cpp/README.dox
deleted file mode 100644
index 447d3ad..0000000
--- a/examples/cpp/README.dox
+++ /dev/null
@@ -1,163 +0,0 @@
-// C++ examples list (doxygen format)
-//
-// For a tutorial-style description of the examples see tutorial.dox.
-// To build the full HTML tutorial and documentation, in your build directory do:
-//
-//     make docs-cpp
-//
-// then open proton-c/bindings/cpp/docs/html/tutorial.html in your browser.
-
-// DEVELOPER NOTE: if you add or modify examples, please add/update a short
-// description below and (if appropriate) extend/update tutorial.dox.
-
-/** example sub directory
-
-The example sub-directory has utilities classes to make the example simpler,
-these classes are not directly related to the use of proton so are in a separate
-`example` directory and namespace.
-
-*/
-
-/** @example helloworld.cpp
-
-Connects to a broker on 127.0.0.1:5672, establishes a subscription
-from the 'examples' node, and creates a sending link to the same
-node. Sends one message and receives it back.
-
-*/
-
-/** @example helloworld_direct.cpp
-
-Variation of helloworld that does not use a broker, but listens for
-incoming connections itself. It establishes a connection to itself
-with a link over which a single message is sent. This demonstrates the
-ease with which a simple daemon an be built using the API.
-
-*/
-
-/** @example simple_send.cpp
-
-An example of sending a fixed number of messages and tracking their
-(asynchronous) acknowledgement. Messages are sent through the 'examples' node on
-an intermediary accessible on 127.0.0.1:5672.
-
-*/
-
-/** @example simple_recv.cpp
-
-Subscribes to the 'examples' node on an intermediary accessible
-on 127.0.0.1:5672. Simply prints out the body of received messages.
-
-*/
-
-/** @example direct_send.cpp
-
-Accepts an incoming connection and then sends like `simple_send`.  You can
-connect directly to `direct_send` *without* a broker using @ref simple_recv.cpp.
-Make sure to stop the broker first or use a different port for `direct_send`.
-
-*/
-
-/** @example direct_recv.cpp
-
-Accepts an incoming connection and then receives like `simple_recv`.  You can
-connect directly to `direct_recv` *without* a broker using @ref simple_send.cpp.
-Make sure to stop the broker first or use a different port for `direct_recv`.
-
-*/
-
-/// @cond INTERNAL
-/** @example encode_decode.cpp
-
-Shows how C++ data types can be converted to and from AMQP types.
-
-*/
-/// @endcond
-
-/** @example client.cpp
-
-The client part of a request-response example. Sends requests and
-prints out responses. Requires an intermediary that supports the AMQP
-1.0 dynamic nodes on which the responses are received. The requests
-are sent through the 'examples' node.
-
-*/
-
-/** @example server.cpp
-
-The server part of a request-response example, that receives requests
-via the examples node, converts the body to uppercase and sends the
-result back to the indicated reply address.
-
-*/
-
-/** @example server_direct.cpp
-
-A variant of the server part of a request-response example that
-accepts incoming connections and does not need an intermediary. Much
-like the original server, it receives incoming requests, converts the
-body to uppercase and sends the result back to the indicated reply
-address. Can be used in conjunction with any of the client
-alternatives.
-
-*/
-
-/** @example broker.hpp
-
-Common logic for a simple "mini broker" that creates creates queues
-automatically when a client tries to send or subscribe. This file contains
-the `queue` class that queues messages and the `broker_handler` class
-that manages queues and links and transfers messages to/from clients.
-
-*/
-
-/** @example broker.cpp
-
-A simple, single-threaded broker using the `proton::container`. You can use this
-to run other examples that reqiure an intermediary, or you can use any AMQP 1.0
-broker. This broker creates queues automatically when a client tries to send or
-subscribe.
-
-*/
-
-/** @example mt/epoll_container.cpp
-
-An example implementation of the proton::container API that shows how
-to use the proton::io::connection_driver SPI to adapt the proton API
-to native IO, in this case using a multithreaded Linux epoll poller as
-the implementation.
-
-__Requires C++11__
-
-*/
-
-/** @example mt/broker.cpp
-
-A multithreaded broker, that will work on any multi-threaded container. See @ref mt/epoll_container.cpp for an example of a multi-threaded container.
-
-__Requires C++11__
-
-*/
-
-/** @example scheduled_send.cpp
-
-Shows how to use proton::container::schedule to schedule a timed callback.
-This version uses std::function and so requires C++11 or better. For a C++03 compatible
-approach see @ref scheduled_send_03.cpp.
-
-*/
-
-/** @example scheduled_send_03.cpp
-
-Shows how to use proton::container::schedule to schedule a timed callback in a
-C++03 compatible way. See @ref scheduled_send.cpp for a more convenient approach
-using std::function if you have C++11.
-
-*/
-
-/** @example service_bus.cpp
-
-A working example for accessing Service Bus session-enabled queues.
-Also provides some general notes on Service Bus usage.
-
-*/
diff --git a/examples/cpp/broker.cpp b/examples/cpp/broker.cpp
deleted file mode 100644
index 97ef206..0000000
--- a/examples/cpp/broker.cpp
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "options.hpp"
-
-#include <proton/connection.hpp>
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/delivery.hpp>
-#include <proton/error_condition.hpp>
-#include <proton/listener.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/message.hpp>
-#include <proton/receiver_options.hpp>
-#include <proton/sender.hpp>
-#include <proton/sender_options.hpp>
-#include <proton/source_options.hpp>
-#include <proton/target_options.hpp>
-#include <proton/tracker.hpp>
-#include <proton/transport.hpp>
-#include <proton/url.hpp>
-
-#include <deque>
-#include <iostream>
-#include <list>
-#include <map>
-#include <string>
-
-#include "fake_cpp11.hpp"
-
-/// A simple implementation of a queue.
-class queue {
-  public:
-    queue(const std::string &name, bool dynamic = false) : name_(name), dynamic_(dynamic) {}
-
-    std::string name() const { return name_; }
-
-    void subscribe(proton::sender s) {
-        consumers_.push_back(s);
-    }
-
-    // Return true if queue can be deleted.
-    bool unsubscribe(proton::sender s) {
-        consumers_.remove(s);
-        return (consumers_.size() == 0 && (dynamic_ || messages_.size() == 0));
-    }
-
-    void publish(const proton::message &m) {
-        messages_.push_back(m);
-        dispatch(0);
-    }
-
-    void dispatch(proton::sender *s) {
-        while (deliver_to(s)) {}
-    }
-
-    bool deliver_to(proton::sender *s) {
-        // Deliver to single sender if supplied, else all consumers
-        int count = s ? 1 : consumers_.size();
-
-        if (!count) return false;
-
-        bool result = false;
-        sender_list::iterator it = consumers_.begin();
-
-        if (!s && count) {
-            s = &*it;
-        }
-
-        while (messages_.size()) {
-            if (s->credit()) {
-                const proton::message& m = messages_.front();
-
-                s->send(m);
-                messages_.pop_front();
-                result = true;
-            }
-
-            if (--count) {
-                it++;
-            } else {
-                return result;
-            }
-        }
-
-        return false;
-    }
-
-  private:
-    typedef std::deque<proton::message> message_queue;
-    typedef std::list<proton::sender> sender_list;
-
-    std::string name_;
-    bool dynamic_;
-    message_queue messages_;
-    sender_list consumers_;
-};
-
-/// A collection of queues and queue factory, used by a broker.
-class queues {
-  public:
-    queues() : next_id_(0) {}
-    virtual ~queues() {}
-
-    // Get or create a queue.
-    virtual queue &get(const std::string &address) {
-        if (address.empty()) {
-            throw std::runtime_error("empty queue name");
-        }
-
-        queue*& q = queues_[address];
-
-        if (!q) q = new queue(address);
-
-        return *q;
-    }
-
-    // Create a dynamic queue with a unique name.
-    virtual queue &dynamic() {
-        std::ostringstream os;
-        os << "q" << next_id_++;
-        queue *q = queues_[os.str()] = new queue(os.str(), true);
-
-        return *q;
-    }
-
-    // Delete the named queue
-    virtual void erase(std::string &name) {
-        delete queues_[name];
-        queues_.erase(name);
-    }
-
-  protected:
-    typedef std::map<std::string, queue *> queue_map;
-    queue_map queues_;
-    int next_id_; // Use to generate unique queue IDs.
-};
-
-// A handler to implement broker logic
-class broker_handler : public proton::messaging_handler {
-  public:
-    broker_handler(queues& qs) : queues_(qs) {}
-
-    void on_sender_open(proton::sender &sender) OVERRIDE {
-        proton::source src(sender.source());
-        queue *q;
-        if (src.dynamic()) {
-            q = &queues_.dynamic();
-        } else if (!src.address().empty()) {
-            q = &queues_.get(src.address());
-        } else {
-            sender.close(proton::error_condition("No queue address supplied"));
-            return;
-        }
-        sender.open(proton::sender_options().source(proton::source_options().address(q->name())));
-        q->subscribe(sender);
-        std::cout << "broker outgoing link from " << q->name() << std::endl;
-    }
-
-    void on_receiver_open(proton::receiver &receiver) OVERRIDE {
-        std::string address = receiver.target().address();
-        if (!address.empty()) {
-            receiver.open(proton::receiver_options().target(proton::target_options().address(address)));
-            std::cout << "broker incoming link to " << address << std::endl;
-        } else {
-            receiver.close(proton::error_condition("No queue address supplied"));
-        }
-    }
-
-    void unsubscribe(proton::sender lnk) {
-        std::string address = lnk.source().address();
-
-        if (queues_.get(address).unsubscribe(lnk)) {
-            queues_.erase(address);
-        }
-    }
-
-    void on_sender_close(proton::sender &sender) OVERRIDE {
-        unsubscribe(sender);
-    }
-
-    void on_connection_close(proton::connection &c) OVERRIDE {
-        remove_stale_consumers(c);
-    }
-
-    void on_transport_close(proton::transport &t) OVERRIDE {
-        remove_stale_consumers(t.connection());
-    }
-
-    void on_transport_error(proton::transport &t) OVERRIDE {
-        std::cout << "broker client disconnect: " << t.error().what() << std::endl;
-    }
-
-    void on_error(const proton::error_condition &c) OVERRIDE {
-        std::cerr << "broker error: " << c.what() << std::endl;
-    }
-
-    void remove_stale_consumers(proton::connection connection) {
-        proton::sender_range r = connection.senders();
-        for (proton::sender_iterator i = r.begin(); i != r.end(); ++i) {
-            if (i->active())
-                unsubscribe(*i);
-        }
-    }
-
-    void on_sendable(proton::sender &s) OVERRIDE {
-        std::string address = s.source().address();
-
-        queues_.get(address).dispatch(&s);
-    }
-
-    void on_message(proton::delivery &d, proton::message &m) OVERRIDE {
-        std::string address = d.receiver().target().address();
-        queues_.get(address).publish(m);
-    }
-
-  protected:
-    queues& queues_;
-};
-
-
-// The broker
-class broker {
-  public:
-    broker(const std::string& url) : handler_(url, queues_) {}
-
-    proton::messaging_handler& handler() { return handler_; }
-
-  private:
-    class my_handler : public broker_handler {
-      public:
-        my_handler(const std::string& u, queues& qs) : broker_handler(qs), url_(u) {}
-
-        void on_container_start(proton::container &c) OVERRIDE {
-            c.listen(url_);
-            std::cout << "broker listening on " << url_ << std::endl;
-        }
-
-      private:
-        const std::string& url_;
-    };
-
-  private:
-    queues queues_;
-    my_handler handler_;
-};
-
-int main(int argc, char **argv) {
-    std::string url("0.0.0.0");
-    example::options opts(argc, argv);
-
-    opts.add_value(url, 'a', "address", "listen on URL", "URL");
-
-    try {
-        opts.parse();
-
-        broker b(url);
-        proton::default_container(b.handler()).run();
-
-        return 0;
-    } catch (const example::bad_option& e) {
-        std::cout << opts << std::endl << e.what() << std::endl;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-
-    return 1;
-}
diff --git a/examples/cpp/broker.hpp b/examples/cpp/broker.hpp
deleted file mode 100644
index 953713f..0000000
--- a/examples/cpp/broker.hpp
+++ /dev/null
@@ -1,236 +0,0 @@
-#ifndef BROKER_HPP
-#define BROKER_HPP
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/// @file
-///
-/// Common code used by different broker examples.
-///
-/// The examples add functionality as needed, this helps to make it
-/// easier to see the important differences between the examples.
-
-#include <proton/connection.hpp>
-#include <proton/delivery.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/message.hpp>
-#include <proton/sasl.hpp>
-#include <proton/sender.hpp>
-#include <proton/tracker.hpp>
-#include <proton/transport.hpp>
-#include <proton/sender_options.hpp>
-#include <proton/receiver_options.hpp>
-#include <proton/source_options.hpp>
-#include <proton/target_options.hpp>
-
-#include <iostream>
-#include <deque>
-#include <map>
-#include <list>
-#include <sstream>
-
-/// A simple implementation of a queue.
-class queue {
-  public:
-    queue(const std::string &name, bool dynamic = false) : name_(name), dynamic_(dynamic) {}
-
-    std::string name() const { return name_; }
-
-    void subscribe(proton::sender s) {
-        consumers_.push_back(s);
-    }
-
-    // Return true if queue can be deleted.
-    bool unsubscribe(proton::sender s) {
-        consumers_.remove(s);
-        return (consumers_.size() == 0 && (dynamic_ || messages_.size() == 0));
-    }
-
-    void publish(const proton::message &m) {
-        messages_.push_back(m);
-        dispatch(0);
-    }
-
-    void dispatch(proton::sender *s) {
-        while (deliver_to(s)) {}
-    }
-
-    bool deliver_to(proton::sender *s) {
-        // Deliver to single sender if supplied, else all consumers
-        int count = s ? 1 : consumers_.size();
-
-        if (!count) return false;
-
-        bool result = false;
-        sender_list::iterator it = consumers_.begin();
-
-        if (!s && count) {
-            s = &*it;
-        }
-
-        while (messages_.size()) {
-            if (s->credit()) {
-                const proton::message& m = messages_.front();
-
-                s->send(m);
-                messages_.pop_front();
-                result = true;
-            }
-
-            if (--count) {
-                it++;
-            } else {
-                return result;
-            }
-        }
-
-        return false;
-    }
-
-  private:
-    typedef std::deque<proton::message> message_queue;
-    typedef std::list<proton::sender> sender_list;
-
-    std::string name_;
-    bool dynamic_;
-    message_queue messages_;
-    sender_list consumers_;
-};
-
-/// A collection of queues and queue factory, used by a broker.
-class queues {
-  public:
-    queues() : next_id_(0) {}
-    virtual ~queues() {}
-
-    // Get or create a queue.
-    virtual queue &get(const std::string &address = std::string()) {
-        if (address.empty()) {
-            throw std::runtime_error("empty queue name");
-        }
-
-        queue*& q = queues_[address];
-
-        if (!q) q = new queue(address);
-
-        return *q;
-    }
-
-    // Create a dynamic queue with a unique name.
-    virtual queue &dynamic() {
-        std::ostringstream os;
-        os << "q" << next_id_++;
-        queue *q = queues_[os.str()] = new queue(os.str(), true);
-
-        return *q;
-    }
-
-    // Delete the named queue
-    virtual void erase(std::string &name) {
-        delete queues_[name];
-        queues_.erase(name);
-    }
-
-  protected:
-    typedef std::map<std::string, queue *> queue_map;
-    queue_map queues_;
-    int next_id_; // Use to generate unique queue IDs.
-};
-
-#include <proton/config.hpp>
-
-/** Common handler logic for brokers. */
-class broker_handler : public proton::messaging_handler {
-  public:
-    broker_handler(queues& qs) : queues_(qs) {}
-
-    void on_transport_open(proton::transport &t) OVERRIDE {
-        std::cout << "Connection from user: " << t.sasl().user() << " (mechanism: " << t.sasl().mech() << ")" << std::endl;
-    }
-
-    void on_sender_open(proton::sender &sender) OVERRIDE {
-        proton::source src(sender.source());
-        queue &q = src.dynamic() ?
-            queues_.dynamic() : queues_.get(src.address());
-        sender.open(proton::sender_options().source(proton::source_options().address(q.name())));
-        q.subscribe(sender);
-        std::cout << "broker outgoing link from " << q.name() << std::endl;
-    }
-
-    void on_receiver_open(proton::receiver &receiver) OVERRIDE {
-        std::string address = receiver.target().address();
-        if (!address.empty()) {
-            receiver.open(proton::receiver_options().target(proton::target_options().address(address)));
-            std::cout << "broker incoming link to " << address << std::endl;
-        }
-    }
-
-    void unsubscribe(proton::sender lnk) {
-        std::string address = lnk.source().address();
-
-        if (queues_.get(address).unsubscribe(lnk)) {
-            queues_.erase(address);
-        }
-    }
-
-    void on_sender_close(proton::sender &sender) OVERRIDE {
-        unsubscribe(sender);
-    }
-
-    void on_connection_close(proton::connection &c) OVERRIDE {
-        remove_stale_consumers(c);
-    }
-
-    void on_transport_close(proton::transport &t) OVERRIDE {
-        remove_stale_consumers(t.connection());
-    }
-
-    void on_transport_error(proton::transport &t) OVERRIDE {
-        std::cout << "broker client disconnect: " << t.error().what() << std::endl;
-    }
-
-    void on_error(const proton::error_condition &c) OVERRIDE {
-        std::cerr << "broker error: " << c.what() << std::endl;
-    }
-
-    void remove_stale_consumers(proton::connection connection) {
-        proton::sender_range sr = connection.senders();
-        for (proton::sender_iterator i = sr.begin(); i != sr.end(); ++i) {
-            if (i->active())
-                unsubscribe(*i);
-        }
-    }
-
-    void on_sendable(proton::sender &s) OVERRIDE {
-        std::string address = s.source().address();
-
-        queues_.get(address).dispatch(&s);
-    }
-
-    void on_message(proton::delivery &d, proton::message &m) OVERRIDE {
-        std::string address = d.receiver().target().address();
-        queues_.get(address).publish(m);
-    }
-
-  protected:
-    queues& queues_;
-};
-
-#endif // BROKER_HPP
diff --git a/examples/cpp/client.cpp b/examples/cpp/client.cpp
deleted file mode 100644
index 7139155..0000000
--- a/examples/cpp/client.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "options.hpp"
-#include <proton/connection.hpp>
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/delivery.hpp>
-#include <proton/message.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/receiver_options.hpp>
-#include <proton/source_options.hpp>
-#include <proton/thread_safe.hpp>
-#include <proton/tracker.hpp>
-
-#include <iostream>
-#include <vector>
-
-#include "fake_cpp11.hpp"
-
-using proton::receiver_options;
-using proton::source_options;
-
-class client : public proton::messaging_handler {
-  private:
-    std::string url;
-    std::vector<std::string> requests;
-    proton::sender sender;
-    proton::receiver receiver;
-
-  public:
-    client(const std::string &u, const std::vector<std::string>& r) : url(u), requests(r) {}
-
-    void on_container_start(proton::container &c) OVERRIDE {
-        sender = c.open_sender(url);
-        // Create a receiver requesting a dynamically created queue
-        // for the message source.
-        receiver_options opts = receiver_options().source(source_options().dynamic(true));
-        receiver = sender.connection().open_receiver("", opts);
-    }
-
-    void send_request() {
-        proton::message req;
-        req.body(requests.front());
-        req.reply_to(receiver.source().address());
-        sender.send(req);
-    }
-
-    void on_receiver_open(proton::receiver &) OVERRIDE {
-        send_request();
-    }
-
-    void on_message(proton::delivery &d, proton::message &response) OVERRIDE {
-        if (requests.empty()) return; // Spurious extra message!
-
-        std::cout << requests.front() << " => " << response.body() << std::endl;
-        requests.erase(requests.begin());
-
-        if (!requests.empty()) {
-            send_request();
-        } else {
-            d.connection().close();
-        }
-    }
-};
-
-int main(int argc, char **argv) {
-    std::string url("127.0.0.1:5672/examples");
-    example::options opts(argc, argv);
-
-    opts.add_value(url, 'a', "address", "connect and send to URL", "URL");
-
-    try {
-        opts.parse();
-
-        std::vector<std::string> requests;
-        requests.push_back("Twas brillig, and the slithy toves");
-        requests.push_back("Did gire and gymble in the wabe.");
-        requests.push_back("All mimsy were the borogroves,");
-        requests.push_back("And the mome raths outgrabe.");
-
-        client c(url, requests);
-        proton::default_container(c).run();
-
-        return 0;
-    } catch (const example::bad_option& e) {
-        std::cout << opts << std::endl << e.what() << std::endl;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-
-    return 1;
-}
diff --git a/examples/cpp/connection_options.cpp b/examples/cpp/connection_options.cpp
deleted file mode 100644
index f718060..0000000
--- a/examples/cpp/connection_options.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/connection.hpp>
-#include <proton/connection_options.hpp>
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/thread_safe.hpp>
-#include <proton/transport.hpp>
-
-#include <iostream>
-
-using proton::connection_options;
-
-#include "fake_cpp11.hpp"
-
-class handler_2 : public proton::messaging_handler {
-    void on_connection_open(proton::connection &c) OVERRIDE {
-        std::cout << "connection events going to handler_2" << std::endl;
-        std::cout << "connection max_frame_size: " << c.max_frame_size() <<
-            ", idle timeout: " << c.idle_timeout() << std::endl;
-        c.close();
-    }
-};
-
-class main_handler : public proton::messaging_handler {
-  private:
-    std::string url;
-    handler_2 conn_handler;
-
-  public:
-    main_handler(const std::string& u) : url(u) {}
-
-    void on_container_start(proton::container &c) OVERRIDE {
-        // Connection options for this connection.  Merged with and overriding the container's
-        // client_connection_options() settings.
-        c.connect(url, connection_options().handler(conn_handler).max_frame_size(2468));
-    }
-
-    void on_connection_open(proton::connection &c) OVERRIDE {
-        std::cout << "unexpected connection event on main handler" << std::endl;
-        c.close();
-    }
-};
-
-int main(int argc, char **argv) {
-    try {
-        std::string url = argc > 1 ? argv[1] : "127.0.0.1:5672/examples";
-        main_handler handler(url);
-        proton::default_container container(handler);
-        // Global connection options for future connections on container.
-        container.client_connection_options(connection_options().max_frame_size(12345).idle_timeout(proton::duration(15000)));
-        container.run();
-        return 0;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-    return 1;
-}
diff --git a/examples/cpp/direct_recv.cpp b/examples/cpp/direct_recv.cpp
deleted file mode 100644
index 705b480..0000000
--- a/examples/cpp/direct_recv.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "options.hpp"
-
-#include <proton/connection.hpp>
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/delivery.hpp>
-#include <proton/message.hpp>
-#include <proton/message_id.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/link.hpp>
-#include <proton/listener.hpp>
-#include <proton/value.hpp>
-
-#include <iostream>
-#include <map>
-
-#include "fake_cpp11.hpp"
-
-class direct_recv : public proton::messaging_handler {
-  private:
-    std::string url;
-    proton::listener listener;
-    int expected;
-    int received;
-
-  public:
-    direct_recv(const std::string &s, int c) : url(s), expected(c), received(0) {}
-
-    void on_container_start(proton::container &c) OVERRIDE {
-        listener = c.listen(url);
-        std::cout << "direct_recv listening on " << url << std::endl;
-    }
-
-    void on_message(proton::delivery &d, proton::message &msg) OVERRIDE {
-        if (proton::coerce<int>(msg.id()) < received) {
-            return; // Ignore duplicate
-        }
-
-        if (expected == 0 || received < expected) {
-            std::cout << msg.body() << std::endl;
-            received++;
-        }
-
-        if (received == expected) {
-            d.receiver().close();
-            d.connection().close();
-            listener.stop();
-        }
-    }
-};
-
-int main(int argc, char **argv) {
-    std::string address("127.0.0.1:5672/examples");
-    int message_count = 100;
-    example::options opts(argc, argv);
-
-    opts.add_value(address, 'a', "address", "listen and receive on URL", "URL");
-    opts.add_value(message_count, 'm', "messages", "receive COUNT messages", "COUNT");
-
-    try {
-        opts.parse();
-
-        direct_recv recv(address, message_count);
-        proton::default_container(recv).run();
-
-        return 0;
-    } catch (const example::bad_option& e) {
-        std::cout << opts << std::endl << e.what() << std::endl;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-
-    return 1;
-}
diff --git a/examples/cpp/direct_send.cpp b/examples/cpp/direct_send.cpp
deleted file mode 100644
index 7de762d..0000000
--- a/examples/cpp/direct_send.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "options.hpp"
-
-#include <proton/connection.hpp>
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/listener.hpp>
-#include <proton/message.hpp>
-#include <proton/message_id.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/value.hpp>
-#include <proton/tracker.hpp>
-#include <proton/types.hpp>
-
-#include <iostream>
-#include <map>
-
-#include "fake_cpp11.hpp"
-
-class simple_send : public proton::messaging_handler {
-  private:
-    std::string url;
-    proton::listener listener;
-    int sent;
-    int confirmed;
-    int total;
-
-  public:
-    simple_send(const std::string &s, int c) : url(s), sent(0), confirmed(0), total(c) {}
-
-    void on_container_start(proton::container &c) OVERRIDE {
-        listener = c.listen(url);
-        std::cout << "direct_send listening on " << url << std::endl;
-    }
-
-    void on_sendable(proton::sender &sender) OVERRIDE {
-        while (sender.credit() && sent < total) {
-            proton::message msg;
-            std::map<std::string, int> m;
-            m["sequence"] = sent + 1;
-
-            msg.id(sent + 1);
-            msg.body(m);
-
-            sender.send(msg);
-            sent++;
-        }
-    }
-
-    void on_tracker_accept(proton::tracker &t) OVERRIDE {
-        confirmed++;
-
-        if (confirmed == total) {
-            std::cout << "all messages confirmed" << std::endl;
-            t.connection().close();
-            listener.stop();
-        }
-    }
-
-    void on_transport_close(proton::transport &) OVERRIDE {
-        sent = confirmed;
-    }
-};
-
-int main(int argc, char **argv) {
-    std::string address("127.0.0.1:5672/examples");
-    int message_count = 100;
-    example::options opts(argc, argv);
-
-    opts.add_value(address, 'a', "address", "listen and send on URL", "URL");
-    opts.add_value(message_count, 'm', "messages", "send COUNT messages", "COUNT");
-
-    try {
-        opts.parse();
-
-        simple_send send(address, message_count);
-        proton::default_container(send).run();
-        return 0;
-    } catch (const example::bad_option& e) {
-        std::cout << opts << std::endl << e.what() << std::endl;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-
-    return 1;
-}
diff --git a/examples/cpp/encode_decode.cpp b/examples/cpp/encode_decode.cpp
deleted file mode 100644
index 862d1dd..0000000
--- a/examples/cpp/encode_decode.cpp
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <proton/types.hpp>
-#include <proton/codec/encoder.hpp>
-#include <proton/codec/decoder.hpp>
-
-#include <algorithm>
-#include <iostream>
-#include <iterator>
-#include <sstream>
-
-// Examples of how to use the encoder and decoder to create and examine AMQP values.
-//
-
-// Print is defined at the end as an example of how to query and extract complex
-// values from a decoder in terms of their simple components.
-void print(proton::value&);
-
-// Some helper templates to print map and std::vector results.
-namespace std {
-template<class T, class U> ostream& operator<<(ostream& o, const std::pair<T,U>& p) {
-    return o << p.first << ":" << p.second;
-}
-template<class T> ostream& operator<<(ostream& o, const std::vector<T>& v) {
-    o << "[ ";
-    ostream_iterator<T> oi(o, " ");
-    copy(v.begin(), v.end(), oi);
-    return o << "]";
-}
-template<class T> ostream& operator<<(ostream& o, const std::list<T>& v) {
-    o << "[ ";
-    ostream_iterator<T> oi(o, " ");
-    copy(v.begin(), v.end(), oi);
-    return o << "]";
-}
-template<class K, class T> ostream& operator<<(ostream& o, const map<K, T>& m) {
-    o << "{ ";
-    ostream_iterator<std::pair<K,T> > oi(o, " ");
-    copy(m.begin(), m.end(), oi);
-    return o << "}";
-}
-}
-
-// Insert/extract native C++ containers with uniform type values.
-static void uniform_containers() {
-    std::cout << std::endl << "== Array, list and map of uniform type." << std::endl;
-    proton::value v;
-
-    std::vector<int> a;
-    a.push_back(1);
-    a.push_back(2);
-    a.push_back(3);
-    // By default a C++ container is encoded as an AMQP array.
-    v = a;
-    print(v);
-    std::list<int> a1;
-    proton::get(v, a1);
-    std::cout << a1 << std::endl;
-
-    // You can specify that a container should be encoded as an AMQP list instead.
-    v = proton::codec::encoder::list(a1);
-    print(v);
-    std::cout << proton::get<std::vector<int> >(v) << std::endl;
-
-    // C++ map types (types with key_type, mapped_type) convert to an AMQP map by default.
-    std::map<std::string, int> m;
-    m["one"] = 1;
-    m["two"] = 2;
-    v = m;
-    print(v);
-    std::cout << proton::get<std::map<std::string, int> >(v) << std::endl;
-
-    // A sequence of pairs encodes as an AMQP MAP, which lets you control the encoded order.
-    std::vector<std::pair<std::string, int> > pairs;
-    pairs.push_back(std::make_pair("z", 3));
-    pairs.push_back(std::make_pair("a", 4));
-    v = pairs;
-    print(v);
-
-    // You can also decode an AMQP map as a sequence of pairs to preserve encode order.
-    std::vector<std::pair<std::string, int> > pairs2;
-    proton::codec::decoder d(v);
-    d >> pairs2;
-    std::cout << pairs2 << std::endl;
-
-    // A vector of proton::value is normally encoded as a mixed-type AMQP LIST,
-    // but you can encoded it as an array provided all the values match the array type.
-    std::vector<proton::value> vv;
-    vv.push_back(proton::value("a"));
-    vv.push_back(proton::value("b"));
-    vv.push_back(proton::value("c"));
-    v = vv;
-    print(v);
-}
-
-// Containers with mixed types use value to represent arbitrary AMQP types.
-static void mixed_containers() {
-    std::cout << std::endl << "== List and map of mixed type values." << std::endl;
-    proton::value v;
-
-    std::vector<proton::value> l;
-    l.push_back(proton::value(42));
-    l.push_back(proton::value(std::string("foo")));
-    // By default, a sequence of proton::value is treated as an AMQP list.
-    v = l;
-    print(v);
-    std::vector<proton::value> l2 = proton::get<std::vector<proton::value> >(v);
-    std::cout << l2 << std::endl;
-
-    std::map<proton::value, proton::value> m;
-    m[proton::value("five")] = proton::value(5);
-    m[proton::value(4)] = proton::value("four"); v = m;
-    print(v);
-    typedef std::map<proton::value, proton::value> value_map;
-    value_map m2(proton::get<value_map>(v));
-    std::cout << m2 << std::endl;
-}
-
-// Insert using stream operators (see print_next for example of extracting with stream ops.)
-static void insert_stream_operators() {
-    std::cout << std::endl << "== Insert with stream operators." << std::endl;
-    proton::value v;
-
-    // Create an array of INT with values [1, 2, 3]
-    proton::codec::encoder e(v);
-    e << proton::codec::start::array(proton::INT)
-      << int32_t(1) << int32_t(2) << int32_t(3)
-      << proton::codec::finish();
-    print(v);
-
-    // Create a mixed-type list of the values [42, 0, "x"].
-    proton::codec::encoder e2(v);
-    e2 << proton::codec::start::list()
-       << int32_t(42) << false << proton::symbol("x")
-       << proton::codec::finish();
-    print(v);
-
-    // Create a map { "k1":42, "k2": false }
-    proton::codec::encoder e3(v);
-    e3 << proton::codec::start::map()
-       << "k1" << int32_t(42)
-       << proton::symbol("k2") << false
-       << proton::codec::finish();
-    print(v);
-}
-
-int main(int, char**) {
-    try {
-        uniform_containers();
-        mixed_containers();
-        insert_stream_operators();
-        return 0;
-    } catch (const std::exception& e) {
-        std::cerr << std::endl << "error: " << e.what() << std::endl;
-    }
-    return 1;
-}
-
-// print_next prints the next value from values by recursively descending into complex values.
-//
-// NOTE this is for example puroses only: There is a built in ostream operator<< for values.
-//
-//
-static void print_next(proton::codec::decoder& d) {
-    proton::type_id type = d.next_type();
-    proton::codec::start s;
-    switch (type) {
-      case proton::ARRAY: {
-          d >> s;
-          std::cout << "array<" << s.element;
-          if (s.is_described) {
-              std::cout  << ", descriptor=";
-              print_next(d);
-          }
-          std::cout << ">[";
-          for (size_t i = 0; i < s.size; ++i) {
-              if (i) std::cout << ", ";
-              print_next(d);
-          }
-          std::cout << "]";
-          d >> proton::codec::finish();
-          break;
-      }
-      case proton::LIST: {
-          d >> s;
-          std::cout << "list[";
-          for (size_t i = 0; i < s.size; ++i) {
-              if (i) std::cout << ", ";
-              print_next(d);
-          }
-          std::cout << "]";
-          d >> proton::codec::finish();
-          break;
-      }
-      case proton::MAP: {
-          d >> s;
-          std::cout << "map{";
-          for (size_t i = 0; i < s.size/2; ++i) {
-              if (i) std::cout << ", ";
-              print_next(d);
-              std::cout << ":";        // key:value
-              print_next(d);
-          }
-          std::cout << "}";
-          d >> proton::codec::finish();
-          break;
-      }
-      case proton::DESCRIBED: {
-          d >> s;
-          std::cout << "described(";
-          print_next(d);      // Descriptor
-          print_next(d);      // value
-          d >> proton::codec::finish();
-          break;
-      }
-      default:
-        // A simple type. We could continue the switch for all AMQP types but
-        // we will take a short cut and extract to another value and print that.
-        proton::value v2;
-        d >> v2;
-        std::cout << type << "(" << v2 << ")";
-    }
-}
-
-// Print a value, for example purposes. Normal code can use operator<<
-void print(proton::value& v) {
-    proton::codec::decoder d(v);
-    d.rewind();
-    while (d.more()) {
-        print_next(d);
-        if (d.more()) std::cout << ", ";
-    }
-    std::cout << std::endl;
-}
diff --git a/examples/cpp/example_test.py b/examples/cpp/example_test.py
deleted file mode 100644
index e2052dc..0000000
--- a/examples/cpp/example_test.py
+++ /dev/null
@@ -1,451 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License
-#
-
-# This is a test script to run the examples and verify that they behave as expected.
-
-import unittest
-import os, sys, socket, time, re, inspect
-from  random import randrange
-from subprocess import Popen, PIPE, STDOUT, call
-from copy import copy
-import platform
-from os.path import dirname as dirname
-from threading import Thread, Event
-from string import Template
-
-createdSASLDb = False
-
-def findfileinpath(filename, searchpath):
-    """Find filename in the searchpath
-        return absolute path to the file or None
-    """
-    paths = searchpath.split(os.pathsep)
-    for path in paths:
-        if os.path.exists(os.path.join(path, filename)):
-            return os.path.abspath(os.path.join(path, filename))
-    return None
-
-def _cyrusSetup(conf_dir):
-  """Write out simple SASL config.
-  """
-  saslpasswd = ""
-  if 'SASLPASSWD' in os.environ:
-    saslpasswd = os.environ['SASLPASSWD']
-  else:
-    saslpasswd = findfileinpath('saslpasswd2', os.getenv('PATH')) or ""
-  if os.path.exists(saslpasswd):
-    t = Template("""sasldb_path: ${db}
-mech_list: EXTERNAL DIGEST-MD5 SCRAM-SHA-1 CRAM-MD5 PLAIN ANONYMOUS
-""")
-    abs_conf_dir = os.path.abspath(conf_dir)
-    call(args=['rm','-rf',abs_conf_dir])
-    os.mkdir(abs_conf_dir)
-    db = os.path.join(abs_conf_dir,'proton.sasldb')
-    conf = os.path.join(abs_conf_dir,'proton-server.conf')
-    f = open(conf, 'w')
-    f.write(t.substitute(db=db))
-    f.close()
-
-    cmd_template = Template("echo password | ${saslpasswd} -c -p -f ${db} -u proton user")
-    cmd = cmd_template.substitute(db=db, saslpasswd=saslpasswd)
-    call(args=cmd, shell=True)
-
-    os.environ['PN_SASL_CONFIG_PATH'] = abs_conf_dir
-    global createdSASLDb
-    createdSASLDb = True
-
-# Globally initialize Cyrus SASL configuration
-#if SASL.extended():
-_cyrusSetup('sasl_conf')
-
-def ensureCanTestExtendedSASL():
-#  if not SASL.extended():
-#    raise Skipped('Extended SASL not supported')
-  if not createdSASLDb:
-    raise Skipped("Can't Test Extended SASL: Couldn't create auth db")
-
-def pick_addr():
-    """Pick a new host:port address."""
-    # TODO Conway 2015-07-14: need a safer way to pick ports.
-    p =  randrange(10000, 20000)
-    return "127.0.0.1:%s" % p
-
-class ProcError(Exception):
-    """An exception that captures failed process output"""
-    def __init__(self, proc, what="non-0 exit"):
-        out = proc.out.strip()
-        if out:
-            out = "\nvvvvvvvvvvvvvvvv\n%s\n^^^^^^^^^^^^^^^^\n" % out
-        else:
-            out = ", no output)"
-        super(Exception, self, ).__init__(
-            "%s %s, code=%s%s" % (proc.args, what, proc.returncode, out))
-
-class Proc(Popen):
-    """A example process that stores its stdout and can scan it for a 'ready' pattern'"""
-
-    if "VALGRIND" in os.environ and os.environ["VALGRIND"]:
-        env_args = [os.environ["VALGRIND"], "--error-exitcode=42", "--quiet", "--leak-check=full"]
-    else:
-        env_args = []
-
-    def __init__(self, args, ready=None, timeout=30, skip_valgrind=False, **kwargs):
-        """Start an example process"""
-        args = list(args)
-        if platform.system() == "Windows":
-            args[0] += ".exe"
-        self.timeout = timeout
-        self.args = args
-        self.out = ""
-        if not skip_valgrind:
-            args = self.env_args + args
-        try:
-            Popen.__init__(self, args, stdout=PIPE, stderr=STDOUT,
-                           universal_newlines=True,  **kwargs)
-        except Exception as e:
-            raise ProcError(self, str(e))
-        # Start reader thread.
-        self.pattern = ready
-        self.ready = Event()
-        # Help with Python 2.5, 2.6, 2.7 changes to Event.wait(), Event.is_set
-        self.ready_set = False
-        self.error = None
-        self.thread = Thread(target=self.run_)
-        self.thread.daemon = True
-        self.thread.start()
-        if self.pattern:
-            self.wait_ready()
-
-    def run_(self):
-        try:
-            while True:
-                l = self.stdout.readline()
-                if not l: break
-                self.out += l
-                if self.pattern is not None:
-                    if re.search(self.pattern, l):
-                        self.ready_set = True
-                        self.ready.set()
-            if self.wait() != 0:
-                raise ProcError(self)
-        except Exception as e:
-            self.error = e
-        finally:
-            self.stdout.close()
-            self.ready_set = True
-            self.ready.set()
-
-    def safe_kill(self):
-        """Kill and clean up zombie but don't wait forever. No exceptions."""
-        try:
-            self.kill()
-            self.thread.join(self.timeout)
-        except: pass
-        return self.out
-
-    def check_(self):
-        if self.error:
-            raise self.error
-
-    def wait_ready(self):
-        """Wait for ready to appear in output"""
-        self.ready.wait(self.timeout)
-        if self.ready_set:
-            self.check_()
-            return self.out
-        else:
-            self.safe_kill()
-            raise ProcError(self, "timeout waiting for '%s'" % self.pattern)
-
-    def wait_exit(self):
-        """Wait for process to exit, return output. Raise ProcError on failure."""
-        self.thread.join(self.timeout)
-        if self.poll() is not None:
-            self.check_()
-            return self.out
-        else:
-            raise ProcError(self, "timeout waiting for exit")
-
-
-if hasattr(unittest.TestCase, 'setUpClass') and  hasattr(unittest.TestCase, 'tearDownClass'):
-    TestCase = unittest.TestCase
-else:
-    class TestCase(unittest.TestCase):
-        """
-        Roughly provides setUpClass and tearDownClass functionality for older python
-        versions in our test scenarios. If subclasses override setUp or tearDown
-        they *must* call the superclass.
-        """
-        def setUp(self):
-            if not hasattr(type(self), '_setup_class_count'):
-                type(self)._setup_class_count = len(
-                    inspect.getmembers(
-                        type(self),
-                        predicate=lambda m: inspect.ismethod(m) and m.__name__.startswith('test_')))
-                type(self).setUpClass()
-
-        def tearDown(self):
-            self.assertTrue(self._setup_class_count > 0)
-            self._setup_class_count -=  1
-            if self._setup_class_count == 0:
-                type(self).tearDownClass()
-
-
-class ExampleTestCase(TestCase):
-    """TestCase that manages started processes"""
-    def setUp(self):
-        super(ExampleTestCase, self).setUp()
-        self.procs = []
-
-    def tearDown(self):
-        for p in self.procs:
-            p.safe_kill()
-        super(ExampleTestCase, self).tearDown()
-
-    def proc(self, *args, **kwargs):
-        p = Proc(*args, **kwargs)
-        self.procs.append(p)
-        return p
-
-class BrokerTestCase(ExampleTestCase):
-    """
-    ExampleTest that starts a broker in setUpClass and kills it in tearDownClass.
-    Subclasses must set `broker_exe` class variable with the name of the broker executable.
-    """
-
-    @classmethod
-    def setUpClass(cls):
-        cls.addr = pick_addr() + "/examples"
-        cls.broker = None       # In case Proc throws, create the attribute.
-        cls.broker = Proc([cls.broker_exe, "-a", cls.addr], ready="listening")
-        cls.broker.wait_ready()
-
-    @classmethod
-    def tearDownClass(cls):
-        if cls.broker: cls.broker.safe_kill()
-
-    def tearDown(self):
-        b = type(self).broker
-        if b and b.poll() !=  None: # Broker crashed
-            type(self).setUpClass() # Start another for the next test.
-            raise ProcError(b, "broker crash")
-        super(BrokerTestCase, self).tearDown()
-
-
-CLIENT_EXPECT="""Twas brillig, and the slithy toves => TWAS BRILLIG, AND THE SLITHY TOVES
-Did gire and gymble in the wabe. => DID GIRE AND GYMBLE IN THE WABE.
-All mimsy were the borogroves, => ALL MIMSY WERE THE BOROGROVES,
-And the mome raths outgrabe. => AND THE MOME RATHS OUTGRABE.
-"""
-
-def recv_expect(name, addr):
-    return "%s listening on %s\n%s" % (
-        name, addr, "".join(['{"sequence"=%s}\n' % (i+1) for i in range(100)]))
-
-class ContainerExampleTest(BrokerTestCase):
-    """Run the container examples, verify they behave as expected."""
-
-    broker_exe = "broker"
-
-    def test_helloworld(self):
-        self.assertEqual('Hello World!\n', self.proc(["helloworld", self.addr]).wait_exit())
-
-    def test_helloworld_direct(self):
-        self.assertEqual('Hello World!\n', self.proc(["helloworld_direct", pick_addr()]).wait_exit())
-
-    def test_simple_send_recv(self):
-        self.assertEqual("all messages confirmed\n",
-                         self.proc(["simple_send", "-a", self.addr]).wait_exit())
-        self.assertEqual(recv_expect("simple_recv", self.addr), self.proc(["simple_recv", "-a", self.addr]).wait_exit())
-
-    def test_simple_recv_send(self):
-        # Start receiver first, then run sender"""
-        recv = self.proc(["simple_recv", "-a", self.addr])
-        self.assertEqual("all messages confirmed\n",
-                         self.proc(["simple_send", "-a", self.addr]).wait_exit())
-        self.assertEqual(recv_expect("simple_recv", self.addr), recv.wait_exit())
-
-
-    def test_simple_send_direct_recv(self):
-        addr = pick_addr()
-        recv = self.proc(["direct_recv", "-a", addr], "listening")
-        self.assertEqual("all messages confirmed\n",
-                         self.proc(["simple_send", "-a", addr]).wait_exit())
-        self.assertEqual(recv_expect("direct_recv", addr), recv.wait_exit())
-
-    def test_simple_recv_direct_send(self):
-        addr = pick_addr()
-        send = self.proc(["direct_send", "-a", addr], "listening")
-        self.assertEqual(recv_expect("simple_recv", addr),
-                         self.proc(["simple_recv", "-a", addr]).wait_exit())
-
-        self.assertEqual(
-            "direct_send listening on %s\nall messages confirmed\n" % addr,
-            send.wait_exit())
-
-    def test_request_response(self):
-        server = self.proc(["server", "-a", self.addr], "connected")
-        self.assertEqual(CLIENT_EXPECT,
-                         self.proc(["client", "-a", self.addr]).wait_exit())
-
-    def test_request_response_direct(self):
-        addr = pick_addr()
-        server = self.proc(["server_direct", "-a", addr+"/examples"], "listening")
-        self.assertEqual(CLIENT_EXPECT,
-                         self.proc(["client", "-a", addr+"/examples"]).wait_exit())
-
-    def test_flow_control(self):
-        want="""success: Example 1: simple credit
-success: Example 2: basic drain
-success: Example 3: drain without credit
-success: Exmaple 4: high/low watermark
-"""
-        self.assertEqual(want, self.proc(["flow_control", "--address", pick_addr(), "--quiet"]).wait_exit())
-
-    def test_encode_decode(self):
-        want="""
-== Array, list and map of uniform type.
-array<int>[int(1), int(2), int(3)]
-[ 1 2 3 ]
-list[int(1), int(2), int(3)]
-[ 1 2 3 ]
-map{string(one):int(1), string(two):int(2)}
-{ one:1 two:2 }
-map{string(z):int(3), string(a):int(4)}
-[ z:3 a:4 ]
-list[string(a), string(b), string(c)]
-
-== List and map of mixed type values.
-list[int(42), string(foo)]
-[ 42 foo ]
-map{int(4):string(four), string(five):int(5)}
-{ 4:four five:5 }
-
-== Insert with stream operators.
-array<int>[int(1), int(2), int(3)]
-list[int(42), boolean(0), symbol(x)]
-map{string(k1):int(42), symbol(k2):boolean(0)}
-"""
-        self.maxDiff = None
-        self.assertEqual(want, self.proc(["encode_decode"]).wait_exit())
-
-    def ssl_certs_dir(self):
-        """Absolute path to the test SSL certificates"""
-        pn_root = dirname(dirname(dirname(sys.argv[0])))
-        return os.path.join(pn_root, "examples/cpp/ssl_certs")
-
-    def test_ssl(self):
-        # SSL without SASL, VERIFY_PEER_NAME
-        addr = "amqps://" + pick_addr() + "/examples"
-        # Disable valgrind when using OpenSSL
-        out = self.proc(["ssl", "-a", addr, "-c", self.ssl_certs_dir()], skip_valgrind=True).wait_exit()
-        expect = "Outgoing client connection connected via SSL.  Server certificate identity CN=test_server\nHello World!"
-        expect_found = (out.find(expect) >= 0)
-        self.assertEqual(expect_found, True)
-
-    def test_ssl_no_name(self):
-        # VERIFY_PEER
-        addr = "amqps://" + pick_addr() + "/examples"
-        # Disable valgrind when using OpenSSL
-        out = self.proc(["ssl", "-a", addr, "-c", self.ssl_certs_dir(), "-v", "noname"], skip_valgrind=True).wait_exit()
-        expect = "Outgoing client connection connected via SSL.  Server certificate identity CN=test_server\nHello World!"
-        expect_found = (out.find(expect) >= 0)
-        self.assertEqual(expect_found, True)
-
-    def test_ssl_bad_name(self):
-        # VERIFY_PEER
-        addr = "amqps://" + pick_addr() + "/examples"
-        # Disable valgrind when using OpenSSL
-        out = self.proc(["ssl", "-a", addr, "-c", self.ssl_certs_dir(), "-v", "fail"], skip_valgrind=True).wait_exit()
-        expect = "Expected failure of connection with wrong peer name"
-        expect_found = (out.find(expect) >= 0)
-        self.assertEqual(expect_found, True)
-
-    def test_ssl_client_cert(self):
-        # SSL with SASL EXTERNAL
-        expect="""Inbound client certificate identity CN=test_client
-Outgoing client connection connected via SSL.  Server certificate identity CN=test_server
-Hello World!
-"""
-        addr = "amqps://" + pick_addr() + "/examples"
-        # Disable valgrind when using OpenSSL
-        out = self.proc(["ssl_client_cert", addr, self.ssl_certs_dir()], skip_valgrind=True).wait_exit()
-        expect_found = (out.find(expect) >= 0)
-        self.assertEqual(expect_found, True)
-
-    def test_scheduled_send_03(self):
-        # Output should be a bunch of "send" lines but can't guarantee exactly how many.
-        out = self.proc(["scheduled_send_03", "-a", self.addr+"scheduled_send", "-t", "0.1", "-i", "0.001"]).wait_exit().split()
-        self.assertTrue(len(out) > 0);
-        self.assertEqual(["send"]*len(out), out)
-
-    def test_scheduled_send(self):
-        try:
-            out = self.proc(["scheduled_send", "-a", self.addr+"scheduled_send", "-t", "0.1", "-i", "0.001"]).wait_exit().split()
-            self.assertTrue(len(out) > 0);
-            self.assertEqual(["send"]*len(out), out)
-        except ProcError:       # File not found, not a C++11 build.
-            pass
-
-
-class EngineTestCase(BrokerTestCase):
-    """Run selected clients to test a connction_engine broker."""
-
-    def test_helloworld(self):
-        self.assertEqual('Hello World!\n',
-                         self.proc(["helloworld", self.addr]).wait_exit())
-
-    def test_simple_send_recv(self):
-        self.assertEqual("all messages confirmed\n",
-                         self.proc(["simple_send", "-a", self.addr]).wait_exit())
-        self.assertEqual(recv_expect("simple_recv", self.addr), self.proc(["simple_recv", "-a", self.addr]).wait_exit())
-
-    def test_simple_recv_send(self):
-        # Start receiver first, then run sender"""
-        recv = self.proc(["simple_recv", "-a", self.addr])
-        self.assertEqual("all messages confirmed\n", self.proc(["simple_send", "-a", self.addr]).wait_exit())
-        self.assertEqual(recv_expect("simple_recv", self.addr), recv.wait_exit())
-
-
-    def test_simple_send_direct_recv(self):
-        addr = pick_addr()
-        recv = self.proc(["direct_recv", "-a", addr], "listening")
-        self.assertEqual("all messages confirmed\n",
-                         self.proc(["simple_send", "-a", addr]).wait_exit())
-        self.assertEqual(recv_expect("direct_recv", addr), recv.wait_exit())
-
-    def test_simple_recv_direct_send(self):
-        addr = pick_addr()
-        send = self.proc(["direct_send", "-a", addr], "listening")
-        self.assertEqual(recv_expect("simple_recv", addr),
-                         self.proc(["simple_recv", "-a", addr]).wait_exit())
-        self.assertEqual("direct_send listening on %s\nall messages confirmed\n" % addr,
-                         send.wait_exit())
-
-    def test_request_response(self):
-        server = self.proc(["server", "-a", self.addr], "connected")
-        self.assertEqual(CLIENT_EXPECT,
-                         self.proc(["client", "-a", self.addr]).wait_exit())
-
-
-class MtBrokerTest(EngineTestCase):
-    broker_exe = "mt_broker"
-
-if __name__ == "__main__":
-    unittest.main()
diff --git a/examples/cpp/fake_cpp11.hpp b/examples/cpp/fake_cpp11.hpp
deleted file mode 100644
index 03daa3b..0000000
--- a/examples/cpp/fake_cpp11.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef FAKE_CPP11_HPP
-#define FAKE_CPP11_HPP
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/// These definitions allow us to use some new C++11 features in previous compilers
-///
-/// It is strongly recommended not to copy this - just use C++11/C++14 instead!
-
-#if __cplusplus < 201103L
-#define OVERRIDE
-#else
-#define OVERRIDE override
-#endif
-
-
-#endif // FAKE_CPP11_HPP
diff --git a/examples/cpp/flow_control.cpp b/examples/cpp/flow_control.cpp
deleted file mode 100644
index c0b8739..0000000
--- a/examples/cpp/flow_control.cpp
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "options.hpp"
-
-#include <proton/connection.hpp>
-#include <proton/connection_options.hpp>
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/delivery.hpp>
-#include <proton/listener.hpp>
-#include <proton/message.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/receiver_options.hpp>
-#include <proton/sender.hpp>
-#include <proton/thread_safe.hpp>
-#include <proton/tracker.hpp>
-
-#include <iostream>
-#include <sstream>
-
-#include "fake_cpp11.hpp"
-
-namespace {
-
-bool verbose = true;
-
-void verify(bool success, const std::string &msg) {
-    if (!success)
-        throw std::runtime_error("example failure:" + msg);
-    else {
-        std::cout << "success: " << msg << std::endl;
-        if (verbose) std::cout << std::endl;
-    }
-}
-
-}
-
-// flow_sender manages the incoming connection and acts as the message sender.
-class flow_sender : public proton::messaging_handler {
-  private:
-    int available;  // Number of messages the sender may send assuming sufficient credit.
-    int sequence;
-
-  public:
-    flow_sender() : available(0), sequence(0) {}
-
-    void send_available_messages(proton::sender &s) {
-        for (int i = sequence; available && s.credit() > 0; i++) {
-            std::ostringstream mbody;
-            mbody << "flow_sender message " << sequence++;
-            proton::message m(mbody.str());
-            s.send(m);
-            available--;
-        }
-    }
-
-    void on_sendable(proton::sender &s) OVERRIDE {
-        if (verbose)
-            std::cout << "flow_sender in \"on_sendable\" with credit " << s.credit()
-                      << " and " << available << " available messages" << std::endl;
-        send_available_messages(s);
-    }
-
-    void on_sender_drain_start(proton::sender &s) OVERRIDE {
-        if (verbose)
-            std::cout << "flow_sender in \"on_drain_start\" with credit " << s.credit()
-                      << " and " << available << " available messages" << std::endl;
-        send_available_messages(s);
-        if (s.credit()) {
-            s.return_credit(); // return the rest
-        }
-    }
-
-    void set_available(int n) { available = n; }
-};
-
-class flow_receiver : public proton::messaging_handler {
-  public:
-    int stage;
-    int received;
-    flow_sender &sender;
-
-    flow_receiver(flow_sender &s) : stage(0), received(0), sender(s) {}
-
-    void example_setup(int n) {
-        received = 0;
-        sender.set_available(n);
-    }
-
-    void run_stage(proton::receiver &r, const std::string &caller) {
-        // Serialize the progression of the flow control examples.
-        switch (stage) {
-        case 0:
-            if (verbose) std::cout << "Example 1.  Simple use of credit." << std::endl;
-            // TODO: add timeout callbacks, show no messages until credit.
-            example_setup(2);
-            r.add_credit(2);
-            break;
-        case 1:
-            if (r.credit() > 0) return;
-            verify(received == 2, "Example 1: simple credit");
-
-            if (verbose) std::cout << "Example 2.   Use basic drain, sender has 3 \"immediate\" messages." << std::endl;
-            example_setup(3);
-            r.add_credit(5); // ask for up to 5
-            r.drain();       // but only use what's available
-            break;
-        case 2:
-            if (caller == "on_message") return;
-            if (caller == "on_receiver_drain_finish") {
-                // Note that unused credit of 2 at sender is returned and is now 0.
-                verify(received == 3 && r.credit() == 0, "Example 2: basic drain");
-
-                if (verbose) std::cout << "Example 3. Drain use with no credit." << std::endl;
-                example_setup(0);
-                r.drain();
-                break;
-            }
-            verify(false, "example 2 run_stage");
-            return;
-
-        case 3:
-            verify(caller == "on_receiver_drain_finish" && received == 0, "Example 3: drain without credit");
-
-            if (verbose) std::cout << "Example 4. Show using high(10)/low(3) watermark for 25 messages." << std::endl;
-            example_setup(25);
-            r.add_credit(10);
-            break;
-
-        case 4:
-            if (received < 25) {
-                // Top up credit as needed.
-                uint32_t credit = r.credit();
-                if (credit <= 3) {
-                    uint32_t new_credit = 10;
-                    uint32_t remaining = 25 - received;
-                    if (new_credit > remaining)
-                        new_credit = remaining;
-                    if (new_credit > credit) {
-                        r.add_credit(new_credit - credit);
-                        if (verbose)
-                            std::cout << "flow_receiver adding credit for " << new_credit - credit
-                                      << " messages" << std::endl;
-                    }
-                }
-                return;
-            }
-
-            verify(received == 25 && r.credit() == 0, "Exmaple 4: high/low watermark");
-            r.connection().close();
-            break;
-
-        default:
-            throw std::runtime_error("run_stage sequencing error");
-        }
-        stage++;
-    }
-
-    void on_receiver_open(proton::receiver &r) OVERRIDE {
-        run_stage(r, "on_receiver_open");
-    }
-
-    void on_message(proton::delivery &d, proton::message &m) OVERRIDE {
-        if (verbose)
-            std::cout << "flow_receiver in \"on_message\" with " << m.body() << std::endl;
-        proton::receiver r(d.receiver());
-        received++;
-        run_stage(r, "on_message");
-    }
-
-    void on_receiver_drain_finish(proton::receiver &r) OVERRIDE {
-        if (verbose)
-            std::cout << "flow_receiver in \"on_receiver_drain_finish\"" << std::endl;
-        run_stage(r, "on_receiver_drain_finish");
-    }
-};
-
-
-class flow_control : public proton::messaging_handler {
-  private:
-    std::string url;
-    proton::listener listener;
-    flow_sender send_handler;
-    flow_receiver receive_handler;
-
-  public:
-    flow_control(const std::string& u) : url(u), receive_handler(send_handler) {}
-
-    void on_container_start(proton::container &c) OVERRIDE {
-        listener = c.listen(url, proton::connection_options().handler(send_handler));
-        c.connect(url);
-    }
-
-    void on_connection_open(proton::connection &c) OVERRIDE {
-        if (c.active()) {
-            // outbound connection
-            c.open_receiver("flow_example", proton::receiver_options().handler(receive_handler).credit_window(0));
-        }
-    }
-
-    void on_connection_close(proton::connection &) OVERRIDE {
-        listener.stop();
-    }
-};
-
-int main(int argc, char **argv) {
-    // Pick an "unusual" port since we are going to be talking to
-    // ourselves, not a broker.
-    std::string address("127.0.0.1:8888");
-    bool quiet = false;
-
-    example::options opts(argc, argv);
-    opts.add_value(address, 'a', "address", "connect and send to URL", "URL");
-    opts.add_flag(quiet, 'q', "quiet", "suppress additional commentary of credit allocation and consumption");
-
-    try {
-        opts.parse();
-        if (quiet)
-            verbose = false;
-
-        flow_control fc(address);
-        proton::default_container(fc).run();
-
-        return 0;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-
-    return 1;
-}
diff --git a/examples/cpp/helloworld.cpp b/examples/cpp/helloworld.cpp
deleted file mode 100644
index 4aa5cdd..0000000
--- a/examples/cpp/helloworld.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/connection.hpp>
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/delivery.hpp>
-#include <proton/message.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/thread_safe.hpp>
-#include <proton/tracker.hpp>
-#include <proton/url.hpp>
-
-#include <iostream>
-
-#include "fake_cpp11.hpp"
-
-class hello_world : public proton::messaging_handler {
-  private:
-    proton::url url;
-
-  public:
-    hello_world(const std::string& u) : url(u) {}
-
-    void on_container_start(proton::container& c) OVERRIDE {
-        c.connect(url);
-    }
-
-    void on_connection_open(proton::connection& c) OVERRIDE {
-        c.open_receiver(url.path());
-        c.open_sender(url.path());
-    }
-
-    void on_sendable(proton::sender &s) OVERRIDE {
-        proton::message m("Hello World!");
-        s.send(m);
-        s.close();
-    }
-
-    void on_message(proton::delivery &d, proton::message &m) OVERRIDE {
-        std::cout << m.body() << std::endl;
-        d.connection().close();
-    }
-};
-
-int main(int argc, char **argv) {
-    try {
-        std::string url = argc > 1 ? argv[1] : "127.0.0.1:5672/examples";
-
-        hello_world hw(url);
-        proton::default_container(hw).run();
-
-        return 0;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-
-    return 1;
-}
diff --git a/examples/cpp/helloworld_direct.cpp b/examples/cpp/helloworld_direct.cpp
deleted file mode 100644
index b3a1af8..0000000
--- a/examples/cpp/helloworld_direct.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/connection.hpp>
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/listener.hpp>
-#include <proton/message.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/sender.hpp>
-#include <proton/thread_safe.hpp>
-#include <proton/tracker.hpp>
-
-#include <iostream>
-
-#include "fake_cpp11.hpp"
-
-class hello_world_direct : public proton::messaging_handler {
-  private:
-    std::string url;
-    proton::listener listener;
-
-  public:
-    hello_world_direct(const std::string& u) : url(u) {}
-
-    void on_container_start(proton::container &c) OVERRIDE {
-        listener = c.listen(url);
-        c.open_sender(url);
-    }
-
-    void on_sendable(proton::sender &s) OVERRIDE {
-        proton::message m("Hello World!");
-        s.send(m);
-        s.close();
-    }
-
-    void on_message(proton::delivery &, proton::message &m) OVERRIDE {
-        std::cout << m.body() << std::endl;
-    }
-
-    void on_tracker_accept(proton::tracker &t) OVERRIDE {
-        t.connection().close();
-    }
-
-    void on_connection_close(proton::connection&) OVERRIDE {
-        listener.stop();
-    }
-};
-
-int main(int argc, char **argv) {
-    try {
-        // Pick an "unusual" port since we are going to be talking to
-        // ourselves, not a broker.
-        std::string url = argc > 1 ? argv[1] : "127.0.0.1:8888/examples";
-
-        hello_world_direct hwd(url);
-        proton::default_container(hwd).run();
-
-        return 0;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-
-    return 1;
-}
diff --git a/examples/cpp/mt/broker.cpp b/examples/cpp/mt/broker.cpp
deleted file mode 100644
index 83b7005..0000000
--- a/examples/cpp/mt/broker.cpp
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "../options.hpp"
-#include "mt_container.hpp"
-
-#include <proton/connection.hpp>
-#include <proton/connection_options.hpp>
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/delivery.hpp>
-#include <proton/error_condition.hpp>
-#include <proton/listen_handler.hpp>
-#include <proton/listener.hpp>
-#include <proton/message.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/sender_options.hpp>
-#include <proton/source_options.hpp>
-#include <proton/target.hpp>
-#include <proton/thread_safe.hpp>
-#include <proton/tracker.hpp>
-
-#include <atomic>
-#include <deque>
-#include <functional>
-#include <iostream>
-#include <map>
-#include <mutex>
-#include <thread>
-
-#include "../fake_cpp11.hpp"
-
-// Thread safe queue.
-// Stores messages, notifies subscribed connections when there is data.
-class queue {
-  public:
-    queue(const std::string& name) : name_(name) {}
-
-    std::string name() const { return name_; }
-
-    // Push a message onto the queue.
-    // If the queue was previously empty, notify subscribers it has messages.
-    // Called from receiver's connection.
-    void push(const proton::message &m) {
-        std::lock_guard<std::mutex> g(lock_);
-        messages_.push_back(m);
-        if (messages_.size() == 1) { // Non-empty, notify subscribers
-            for (auto cb : callbacks_)
-                cb(this);
-            callbacks_.clear();
-        }
-    }
-
-    // If the queue is not empty, pop a message into m and return true.
-    // Otherwise save callback to be called when there are messages and return false.
-    // Called from sender's connection.
-    bool pop(proton::message& m, std::function<void(queue*)> callback) {
-        std::lock_guard<std::mutex> g(lock_);
-        if (messages_.empty()) {
-            callbacks_.push_back(callback);
-            return false;
-        } else {
-            m = std::move(messages_.front());
-            messages_.pop_front();
-            return true;
-        }
-    }
-
-  private:
-    const std::string name_;
-    std::mutex lock_;
-    std::deque<proton::message> messages_;
-    std::vector<std::function<void(queue*)> > callbacks_;
-};
-
-/// Thread safe map of queues.
-class queues {
-  public:
-    queues() : next_id_(0) {}
-
-    // Get or create the named queue.
-    queue* get(const std::string& name) {
-        std::lock_guard<std::mutex> g(lock_);
-        auto i = queues_.insert(queue_map::value_type(name, nullptr)).first;
-        if (!i->second)
-            i->second.reset(new queue(name));
-        return i->second.get();
-    }
-
-    // Create a dynamic queue with a unique name.
-    queue* dynamic() {
-        std::ostringstream os;
-        os << "_dynamic_" << next_id_++;
-        return get(os.str());
-    }
-
-  private:
-    typedef std::map<std::string, std::unique_ptr<queue> > queue_map;
-
-    std::mutex lock_;
-    queue_map queues_;
-    std::atomic<int> next_id_; // Use to generate unique queue IDs.
-};
-
-/// Broker connection handler. Things to note:
-///
-/// 1. Each handler manages a single connection.
-///
-/// 2. For a *single connection* calls to proton::handler functions and calls to
-/// function objects passed to proton::event_loop::inject() are serialized,
-/// i.e. never called concurrently. Handlers can have per-connection state
-/// without needing locks.
-///
-/// 3. Handler/injected functions for *different connections* can be called
-/// concurrently. Resources used by multiple connections (e.g. the queues in
-/// this example) must be thread-safe.
-///
-/// 4. You can 'inject' work to be done sequentially using a connection's
-/// proton::event_loop. In this example, we create a std::function callback
-/// that we pass to queues, so they can notify us when they have messages.
-///
-class broker_connection_handler : public proton::messaging_handler {
-  public:
-    broker_connection_handler(queues& qs) : queues_(qs) {}
-
-    void on_connection_open(proton::connection& c) OVERRIDE {
-        // Create the has_messages callback for queue subscriptions.
-        //
-        // Make a std::shared_ptr to a thread_safe handle for our proton::connection.
-        // The connection's proton::event_loop will remain valid as a shared_ptr exists.
-        std::shared_ptr<proton::thread_safe<proton::connection> > ts_c = make_shared_thread_safe(c);
-
-        // Make a lambda function to inject a call to this->has_messages() via the proton::event_loop.
-        // The function is bound to a shared_ptr so this is safe. If the connection has already closed
-        // proton::event_loop::inject() will drop the callback.
-        has_messages_callback_ = [this, ts_c](queue* q) mutable {
-            ts_c->event_loop()->inject(
-                std::bind(&broker_connection_handler::has_messages, this, q));
-        };
-
-        c.open();            // Accept the connection
-    }
-
-    // A sender sends messages from a queue to a subscriber.
-    void on_sender_open(proton::sender &sender) OVERRIDE {
-        queue *q = sender.source().dynamic() ?
-            queues_.dynamic() : queues_.get(sender.source().address());
-        sender.open(proton::sender_options().source((proton::source_options().address(q->name()))));
-        std::cout << "sending from " << q->name() << std::endl;
-    }
-
-    // We have credit to send a message.
-    void on_sendable(proton::sender &s) OVERRIDE {
-        queue* q = sender_queue(s);
-        if (!do_send(q, s))     // Queue is empty, save ourselves in the blocked set.
-            blocked_.insert(std::make_pair(q, s));
-    }
-
-    // A receiver receives messages from a publisher to a queue.
-    void on_receiver_open(proton::receiver &r) OVERRIDE {
-        std::string qname = r.target().address();
-        if (qname == "shutdown") {
-            std::cout << "broker shutting down" << std::endl;
-            // Sending to the special "shutdown" queue stops the broker.
-            r.connection().container().stop(
-                proton::error_condition("shutdown", "stop broker"));
-        } else {
-            std::cout << "receiving to " << qname << std::endl;
-        }
-    }
-
-    // A message is received.
-    void on_message(proton::delivery &d, proton::message &m) OVERRIDE {
-        std::string qname = d.receiver().target().address();
-        queues_.get(qname)->push(m);
-    }
-
-    void on_session_close(proton::session &session) OVERRIDE {
-        // Erase all blocked senders that belong to session.
-        auto predicate = [session](const proton::sender& s) {
-            return s.session() == session;
-        };
-        erase_sender_if(blocked_.begin(), blocked_.end(), predicate);
-    }
-
-    void on_sender_close(proton::sender &sender) OVERRIDE {
-        // Erase sender from the blocked set.
-        auto range = blocked_.equal_range(sender_queue(sender));
-        auto predicate = [sender](const proton::sender& s) { return s == sender; };
-        erase_sender_if(range.first, range.second, predicate);
-    }
-
-    void on_error(const proton::error_condition& e) OVERRIDE {
-        std::cerr << "error: " << e.what() << std::endl;
-    }
-    // The container calls on_transport_close() last.
-    void on_transport_close(proton::transport&) OVERRIDE {
-        delete this;            // All done.
-    }
-
-  private:
-    typedef std::multimap<queue*, proton::sender> blocked_map;
-
-    // Get the queue associated with a sender.
-    queue* sender_queue(const proton::sender& s) {
-        return queues_.get(s.source().address()); // Thread safe.
-    }
-
-    // Only called if we have credit. Return true if we sent a message.
-    bool do_send(queue* q, proton::sender &s) {
-        proton::message m;
-        bool popped =  q->pop(m, has_messages_callback_);
-        if (popped)
-            s.send(m);
-        /// if !popped the queue has saved the callback for later.
-        return popped;
-    }
-
-    // Called via the connection's proton::event_loop when q has messages.
-    // Try all the blocked senders.
-    void has_messages(queue* q) {
-        auto range = blocked_.equal_range(q);
-        for (auto i = range.first; i != range.second;) {
-            if (i->second.credit() <= 0 || do_send(q, i->second))
-                i = blocked_.erase(i); // No credit or send was successful, stop blocked.
-            else
-                ++i;            // have credit, didn't send, keep blocked
-        }
-    }
-
-    // Use to erase closed senders from blocked_ set.
-    template <class Predicate>
-    void erase_sender_if(blocked_map::iterator begin, blocked_map::iterator end, Predicate p) {
-        for (auto i = begin; i != end; ) {
-            if (p(i->second))
-                i = blocked_.erase(i);
-            else
-                ++i;
-        }
-    }
-
-    queues& queues_;
-    blocked_map blocked_;
-    std::function<void(queue*)> has_messages_callback_;
-    proton::connection connection_;
-};
-
-
-class broker {
-  public:
-    broker(const std::string addr) :
-        container_(make_mt_container("mt_broker")), listener_(queues_)
-    {
-        container_->listen(addr, listener_);
-        std::cout << "broker listening on " << addr << std::endl;
-    }
-
-    void run() {
-        std::vector<std::thread> threads(std::thread::hardware_concurrency()-1);
-        for (auto& t : threads)
-            t = std::thread(&proton::container::run, container_.get());
-        container_->run();      // Use this thread too.
-        for (auto& t : threads)
-            t.join();
-    }
-
-  private:
-    struct listener : public proton::listen_handler {
-        listener(queues& qs) : queues_(qs) {}
-
-        proton::connection_options on_accept() OVERRIDE{
-            return proton::connection_options().handler(*(new broker_connection_handler(queues_)));
-        }
-
-        void on_error(const std::string& s) OVERRIDE {
-            std::cerr << "listen error: " << s << std::endl;
-            throw std::runtime_error(s);
-        }
-        queues& queues_;
-    };
-
-    queues queues_;
-    std::unique_ptr<proton::container> container_;
-    listener listener_;
-};
-
-int main(int argc, char **argv) {
-    // Command line options
-    std::string address("0.0.0.0");
-    example::options opts(argc, argv);
-    opts.add_value(address, 'a', "address", "listen on URL", "URL");
-    try {
-        opts.parse();
-        broker(address).run();
-        return 0;
-    } catch (const example::bad_option& e) {
-        std::cout << opts << std::endl << e.what() << std::endl;
-    } catch (const std::exception& e) {
-        std::cerr << "broker shutdown: " << e.what() << std::endl;
-    }
-    return 1;
-}
diff --git a/examples/cpp/mt/epoll_container.cpp b/examples/cpp/mt/epoll_container.cpp
deleted file mode 100644
index 7646673..0000000
--- a/examples/cpp/mt/epoll_container.cpp
+++ /dev/null
@@ -1,541 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "mt_container.hpp"
-
-#include <proton/default_container.hpp>
-#include <proton/event_loop.hpp>
-#include <proton/listen_handler.hpp>
-#include <proton/url.hpp>
-
-#include <proton/io/container_impl_base.hpp>
-#include <proton/io/connection_driver.hpp>
-#include <proton/io/link_namer.hpp>
-
-#include <atomic>
-#include <memory>
-#include <mutex>
-#include <condition_variable>
-#include <thread>
-#include <set>
-#include <sstream>
-#include <system_error>
-
-// Linux native IO
-#include <assert.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <sys/epoll.h>
-#include <sys/eventfd.h>
-#include <unistd.h>
-
-#include "../fake_cpp11.hpp"
-
-// Private implementation
-namespace  {
-
-
-using lock_guard = std::lock_guard<std::mutex>;
-
-// Get string from errno
-std::string errno_str(const std::string& msg) {
-    return std::system_error(errno, std::system_category(), msg).what();
-}
-
-// Throw proton::error(errno_str(msg)) if result < 0
-int check(int result, const std::string& msg) {
-    if (result < 0)
-        throw proton::error(errno_str(msg));
-    return result;
-}
-
-// Wrapper for getaddrinfo() that cleans up in destructor.
-class unique_addrinfo {
-  public:
-    unique_addrinfo(const std::string& addr) : addrinfo_(0) {
-        proton::url u(addr);
-        int result = ::getaddrinfo(char_p(u.host()), char_p(u.port()), 0, &addrinfo_);
-        if (result)
-            throw proton::error(std::string("bad address: ") + gai_strerror(result));
-    }
-    ~unique_addrinfo() { if (addrinfo_) ::freeaddrinfo(addrinfo_); }
-
-    ::addrinfo* operator->() const { return addrinfo_; }
-
-  private:
-    static const char* char_p(const std::string& s) { return s.empty() ? 0 : s.c_str(); }
-    ::addrinfo *addrinfo_;
-};
-
-// File descriptor wrapper that calls ::close in destructor.
-class unique_fd {
-  public:
-    unique_fd(int fd) : fd_(fd) {}
-    ~unique_fd() { if (fd_ >= 0) ::close(fd_); }
-    operator int() const { return fd_; }
-    int release() { int ret = fd_; fd_ = -1; return ret; }
-
-  protected:
-    int fd_;
-};
-
-class pollable;
-class pollable_driver;
-class pollable_listener;
-
-class epoll_container : public proton::io::container_impl_base {
-  public:
-    epoll_container(const std::string& id);
-    ~epoll_container();
-
-    // Pull in base class functions here so that name search finds all the overloads
-    using standard_container::stop;
-    using standard_container::connect;
-    using standard_container::listen;
-
-    proton::returned<proton::connection> connect(
-        const std::string& addr, const proton::connection_options& opts) OVERRIDE;
-
-    proton::listener listen(const std::string& addr, proton::listen_handler&) OVERRIDE;
-
-    void stop_listening(const std::string& addr) OVERRIDE;
-
-    void run() OVERRIDE;
-    void auto_stop(bool) OVERRIDE;
-    void stop(const proton::error_condition& err) OVERRIDE;
-
-    std::string id() const OVERRIDE { return id_; }
-
-    // Functions used internally.
-    proton::connection add_driver(proton::connection_options opts, int fd, bool server);
-    void erase(pollable*);
-
-    // Link names must be unique per container.
-    // Generate unique names with a simple atomic counter.
-    class atomic_link_namer : public proton::io::link_namer {
-      public:
-        std::string link_name() {
-            std::ostringstream o;
-            o << std::hex << ++count_;
-            return o.str();
-        }
-      private:
-        std::atomic<int> count_;
-    };
-
-     // FIXME aconway 2016-06-07: Unfinished
-    void schedule(proton::duration, std::function<void()>) OVERRIDE { throw std::logic_error("FIXME"); }
-    void schedule(proton::duration, proton::void_function0&) OVERRIDE { throw std::logic_error("FIXME"); }
-    atomic_link_namer link_namer;
-
-  private:
-    template <class T> void store(T& v, const T& x) const { lock_guard g(lock_); v = x; }
-
-    void idle_check(const lock_guard&);
-    void interrupt();
-    void wait();
-
-    const std::string id_;
-    const unique_fd epoll_fd_;
-    const unique_fd interrupt_fd_;
-
-    mutable std::mutex lock_;
-
-    proton::connection_options options_;
-    std::map<std::string, std::unique_ptr<pollable_listener> > listeners_;
-    std::map<pollable*, std::unique_ptr<pollable_driver> > drivers_;
-
-    std::condition_variable stopped_;
-    bool stopping_;
-    proton::error_condition stop_err_;
-    std::atomic<size_t> threads_;
-};
-
-// Base class for pollable file-descriptors. Manages epoll interaction,
-// subclasses implement virtual work() to do their serialized work.
-class pollable {
-  public:
-    pollable(int fd, int epoll_fd) : fd_(fd), epoll_fd_(epoll_fd), notified_(false), working_(false)
-    {
-        int flags = check(::fcntl(fd, F_GETFL, 0), "non-blocking");
-        check(::fcntl(fd, F_SETFL,  flags | O_NONBLOCK), "non-blocking");
-        ::epoll_event ev = {};
-        ev.data.ptr = this;
-        ::epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, fd_, &ev);
-    }
-
-    virtual ~pollable() {
-        ::epoll_event ev = {};
-        ::epoll_ctl(epoll_fd_, EPOLL_CTL_DEL, fd_, &ev); // Ignore errors.
-    }
-
-    bool do_work(uint32_t events) {
-        {
-            lock_guard g(lock_);
-            if (working_)
-                return true;         // Another thread is already working.
-            working_ = true;
-            notified_ = false;
-        }
-        uint32_t new_events = work(events);  // Serialized, outside the lock.
-        if (new_events) {
-            lock_guard g(lock_);
-            rearm(notified_ ?  EPOLLIN|EPOLLOUT : new_events);
-        }
-        return new_events;
-    }
-
-    // Called from any thread to wake up the connection handler.
-    void notify() {
-        lock_guard g(lock_);
-        if (!notified_) {
-            notified_ = true;
-            if (!working_) // No worker thread, rearm now.
-                rearm(EPOLLIN|EPOLLOUT);
-        }
-    }
-
-  protected:
-
-    // Subclass implements  work.
-    // Returns epoll events to re-enable or 0 if finished.
-    virtual uint32_t work(uint32_t events) = 0;
-
-    const unique_fd fd_;
-    const int epoll_fd_;
-
-  private:
-
-    void rearm(uint32_t events) {
-        epoll_event ev;
-        ev.data.ptr = this;
-        ev.events = EPOLLONESHOT | events;
-        check(::epoll_ctl(epoll_fd_, EPOLL_CTL_MOD, fd_, &ev), "re-arm epoll");
-        working_ = false;
-    }
-
-    std::mutex lock_;
-    bool notified_;
-    bool working_;
-};
-
-class epoll_event_loop : public proton::event_loop {
-  public:
-    typedef std::vector<std::function<void()> > jobs;
-
-    epoll_event_loop(pollable& p) : pollable_(p), closed_(false) {}
-
-    bool inject(std::function<void()> f) OVERRIDE {
-        // Note this is an unbounded work queue.
-        // A resource-safe implementation should be bounded.
-        lock_guard g(lock_);
-        if (closed_)
-            return false;
-        jobs_.push_back(f);
-        pollable_.notify();
-        return true;
-    }
-
-    bool inject(proton::void_function0& f) OVERRIDE {
-        return inject([&f]() { f(); });
-    }
-
-    jobs pop_all() {
-        lock_guard g(lock_);
-        return std::move(jobs_);
-    }
-
-    void close() {
-        lock_guard g(lock_);
-        closed_ = true;
-    }
-
-  private:
-    std::mutex lock_;
-    pollable& pollable_;
-    jobs jobs_;
-    bool closed_;
-};
-
-// Handle epoll wakeups for a connection_driver.
-class pollable_driver : public pollable {
-  public:
-    pollable_driver(epoll_container& c, int fd, int epoll_fd) :
-        pollable(fd, epoll_fd),
-        loop_(new epoll_event_loop(*this)),
-        driver_(c, loop_)
-    {
-        proton::connection conn = driver_.connection();
-        proton::io::set_link_namer(conn, c.link_namer);
-    }
-
-    ~pollable_driver() {
-        loop_->close();                // No calls to notify() after this.
-        driver_.dispatch();            // Run any final events.
-        try { write(); } catch(...) {} // Write connection close if we can.
-        for (auto f : loop_->pop_all()) {// Run final queued work for side-effects.
-            try { f(); } catch(...) {}
-        }
-    }
-
-    uint32_t work(uint32_t events) {
-        try {
-            bool can_read = events & EPOLLIN, can_write = events & EPOLLOUT;
-            do {
-                can_write = can_write && write();
-                can_read = can_read && read();
-                for (auto f : loop_->pop_all()) // Run queued work
-                    f();
-                driver_.dispatch();
-            } while (can_read || can_write);
-            return (driver_.read_buffer().size ? EPOLLIN:0) |
-                (driver_.write_buffer().size ? EPOLLOUT:0);
-        } catch (const std::exception& e) {
-            driver_.disconnected(proton::error_condition("exception", e.what()));
-        }
-        return 0;               // Ending
-    }
-
-    proton::io::connection_driver& driver() { return driver_; }
-
-  private:
-    static bool try_again(int e) {
-        // These errno values from read or write mean "try again"
-        return (e == EAGAIN || e == EWOULDBLOCK || e == EINTR);
-    }
-
-    bool write() {
-        proton::io::const_buffer wbuf(driver_.write_buffer());
-        if (wbuf.size) {
-            ssize_t n = ::write(fd_, wbuf.data, wbuf.size);
-            if (n > 0) {
-                driver_.write_done(n);
-                return true;
-            } else if (n < 0 && !try_again(errno)) {
-                check(n, "write");
-            }
-        }
-        return false;
-    }
-
-    bool read() {
-        proton::io::mutable_buffer rbuf(driver_.read_buffer());
-        if (rbuf.size) {
-            ssize_t n = ::read(fd_, rbuf.data, rbuf.size);
-            if (n > 0) {
-                driver_.read_done(n);
-                return true;
-            }
-            else if (n == 0)
-                driver_.read_close();
-            else if (!try_again(errno))
-                check(n, "read");
-        }
-        return false;
-    }
-
-    // Lifecycle note: loop_ belongs to the proton::connection, which can live
-    // longer than the driver if the application holds a reference to it, we
-    // disconnect ourselves with loop_->close() in ~connection_driver()
-    epoll_event_loop* loop_;
-    proton::io::connection_driver driver_;
-};
-
-// A pollable listener fd that creates pollable_driver for incoming connections.
-class pollable_listener : public pollable {
-  public:
-    pollable_listener(
-        const std::string& addr,
-        proton::listen_handler& l,
-        int epoll_fd,
-        epoll_container& c
-    ) :
-        pollable(socket_listen(addr), epoll_fd),
-        addr_(addr),
-        container_(c),
-        listener_(l)
-    {}
-
-    uint32_t work(uint32_t events) {
-        if (events & EPOLLRDHUP) {
-            try { listener_.on_close(); } catch (...) {}
-            return 0;
-        }
-        try {
-            int accepted = check(::accept(fd_, NULL, 0), "accept");
-            container_.add_driver(listener_.on_accept(), accepted, true);
-            return EPOLLIN;
-        } catch (const std::exception& e) {
-            listener_.on_error(e.what());
-            return 0;
-        }
-    }
-
-    std::string addr() { return addr_; }
-
-  private:
-
-    static int socket_listen(const std::string& addr) {
-        std::string msg = "listen on "+addr;
-        unique_addrinfo ainfo(addr);
-        unique_fd fd(check(::socket(ainfo->ai_family, SOCK_STREAM, 0), msg));
-        int yes = 1;
-        check(::setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)), msg);
-        check(::bind(fd, ainfo->ai_addr, ainfo->ai_addrlen), msg);
-        check(::listen(fd, 32), msg);
-        return fd.release();
-    }
-
-    std::string addr_;
-    std::function<proton::connection_options(const std::string&)> factory_;
-    epoll_container& container_;
-    proton::connection_options opts_;
-    proton::listen_handler& listener_;
-};
-
-
-epoll_container::epoll_container(const std::string& id)
-    : id_(id),                       epoll_fd_(check(epoll_create(1), "epoll_create")),
-      interrupt_fd_(check(eventfd(1, 0), "eventfd")),
-      stopping_(false), threads_(0)
-{}
-
-epoll_container::~epoll_container() {
-    try {
-        stop(proton::error_condition("exception", "container shut-down"));
-        wait();
-    } catch (...) {}
-}
-
-proton::connection epoll_container::add_driver(proton::connection_options opts, int fd, bool server)
-{
-    lock_guard g(lock_);
-    if (stopping_)
-        throw proton::error("container is stopping");
-    std::unique_ptr<pollable_driver> eng(new pollable_driver(*this, fd, epoll_fd_));
-    if (server)
-        eng->driver().accept(opts);
-    else
-        eng->driver().connect(opts);
-    proton::connection c = eng->driver().connection();
-    eng->notify();
-    drivers_[eng.get()] = std::move(eng);
-    return c;
-}
-
-void epoll_container::erase(pollable* e) {
-    lock_guard g(lock_);
-    if (!drivers_.erase(e)) {
-        pollable_listener* l = dynamic_cast<pollable_listener*>(e);
-        if (l)
-            listeners_.erase(l->addr());
-    }
-    idle_check(g);
-}
-
-void epoll_container::idle_check(const lock_guard&) {
-    if (stopping_  && drivers_.empty() && listeners_.empty())
-        interrupt();
-}
-
-proton::returned<proton::connection> epoll_container::connect(
-    const std::string& addr, const proton::connection_options& opts)
-{
-    std::string msg = "connect to "+addr;
-    unique_addrinfo ainfo(addr);
-    unique_fd fd(check(::socket(ainfo->ai_family, SOCK_STREAM, 0), msg));
-    check(::connect(fd, ainfo->ai_addr, ainfo->ai_addrlen), msg);
-    return make_thread_safe(add_driver(opts, fd.release(), false));
-}
-
-proton::listener epoll_container::listen(const std::string& addr, proton::listen_handler& lh) {
-    lock_guard g(lock_);
-    if (stopping_)
-        throw proton::error("container is stopping");
-    auto& l = listeners_[addr];
-    try {
-        l.reset(new pollable_listener(addr, lh, epoll_fd_, *this));
-        l->notify();
-        return proton::listener(*this, addr);
-    } catch (const std::exception& e) {
-        lh.on_error(e.what());
-        lh.on_close();
-        throw;
-    }
-}
-
-void epoll_container::stop_listening(const std::string& addr) {
-    lock_guard g(lock_);
-    listeners_.erase(addr);
-    idle_check(g);
-}
-
-void epoll_container::run() {
-    ++threads_;
-    try {
-        epoll_event e;
-        while(true) {
-            check(::epoll_wait(epoll_fd_, &e, 1, -1), "epoll_wait");
-            pollable* p = reinterpret_cast<pollable*>(e.data.ptr);
-            if (!p)
-                break;          // Interrupted
-            if (!p->do_work(e.events))
-                erase(p);
-        }
-    } catch (const std::exception& e) {
-        stop(proton::error_condition("exception", e.what()));
-    }
-    if (--threads_ == 0)
-        stopped_.notify_all();
-}
-
-void epoll_container::auto_stop(bool set) {
-    lock_guard g(lock_);
-    stopping_ = set;
-}
-
-void epoll_container::stop(const proton::error_condition& err) {
-    lock_guard g(lock_);
-    stop_err_ = err;
-    interrupt();
-}
-
-void epoll_container::wait() {
-    std::unique_lock<std::mutex> l(lock_);
-    stopped_.wait(l, [this]() { return this->threads_ == 0; } );
-    for (auto& eng : drivers_)
-        eng.second->driver().disconnected(stop_err_);
-    listeners_.clear();
-    drivers_.clear();
-}
-
-void epoll_container::interrupt() {
-    // Add an always-readable fd with 0 data and no ONESHOT to interrupt all threads.
-    epoll_event ev = {};
-    ev.events = EPOLLIN;
-    check(epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, interrupt_fd_, &ev), "interrupt");
-}
-
-}
-
-// This is the only public function.
-std::unique_ptr<proton::container> make_mt_container(const std::string& id) {
-    return std::unique_ptr<proton::container>(new epoll_container(id));
-}
diff --git a/examples/cpp/mt/mt_container.hpp b/examples/cpp/mt/mt_container.hpp
deleted file mode 100644
index 164fe72..0000000
--- a/examples/cpp/mt/mt_container.hpp
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef MT_MT_CONTROLLER_HPP
-#define MT_MT_CONTROLLER_HPP
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <proton/default_container.hpp>
-#include <memory>
-
-// Defined in whichever MT container implementation we are linked with.
-std::unique_ptr<proton::container> make_mt_container(const std::string& id);
-
-#endif // MT_MT_DEFAULT_CONTAINER.HPP
diff --git a/examples/cpp/options.hpp b/examples/cpp/options.hpp
deleted file mode 100644
index dab1bc2..0000000
--- a/examples/cpp/options.hpp
+++ /dev/null
@@ -1,175 +0,0 @@
-#ifndef OPTIONS_HPP
-#define OPTIONS_HPP
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <string>
-#include <sstream>
-#include <ostream>
-#include <vector>
-#include <stdexcept>
-
-namespace example {
-/** bad_option is thrown for option parsing errors */
-struct bad_option : public std::runtime_error {
-    bad_option(const std::string& s) : std::runtime_error(s) {}
-};
-
-/** Simple command-line option parser for example programs */
-class options {
-  public:
-
-    options(int argc, char const * const * argv) : argc_(argc), argv_(argv), prog_(argv[0]), help_() {
-        size_t slash = prog_.find_last_of("/\\");
-        if (slash != std::string::npos)
-            prog_ = prog_.substr(slash+1); // Extract prog name from path
-        add_flag(help_, 'h', "help", "Print the help message");
-    }
-
-    ~options() {
-        for (opts::iterator i = opts_.begin(); i != opts_.end(); ++i)
-            delete *i;
-    }
-
-    /** Updates value when parse() is called if option is present with a value. */
-    template<class T>
-    void add_value(T& value, char short_name, const std::string& long_name, const std::string& description, const std::string var) {
-        opts_.push_back(new option_value<T>(value, short_name, long_name, description, var));
-    }
-
-    /** Sets flag when parse() is called if option is present. */
-    void add_flag(bool& flag, char short_name, const std::string& long_name, const std::string& description) {
-        opts_.push_back(new option_flag(flag, short_name, long_name, description));
-    }
-
-    /** Parse the command line, return the index of the first non-option argument.
-     *@throws bad_option if there is a parsing error or unknown option.
-     */
-    int parse() {
-        int arg = 1;
-        for (; arg < argc_ && argv_[arg][0] == '-'; ++arg) {
-            opts::iterator i = opts_.begin();
-            while (i != opts_.end() && !(*i)->parse(argc_, argv_, arg))
-                ++i;
-            if (i == opts_.end())
-                throw bad_option(std::string("unknown option ") + argv_[arg]);
-        }
-        if (help_) throw bad_option("");
-        return arg;
-    }
-
-    /** Print a usage message */
-  friend std::ostream& operator<<(std::ostream& os, const options& op) {
-      os << std::endl << "usage: " << op.prog_ << " [options]" << std::endl;
-      os << std::endl << "options:" << std::endl;
-      for (opts::const_iterator i = op.opts_.begin(); i < op.opts_.end(); ++i)
-          os << **i << std::endl;
-      return os;
-  }
-
- private:
-    class option {
-      public:
-        option(char s, const std::string& l, const std::string& d, const std::string v) :
-            short_(std::string("-") + s), long_("--" + l), desc_(d), var_(v) {}
-        virtual ~option() {}
-
-        virtual bool parse(int argc, char const * const * argv, int &i) = 0;
-        virtual void print_default(std::ostream&) const {}
-
-      friend std::ostream& operator<<(std::ostream& os, const option& op) {
-          os << "  " << op.short_;
-          if (!op.var_.empty()) os << " " << op.var_;
-          os << ", " << op.long_;
-          if (!op.var_.empty()) os << "=" << op.var_;
-          os << std::endl << "        " << op.desc_;
-          op.print_default(os);
-          return os;
-      }
-
-      protected:
-        std::string short_, long_, desc_, var_;
-    };
-
-    template <class T>
-    class option_value : public option {
-      public:
-        option_value(T& value, char s, const std::string& l, const std::string& d, const std::string& v) :
-            option(s, l, d, v), value_(value) {}
-
-        bool parse(int argc, char const * const * argv, int &i) {
-            std::string arg(argv[i]);
-            if (arg == short_ || arg == long_) {
-                if (i < argc-1) {
-                    set_value(arg, argv[++i]);
-                    return true;
-                } else {
-                    throw bad_option("missing value for " + arg);
-                }
-            }
-            if (arg.compare(0, long_.size(), long_) == 0 && arg[long_.size()] == '=' ) {
-                set_value(long_, arg.substr(long_.size()+1));
-                return true;
-            }
-            return false;
-        }
-
-        virtual void print_default(std::ostream& os) const { os << " (default " << value_ << ")"; }
-
-        void set_value(const std::string& opt, const std::string& s) {
-            std::istringstream is(s);
-            is >> value_;
-            if (is.fail() || is.bad())
-                throw bad_option("bad value for " + opt + ": " + s);
-        }
-
-      private:
-        T& value_;
-    };
-
-    class option_flag: public option {
-      public:
-        option_flag(bool& flag, const char s, const std::string& l, const std::string& d) :
-            option(s, l, d, ""), flag_(flag)
-        { flag_ = false; }
-
-        bool parse(int /*argc*/, char const * const * argv, int &i) {
-            if (argv[i] == short_ || argv[i] == long_) {
-                flag_ = true;
-                return true;
-            } else {
-                return false;
-            }
-        }
-
-      private:
-        bool &flag_;
-    };
-
-    typedef std::vector<option*> opts;
-
-    int argc_;
-    char const * const * argv_;
-    std::string prog_;
-    opts opts_;
-    bool help_;
-};
-}
-
-#endif // OPTIONS_HPP
diff --git a/examples/cpp/queue_browser.cpp b/examples/cpp/queue_browser.cpp
deleted file mode 100644
index 583277e..0000000
--- a/examples/cpp/queue_browser.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/connection.hpp>
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/delivery.hpp>
-#include <proton/message.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/receiver_options.hpp>
-#include <proton/source_options.hpp>
-#include <proton/thread_safe.hpp>
-#include <proton/url.hpp>
-
-#include <iostream>
-
-#include "fake_cpp11.hpp"
-
-using proton::source_options;
-
-class browser : public proton::messaging_handler {
-  private:
-    proton::url url;
-
-  public:
-    browser(const std::string& u) : url(u) {}
-
-    void on_container_start(proton::container &c) OVERRIDE {
-        proton::connection conn = c.connect(url);
-        source_options browsing = source_options().distribution_mode(proton::source::COPY);
-        conn.open_receiver(url.path(), proton::receiver_options().source(browsing));
-    }
-
-    void on_message(proton::delivery &, proton::message &m) OVERRIDE {
-        std::cout << m.body() << std::endl;
-    }
-};
-
-int main(int argc, char **argv) {
-    try {
-        std::string url = argc > 1 ? argv[1] : "127.0.0.1:5672/examples";
-
-        browser b(url);
-        proton::default_container(b).run();
-
-        return 0;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-
-    return 1;
-}
diff --git a/examples/cpp/scheduled_send.cpp b/examples/cpp/scheduled_send.cpp
deleted file mode 100644
index ef6cd27..0000000
--- a/examples/cpp/scheduled_send.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "options.hpp"
-
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/message.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/sender.hpp>
-#include <proton/thread_safe.hpp>
-#include <proton/tracker.hpp>
-
-#include <iostream>
-
-#include "fake_cpp11.hpp"
-
-// Send messages at a constant rate one per interval. cancel after a timeout.
-class scheduled_sender : public proton::messaging_handler {
-  private:
-    std::string url;
-    proton::sender sender;
-    proton::duration interval, timeout;
-    bool ready, canceled;
-
-  public:
-
-    scheduled_sender(const std::string &s, double d, double t) :
-        url(s),
-        interval(int(d*proton::duration::SECOND.milliseconds())), // Send interval.
-        timeout(int(t*proton::duration::SECOND.milliseconds())), // Cancel after timeout.
-        ready(true),            // Ready to send.
-        canceled(false)         // Canceled.
-    {}
-
-    void on_container_start(proton::container &c) OVERRIDE {
-        sender = c.open_sender(url);
-        // Call this->cancel after timeout.
-        c.schedule(timeout, [this]() { this->cancel(); });
-         // Start regular ticks every interval.
-        c.schedule(interval, [this]() { this->tick(); });
-    }
-
-    void cancel() {
-        canceled = true;
-        sender.connection().close();
-    }
-
-    void tick() {
-        // Schedule the next tick unless we have been cancelled.
-        if (!canceled)
-            sender.container().schedule(interval, [this]() { this->tick(); });
-        if (sender.credit() > 0) // Only send if we have credit
-            send();
-        else
-            ready = true;  // Set the ready flag, send as soon as we get credit.
-    }
-
-    void on_sendable(proton::sender &) OVERRIDE {
-        if (ready)              // We have been ticked since the last send.
-            send();
-    }
-
-    void send() {
-        std::cout << "send" << std::endl;
-        sender.send(proton::message("ping"));
-        ready = false;
-    }
-};
-
-
-int main(int argc, char **argv) {
-    std::string address("127.0.0.1:5672/examples");
-    double interval = 1.0;
-    double timeout = 5.0;
-
-    example::options opts(argc, argv);
-
-    opts.add_value(address, 'a', "address", "connect and send to URL", "URL");
-    opts.add_value(interval, 'i', "interval", "send a message every INTERVAL seconds", "INTERVAL");
-    opts.add_value(timeout, 't', "timeout", "stop after T seconds", "T");
-
-    try {
-        opts.parse();
-        scheduled_sender h(address, interval, timeout);
-        proton::default_container(h).run();
-        return 0;
-    } catch (const example::bad_option& e) {
-        std::cout << opts << std::endl << e.what() << std::endl;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-
-    return 1;
-}
diff --git a/examples/cpp/scheduled_send_03.cpp b/examples/cpp/scheduled_send_03.cpp
deleted file mode 100644
index 92e5767..0000000
--- a/examples/cpp/scheduled_send_03.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "options.hpp"
-
-#include <proton/container.hpp>
-#include <proton/connection.hpp>
-#include <proton/default_container.hpp>
-#include <proton/duration.hpp>
-#include <proton/function.hpp>
-#include <proton/message.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/sender.hpp>
-#include <proton/thread_safe.hpp>
-#include <proton/tracker.hpp>
-
-#include <iostream>
-
-#include "fake_cpp11.hpp"
-
-// Send messages at a constant rate one per interval. cancel after a timeout.
-// This example uses only C++03 features.
-class scheduled_sender : public proton::messaging_handler {
-  private:
-    std::string url;
-    proton::sender sender;
-    proton::duration interval, timeout;
-    bool ready, canceled;
-
-    struct tick_fn : public proton::void_function0 {
-        scheduled_sender& parent;
-        tick_fn(scheduled_sender& ss) : parent(ss) {}
-        void operator()() { parent.tick(); }
-    };
-
-    struct cancel_fn : public proton::void_function0 {
-        scheduled_sender& parent;
-        cancel_fn(scheduled_sender& ss) : parent(ss) {}
-        void operator()() { parent.cancel(); }
-    };
-
-    tick_fn do_tick;
-    cancel_fn do_cancel;
-
-  public:
-
-    scheduled_sender(const std::string &s, double d, double t) :
-        url(s),
-        interval(int(d*proton::duration::SECOND.milliseconds())), // Send interval.
-        timeout(int(t*proton::duration::SECOND.milliseconds())), // Cancel after timeout.
-        ready(true),            // Ready to send.
-        canceled(false),         // Canceled.
-        do_tick(*this),
-        do_cancel(*this)
-    {}
-
-    void on_container_start(proton::container &c) OVERRIDE {
-        sender = c.open_sender(url);
-        c.schedule(timeout, do_cancel); // Call this->cancel after timeout.
-        c.schedule(interval, do_tick); // Start regular ticks every interval.
-    }
-
-    void cancel() {
-        canceled = true;
-        sender.connection().close();
-    }
-
-    void tick() {
-        if (!canceled) {
-            sender.container().schedule(interval, do_tick); // Next tick
-            if (sender.credit() > 0) // Only send if we have credit
-                send();
-            else
-                ready = true; // Set the ready flag, send as soon as we get credit.
-        }
-    }
-
-    void on_sendable(proton::sender &) OVERRIDE {
-        if (ready)              // We have been ticked since the last send.
-            send();
-    }
-
-    void send() {
-        std::cout << "send" << std::endl;
-        sender.send(proton::message("ping"));
-        ready = false;
-    }
-};
-
-
-int main(int argc, char **argv) {
-    std::string address("127.0.0.1:5672/examples");
-    double interval = 1.0;
-    double timeout = 5.0;
-
-    example::options opts(argc, argv);
-
-    opts.add_value(address, 'a', "address", "connect and send to URL", "URL");
-    opts.add_value(interval, 'i', "interval", "send a message every INTERVAL seconds", "INTERVAL");
-    opts.add_value(timeout, 't', "timeout", "stop after T seconds", "T");
-
-    try {
-        opts.parse();
-        scheduled_sender h(address, interval, timeout);
-        proton::default_container(h).run();
-        return 0;
-    } catch (const example::bad_option& e) {
-        std::cout << opts << std::endl << e.what() << std::endl;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-
-    return 1;
-}
diff --git a/examples/cpp/selected_recv.cpp b/examples/cpp/selected_recv.cpp
deleted file mode 100644
index a48ef0e..0000000
--- a/examples/cpp/selected_recv.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/connection.hpp>
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/message.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/receiver_options.hpp>
-#include <proton/source_options.hpp>
-#include <proton/thread_safe.hpp>
-#include <proton/url.hpp>
-
-#include <iostream>
-
-#include "fake_cpp11.hpp"
-
-namespace {
-
-    // Example custom function to configure an AMQP filter,
-    // specifically an APACHE.ORG:SELECTOR
-    // (http://www.amqp.org/specification/1.0/filters)
-
-    void set_filter(proton::source_options &opts, const std::string& selector_str) {
-        proton::source::filter_map map;
-        proton::symbol filter_key("selector");
-        proton::value filter_value;
-        // The value is a specific AMQP "described type": binary string with symbolic descriptor
-        proton::codec::encoder enc(filter_value);
-        enc << proton::codec::start::described()
-            << proton::symbol("apache.org:selector-filter:string")
-            << proton::binary(selector_str)
-            << proton::codec::finish();
-        // In our case, the map has this one element
-        map.put(filter_key, filter_value);
-        opts.filters(map);
-    }
-}
-
-
-class selected_recv : public proton::messaging_handler {
-  private:
-    proton::url url;
-
-  public:
-    selected_recv(const std::string& u) : url(u) {}
-
-    void on_container_start(proton::container &c) OVERRIDE {
-        proton::source_options opts;
-        set_filter(opts, "colour = 'green'");
-        proton::connection conn = c.connect(url);
-        conn.open_receiver(url.path(), proton::receiver_options().source(opts));
-    }
-
-    void on_message(proton::delivery &, proton::message &m) OVERRIDE {
-        std::cout << m.body() << std::endl;
-    }
-};
-
-int main(int argc, char **argv) {
-    try {
-        std::string url = argc > 1 ? argv[1] : "127.0.0.1:5672/examples";
-
-        selected_recv recv(url);
-        proton::default_container(recv).run();
-
-        return 0;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-
-    return 1;
-}
diff --git a/examples/cpp/server.cpp b/examples/cpp/server.cpp
deleted file mode 100644
index 449ce6e..0000000
--- a/examples/cpp/server.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "options.hpp"
-
-#include <proton/connection.hpp>
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/message.hpp>
-#include <proton/message_id.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/thread_safe.hpp>
-#include <proton/tracker.hpp>
-#include <proton/url.hpp>
-
-#include <iostream>
-#include <map>
-#include <string>
-#include <cctype>
-
-#include "fake_cpp11.hpp"
-
-class server : public proton::messaging_handler {
-  private:
-    typedef std::map<std::string, proton::sender> sender_map;
-    proton::url url;
-    proton::connection connection;
-    sender_map senders;
-
-  public:
-    server(const std::string &u) : url(u) {}
-
-    void on_container_start(proton::container &c) OVERRIDE {
-        connection = c.connect(url);
-        connection.open_receiver(url.path());
-
-        std::cout << "server connected to " << url << std::endl;
-    }
-
-    std::string to_upper(const std::string &s) {
-        std::string uc(s);
-        size_t l = uc.size();
-        for (size_t i=0; i<l; i++)
-            uc[i] = static_cast<char>(std::toupper(uc[i]));
-        return uc;
-    }
-
-    void on_message(proton::delivery &, proton::message &m) OVERRIDE {
-        std::cout << "Received " << m.body() << std::endl;
-
-        std::string reply_to = m.reply_to();
-        proton::message reply;
-
-        reply.to(reply_to);
-        reply.body(to_upper(proton::get<std::string>(m.body())));
-        reply.correlation_id(m.correlation_id());
-
-        if (!senders[reply_to]) {
-            senders[reply_to] = connection.open_sender(reply_to);
-        }
-
-        senders[reply_to].send(reply);
-    }
-};
-
-int main(int argc, char **argv) {
-    std::string address("amqp://0.0.0.0:5672/examples");
-    example::options opts(argc, argv);
-
-    opts.add_value(address, 'a', "address", "listen on URL", "URL");
-
-    try {
-        opts.parse();
-
-        server srv(address);
-        proton::default_container(srv).run();
-
-        return 0;
-    } catch (const example::bad_option& e) {
-        std::cout << opts << std::endl << e.what() << std::endl;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-
-    return 1;
-}
diff --git a/examples/cpp/server_direct.cpp b/examples/cpp/server_direct.cpp
deleted file mode 100644
index 22d519a..0000000
--- a/examples/cpp/server_direct.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "options.hpp"
-
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/listener.hpp>
-#include <proton/message.hpp>
-#include <proton/message_id.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/sender.hpp>
-#include <proton/sender_options.hpp>
-#include <proton/source_options.hpp>
-#include <proton/tracker.hpp>
-
-#include <iostream>
-#include <map>
-#include <string>
-#include <sstream>
-#include <cctype>
-
-#include "fake_cpp11.hpp"
-
-class server : public proton::messaging_handler {
-  private:
-    typedef std::map<std::string, proton::sender> sender_map;
-    std::string url;
-    sender_map senders;
-    int address_counter;
-
-  public:
-    server(const std::string &u) : url(u), address_counter(0) {}
-
-    void on_container_start(proton::container &c) OVERRIDE {
-        c.listen(url);
-        std::cout << "server listening on " << url << std::endl;
-    }
-
-    std::string to_upper(const std::string &s) {
-        std::string uc(s);
-        size_t l = uc.size();
-
-        for (size_t i=0; i<l; i++)
-            uc[i] = static_cast<char>(std::toupper(uc[i]));
-
-        return uc;
-    }
-
-    std::string generate_address() {
-        std::ostringstream addr;
-        addr << "server" << address_counter++;
-
-        return addr.str();
-    }
-
-    void on_sender_open(proton::sender &sender) OVERRIDE {
-        if (sender.source().dynamic()) {
-            std::string addr = generate_address();
-            sender.open(proton::sender_options().source(proton::source_options().address(addr)));
-            senders[addr] = sender;
-        }
-    }
-
-    void on_message(proton::delivery &, proton::message &m) OVERRIDE {
-        std::cout << "Received " << m.body() << std::endl;
-
-        std::string reply_to = m.reply_to();
-        sender_map::iterator it = senders.find(reply_to);
-
-        if (it == senders.end()) {
-            std::cout << "No link for reply_to: " << reply_to << std::endl;
-        } else {
-            proton::sender sender = it->second;
-            proton::message reply;
-
-            reply.to(reply_to);
-            reply.body(to_upper(proton::get<std::string>(m.body())));
-            reply.correlation_id(m.correlation_id());
-
-            sender.send(reply);
-        }
-    }
-};
-
-int main(int argc, char **argv) {
-    std::string address("amqp://127.0.0.1:5672/examples");
-    example::options opts(argc, argv);
-
-    opts.add_value(address, 'a', "address", "listen on URL", "URL");
-
-    try {
-        opts.parse();
-
-        server srv(address);
-        proton::default_container(srv).run();
-
-        return 0;
-    } catch (const example::bad_option& e) {
-        std::cout << opts << std::endl << e.what() << std::endl;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-
-    return 1;
-}
diff --git a/examples/cpp/service_bus.cpp b/examples/cpp/service_bus.cpp
deleted file mode 100644
index 6b57f8d..0000000
--- a/examples/cpp/service_bus.cpp
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*
- * Service Bus example.
- *
- * This is an example of using "Service Bus sessions" (not the same thing as an
- * AMQP session) to selectively retrieve messages from a queue.  The queue must
- * be configured within Service Bus to support sessions.  Service Bus uses the
- * AMQP group_id message property to associate messages with a particular
- * Service Bus session.  It uses AMQP filters to specify which session is
- * associated with a receiver.
- *
- * The mechanics for sending and receiving to other types of service bus queue
- * are broadly the same, as long as the step using the
- * receiver.source().filters() is omitted.
- *
- * Other Service Bus notes: There is no drain support, hence the need to to use
- * timeouts in this example to detect the end of the message stream.  There is
- * no browse support when setting the AMQP link distribution mode to COPY.
- * Service Bus claims to support browsing, but it is unclear how to manage that
- * with an AMQP client.  Maximum message sizes (for body and headers) vary
- * between queue types and fee tier ranging from 64KB to 1MB.  Due to the
- * distributed nature of Service Bus, queues do not automatically preserve FIFO
- * order of messages unless the user takes steps to force the message stream to
- * a single partition of the queue or creates the queue with partitioning disabled.
- *
- * This example shows use of the simpler SAS (Shared Access Signature)
- * authentication scheme where the credentials are supplied on the connection.
- * Service Bus does not actually check these credentials when setting up the
- * connection, it merely caches the SAS key and policy (AKA key name) for later
- * access authorization when creating senders and receivers.  There is a second
- * authentication scheme that allows for multiple tokens and even updating them
- * within a long-lived connection which uses special management request-response
- * queues in Service Bus.  The format of this exchange may be documented
- * somewhere but is also available by working through the CbsAsyncExample.cs
- * program in the Amqp.Net Lite project.
- *
- * The sample output for this program is:
-
-   sent message: message 0 in service bus session "red"
-   sent message: message 1 in service bus session "green"
-   sent message: message 2 in service bus session "blue"
-   sent message: message 3 in service bus session "red"
-   sent message: message 4 in service bus session "black"
-   sent message: message 5 in service bus session "blue"
-   sent message: message 6 in service bus session "yellow"
-receiving messages with session identifier "green" from queue ses_q1
-   received message: message 1 in service bus session "green"
-receiving messages with session identifier "red" from queue ses_q1
-   received message: message 0 in service bus session "red"
-   received message: message 3 in service bus session "red"
-receiving messages with session identifier "blue" from queue ses_q1
-   received message: message 2 in service bus session "blue"
-   received message: message 5 in service bus session "blue"
-receiving messages with session identifier "black" from queue ses_q1
-   received message: message 4 in service bus session "black"
-receiving messages with session identifier "yellow" from queue ses_q1
-   received message: message 6 in service bus session "yellow"
-Done. No more messages.
-
- *
- */
-
-#include "options.hpp"
-
-#include <proton/connection.hpp>
-#include <proton/connection_options.hpp>
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/delivery.hpp>
-#include <proton/function.hpp>
-#include <proton/message.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/receiver_options.hpp>
-#include <proton/sender.hpp>
-#include <proton/sender_options.hpp>
-#include <proton/source_options.hpp>
-#include <proton/thread_safe.hpp>
-#include <proton/tracker.hpp>
-#include <proton/url.hpp>
-
-#include <iostream>
-#include <sstream>
-
-#include "fake_cpp11.hpp"
-
-using proton::source_options;
-using proton::connection_options;
-using proton::sender_options;
-using proton::receiver_options;
-
-void do_next_sequence();
-
-namespace {
-void check_arg(const std::string &value, const std::string &name) {
-    if (value.empty())
-        throw std::runtime_error("missing argument for \"" + name + "\"");
-}
-}
-
-/// Connect to Service Bus queue and retrieve messages in a particular session.
-class session_receiver : public proton::messaging_handler {
-  private:
-    const std::string &connection_url;
-    const std::string &entity;
-    proton::value session_identifier; // AMQP null type by default, matches any Service Bus sequence identifier
-    int message_count;
-    bool closed;
-    proton::duration read_timeout;
-    proton::timestamp last_read;
-    proton::container *container;
-    proton::receiver receiver;
-
-
-    struct process_timeout_fn : public proton::void_function0 {
-        session_receiver& parent;
-        process_timeout_fn(session_receiver& sr) : parent(sr) {}
-        void operator()() { parent.process_timeout(); }
-    };
-
-    process_timeout_fn do_process_timeout;
-
-
-  public:
-    session_receiver(const std::string &c, const std::string &e,
-                     const char *sid) : connection_url(c), entity(e), message_count(0), closed(false), read_timeout(5000),
-                                               last_read(0), container(0), do_process_timeout(*this) {
-        if (sid)
-            session_identifier = std::string(sid);
-        // session_identifier is now either empty/null or an AMQP string type.
-        // If null, Service Bus will pick the first available message and create
-        // a filter at its end with that message's session identifier.
-        // Technically, an AMQP string is not a valid filter-set value unless it
-        // is annotated as an AMQP described type, so this may change.
-
-    }
-
-    void run (proton::container &c) {
-        message_count = 0;
-        closed = false;
-        c.connect(connection_url, connection_options().handler(*this));
-        container = &c;
-    }
-
-    void on_connection_open(proton::connection &connection) OVERRIDE {
-        proton::source::filter_map sb_filter_map;
-        proton::symbol key("com.microsoft:session-filter");
-        sb_filter_map.put(key, session_identifier);
-        receiver = connection.open_receiver(entity, receiver_options().source(source_options().filters(sb_filter_map)));
-
-        // Start timeout processing here.  If Service Bus has no pending
-        // messages, it may defer completing the receiver open until a message
-        // becomes available (e.g. to be able to set the actual session
-        // identifier if none was specified).
-        last_read = proton::timestamp::now();
-        // Call this->process_timeout after read_timeout.
-        container->schedule(read_timeout, do_process_timeout);
-    }
-
-    void on_receiver_open(proton::receiver &r) OVERRIDE {
-        if (closed) return; // PROTON-1264
-        proton::value actual_session_id = r.source().filters().get("com.microsoft:session-filter");
-        std::cout << "receiving messages with session identifier \"" << actual_session_id
-                  << "\" from queue " << entity << std::endl;
-        last_read = proton::timestamp::now();
-    }
-
-    void on_message(proton::delivery &, proton::message &m) OVERRIDE {
-        message_count++;
-        std::cout << "   received message: " << m.body() << std::endl;
-        last_read = proton::timestamp::now();
-    }
-
-    void process_timeout() {
-        proton::timestamp deadline = last_read + read_timeout;
-        proton::timestamp now = proton::timestamp::now();
-        if (now >= deadline) {
-            receiver.close();
-            closed = true;
-            receiver.connection().close();
-            if (message_count)
-                do_next_sequence();
-            else
-                std::cout << "Done. No more messages." << std::endl;
-        } else {
-            proton::duration next = deadline - now;
-            container->schedule(next, do_process_timeout);
-        }
-    }
-};
-
-
-/// Connect to Service Bus queue and send messages divided into different sessions.
-class session_sender : public proton::messaging_handler {
-  private:
-    const std::string &connection_url;
-    const std::string &entity;
-    int msg_count;
-    int total;
-    int accepts;
-
-  public:
-    session_sender(const std::string &c, const std::string &e) : connection_url(c), entity(e),
-                                                                 msg_count(0), total(7), accepts(0) {}
-
-    void run(proton::container &c) {
-        c.open_sender(connection_url + "/" + entity, sender_options(), connection_options().handler(*this));
-    }
-
-    void send_remaining_messages(proton::sender &s) {
-        std::string gid;
-        for (; msg_count < total && s.credit() > 0; msg_count++) {
-            switch (msg_count) {
-            case 0: gid = "red"; break;
-            case 1: gid = "green"; break;
-            case 2: gid = "blue"; break;
-            case 3: gid = "red"; break;
-            case 4: gid = "black"; break;
-            case 5: gid = "blue"; break;
-            case 6: gid = "yellow"; break;
-            }
-
-            std::ostringstream mbody;
-            mbody << "message " << msg_count << " in service bus session \"" << gid << "\"";
-            proton::message m(mbody.str());
-            m.group_id(gid);  // Service Bus uses the group_id property to as the session identifier.
-            s.send(m);
-            std::cout << "   sent message: " << m.body() << std::endl;
-        }
-    }
-
-    void on_sendable(proton::sender &s) OVERRIDE {
-        send_remaining_messages(s);
-    }
-
-    void on_tracker_accept(proton::tracker &t) OVERRIDE {
-        accepts++;
-        if (accepts == total) {
-            // upload complete
-            t.sender().close();
-            t.sender().connection().close();
-            do_next_sequence();
-        }
-    }
-};
-
-
-/// Orchestrate the sequential actions of sending and receiving session-based messages.
-class sequence : public proton::messaging_handler {
-  private:
-    proton::container *container;
-    int sequence_no;
-    session_sender snd;
-    session_receiver rcv_red, rcv_green, rcv_null;
-
-  public:
-    static sequence *the_sequence;
-
-    sequence (const std::string &c, const std::string &e) : sequence_no(0),
-        snd(c, e), rcv_red(c, e, "red"), rcv_green(c, e, "green"), rcv_null(c, e, NULL) {
-        the_sequence = this;
-    }
-
-    void on_container_start(proton::container &c) OVERRIDE {
-        container = &c;
-        next_sequence();
-    }
-
-    void next_sequence() {
-        switch (sequence_no++) {
-        // run these in order exactly once
-        case 0: snd.run(*container); break;
-        case 1: rcv_green.run(*container); break;
-        case 2: rcv_red.run(*container); break;
-        // Run this until the receiver decides there is no messages left to sequence through
-        default: rcv_null.run(*container); break;
-        }
-    }
-};
-
-sequence *sequence::the_sequence = NULL;
-
-void do_next_sequence() { sequence::the_sequence->next_sequence(); }
-
-
-int main(int argc, char **argv) {
-    std::string sb_namespace; // i.e. "foo.servicebus.windows.net"
-    // Make sure the next two are urlencoded for Proton
-    std::string sb_key_name;  // shared access key name for entity (AKA "Policy Name")
-    std::string sb_key;       // shared access key
-    std::string sb_entity;    // AKA the service bus queue.  Must enable
-                              // sessions on it for this example.
-
-    example::options opts(argc, argv);
-    opts.add_value(sb_namespace, 'n', "namespace", "Service Bus full namespace", "NAMESPACE");
-    opts.add_value(sb_key_name, 'p', "policy", "policy name that specifies access rights (key name)", "POLICY");
-    opts.add_value(sb_key, 'k', "key", "secret key for the policy", "key");
-    opts.add_value(sb_entity, 'e', "entity", "entity path (queue name)", "ENTITY");
-
-    try {
-        opts.parse();
-        check_arg(sb_namespace, "namespace");
-        check_arg(sb_key_name, "policy");
-        check_arg(sb_key, "key");
-        check_arg(sb_entity, "entity");
-        std::string connection_string("amqps://" + sb_key_name + ":" + sb_key + "@" + sb_namespace);
-
-        sequence seq(connection_string, sb_entity);
-        proton::default_container(seq).run();
-        return 0;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-
-    return 1;
-}
diff --git a/examples/cpp/simple_recv.cpp b/examples/cpp/simple_recv.cpp
deleted file mode 100644
index 145eef9..0000000
--- a/examples/cpp/simple_recv.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "options.hpp"
-
-#include <proton/connection.hpp>
-#include <proton/connection_options.hpp>
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/delivery.hpp>
-#include <proton/link.hpp>
-#include <proton/message.hpp>
-#include <proton/message_id.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/thread_safe.hpp>
-#include <proton/value.hpp>
-
-#include <iostream>
-#include <map>
-
-#include "fake_cpp11.hpp"
-
-class simple_recv : public proton::messaging_handler {
-  private:
-    std::string url;
-    std::string user;
-    std::string password;
-    proton::receiver receiver;
-    int expected;
-    int received;
-
-  public:
-    simple_recv(const std::string &s, const std::string &u, const std::string &p, int c) :
-        url(s), user(u), password(p), expected(c), received(0) {}
-
-    void on_container_start(proton::container &c) OVERRIDE {
-        proton::connection_options co;
-        if (!user.empty()) co.user(user);
-        if (!password.empty()) co.password(password);
-        receiver = c.open_receiver(url, co);
-        std::cout << "simple_recv listening on " << url << std::endl;
-    }
-
-    void on_message(proton::delivery &d, proton::message &msg) OVERRIDE {
-        if (proton::coerce<int>(msg.id()) < received) {
-            return; // Ignore duplicate
-        }
-
-        if (expected == 0 || received < expected) {
-            std::cout << msg.body() << std::endl;
-            received++;
-
-            if (received == expected) {
-                d.receiver().close();
-                d.connection().close();
-            }
-        }
-    }
-};
-
-int main(int argc, char **argv) {
-    std::string address("127.0.0.1:5672/examples");
-    std::string user;
-    std::string password;
-    int message_count = 100;
-    example::options opts(argc, argv);
-
-    opts.add_value(address, 'a', "address", "connect to and receive from URL", "URL");
-    opts.add_value(message_count, 'm', "messages", "receive COUNT messages", "COUNT");
-    opts.add_value(user, 'u', "user", "authenticate as USER", "USER");
-    opts.add_value(password, 'p', "password", "authenticate with PASSWORD", "PASSWORD");
-
-
-    try {
-        opts.parse();
-
-        simple_recv recv(address, user, password, message_count);
-        proton::default_container(recv).run();
-
-        return 0;
-    } catch (const example::bad_option& e) {
-        std::cout << opts << std::endl << e.what() << std::endl;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-
-    return 1;
-}
diff --git a/examples/cpp/simple_send.cpp b/examples/cpp/simple_send.cpp
deleted file mode 100644
index 358bbec..0000000
--- a/examples/cpp/simple_send.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "options.hpp"
-
-#include <proton/connection.hpp>
-#include <proton/connection_options.hpp>
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/message.hpp>
-#include <proton/message_id.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/thread_safe.hpp>
-#include <proton/tracker.hpp>
-#include <proton/types.hpp>
-
-#include <iostream>
-#include <map>
-
-#include "fake_cpp11.hpp"
-
-class simple_send : public proton::messaging_handler {
-  private:
-    std::string url;
-    std::string user;
-    std::string password;
-    proton::sender sender;
-    int sent;
-    int confirmed;
-    int total;
-
-  public:
-    simple_send(const std::string &s, const std::string &u, const std::string &p, int c) :
-        url(s), user(u), password(p), sent(0), confirmed(0), total(c) {}
-
-    void on_container_start(proton::container &c) OVERRIDE {
-        proton::connection_options co;
-        if (!user.empty()) co.user(user);
-        if (!password.empty()) co.password(password);
-        sender = c.open_sender(url, co);
-    }
-
-    void on_sendable(proton::sender &s) OVERRIDE {
-        while (s.credit() && sent < total) {
-            proton::message msg;
-            std::map<std::string, int> m;
-            m["sequence"] = sent + 1;
-
-            msg.id(sent + 1);
-            msg.body(m);
-
-            s.send(msg);
-            sent++;
-        }
-    }
-
-    void on_tracker_accept(proton::tracker &t) OVERRIDE {
-        confirmed++;
-
-        if (confirmed == total) {
-            std::cout << "all messages confirmed" << std::endl;
-            t.connection().close();
-        }
-    }
-
-    void on_transport_close(proton::transport &) OVERRIDE {
-        sent = confirmed;
-    }
-};
-
-int main(int argc, char **argv) {
-    std::string address("127.0.0.1:5672/examples");
-    std::string user;
-    std::string password;
-    int message_count = 100;
-    example::options opts(argc, argv);
-
-    opts.add_value(address, 'a', "address", "connect and send to URL", "URL");
-    opts.add_value(message_count, 'm', "messages", "send COUNT messages", "COUNT");
-    opts.add_value(user, 'u', "user", "authenticate as USER", "USER");
-    opts.add_value(password, 'p', "password", "authenticate with PASSWORD", "PASSWORD");
-
-    try {
-        opts.parse();
-
-        simple_send send(address, user, password, message_count);
-        proton::default_container(send).run();
-
-        return 0;
-    } catch (const example::bad_option& e) {
-        std::cout << opts << std::endl << e.what() << std::endl;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-
-    return 1;
-}
diff --git a/examples/cpp/ssl.cpp b/examples/cpp/ssl.cpp
deleted file mode 100644
index 2e901c2..0000000
--- a/examples/cpp/ssl.cpp
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "options.hpp"
-
-#include <proton/connection_options.hpp>
-#include <proton/connection.hpp>
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/error_condition.hpp>
-#include <proton/listener.hpp>
-#include <proton/message.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/ssl.hpp>
-#include <proton/thread_safe.hpp>
-#include <proton/tracker.hpp>
-#include <proton/transport.hpp>
-
-#include <iostream>
-
-#include "fake_cpp11.hpp"
-
-using proton::connection_options;
-using proton::ssl_client_options;
-using proton::ssl_server_options;
-using proton::ssl_certificate;
-
-// Helper functions defined below.
-bool using_OpenSSL();
-std::string platform_CA(const std::string &base_name);
-ssl_certificate platform_certificate(const std::string &base_name, const std::string &passwd);
-std::string find_CN(const std::string &);
-
-namespace {
-    std::string verify_full("full");  // Normal verification
-    std::string verify_noname("noname"); // Skip matching host name against the certificate
-    std::string verify_fail("fail");  // Force name mismatch failure
-    std::string verify(verify_full);  // Default for example
-    std::string cert_directory;
-
-    class example_cert_error : public std::runtime_error
-    {
-    public:
-        explicit example_cert_error(const std::string& s) : std::runtime_error(s) {}
-    };
-
-}
-
-
-struct server_handler : public proton::messaging_handler {
-    std::string url;
-
-    void on_connection_open(proton::connection &c) OVERRIDE {
-        std::cout << "Inbound server connection connected via SSL.  Protocol: " <<
-            c.transport().ssl().protocol() << std::endl;
-        c.container().stop_listening(url);  // Just expecting the one connection.
-    }
-
-    void on_transport_error(proton::transport &t) OVERRIDE {
-        t.connection().container().stop_listening(url);
-    }
-
-    void on_message(proton::delivery &, proton::message &m) OVERRIDE {
-        std::cout << m.body() << std::endl;
-    }
-};
-
-
-class hello_world_direct : public proton::messaging_handler {
-  private:
-    std::string url;
-    server_handler s_handler;
-
-  public:
-    hello_world_direct(const std::string& u) : url(u) {}
-
-    void on_container_start(proton::container &c) OVERRIDE {
-        // Configure listener.  Details vary by platform.
-        ssl_certificate server_cert = platform_certificate("tserver", "tserverpw");
-        ssl_server_options ssl_srv(server_cert);
-        connection_options server_opts;
-        server_opts.ssl_server_options(ssl_srv).handler(s_handler);
-        c.server_connection_options(server_opts);
-
-        // Configure client with a Certificate Authority database
-        // populated with the server's self signed certificate.
-        connection_options client_opts;
-        if (verify == verify_full) {
-            ssl_client_options ssl_cli(platform_CA("tserver"));
-            client_opts.ssl_client_options(ssl_cli);
-            // The next line is optional in normal use.  Since the
-            // example uses IP addresses in the connection string, use
-            // the virtual_host option to set the server host name
-            // used for certificate verification:
-            client_opts.virtual_host("test_server");
-        } else if (verify == verify_noname) {
-            // Downgrade the verification from VERIFY_PEER_NAME to VERIFY_PEER.
-            ssl_client_options ssl_cli(platform_CA("tserver"), proton::ssl::VERIFY_PEER);
-            client_opts.ssl_client_options(ssl_cli);
-        } else if (verify == verify_fail) {
-            ssl_client_options ssl_cli(platform_CA("tserver"));
-            client_opts.ssl_client_options(ssl_cli);
-            client_opts.virtual_host("wrong_name_for_server"); // Pick any name that doesn't match.
-        } else throw std::logic_error("bad verify mode: " + verify);
-
-        c.client_connection_options(client_opts);
-        s_handler.url = url;
-        c.listen(url);
-        c.open_sender(url);
-    }
-
-    void on_connection_open(proton::connection &c) OVERRIDE {
-        std::string subject = c.transport().ssl().remote_subject();
-        std::cout << "Outgoing client connection connected via SSL.  Server certificate identity " <<
-            find_CN(subject) << std::endl;
-    }
-
-    void on_transport_error(proton::transport &t) OVERRIDE {
-        std::string err = t.error().what();
-        if (err.find("certificate"))
-            throw example_cert_error(err);
-    }
-
-    void on_sendable(proton::sender &s) OVERRIDE {
-        proton::message m;
-        m.body("Hello World!");
-        s.send(m);
-        s.close();
-    }
-
-    void on_tracker_accept(proton::tracker &t) OVERRIDE {
-        // All done.
-        t.connection().close();
-    }
-};
-
-int main(int argc, char **argv) {
-    // Pick an "unusual" port since we are going to be talking to
-    // ourselves, not a broker.
-    // Note the use of "amqps" as the URL scheme to denote a TLS/SSL connection.
-    std::string address("amqps://127.0.0.1:8888/examples");
-    example::options opts(argc, argv);
-    opts.add_value(address, 'a', "address", "connect and send to URL", "URL");
-    opts.add_value(cert_directory, 'c', "cert_directory",
-                   "directory containing SSL certificates and private key information", "CERTDIR");
-    opts.add_value(verify, 'v', "verify", "verify type: \"minimum\", \"full\", \"fail\"", "VERIFY");
-
-    try {
-        opts.parse();
-
-        size_t sz = cert_directory.size();
-        if (sz && cert_directory[sz -1] != '/')
-            cert_directory.append("/");
-        else cert_directory = "ssl_certs/";
-
-        if (verify != verify_noname && verify != verify_full && verify != verify_fail)
-            throw std::runtime_error("bad verify argument: " + verify);
-
-        hello_world_direct hwd(address);
-        proton::default_container(hwd).run();
-        return 0;
-    } catch (const example_cert_error& ce) {
-        if (verify == verify_fail) {
-            std::cout << "Expected failure of connection with wrong peer name: " << ce.what() << std::endl;
-            return 0;
-        }
-        std::cerr << "unexpected internal certificate failure: " << ce.what() << std::endl;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-    return 1;
-}
-
-
-bool using_OpenSSL() {
-    // Current defaults.
-#if defined(WIN32)
-    return false;
-#else
-    return true;
-#endif
-}
-
-ssl_certificate platform_certificate(const std::string &base_name, const std::string &passwd) {
-    if (using_OpenSSL()) {
-        // The first argument will be the name of the file containing the public certificate, the
-        // second argument will be the name of the file containing the private key.
-        return ssl_certificate(cert_directory + base_name + "-certificate.pem",
-                               cert_directory + base_name + "-private-key.pem", passwd);
-    }
-    else {
-        // Windows SChannel
-        // The first argument will be the database or store that contains one or more complete certificates
-        // (public and private data).  The second will be an optional name of the certificate in the store
-        // (not used in this example with one certificate per store).
-        return ssl_certificate(cert_directory + base_name + "-full.p12", "", passwd);
-    }
-}
-
-std::string platform_CA(const std::string &base_name) {
-    if (using_OpenSSL()) {
-        // In this simple example with self-signed certificates, the peer's certificate is the CA database.
-        return cert_directory + base_name + "-certificate.pem";
-    }
-    else {
-        // Windows SChannel.  Use a pkcs#12 file with just the peer's public certificate information.
-        return cert_directory + base_name + "-certificate.p12";
-    }
-}
-
-std::string find_CN(const std::string &subject) {
-    // The subject string is returned with different whitespace and component ordering between platforms.
-    // Here we just return the common name by searching for "CN=...." in the subject, knowing that
-    // the test certificates do not contain any escaped characters.
-    size_t pos = subject.find("CN=");
-    if (pos == std::string::npos) throw std::runtime_error("No common name in certificate subject");
-    std::string cn = subject.substr(pos);
-    pos = cn.find(',');
-    return pos == std::string::npos ? cn : cn.substr(0, pos);
-}
diff --git a/examples/cpp/ssl_certs/README.txt b/examples/cpp/ssl_certs/README.txt
deleted file mode 100644
index 9a8a4f9..0000000
--- a/examples/cpp/ssl_certs/README.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-This directory contains basic self signed test certificates for use by
-proton examples.
-
-The ".pem" files are in the format expected by proton implementations
-using OpenSSL.  The ".p12" file are for Windows implementations using
-SChannel.
-
-The commands used to generate the certificates follow.
-
-
-make_pn_cert()
-{
-  name=$1
-  subject=$2
-  passwd=$3
-  # create the pem files
-  openssl req -newkey rsa:2048 -keyout $name-private-key.pem -out $name-certificate.pem -subj $subject -passout pass:$passwd -x509 -days 3650
-  # create the p12 files
-  openssl pkcs12 -export -out $name-full.p12 -passin pass:$passwd -passout pass:$passwd -inkey $name-private-key.pem -in $name-certificate.pem -name $name
-  openssl pkcs12 -export -out $name-certificate.p12 -in $name-certificate.pem -name $name -nokeys -passout pass:
-}
-
-make_pn_cert tserver /CN=test_server/OU=proton_test tserverpw
-make_pn_cert tclient /CN=test_client/OU=proton_test tclientpw
diff --git a/examples/cpp/ssl_certs/tclient-certificate.p12 b/examples/cpp/ssl_certs/tclient-certificate.p12
deleted file mode 100644
index 4d0e000..0000000
--- a/examples/cpp/ssl_certs/tclient-certificate.p12
+++ /dev/null
Binary files differ
diff --git a/examples/cpp/ssl_certs/tclient-certificate.pem b/examples/cpp/ssl_certs/tclient-certificate.pem
deleted file mode 100644
index 8088e2e..0000000
--- a/examples/cpp/ssl_certs/tclient-certificate.pem
+++ /dev/null
@@ -1,19 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDKzCCAhOgAwIBAgIJAIV7frIjftgcMA0GCSqGSIb3DQEBCwUAMCwxFDASBgNV
-BAMMC3Rlc3RfY2xpZW50MRQwEgYDVQQLDAtwcm90b25fdGVzdDAeFw0xNTExMjcx
-ODEwMzlaFw0yNTExMjQxODEwMzlaMCwxFDASBgNVBAMMC3Rlc3RfY2xpZW50MRQw
-EgYDVQQLDAtwcm90b25fdGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
-ggEBAPCIS4qUdOtQplUxZ6WW0LXcvosqFP6qOiCARLSEWpR3B8bq213rzefwwfcM
-4TtMr88bP+huLKmlyMfwpl8yB88eXkscPgaAce2zk24urWkFXKSQ6GPitWBLGqBa
-V+W0wJ4mfW7MwefVslWfGXI381QEUlBHjkFG30AtzMMTRj2GK2JqUlRXZPljGyB7
-WcXwxcoS+HkKV7FtHWSkLAzyXwQ9vsCUEYdWTUaGXfCUNRSRV7h1LIANbu03NxV0
-XdEl7WXcr7tuTw3axeUGhRFVhLegrxKLuZTTno4aAJnEr8uaDzjxvXnv3Ne2igvy
-gRfZgOMx+XrZEob9OpAoRghQt4cCAwEAAaNQME4wHQYDVR0OBBYEFE4vbyiM0RjG
-TLMLLGGhMZE/5x1GMB8GA1UdIwQYMBaAFE4vbyiM0RjGTLMLLGGhMZE/5x1GMAwG
-A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAErr/rvLS9Ig0UCMwh1J1lA9
-/gvXf93iIK/SjrFIAqYRmfZxg4husfoes8t2hFUeuqoH05TuSOoXG8p8DpgTSGmF
-jAFe+T90vJZTm0oqZkkkI/hdzjGQoHURRp9/O2Z/lm39KSKGVAN5pUWCUDi/G5iS
-P9LZPJN6a5syXMrR6x62IPxAXowlpXkRghKClF3zPOaOBTzT1V27EkI8IEgC+p45
-246EooLnw8ibB+ucNc3KHNzpgKGVd/622+I+Q5eg9AT9PLFttP+R2ECsrVDDPYuA
-p0qaSnwgeozj/d6K3FOgKKEKbzBmpWgkv0jdcVk18aPMHypI/RDtZ/+3ET2Ksi8=
------END CERTIFICATE-----
diff --git a/examples/cpp/ssl_certs/tclient-full.p12 b/examples/cpp/ssl_certs/tclient-full.p12
deleted file mode 100644
index ad2d7d3..0000000
--- a/examples/cpp/ssl_certs/tclient-full.p12
+++ /dev/null
Binary files differ
diff --git a/examples/cpp/ssl_certs/tclient-private-key.pem b/examples/cpp/ssl_certs/tclient-private-key.pem
deleted file mode 100644
index e5c114d..0000000
--- a/examples/cpp/ssl_certs/tclient-private-key.pem
+++ /dev/null
@@ -1,30 +0,0 @@
------BEGIN ENCRYPTED PRIVATE KEY-----
-MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQICy6ghWp45z4CAggA
-MBQGCCqGSIb3DQMHBAiVdDoo4NIghQSCBMixGm1bm/omMxsaKnIPO7zm5dyLexJ+
-yTFpmh2KV7kQqmpzCyIOdoG6K8YqFnie2XdFWm3S8faRHoMq54bDmyEWIxfQPq5f
-I1iYFbIZkbnhUvK53RActsEUMf0locS4xylU7VQK3XTAwp0TVip3Lp3ehEMEdcXL
-iUWibGsoTPKcY9MIWGXZAJXsEXoeHt6k2hHo1G4E0/Bi6mLW1LY/cxZCjHTGD6qI
-Kt54SCCDvinqVa+rixw6yX9F14EA6bhALami8e+Ccd3lqHOyYlXcBaSS1ezCg6ig
-oNK97mC+gEGy1KlkZDKWXclFoOCBXRBe4DByre6Rlq3yeI9L42bvAuSBSmf5QT5g
-73Yl8vjEAKR65awBT09dPuKu7t+Fb6vkwF8/t+uyj9IuL+42UuXhMLK3ohf+6DbU
-8/zB4y3GXI80QmWM0+Wx4n6khFhPFLHt2q0Sn6V9PG1vtHyiq50oSCoyrPQLaecp
-hefnMCFBYTcT3JUwmoVGGy0boIAwL7T4aGsMt7QhwOx5tU35tKFxyY7m4fX14AKo
-2EIy+TPQwCGkGf3Puy/Pc9VA8IAxB5+WwSrjk+NeCv88eIX7gy43k4rCr+OmD9FF
-wknr3xoP3KYhNXjdZ4Ep/1UHSK+JAtzzbNLQjDcqN+gQPg/yUX6ih0j5K3Wvh9bK
-E/DvzbpJroUZPgzR+8z5O68CfsD+OIdpHBFTKqAFmzvUuqpADpr998LdCjD+lW+V
-xZZgZa8KEblwgiH3fdGbYl46Ho1zrZisf439DbqyybAuBIQB4NSZcL/MAgVGO17k
-QDpVElWZWYrFm4CFTcvS2HvIzRmbefF5m5oJedsN7Q6WQCp+3gnwYx1xIOknd7pW
-N4AHNnqjscSj9yACj/EiBVKAKNnC5H7ZGZTsaAjMETZyjLXfI2AZ3Fviz4zFR+oz
-NkAfFB6WUpRpl7H02FzrzYT7XkkLcXd6H6g+mv2iDa9uKWk/PS2QlqnJt8/dHEHD
-JKTG331yDK5GHlKAVGF3nP5BwFGgTQMuSoeiOervMXPUwDpQ8OaYkuaRej0cZLgT
-kAF9sUjqdsoYNcXDFHALp6y5g8qYkfrxrlIbKs82zIsmB5I+dtZbUaD3a0zAUrmW
-5Xm3Pc9dVP0EXKwfHz6zqPReEw2yYLisB5IoHd4M2wa3GzHBdra1ij4QTmvd3o7e
-buGFoX8KJQAcig0zpbYkoDP2gPhIh9rY4unVPQNX1Q8/wRsiJAZZsYvZY+A+SmuZ
-bwSwk+8ZJRsFzdYYYhQeRytD5cDAIQiClcI5Yj4T9dWQV/gf0N/wIBDNTMp0jJAy
-1l7PuXTfGZodNJWZH0oqsrNoWbn/k67NildvvofIKX+h09Nxszr670Pvj0qoHd5/
-CWq30lnxoJBUgbikFOz6ZuuHi/ZiCXL+haH+v8hJKN5ptRKnyYJQHchRB/IOGRoT
-5lmWxo8a7K+yXhp0VBDHJfw3685ms0xQX8Xj4X3MEuN64zd0fB1JmhtP12ydK85J
-ABawNKlRQPw5weckwtCviXQX+vX25S/xu3xA6IuqlHyqL/1t3DICzuxeOyT2mZxD
-tKQxEgNihPvu32vn9m74qA3adEaxuWPRkPZuTeITHOkMTZolvqYX/5olBsSgYwka
-7/g=
------END ENCRYPTED PRIVATE KEY-----
diff --git a/examples/cpp/ssl_certs/tserver-certificate.p12 b/examples/cpp/ssl_certs/tserver-certificate.p12
deleted file mode 100644
index f38b67d..0000000
--- a/examples/cpp/ssl_certs/tserver-certificate.p12
+++ /dev/null
Binary files differ
diff --git a/examples/cpp/ssl_certs/tserver-certificate.pem b/examples/cpp/ssl_certs/tserver-certificate.pem
deleted file mode 100644
index 86231f3..0000000
--- a/examples/cpp/ssl_certs/tserver-certificate.pem
+++ /dev/null
@@ -1,19 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDKzCCAhOgAwIBAgIJAPnYOOQCJ3kDMA0GCSqGSIb3DQEBCwUAMCwxFDASBgNV
-BAMMC3Rlc3Rfc2VydmVyMRQwEgYDVQQLDAtwcm90b25fdGVzdDAeFw0xNTExMjcx
-ODEwMzlaFw0yNTExMjQxODEwMzlaMCwxFDASBgNVBAMMC3Rlc3Rfc2VydmVyMRQw
-EgYDVQQLDAtwcm90b25fdGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
-ggEBAKJNB78lgw4KtXDAvXocTLud6mbn6zgfB6ETIF+kcrukOH9DnPxjLBBM4Lig
-sp1+kmeudFK5/X8riDrvIW52b/rlEBLgLB+oDtI74m6OTbBs9L+FUFYOuxApetQF
-qoJy2vf9pWfy4uku24vCpeo7eVLi6ypu4lXE3LR+Km3FruHI1NKonHBMhwXSOWqF
-pYM6/4IZJ4fbV0+eU0Jrx+05s6XHg5vone2BVJKxeSIBje+zWnNnh8+qG0Z70Jgp
-aMetME5KGnLNgD1okpH0vb3lwjvuqkkx4WswGVZGbLLkSqqBpXPyM9fCFVy5aKSL
-DBq7IABQtO67O2nBzK3OyigHrUUCAwEAAaNQME4wHQYDVR0OBBYEFGV1PY0FCFbJ
-gpcDVKI6JGiRTt3kMB8GA1UdIwQYMBaAFGV1PY0FCFbJgpcDVKI6JGiRTt3kMAwG
-A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAIx1TOTGWnnbpan4bse7wuvH
-GYSNDJhoTVS+X1TC63xukJD1JBAsCNTqg/ZV6lN3XEl7vvOXfGoCiyXM6a9XOKUo
-gSDtMrIr+wTh6Ss1yRO8QcCJmxH5JDXNu1ojtwsjFW/vneI4IL9kwpDsSlMQEX/E
-EkkQwtAx/Cvfe7pecZL4qSeykJOUMTts9H8fCAZqEiRZBA3ugJxqF8jwLP3DoFVQ
-6QZzKDY6CSPqfMnVb5i0MAIYVDpau+e3N9dgQpZD22F/zbua0OVbfAPdiRMnYxML
-FT4sxLnh+5YVqwpVWbEKp4onHe2Fq6YIvAxUYAJ3SBA2C8O2RAVKWxf1jko3jYI=
------END CERTIFICATE-----
diff --git a/examples/cpp/ssl_certs/tserver-full.p12 b/examples/cpp/ssl_certs/tserver-full.p12
deleted file mode 100644
index d4a0e40..0000000
--- a/examples/cpp/ssl_certs/tserver-full.p12
+++ /dev/null
Binary files differ
diff --git a/examples/cpp/ssl_certs/tserver-private-key.pem b/examples/cpp/ssl_certs/tserver-private-key.pem
deleted file mode 100644
index 91dcf0e..0000000
--- a/examples/cpp/ssl_certs/tserver-private-key.pem
+++ /dev/null
@@ -1,30 +0,0 @@
------BEGIN ENCRYPTED PRIVATE KEY-----
-MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQI1cT0c2J3GcQCAggA
-MBQGCCqGSIb3DQMHBAi1hxSX2LJ+EgSCBMheHJ0iXr5A36Natjk/LcAEeKUMT9s+
-sMzoQceCWe8qMlQluWksr9iDdZ4JRIE8cpK8dbmx4dLY/SShUzdlhJHCSa4zZBHq
-8cZ/jGUF/RF1rqdgjK589eUq+uOl3/gXKzG/SxBqayy6PSn12kX3qnvmlkXCmtwU
-lg+iBm5wRcJ0MyVHaJkyA8sW8gr186C/VAau6Yu0crQXN7NRo9snrd4ewuYMIEhZ
-hgaG9XsYQWB1bPhAaKj80CZGxsQbJyTwcbKKkB3IY4WXx8mmhuiNl+vKT3HBJ9Ju
-YB6tgIjs8CJ4X2P4aU3yNJwG1QldgHSqmFGQ19bcZAw3s3kzwjdzRf4H2V16XOBd
-zQ5AEs/ffVMzMIAfkb1gYwgunZ2CVwwDJ2mi1RcgkX+Og2aFQc+fxXcVOnDcGLxV
-6fuCuZ2lsXfoiIyRh9kj3L75N12GtVUvgBdnMuOc1wPw6XnGQtDwt0acJpdexLMG
-k0j57r/gcgzTcmF3qNM+y9L/HLssgrJkvVJw2Np5gmtIyfDocsDUWUbClS4dTpYf
-oTngUTU+vWtHBuaUnb+f5/WJaRS/S7mmR8usbVG3i9WnEr/vlPJpbJFSjW2S6u/H
-7cFxKUmmBZsSuEv/EKt9a+Sh62kprOChm4myqfCI1/gvNKfUZC6m0Vp8zf+2LgAq
-2RgbMuqysMjWUtV4kDRZT7oCYckUDwsCHdbLES3nmVrtBk2ShMKHBpDp8/GoRuiV
-jdV7/EjKM/M1kXtFYYe3z7Mxv++lKYIJ7bNwVrQ8nrhce/VwHw6D5emWXNCJXhKZ
-FW7EM2ZOZ9eaKOlCsIi8sbjV6Yie9IY6HJKKmi3CpO0Tv5kLBdHkru8vGCSFm3O1
-n7wz7Ys5FBSlZ19X0NwQSCQX1Q4w+tido6i1SCRX0qJEdTNGuGwVXMHCf4/1zyHV
-hj8vnxh8fzo79LFrwlTTgwLg1Mr8sEUFFDJ/raJ1AhFXi8n24trtNR8EHxRW8wtD
-CLCKaqkEqfBiFXK/Yq3RrefCayPHiD+DaNsI8BwefMGpED3vD8YYCjAzXNPh/CSF
-sc1i1jWMzbJhzOoFSPNXhlfusbUFMFQ/6olatmH47SY6HBBOL3DDP5uQ0jw8P454
-QBjlMOpEZmZxO6TcEtJwu0vzgog4rQ5g3NWy6SIpjWehNwTynLt7yM3R5WTI6cZs
-0GTv/rqo2/SUoNsFmnGIUwj/DrBe4XOAq1nS2ZlEctxKhBsKH0hMFp6D1rXOzrgl
-bwcq+oistoB0TLcThShyNgSqzW1znQ1n5SVUk9b5rRhSttJxn3yOMewH0i3v8bPo
-HOhP5kaGjblPsCYyhlL/SNVF0OXEGTwLNey7FQdWFOwVwTRRXe7k+uGZ2d5hg+Jn
-It/trDZ1RDYbVmB7/Qy73c16J4mvhOUJ2de5ZciFBjkidbiiUKLj9xnjK9k9Sauo
-MKhNnDMAEU5VDQM3xNe5BRdX8dFLwfF5H64sU3nROF83aUnDgvfFEowYPnCuPYfm
-m4aQHfoBSg4j3v1OeOwktcl+Q2TjxPHfWhbWeRBfxOTqQ/suYhnQChuFSK/qyo9K
-ccgotqghhunRsWMoZT25H7AZM6yKb1sMz/0oyMRIKeGqoYh+ULM5XLY0xNYd4/xU
-WtQ=
------END ENCRYPTED PRIVATE KEY-----
diff --git a/examples/cpp/ssl_client_cert.cpp b/examples/cpp/ssl_client_cert.cpp
deleted file mode 100644
index 630e74b..0000000
--- a/examples/cpp/ssl_client_cert.cpp
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/connection.hpp>
-#include <proton/connection_options.hpp>
-#include <proton/container.hpp>
-#include <proton/default_container.hpp>
-#include <proton/listener.hpp>
-#include <proton/message.hpp>
-#include <proton/messaging_handler.hpp>
-#include <proton/sasl.hpp>
-#include <proton/ssl.hpp>
-#include <proton/thread_safe.hpp>
-#include <proton/tracker.hpp>
-#include <proton/transport.hpp>
-
-#include <iostream>
-
-#include "fake_cpp11.hpp"
-
-using proton::connection_options;
-using proton::ssl_client_options;
-using proton::ssl_server_options;
-using proton::ssl_certificate;
-using proton::sasl;
-
-// Helper functions defined below.
-bool using_OpenSSL();
-std::string platform_CA(const std::string &base_name);
-ssl_certificate platform_certificate(const std::string &base_name, const std::string &passwd);
-static std::string cert_directory;
-static std::string find_CN(const std::string &);
-
-
-struct server_handler : public proton::messaging_handler {
-    proton::listener listener;
-
-    void on_connection_open(proton::connection &c) OVERRIDE {
-        std::cout << "Inbound server connection connected via SSL.  Protocol: " <<
-            c.transport().ssl().protocol() << std::endl;
-        if (c.transport().sasl().outcome() == sasl::OK) {
-            std::string subject = c.transport().ssl().remote_subject();
-            std::cout << "Inbound client certificate identity " << find_CN(subject) << std::endl;
-        }
-        else {
-            std::cout << "Inbound client authentication failed" <<std::endl;
-            c.close();
-        }
-        listener.stop();
-    }
-
-    void on_message(proton::delivery &, proton::message &m) OVERRIDE {
-        std::cout << m.body() << std::endl;
-    }
-};
-
-
-class hello_world_direct : public proton::messaging_handler {
-  private:
-    std::string url;
-    server_handler s_handler;
-
-  public:
-    hello_world_direct(const std::string& u) : url(u) {}
-
-    void on_container_start(proton::container &c) OVERRIDE {
-        // Configure listener.  Details vary by platform.
-        ssl_certificate server_cert = platform_certificate("tserver", "tserverpw");
-        std::string client_CA = platform_CA("tclient");
-        // Specify an SSL domain with CA's for client certificate verification.
-        ssl_server_options srv_ssl(server_cert, client_CA);
-        connection_options server_opts;
-        server_opts.ssl_server_options(srv_ssl).handler(s_handler);
-        server_opts.sasl_allowed_mechs("EXTERNAL");
-        c.server_connection_options(server_opts);
-
-        // Configure client.
-        ssl_certificate client_cert = platform_certificate("tclient", "tclientpw");
-        std::string server_CA = platform_CA("tserver");
-        // Since the test certifcate's credentials are unlikely to match this host's name, downgrade the verification
-        // from VERIFY_PEER_NAME to VERIFY_PEER.
-        ssl_client_options ssl_cli(client_cert, server_CA, proton::ssl::VERIFY_PEER);
-        connection_options client_opts;
-        client_opts.ssl_client_options(ssl_cli).sasl_allowed_mechs("EXTERNAL");
-        c.client_connection_options(client_opts);
-
-        s_handler.listener = c.listen(url);
-        c.open_sender(url);
-    }
-
-    void on_connection_open(proton::connection &c) OVERRIDE {
-        std::string subject = c.transport().ssl().remote_subject();
-        std::cout << "Outgoing client connection connected via SSL.  Server certificate identity " <<
-            find_CN(subject) << std::endl;
-    }
-
-    void on_sendable(proton::sender &s) OVERRIDE {
-        proton::message m;
-        m.body("Hello World!");
-        s.send(m);
-        s.close();
-    }
-
-    void on_tracker_accept(proton::tracker &t) OVERRIDE {
-        // All done.
-        t.connection().close();
-    }
-};
-
-int main(int argc, char **argv) {
-    try {
-        // Pick an "unusual" port since we are going to be talking to ourselves, not a broker.
-        // Note the use of "amqps" as the URL scheme to denote a TLS/SSL connection.
-        std::string url = argc > 1 ? argv[1] : "amqps://127.0.0.1:8888/examples";
-        // Location of certificates and private key information:
-        if (argc > 2) {
-            cert_directory = argv[2];
-            size_t sz = cert_directory.size();
-            if (sz && cert_directory[sz -1] != '/')
-                cert_directory.append("/");
-        }
-        else cert_directory = "ssl_certs/";
-
-        hello_world_direct hwd(url);
-        proton::default_container(hwd).run();
-        return 0;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-    return 1;
-}
-
-
-bool using_OpenSSL() {
-    // Current defaults.
-#if defined(WIN32)
-    return false;
-#else
-    return true;
-#endif
-}
-
-ssl_certificate platform_certificate(const std::string &base_name, const std::string &passwd) {
-    if (using_OpenSSL()) {
-        // The first argument will be the name of the file containing the public certificate, the
-        // second argument will be the name of the file containing the private key.
-        return ssl_certificate(cert_directory + base_name + "-certificate.pem",
-                               cert_directory + base_name + "-private-key.pem", passwd);
-    }
-    else {
-        // Windows SChannel
-        // The first argument will be the database or store that contains one or more complete certificates
-        // (public and private data).  The second will be an optional name of the certificate in the store
-        // (not used in this example with one certificate per store).
-        return ssl_certificate(cert_directory + base_name + "-full.p12", "", passwd);
-    }
-}
-
-std::string platform_CA(const std::string &base_name) {
-    if (using_OpenSSL()) {
-        // In this simple example with self-signed certificates, the peer's certificate is the CA database.
-        return cert_directory + base_name + "-certificate.pem";
-    }
-    else {
-        // Windows SChannel.  Use a pkcs#12 file with just the peer's public certificate information.
-        return cert_directory + base_name + "-certificate.p12";
-    }
-}
-
-std::string find_CN(const std::string &subject) {
-    // The subject string is returned with different whitespace and component ordering between platforms.
-    // Here we just return the common name by searching for "CN=...." in the subject, knowing that
-    // the test certificates do not contain any escaped characters.
-    size_t pos = subject.find("CN=");
-    if (pos == std::string::npos) throw std::runtime_error("No common name in certificate subject");
-    std::string cn = subject.substr(pos);
-    pos = cn.find(',');
-    return pos == std::string::npos ? cn : cn.substr(0, pos);
-}
diff --git a/examples/cpp/tutorial.dox b/examples/cpp/tutorial.dox
deleted file mode 100644
index 56345a1..0000000
--- a/examples/cpp/tutorial.dox
+++ /dev/null
@@ -1,432 +0,0 @@
-// -*-markdown-*-
-// NOTE: doxygen can include markdown pages directly but there seems to be a bug
-// that shows messed-up line numbers in \skip \until code extracts. This file
-// is markdown wrapped in a doxygen comment - which works. The file is best viewed/editied
-// as markdown.
-
-/**
-
-@page tutorial Tutorial
-
-This is a brief tutorial that will walk you through the fundamentals
-of building messaging applications in incremental steps. There are
-further examples, in addition the ones mentioned in the tutorial.
-
-Proton provides an "event-driven" programming model, where you
-implement a subclass of `proton::messaging_handler` and override
-functions that react to various AMQP events (connections opening and
-closing, messages being delivered, and so on).
-
-The examples below show how to implement handlers for clients and
-servers and how to run them using the `proton::default_container`, a
-portable, easy-to-use way to build single-threaded clients or servers.
-
-Some of the examples require an AMQP *broker* that can receive, store,
-and send messages. @ref broker.hpp and @ref broker.cpp define a simple
-example broker. If run without arguments, it listens on
-`0.0.0.0:5672`, the standard AMQP port on all network interfaces. To
-use a different port or network interface:
-
-    broker -a <host>:<port>
-
-Instead of the example broker, you can use any AMQP 1.0-compliant
-broker. You must configure your broker to have a queue (or topic)
-named "examples".
-
-The `helloworld` examples take an optional URL argument. The other
-examples take an option `-a URL`. A URL looks like this:
-
-    HOST:PORT/ADDRESS
-
-It usually defaults to `127.0.0.1:5672/examples`, but you can change
-this if your broker is on a different host or port, or you want to use
-a different queue or topic name (the ADDRESS part of the URL). URL
-details are at `proton::url`.
-
-Hello World!
-------------
-
-\dontinclude helloworld.cpp
-
-Tradition dictates that we start with Hello World! This example
-demonstrates sending and receiving by sending a message to a broker
-and then receiving the same message back. In a realistic system the
-sender and receiver would normally be in different processes. The
-complete example is @ref helloworld.cpp
-
-We will include the following classes: `proton::default_container` (an
-implementation of `proton::container`) runs an event loop which
-dispatches events to a `proton::messaging_handler`. This allows a
-*reactive* style of programming which is well suited to messaging
-applications. `proton::connection` and `proton::delivery` are AMQP
-entities used in the handler functions.  `proton::url` is a simple
-parser for the URL format mentioned above.
-
-\skip proton/connection
-\until proton/url
-
-We will define a class `hello_world` which is a subclass of
-`proton::messaging_handler` and overrides functions to handle the
-events of interest in sending and receiving a message.
-
-\skip class hello_world
-\until {}
-
-`proton::messaging_handler::on_container_start()` is called when the
-event loop first starts. We handle that by establishing a connection
-and creating a sender and a receiver.
-
-\skip on_container_start
-\until }
-\until }
-
-`proton::messaging_handler::on_sendable()` is called when the message
-can be transferred over the associated sender link to the remote
-peer. We create a `proton::message`, set the message body to `"Hello
-World!"`, and send the message. Then we close the sender, since we
-only want to send one message. Closing the sender will prevent further
-calls to `proton::messaging_handler::on_sendable()`.
-
-\skip on_sendable
-\until }
-
-`proton::messaging_handler::on_message()` is called when a message is
-received. We just print the body of the message and close the
-connection, as we only want one message
-
-\skip on_message
-\until }
-
-The message body is a `proton::value`, see the documentation for more on how to
-extract the message body as type-safe C++ values.
-
-Our `main` function creates an instance of the `hello_world` handler
-and a `proton::default_container` using that handler. Calling
-`proton::container::run` sets things in motion and returns when we
-close the connection as there is nothing further to do. It may throw
-an exception, which will be a subclass of `proton::error`. That in
-turn is a subclass of `std::exception`.
-
-\skip main
-\until }
-\until }
-\until }
-
-Hello World, direct!
---------------------
-
-\dontinclude helloworld_direct.cpp
-
-Though often used in conjunction with a broker, AMQP does not
-*require* this. It also allows senders and receivers to communicate
-directly if desired.
-
-We will modify our example to send a message directly to itself. This
-is a bit contrived but illustrates both sides of the direct send and
-receive scenario. The full code is at @ref helloworld_direct.cpp.
-
-The first difference is that, rather than creating a receiver on the
-same connection as our sender, we listen for incoming connections by
-invoking the `proton::container::listen()` method on the container.
-
-\skip on_container_start
-\until }
-
-As we only need then to initiate one link, the sender, we can do that
-by passing in a url rather than an existing connection, and the
-connection will also be automatically established for us.
-
-We send the message in response to the
-`proton::messaging_handler::on_sendable()` callback and print the
-message out in response to the
-`proton::messaging_handler::on_message()` callback exactly as before.
-
-\skip on_sendable
-\until }
-\until }
-
-However, we also handle two new events. We now close the connection
-from the sender's side once the message has been accepted.  The
-acceptance of the message is an indication of successful transfer to
-the peer. We are notified of that event through the
-`proton::messaging_handler::on_tracker_accept()` callback.
-
-\skip on_tracker_accept
-\until }
-
-Then, once the connection has been closed, of which we are notified
-through the `proton::messaging_handler::on_connection_close()`
-callback, we stop accepting incoming connections.  A that point there
-is no work to be done, the event loop exits, and the
-`proton::container::run()` method returns.
-
-\skip on_connection_close
-\until }
-
-So now we have our example working without a broker involved!
-
-Note that for this example we pick an "unusual" port 8888 since we are talking
-to ourselves rather than a broker.
-
-\skipline url =
-
-Asynchronous send and receive
------------------------------
-
-Of course, these `Hello World!` examples are very artificial,
-communicating as they do over a network connection but with the same
-process. A more realistic example involves communication between
-separate processes, which could indeed be running on completely
-separate machines.
-
-Let's separate the sender from the receiver, and transfer more than a
-single message between them.
-
-We'll start with a simple sender, @ref simple_send.cpp.
-
-\dontinclude simple_send.cpp
-
-As with the previous example, we define the application logic in a
-class that handles events. Because we are transferring more than one
-message, we need to keep track of how many we have sent. We'll use a
-`sent` member variable for that.  The `total` member variable will
-hold the number of messages we want to send.
-
-\skip class simple_send
-\until total
-
-As before, we use the
-`proton::messaging_handler::on_container_start()` event to establish
-our sender link over which we will transfer messages.
-
-\skip on_container_start
-\until }
-
-AMQP defines a credit-based flow-control mechanism. Flow control
-allows the receiver to control how many messages it is prepared to
-receive at a given time and thus prevents any component being
-overwhelmed by the number of messages it is sent.
-
-In the `proton::messaging_handler::on_sendable()` callback, we check
-that our sender has credit before sending messages. We also check that
-we haven't already sent the required number of messages.
-
-\skip on_sendable
-\until }
-\until }
-
-The `proton::sender::send()` call above is asynchronous. When it
-returns, the message has not yet actually been transferred across the
-network to the receiver. By handling the
-`proton::messaging_handler::on_tracker_accept()` event, we can get
-notified when the receiver has received and accepted the message. In
-our example we use this event to track the confirmation of the
-messages we have sent. We only close the connection and exit when the
-receiver has received all the messages we wanted to send.
-
-\skip on_tracker_accept
-\until }
-\until }
-
-If we are disconnected after a message is sent and before it has been
-confirmed by the receiver, it is said to be "in doubt". We don't know
-whether or not it was received. In this example, we will handle that
-by resending any in-doubt messages. This is known as an
-"at-least-once" guarantee, since each message should eventually be
-received at least once, though a given message may be received more
-than once (i.e., duplicates are possible). In the
-`proton::messaging_handler::on_transport_close()` callback, we reset
-the sent count to reflect only those that have been confirmed. The
-library will automatically try to reconnect for us, and when our
-sender is sendable again, we can restart from the point we know the
-receiver got to.
-
-\skip on_transport_close
-\until }
-
-\dontinclude simple_recv.cpp
-
-Now let's look at the corresponding receiver, @ref simple_recv.cpp.
-
-This time we'll use an `expected` member variable for for the number
-of messages we expect and a `received` variable to count how many we
-have received so far.
-
-\skip class simple_recv
-\until received
-
-We handle `proton::messaging_handler::on_container_start()` by
-creating our receiver, much like we did for the sender.
-
-\skip on_container_start
-\until }
-
-We also handle the `proton::messaging_handler::on_message()` event for
-received messages and print the message out as in the `Hello World!`
-examples.  However, we add some logic to allow the receiver to wait
-for a given number of messages and then close the connection and
-exit. We also add some logic to check for and ignore duplicates, using
-a simple sequential ID scheme.
-
-\skip on_message
-\until }
-
-Direct send and receive
------------------------
-
-Sending between these two examples requires an intermediary broker
-since neither accepts incoming connections. AMQP allows us to send
-messages directly between two processes. In that case, one or other of
-the processes needs to accept incoming connections. Let's create a
-modified version of the receiving example that does this with @ref
-direct_recv.cpp.
-
-\dontinclude direct_recv.cpp
-
-There are only two differences here. Instead of initiating a link (and
-implicitly a connection), we listen for incoming connections.
-
-\skip on_container_start
-\until }
-
-When we have received all the expected messages, we then stop
-listening for incoming connections by calling
-`proton::listener::stop()`
-
-\skip on_message
-\until }
-\until }
-\until }
-\until }
-
-You can use the @ref simple_send.cpp example to send to this receiver
-directly. (Note: you will need to stop any broker that is listening on
-the 5672 port, or else change the port used by specifying a different
-address to each example via the `-a` command-line switch).
-
-We can also modify the sender to allow the original receiver to
-connect to it, in @ref direct_send.cpp. Again, that requires just two
-modifications:
-
-\dontinclude direct_send.cpp
-
-As with the modified receiver, instead of initiating establishment of a
-link, we listen for incoming connections.
-
-\skip on_container_start
-\until }
-
-When we have received confirmation of all the messages we sent, we call
-`container::listener::stop()` to exit.
-
-\skip on_tracker_accept
-\until }
-\until }
-
-To try this modified sender, run the original @ref simple_recv.cpp
-against it.
-
-The symmetry in the underlying AMQP wire protocol that enables this is
-quite unique and elegant, and in reflecting this the Proton API
-provides a flexible toolkit for implementing all sorts of interesting
-intermediaries.
-
-Request and response
---------------------
-
-A common pattern is to send a request message and expect a response
-message in return. AMQP has special support for this pattern. Let's
-have a look at a simple example. We'll start with @ref server.cpp, the
-program that will process the request and send the response. Note that
-we are still using a broker in this example.
-
-Our server will provide a very simple service: it will respond with
-the body of the request converted to uppercase.
-
-\dontinclude server.cpp
-\skip class server
-\until };
-
-The code here is not too different from the simple receiver example.
-However, when we receive a request in
-`proton::messaging_handler::on_message`, we look at the
-`proton::message::reply_to` address and create a sender with that
-address for the response. We'll cache the senders in case we get
-further requests with the same `reply_to`.
-
-Now let's create a simple @ref client.cpp to test this service out.
-
-\dontinclude client.cpp
-
-Our client takes a list of strings to send as requests.
-
-\skipline client(
-
-Since we will be sending and receiving, we create a sender and a
-receiver in `proton::messaging_handler::on_container_start`.  Our
-receiver has a blank address and sets the `dynamic` flag to true,
-which means we expect the remote end (the broker or server) to assign
-a unique address for us.
-
-\skip on_container_start
-\until }
-
-Now we need a function to send the next request from our list of
-requests. We set the `reply_to` address to be the dynamically assigned
-address of our receiver.
-
-\skip send_request
-\until }
-
-We need to use the address assigned by the broker as the `reply_to`
-address of our requests, so we can't send them until our receiver has
-been set up. To do that, we add an
-`proton::messaging_handler::on_receiver_open()` method to our handler
-class and use that as the trigger to send our first request.
-
-\skip on_receiver_open
-\until }
-
-When we receive a reply, we send the next request.
-
-\skip on_message
-\until }
-\until }
-\until }
-
-Direct request and response
----------------------------
-
-We can avoid the intermediary process by writing a server that accepts
-connections directly, @ref server_direct.cpp. It involves the
-following changes to our original server:
-
-\dontinclude server_direct.cpp
-
-Our server must generate unique `reply-to` addresses for links from
-the client that request a dynamic address (previously this was done by
-the broker).  We use a simple counter.
-
-\skip generate_address
-\until }
-
-Next we need to handle incoming requests for links with dynamic
-addresses from the client.  We give the link a unique address and
-record it in our `senders` map.
-
-\skip on_sender_open
-\until }
-
-Note that we are interested in *sender* links above because we are
-implementing the server. A *receiver* link created on the client
-corresponds to a *sender* link on the server.
-
-Finally when we receive a message we look up its `reply_to` in our
-senders map and send the reply.
-
-\skip on_message
-\until }
-\until }
-\until }
-
-*/
diff --git a/examples/exampletest.py b/examples/exampletest.py
deleted file mode 100644
index d40b9cb..0000000
--- a/examples/exampletest.py
+++ /dev/null
@@ -1,183 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License
-#
-
-# A test library to make it easy to run unittest tests that start,
-# monitor, and report output from sub-processes. In particular
-# it helps with starting processes that listen on random ports.
-
-import unittest
-import os, sys, socket, time, re, inspect, errno, threading
-from  random import randrange
-from subprocess import Popen, PIPE, STDOUT
-from copy import copy
-import platform
-from os.path import dirname as dirname
-
-def pick_port():
-    """Pick a random port."""
-    p =  randrange(10000, 20000)
-    return p
-
-class ProcError(Exception):
-    """An exception that captures failed process output"""
-    def __init__(self, proc, what="bad exit status"):
-        out = proc.out.strip()
-        if out:
-            out = "\nvvvvvvvvvvvvvvvv\n%s\n^^^^^^^^^^^^^^^^\n" % out
-        else:
-            out = ", no output)"
-        super(Exception, self, ).__init__(
-            "%s %s, code=%s%s" % (proc.args, what, proc.returncode, out))
-
-class NotFoundError(ProcError):
-    pass
-
-class Proc(Popen):
-    """A example process that stores its output, optionally run with valgrind."""
-
-    if "VALGRIND" in os.environ and os.environ["VALGRIND"]:
-        env_args = [os.environ["VALGRIND"], "--error-exitcode=42", "--quiet", "--leak-check=full"]
-    else:
-        env_args = []
-
-    @property
-    def out(self):
-        self._out.seek(0)
-        return self._out.read()
-
-    def __init__(self, args, **kwargs):
-        """Start an example process"""
-        args = list(args)
-        self.args = args
-        self._out = os.tmpfile()
-        try:
-            Popen.__init__(self, self.env_args + self.args, stdout=self._out, stderr=STDOUT, **kwargs)
-        except OSError, e:
-            if e.errno == errno.ENOENT:
-                raise NotFoundError(self, str(e))
-            raise ProcError(self, str(e))
-        except Exception, e:
-            raise ProcError(self, str(e))
-
-    def kill(self):
-        try:
-            if self.poll() is None:
-                Popen.kill(self)
-        except:
-            pass                # Already exited.
-        return self.out
-
-    def wait_out(self, timeout=10, expect=0):
-        """Wait for process to exit, return output. Raise ProcError  on failure."""
-        t = threading.Thread(target=self.wait)
-        t.start()
-        t.join(timeout)
-        if self.poll() is None:      # Still running
-            self.kill()
-            raise ProcError(self, "timeout")
-        if expect is not None and self.poll() != expect:
-            raise ProcError(self)
-        return self.out
-
-# Work-around older python unittest that lacks setUpClass.
-if hasattr(unittest.TestCase, 'setUpClass') and  hasattr(unittest.TestCase, 'tearDownClass'):
-    TestCase = unittest.TestCase
-else:
-    class TestCase(unittest.TestCase):
-        """
-        Roughly provides setUpClass and tearDownClass functionality for older python
-        versions in our test scenarios. If subclasses override setUp or tearDown
-        they *must* call the superclass.
-        """
-        def setUp(self):
-            if not hasattr(type(self), '_setup_class_count'):
-                type(self)._setup_class_count = len(
-                    inspect.getmembers(
-                        type(self),
-                        predicate=lambda(m): inspect.ismethod(m) and m.__name__.startswith('test_')))
-                type(self).setUpClass()
-
-        def tearDown(self):
-            self.assertTrue(self._setup_class_count > 0)
-            self._setup_class_count -=  1
-            if self._setup_class_count == 0:
-                type(self).tearDownClass()
-
-class ExampleTestCase(TestCase):
-    """TestCase that manages started processes"""
-    def setUp(self):
-        super(ExampleTestCase, self).setUp()
-        self.procs = []
-
-    def tearDown(self):
-        for p in self.procs:
-            p.kill()
-        super(ExampleTestCase, self).tearDown()
-
-    def proc(self, *args, **kwargs):
-        p = Proc(*args, **kwargs)
-        self.procs.append(p)
-        return p
-
-def wait_port(port, timeout=10):
-    """Wait up to timeout for port to be connectable."""
-    if timeout:
-        deadline = time.time() + timeout
-    while (timeout is None or time.time() < deadline):
-        try:
-            s = socket.create_connection((None, port), timeout) # Works for IPv6 and v4
-            s.close()
-            return
-        except socket.error, e:
-            if e.errno != errno.ECONNREFUSED: # Only retry on connection refused error.
-                raise
-    raise socket.timeout()
-
-
-class BrokerTestCase(ExampleTestCase):
-    """
-    ExampleTest that starts a broker in setUpClass and kills it in tearDownClass.
-    Subclass must set `broker_exe` class variable with the name of the broker executable.
-    """
-
-    @classmethod
-    def setUpClass(cls):
-        cls.port = pick_port()
-        cls.addr = "127.0.0.1:%s/examples" % (cls.port)
-        cls.broker = None       # In case Proc throws, create the attribute.
-        cls.broker = Proc(cls.broker_exe + ["-a", cls.addr])
-        try:
-            wait_port(cls.port)
-        except Exception, e:
-            cls.broker.kill()
-            raise ProcError(cls.broker, "timed out waiting for port")
-
-    @classmethod
-    def tearDownClass(cls):
-        if cls.broker: cls.broker.kill()
-
-    def tearDown(self):
-        b = type(self).broker
-        if b and b.poll() !=  None: # Broker crashed
-            type(self).setUpClass() # Start another for the next test.
-            raise ProcError(b, "broker crash")
-        super(BrokerTestCase, self).tearDown()
-
-if __name__ == "__main__":
-    unittest.main()
diff --git a/examples/go/CMakeLists.txt b/examples/go/CMakeLists.txt
deleted file mode 100644
index c9aba01..0000000
--- a/examples/go/CMakeLists.txt
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-if(BUILD_GO)
-
-  set(examples electron/broker electron/receive electron/send proton/broker)
-  file(GLOB_RECURSE example_source FOLLOW_SYMLINKS ${CMAKE_CURRENT_SOURCE_DIR}/*.go)
-
-  # Build example exes
-  foreach(example ${examples})
-    string(REPLACE / _ target ${example})
-    set(target "go_example_${target}")
-    set(output ${CMAKE_CURRENT_BINARY_DIR}/${example})
-    # Always run go_build, it will do nothing if there is nothing to do.
-    # Otherwise it's too hard to get the dependencies right.
-    add_custom_target(${target} ALL
-      COMMAND ${GO_BUILD} ${GO_EXAMPLE_FLAGS} -o ${output} ${CMAKE_CURRENT_SOURCE_DIR}/${example}.go
-      WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-      DEPENDS go-build)
-    list(APPEND example_targets ${target})
-  endforeach()
-
-  # Build test driver exe
-  set(test_exe ${CMAKE_CURRENT_BINARY_DIR}/example_test)
-  add_custom_target(go_example_test ALL
-    COMMAND ${GO_TEST} -c -o ${test_exe} ${CMAKE_CURRENT_SOURCE_DIR}/example_test.go
-    WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
-
-  add_test(
-    NAME go-example-electron
-    COMMAND ${GO_ENV} ${test_exe} -dir ${CMAKE_CURRENT_BINARY_DIR}/electron -broker broker)
-
-  add_test(
-    NAME go-example-proton
-    COMMAND ${GO_ENV} ${test_exe} -dir ${CMAKE_CURRENT_BINARY_DIR}/electron -broker ../proton/broker)
-
-  list(APPEND ADDITIONAL_MAKE_CLEAN_FILES ${examples})
-endif()
diff --git a/examples/go/README.md b/examples/go/README.md
deleted file mode 100644
index 24f4d2a..0000000
--- a/examples/go/README.md
+++ /dev/null
@@ -1,131 +0,0 @@
-# Go examples
-
-## Electron examples
-
-[qpid.apache.org/electron](http://godoc.org/qpid.apache.org/electron) is a
-simple API for writing concurrent AMQP clients and servers.
-
-- [receive.go](electron/receive.go) receive from many connections concurrently.
-- [send.go](electron/send.go) send to many connections concurrently.
-- [broker.go](electron/broker.go) a simple broker using the electron API
-n
-## Proton examples
-
-[qpid.apache.org/proton](http://godoc.org/qpid.apache.org/proton) is an
-event-driven, concurrent-unsafe Go wrapper for the proton-C library. The
-[electron](http://godoc.org/qpid.apache.org/electron) package provides a more
-Go-friendly concurrent API built on top of proton.
-
-- [broker.go](proton/broker.go) a simple broker using the proton API
-
-See [A Tale of Two Brokers](#a-tale-of-two-brokers) for a comparison of the two APIs.
-
-## Using the Go packages
-
-If you have the proton-C library and headers installed you can get the latest go
-packages with
-
-    go get qpid.apache.org/electron
-
-If Proton-C is installed in a non-standard place (other than /usr or /usr/local)
-you should set these environment variables before `go get`:
-
-    export CGO_LDFLAGS="-L/<my-proton>/lib[64]"
-    export CGO_CFLAGS="-I/<my-proton>/include"
-    go get qpid.apache.org/electron
-
-If you have a proton build you don't need to `go get`, you can set your GOPATH
-to use the binding from the checkout with:
-
-    source <path-to-proton>/config.sh
-
-Once you are set up, the go tools will work as normal. You can see documentation
-in your web browser at `localhost:6060` by running:
-
-    godoc -http=:6060
-
-## Running the examples
-
-You can run the examples directly from source like this:
-
-    go run <program>.go
-
-This is a little slow (a couple of seconds) as it compiles the program and runs it in one step.
-You can compile the program first and then run the executable to avoid the delay:
-
-    go build <program>.go
-    ./<program>
-
-All the examples take a `-h` flag to show usage information, and the comments in
-the example source have more details.
-
-First start the broker (the optional `-debug` flag will print extra information about
-what the broker is doing)
-
-    go run broker.go -debug
-
-Send messages concurrently to queues "foo" and "bar", 10 messages to each queue:
-
-    go run send.go -count 10 localhost:/foo localhost:/bar
-
-Receive messages concurrently from "foo" and "bar". Note -count 20 for 10 messages each on 2 queues:
-
-    go run receive.go -count 20 localhost:/foo localhost:/bar
-
-The broker and clients use the standard AMQP port (5672) on the local host by
-default, to use a different address use the `-addr host:port` flag.
-
-If you have other Proton examples available you can try communicating between
-programs in in different languages. For example use the python broker with Go
-clients:
-
-    python ../python/broker.py
-    go run send.go -count 10 localhost:/foo localhost:/bar
-
-Or use the Go broker and the python clients:
-
-    go run broker.go -debug
-    python ../python/simple_send.py
-    python ../python/simple_recv.py
-
-
-## A tale of two brokers.
-
-The [proton](http://godoc.org/qpid.apache.org/proton) and
-[electron](http://godoc.org/qpid.apache.org/electron) packages provide two
-different APIs for building AMQP applications. For most applications,
-[electron](http://godoc.org/qpid.apache.org/electron) is easier to use.
-[The proton Go README](https://github.com/apache/qpid-proton/blob/master/proton-c/bindings/go/src/qpid.apache.org/README.md)
-has some discussion about why there are two APIs.
-
-The examples [proton/broker.go](proton/broker.go) and
-[electron/broker.go](electron/broker.go) implement the same simple broker
-functionality using each of the two APIs. They both handle multiple connections
-concurrently and store messages on bounded queues implemented by Go channels.
-
-However the [electron/broker.go](electron/broker.go) is less than half as long as the
-[proton/broker.go](proton/broker.go) illustrating why it is better suited for most Go
-applications.
-
-[proton/broker.go](proton/broker.go) implements an event-driven loop per connection that reacts
-to events like 'incoming link', 'incoming message' and 'sender has credit'.  It
-uses channels to exchange data between the event-loop goroutine for each
-connection and shared queues that are accessible to all connections. Sending
-messages is particularly tricky, the broker must monitor the queue for available
-messages and the sender link for available credit.
-
-
-[electron/broker.go](electron/broker.go) does not need any "upside-down"
-event-driven code, it is implemented as straightforward loops. The broker is a
-loop listening for connections. Each connection is a loop accepting for incoming
-sender or recdiver links. Each receiving link is a loop that receives a message
-and pushes it to a queue.  Each sending link is a loop that pops a message from
-a queue and sends it.
-
-Queue bounds and credit manage themselves: popping from a queue blocks till
-there is a message, sending blocks until there is credit, receiving blocks till
-something is received and pushing onto a queue blocks until there is
-space. There's no need for code that monitors the state of multiple queues and
-links. Each loop has one simple job to do, and the Go run-time schedules them
-efficiently.
-
diff --git a/examples/go/electron/broker.go b/examples/go/electron/broker.go
deleted file mode 100644
index d698838..0000000
--- a/examples/go/electron/broker.go
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-//
-// This is a simple AMQP broker implemented using the procedural electron package.
-//
-// It maintains a set of named in-memory queues of messages. Clients can send
-// messages to queues or subscribe to receive messages from them.
-//
-
-package main
-
-import (
-	"../util"
-	"flag"
-	"fmt"
-	"log"
-	"net"
-	"os"
-	"qpid.apache.org/amqp"
-	"qpid.apache.org/electron"
-)
-
-// Usage and command-line flags
-func usage() {
-	fmt.Fprintf(os.Stderr, `
-Usage: %s
-A simple broker-like demo. Queues are created automatically for sender or receiver addrsses.
-`, os.Args[0])
-	flag.PrintDefaults()
-}
-
-var addr = flag.String("addr", ":amqp", "Listening address")
-var credit = flag.Int("credit", 100, "Receiver credit window")
-var qsize = flag.Int("qsize", 1000, "Max queue size")
-
-func main() {
-	flag.Usage = usage
-	flag.Parse()
-	b := &broker{
-		queues:    util.MakeQueues(*qsize),
-		container: electron.NewContainer(fmt.Sprintf("broker[%s]", os.Getpid())),
-		acks:      make(chan electron.Outcome),
-		sent:      make(chan sentMessage),
-	}
-	if err := b.run(); err != nil {
-		log.Fatal(err)
-	}
-}
-
-// State for the broker
-type broker struct {
-	queues    util.Queues           // A collection of queues.
-	container electron.Container    // electron.Container manages AMQP connections.
-	sent      chan sentMessage      // Channel to record sent messages.
-	acks      chan electron.Outcome // Channel to receive the Outcome of sent messages.
-}
-
-// Record of a sent message and the queue it came from.
-// If a message is rejected or not acknowledged due to a failure, we will put it back on the queue.
-type sentMessage struct {
-	m amqp.Message
-	q util.Queue
-}
-
-// run listens for incoming net.Conn connections and starts an electron.Connection for each one.
-func (b *broker) run() error {
-	listener, err := net.Listen("tcp", *addr)
-	if err != nil {
-		return err
-	}
-	defer listener.Close()
-	fmt.Printf("Listening on %v\n", listener.Addr())
-
-	go b.acknowledgements() // Handles acknowledgements for all connections.
-
-	// Start a goroutine for each new connections
-	for {
-		c, err := b.container.Accept(listener)
-		if err != nil {
-			util.Debugf("Accept error: %v", err)
-			continue
-		}
-		cc := &connection{b, c}
-		go cc.run() // Handle the connection
-		util.Debugf("Accepted %v", c)
-	}
-}
-
-// State for a broker connectoin
-type connection struct {
-	broker     *broker
-	connection electron.Connection
-}
-
-// accept remotely-opened endpoints (Session, Sender and Receiver) on a connection
-// and start goroutines to service them.
-func (c *connection) run() {
-	for in := range c.connection.Incoming() {
-		switch in := in.(type) {
-
-		case *electron.IncomingSender:
-			if in.Source() == "" {
-				in.Reject(fmt.Errorf("no source"))
-			} else {
-				go c.sender(in.Accept().(electron.Sender))
-			}
-
-		case *electron.IncomingReceiver:
-			if in.Target() == "" {
-				in.Reject(fmt.Errorf("no target"))
-			} else {
-				in.SetPrefetch(true)
-				in.SetCapacity(*credit) // Pre-fetch up to credit window.
-				go c.receiver(in.Accept().(electron.Receiver))
-			}
-
-		default:
-			in.Accept() // Accept sessions unconditionally
-		}
-		util.Debugf("incoming: %v", in)
-	}
-	util.Debugf("incoming closed: %v", c.connection)
-}
-
-// receiver receives messages and pushes to a queue.
-func (c *connection) receiver(receiver electron.Receiver) {
-	q := c.broker.queues.Get(receiver.Target())
-	for {
-		if rm, err := receiver.Receive(); err == nil {
-			util.Debugf("%v: received %v", receiver, util.FormatMessage(rm.Message))
-			q <- rm.Message
-			rm.Accept()
-		} else {
-			util.Debugf("%v error: %v", receiver, err)
-			break
-		}
-	}
-}
-
-// sender pops messages from a queue and sends them.
-func (c *connection) sender(sender electron.Sender) {
-	q := c.broker.queues.Get(sender.Source())
-	for {
-		if sender.Error() != nil {
-			util.Debugf("%v closed: %v", sender, sender.Error())
-			return
-		}
-		select {
-
-		case m := <-q:
-			util.Debugf("%v: sent %v", sender, util.FormatMessage(m))
-			sm := sentMessage{m, q}
-			c.broker.sent <- sm                    // Record sent message
-			sender.SendAsync(m, c.broker.acks, sm) // Receive outcome on c.broker.acks with Value sm
-
-		case <-sender.Done(): // break if sender is closed
-			break
-		}
-	}
-}
-
-// acknowledgements keeps track of sent messages and receives outcomes.
-//
-// We could have handled outcomes separately per-connection, per-sender or even
-// per-message. Message outcomes are returned via channels defined by the user
-// so they can be grouped in any way that suits the application.
-func (b *broker) acknowledgements() {
-	sentMap := make(map[sentMessage]bool)
-	for {
-		select {
-		case sm, ok := <-b.sent: // A local sender records that it has sent a message.
-			if ok {
-				sentMap[sm] = true
-			} else {
-				return // Closed
-			}
-		case outcome := <-b.acks: // The message outcome is available
-			sm := outcome.Value.(sentMessage)
-			delete(sentMap, sm)
-			if outcome.Status != electron.Accepted { // Error, release or rejection
-				sm.q.PutBack(sm.m) // Put the message back on the queue.
-				util.Debugf("message %v put back, status %v, error %v",
-					util.FormatMessage(sm.m), outcome.Status, outcome.Error)
-			}
-		}
-	}
-}
diff --git a/examples/go/electron/receive.go b/examples/go/electron/receive.go
deleted file mode 100644
index 7a505d8..0000000
--- a/examples/go/electron/receive.go
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package main
-
-import (
-	"../util"
-	"flag"
-	"fmt"
-	"log"
-	"os"
-	"qpid.apache.org/amqp"
-	"qpid.apache.org/electron"
-	"sync"
-)
-
-// Usage and command-line flags
-func usage() {
-	fmt.Fprintf(os.Stderr, `Usage: %s url [url ...]
-Receive messages from all the listed URLs concurrently and print them.
-`, os.Args[0])
-	flag.PrintDefaults()
-}
-
-var count = flag.Uint64("count", 1, "Stop after receiving this many messages.")
-
-func main() {
-	flag.Usage = usage
-	flag.Parse()
-
-	urls := flag.Args() // Non-flag arguments are URLs to receive from
-	if len(urls) == 0 {
-		log.Println("No URL provided")
-		usage()
-		os.Exit(1)
-	}
-
-	messages := make(chan amqp.Message) // Channel for messages from goroutines to main()
-	defer close(messages)
-
-	var wait sync.WaitGroup // Used by main() to wait for all goroutines to end.
-	wait.Add(len(urls))     // Wait for one goroutine per URL.
-
-	container := electron.NewContainer(fmt.Sprintf("receive[%s]", os.Getpid()))
-	connections := make(chan electron.Connection, len(urls)) // Connections to close on exit
-
-	// Start a goroutine to for each URL to receive messages and send them to the messages channel.
-	// main() receives and prints them.
-	for _, urlStr := range urls {
-		util.Debugf("Connecting to %s\n", urlStr)
-		go func(urlStr string) { // Start the goroutine
-
-			defer wait.Done()                 // Notify main() when this goroutine is done.
-			url, err := amqp.ParseURL(urlStr) // Like net/url.Parse() but with AMQP defaults.
-			util.ExitIf(err)
-
-			// Open a new connection
-			c, err := container.Dial("tcp", url.Host) // Note net.URL.Host is actually "host:port"
-			util.ExitIf(err)
-			connections <- c // Save connection so we can Close() when main() ends
-
-			// Create a Receiver using the path of the URL as the source address
-			r, err := c.Receiver(electron.Source(url.Path))
-			util.ExitIf(err)
-
-			// Loop receiving messages and sending them to the main() goroutine
-			for {
-				if rm, err := r.Receive(); err != nil {
-					util.Debugf("closed %v: %v", urlStr, err)
-					return
-				} else {
-					rm.Accept()
-					messages <- rm.Message
-				}
-			}
-		}(urlStr)
-	}
-
-	// All goroutines are started, we are receiving messages.
-	fmt.Printf("Listening on %d connections\n", len(urls))
-
-	// print each message until the count is exceeded.
-	for i := uint64(0); i < *count; i++ {
-		m := <-messages
-		util.Debugf("%s\n", util.FormatMessage(m))
-	}
-	fmt.Printf("Received %d messages\n", *count)
-
-	// Close all connections, this will interrupt goroutines blocked in Receiver.Receive()
-	for i := 0; i < len(urls); i++ {
-		c := <-connections
-		util.Debugf("close %s", c)
-		c.Close(nil)
-	}
-	wait.Wait() // Wait for all goroutines to finish.
-}
diff --git a/examples/go/electron/send.go b/examples/go/electron/send.go
deleted file mode 100644
index 4ea93ec..0000000
--- a/examples/go/electron/send.go
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package main
-
-import (
-	"../util"
-	"flag"
-	"fmt"
-	"log"
-	"os"
-	"qpid.apache.org/amqp"
-	"qpid.apache.org/electron"
-	"sync"
-)
-
-// Usage and command-line flags
-func usage() {
-	fmt.Fprintf(os.Stderr, `Usage: %s url [url ...]
-Send messages to each URL concurrently with body "<url-path>-<n>" where n is the message number.
-`, os.Args[0])
-	flag.PrintDefaults()
-}
-
-var count = flag.Int64("count", 1, "Send this may messages per address.")
-
-func main() {
-	flag.Usage = usage
-	flag.Parse()
-
-	urls := flag.Args() // Non-flag arguments are URLs to receive from
-	if len(urls) == 0 {
-		log.Println("No URL provided")
-		flag.Usage()
-		os.Exit(1)
-	}
-
-	sentChan := make(chan electron.Outcome) // Channel to receive acknowledgements.
-
-	var wait sync.WaitGroup
-	wait.Add(len(urls)) // Wait for one goroutine per URL.
-
-	container := electron.NewContainer(fmt.Sprintf("send[%s]", os.Getpid()))
-	connections := make(chan electron.Connection, len(urls)) // Connctions to close on exit
-
-	// Start a goroutine for each URL to send messages.
-	for _, urlStr := range urls {
-		util.Debugf("Connecting to %v\n", urlStr)
-		go func(urlStr string) {
-
-			defer wait.Done()                 // Notify main() that this goroutine is done.
-			url, err := amqp.ParseURL(urlStr) // Like net/url.Parse() but with AMQP defaults.
-			util.ExitIf(err)
-
-			// Open a new connection
-			c, err := container.Dial("tcp", url.Host) // Note net.URL.Host is actually "host:port"
-			util.ExitIf(err)
-			connections <- c // Save connection so we can Close() when main() ends
-
-			// Create a Sender using the path of the URL as the AMQP address
-			s, err := c.Sender(electron.Target(url.Path))
-			util.ExitIf(err)
-
-			// Loop sending messages.
-			for i := int64(0); i < *count; i++ {
-				m := amqp.NewMessage()
-				body := fmt.Sprintf("%v-%v", url.Path, i)
-				m.Marshal(body)
-				s.SendAsync(m, sentChan, body) // Outcome will be sent to sentChan
-			}
-		}(urlStr)
-	}
-
-	// Wait for all the acknowledgements
-	expect := int(*count) * len(urls)
-	util.Debugf("Started senders, expect %v acknowledgements\n", expect)
-	for i := 0; i < expect; i++ {
-		out := <-sentChan // Outcome of async sends.
-		if out.Error != nil {
-			util.Debugf("acknowledgement[%v] %v error: %v\n", i, out.Value, out.Error)
-		} else {
-			util.Debugf("acknowledgement[%v]  %v (%v)\n", i, out.Value, out.Status)
-		}
-	}
-	fmt.Printf("Received all %v acknowledgements\n", expect)
-
-	wait.Wait() // Wait for all goroutines to finish.
-	close(connections)
-	for c := range connections { // Close all connections
-		if c != nil {
-			c.Close(nil)
-		}
-	}
-}
diff --git a/examples/go/example_test.go b/examples/go/example_test.go
deleted file mode 100644
index 6de309e..0000000
--- a/examples/go/example_test.go
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-// Tests to verify that example code behaves as expected.
-// Run in this directory with `go test example_test.go`
-//
-package main
-
-import (
-	"bufio"
-	"bytes"
-	"flag"
-	"fmt"
-	"io"
-	"log"
-	"math/rand"
-	"net"
-	"os"
-	"os/exec"
-	"path"
-	"path/filepath"
-	"reflect"
-	"testing"
-	"time"
-)
-
-func fatalIf(t *testing.T, err error) {
-	if err != nil {
-		t.Fatalf("%s", err)
-	}
-}
-
-// A demo broker process
-type broker struct {
-	cmd    *exec.Cmd
-	addr   string
-	runerr chan error
-	err    error
-}
-
-// Try to connect to the broker to verify it is ready, give up after a timeout
-func (b *broker) check() error {
-	dialer := net.Dialer{Deadline: time.Now().Add(time.Second * 10)}
-	for {
-		c, err := dialer.Dial("tcp", b.addr)
-		if err == nil { // Success
-			c.Close()
-			return nil
-		}
-		select {
-		case runerr := <-b.runerr: // Broker exited.
-			return runerr
-		default:
-		}
-		if neterr, ok := err.(net.Error); ok && neterr.Timeout() { // Running but timed out
-			b.stop()
-			return fmt.Errorf("timed out waiting for broker")
-		}
-		time.Sleep(time.Second / 10)
-	}
-}
-
-// Start the demo broker, wait till it is listening on *addr. No-op if already started.
-func (b *broker) start(t *testing.T) error {
-	if b.cmd == nil { // Not already started
-		b.addr = fmt.Sprintf("127.0.0.1:%d", rand.Intn(10000)+10000)
-		b.cmd = exampleCommand(t, *brokerName, "-addr", b.addr)
-		b.runerr = make(chan error)
-		b.cmd.Stderr, b.cmd.Stdout = os.Stderr, os.Stdout
-		b.err = b.cmd.Start()
-		if b.err == nil {
-			go func() { b.runerr <- b.cmd.Wait() }()
-		} else {
-			b.runerr <- b.err
-		}
-		b.err = b.check()
-	}
-	return b.err
-}
-
-func (b *broker) stop() {
-	if b != nil && b.cmd != nil {
-		b.cmd.Process.Kill()
-		<-b.runerr
-	}
-}
-
-func checkEqual(want interface{}, got interface{}) error {
-	if reflect.DeepEqual(want, got) {
-		return nil
-	}
-	return fmt.Errorf("%#v != %#v", want, got)
-}
-
-// exampleCommand returns an exec.Cmd to run an example.
-func exampleCommand(t *testing.T, prog string, arg ...string) (cmd *exec.Cmd) {
-	args := []string{}
-	if *debug {
-		args = append(args, "-debug=true")
-	}
-	args = append(args, arg...)
-	prog, err := filepath.Abs(path.Join(*dir, prog))
-	fatalIf(t, err)
-	if _, err := os.Stat(prog); err == nil {
-		cmd = exec.Command(prog, args...)
-	} else if _, err := os.Stat(prog + ".go"); err == nil {
-		args = append([]string{"run", prog + ".go"}, args...)
-		cmd = exec.Command("go", args...)
-	} else {
-		t.Fatalf("Cannot find binary or source for %s", prog)
-	}
-	cmd.Stderr = os.Stderr
-	return cmd
-}
-
-// Run an example Go program, return the combined output as a string.
-func runExample(t *testing.T, prog string, arg ...string) (string, error) {
-	cmd := exampleCommand(t, prog, arg...)
-	out, err := cmd.Output()
-	return string(out), err
-}
-
-func prefix(prefix string, err error) error {
-	if err != nil {
-		return fmt.Errorf("%s: %s", prefix, err)
-	}
-	return nil
-}
-
-func runExampleWant(t *testing.T, want string, prog string, args ...string) error {
-	out, err := runExample(t, prog, args...)
-	if err != nil {
-		return fmt.Errorf("%s failed: %s: %s", prog, err, out)
-	}
-	return prefix(prog, checkEqual(want, out))
-}
-
-func exampleArgs(args ...string) []string {
-	for i := 0; i < *connections; i++ {
-		args = append(args, fmt.Sprintf("%s/%s%d", testBroker.addr, "q", i))
-	}
-	return args
-}
-
-// Send then receive
-func TestExampleSendReceive(t *testing.T) {
-	if testing.Short() {
-		t.Skip("Skip demo tests in short mode")
-	}
-	testBroker.start(t)
-	err := runExampleWant(t,
-		fmt.Sprintf("Received all %d acknowledgements\n", expected),
-		"send",
-		exampleArgs("-count", fmt.Sprintf("%d", *count))...)
-	if err != nil {
-		t.Fatal(err)
-	}
-	err = runExampleWant(t,
-		fmt.Sprintf("Listening on %v connections\nReceived %v messages\n", *connections, *count**connections),
-		"receive",
-		exampleArgs("-count", fmt.Sprintf("%d", *count**connections))...)
-	if err != nil {
-		t.Fatal(err)
-	}
-}
-
-var ready error
-
-func init() { ready = fmt.Errorf("Ready") }
-
-// Run receive in a goroutine.
-// Send ready on errchan when it is listening.
-// Send final error when it is done.
-// Returns the Cmd, caller must Wait()
-func goReceiveWant(t *testing.T, errchan chan<- error, want string, arg ...string) *exec.Cmd {
-	cmd := exampleCommand(t, "receive", arg...)
-	go func() {
-		pipe, err := cmd.StdoutPipe()
-		if err != nil {
-			errchan <- err
-			return
-		}
-		out := bufio.NewReader(pipe)
-		cmd.Start()
-		line, err := out.ReadString('\n')
-		if err != nil && err != io.EOF {
-			errchan <- err
-			return
-		}
-		listening := "Listening on 3 connections\n"
-		if line != listening {
-			errchan <- checkEqual(listening, line)
-			return
-		}
-		errchan <- ready
-		buf := bytes.Buffer{}
-		io.Copy(&buf, out) // Collect the rest of the output
-		cmd.Wait()
-		errchan <- checkEqual(want, buf.String())
-		close(errchan)
-	}()
-	return cmd
-}
-
-// Start receiver first, wait till it is running, then send.
-func TestExampleReceiveSend(t *testing.T) {
-	if testing.Short() {
-		t.Skip("Skip demo tests in short mode")
-	}
-	testBroker.start(t)
-
-	// Start receiver, wait for "listening" message on stdout
-	recvCmd := exampleCommand(t, "receive", exampleArgs(fmt.Sprintf("-count=%d", expected))...)
-	pipe, err := recvCmd.StdoutPipe()
-	if err != nil {
-		t.Fatal(err)
-	}
-	recvCmd.Start()
-	out := bufio.NewReader(pipe)
-	line, err := out.ReadString('\n')
-	if err := checkEqual("Listening on 3 connections\n", line); err != nil {
-		t.Fatal(err)
-	}
-
-	if err := runExampleWant(t,
-		fmt.Sprintf("Received all %d acknowledgements\n", expected),
-		"send",
-		exampleArgs("-count", fmt.Sprintf("%d", *count))...); err != nil {
-		t.Fatal(err)
-	}
-
-	buf := bytes.Buffer{}
-	io.Copy(&buf, out)
-	if err := checkEqual(fmt.Sprintf("Received %d messages\n", expected), buf.String()); err != nil {
-		t.Fatal(err)
-	}
-}
-
-var testBroker *broker
-
-var debug = flag.Bool("debug", false, "Debugging output from examples")
-var brokerName = flag.String("broker", "broker", "Name of broker executable to run")
-var count = flag.Int("count", 3, "Count of messages to send in tests")
-var connections = flag.Int("connections", 3, "Number of connections to make in tests")
-var dir = flag.String("dir", "electron", "Directory containing example sources or binaries")
-var expected int
-
-func TestMain(m *testing.M) {
-	if out, err := exec.Command("go", "install", "qpid.apache.org/...").CombinedOutput(); err != nil {
-		log.Fatalf("go install failed: %s\n%s", err, out)
-	}
-	expected = (*count) * (*connections)
-	rand.Seed(time.Now().UTC().UnixNano())
-	testBroker = &broker{} // Broker is started on-demand by tests.
-	status := m.Run()
-	testBroker.stop()
-	os.Exit(status)
-}
diff --git a/examples/go/proton/broker.go b/examples/go/proton/broker.go
deleted file mode 100644
index 8f0efda..0000000
--- a/examples/go/proton/broker.go
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-//
-// This is a simple AMQP broker implemented using the event-driven proton package.
-//
-// It maintains a set of named in-memory queues of messages. Clients can send
-// messages to queues or subscribe to receive messages from them.
-//
-
-// TODO: show how to handle acknowledgedments from receivers and put rejected or
-// un-acknowledged messages back on their queues.
-
-package main
-
-import (
-	"../util"
-	"flag"
-	"fmt"
-	"log"
-	"net"
-	"os"
-	"qpid.apache.org/amqp"
-	"qpid.apache.org/proton"
-)
-
-// Usage and command-line flags
-func usage() {
-	fmt.Fprintf(os.Stderr, `
-Usage: %s
-A simple broker-like demo. Queues are created automatically for sender or receiver addrsses.
-`, os.Args[0])
-	flag.PrintDefaults()
-}
-
-var addr = flag.String("addr", ":amqp", "Listening address")
-var credit = flag.Int("credit", 100, "Receiver credit window")
-var qsize = flag.Int("qsize", 1000, "Max queue size")
-
-func main() {
-	flag.Usage = usage
-	flag.Parse()
-	b := &broker{util.MakeQueues(*qsize)}
-	if err := b.run(); err != nil {
-		log.Fatal(err)
-	}
-}
-
-// State for the broker
-type broker struct {
-	queues util.Queues
-}
-
-// Listens for connections and starts a proton.Engine for each one.
-func (b *broker) run() error {
-	listener, err := net.Listen("tcp", *addr)
-	if err != nil {
-		return err
-	}
-	defer listener.Close()
-	fmt.Printf("Listening on %s\n", listener.Addr())
-	for {
-		conn, err := listener.Accept()
-		if err != nil {
-			util.Debugf("Accept error: %v", err)
-			continue
-		}
-		adapter := proton.NewMessagingAdapter(newHandler(&b.queues))
-		// We want to accept messages when they are enqueued, not just when they
-		// are received, so we turn off auto-accept and prefetch by the adapter.
-		adapter.Prefetch = 0
-		adapter.AutoAccept = false
-		engine, err := proton.NewEngine(conn, adapter)
-		if err != nil {
-			util.Debugf("Connection error: %v", err)
-			continue
-		}
-		engine.Server() // Enable server-side protocol negotiation.
-		util.Debugf("Accepted connection %s", engine)
-		go func() { // Start goroutine to run the engine event loop
-			engine.Run()
-			util.Debugf("Closed %s", engine)
-		}()
-	}
-}
-
-// handler handles AMQP events. There is one handler per connection.  The
-// handler does not need to be concurrent-safe as proton.Engine will serialize
-// all calls to the handler. We use channels to communicate between the handler
-// goroutine and other goroutines sending and receiving messages.
-type handler struct {
-	queues    *util.Queues
-	receivers map[proton.Link]*receiver
-	senders   map[proton.Link]*sender
-	injecter  proton.Injecter
-}
-
-func newHandler(queues *util.Queues) *handler {
-	return &handler{
-		queues:    queues,
-		receivers: make(map[proton.Link]*receiver),
-		senders:   make(map[proton.Link]*sender),
-	}
-}
-
-// HandleMessagingEvent handles an event, called in the handler goroutine.
-func (h *handler) HandleMessagingEvent(t proton.MessagingEvent, e proton.Event) {
-	switch t {
-
-	case proton.MStart:
-		h.injecter = e.Injecter()
-
-	case proton.MLinkOpening:
-		if e.Link().IsReceiver() {
-			h.startReceiver(e)
-		} else {
-			h.startSender(e)
-		}
-
-	case proton.MLinkClosed:
-		h.linkClosed(e.Link(), e.Link().RemoteCondition().Error())
-
-	case proton.MSendable:
-		if s, ok := h.senders[e.Link()]; ok {
-			s.sendable() // Signal the send goroutine that we have credit.
-		} else {
-			proton.CloseError(e.Link(), amqp.Errorf(amqp.NotFound, "link %s sender not found", e.Link()))
-		}
-
-	case proton.MMessage:
-		m, err := e.Delivery().Message() // Message() must be called while handling the MMessage event.
-		if err != nil {
-			proton.CloseError(e.Link(), err)
-			break
-		}
-		r, ok := h.receivers[e.Link()]
-		if !ok {
-			proton.CloseError(e.Link(), amqp.Errorf(amqp.NotFound, "link %s receiver not found", e.Link()))
-			break
-		}
-		// This will not block as AMQP credit is set to the buffer capacity.
-		r.buffer <- receivedMessage{e.Delivery(), m}
-		util.Debugf("link %s received %s", e.Link(), util.FormatMessage(m))
-
-	case proton.MConnectionClosed, proton.MDisconnected:
-		for l, _ := range h.receivers {
-			h.linkClosed(l, nil)
-		}
-		for l, _ := range h.senders {
-			h.linkClosed(l, nil)
-		}
-	}
-}
-
-// linkClosed is called when a link has been closed by both ends.
-// It removes the link from the handlers maps and stops its goroutine.
-func (h *handler) linkClosed(l proton.Link, err error) {
-	if s, ok := h.senders[l]; ok {
-		s.stop()
-		delete(h.senders, l)
-	} else if r, ok := h.receivers[l]; ok {
-		r.stop()
-		delete(h.receivers, l)
-	}
-}
-
-// link has some common data and methods that are used by the sender and receiver types.
-//
-// An active link is represented by a sender or receiver value and a goroutine
-// running its run() method. The run() method communicates with the handler via
-// channels.
-type link struct {
-	l proton.Link
-	q util.Queue
-	h *handler
-}
-
-func makeLink(l proton.Link, q util.Queue, h *handler) link {
-	lnk := link{l: l, q: q, h: h}
-	return lnk
-}
-
-// receiver has a channel to buffer messages that have been received by the
-// handler and are waiting to go on the queue. AMQP credit ensures that the
-// handler does not overflow the buffer and block.
-type receiver struct {
-	link
-	buffer chan receivedMessage
-}
-
-// receivedMessage holds a message and a Delivery so that the message can be
-// acknowledged when it is put on the queue.
-type receivedMessage struct {
-	delivery proton.Delivery
-	message  amqp.Message
-}
-
-// startReceiver creates a receiver and a goroutine for its run() method.
-func (h *handler) startReceiver(e proton.Event) {
-	q := h.queues.Get(e.Link().RemoteTarget().Address())
-	r := &receiver{
-		link:   makeLink(e.Link(), q, h),
-		buffer: make(chan receivedMessage, *credit),
-	}
-	h.receivers[r.l] = r
-	r.l.Flow(cap(r.buffer)) // Give credit to fill the buffer to capacity.
-	go r.run()
-}
-
-// run runs in a separate goroutine. It moves messages from the buffer to the
-// queue for a receiver link, and injects a handler function to acknowledge the
-// message and send a credit.
-func (r *receiver) run() {
-	for rm := range r.buffer {
-		r.q <- rm.message
-		d := rm.delivery
-		// We are not in the handler goroutine so we Inject the accept function as a closure.
-		r.h.injecter.Inject(func() {
-			// Check that the receiver is still open, it may have been closed by the remote end.
-			if r == r.h.receivers[r.l] {
-				d.Accept()  // Accept the delivery
-				r.l.Flow(1) // Add one credit
-			}
-		})
-	}
-}
-
-// stop closes the buffer channel and waits for the run() goroutine to stop.
-func (r *receiver) stop() {
-	close(r.buffer)
-}
-
-// sender has a channel that is used to signal when there is credit to send messages.
-type sender struct {
-	link
-	credit chan struct{} // Channel to signal availability of credit.
-}
-
-// startSender creates a sender and starts a goroutine for sender.run()
-func (h *handler) startSender(e proton.Event) {
-	q := h.queues.Get(e.Link().RemoteSource().Address())
-	s := &sender{
-		link:   makeLink(e.Link(), q, h),
-		credit: make(chan struct{}, 1), // Capacity of 1 for signalling.
-	}
-	h.senders[e.Link()] = s
-	go s.run()
-}
-
-// stop closes the credit channel and waits for the run() goroutine to stop.
-func (s *sender) stop() {
-	close(s.credit)
-}
-
-// sendable signals that the sender has credit, it does not block.
-// sender.credit has capacity 1, if it is already full we carry on.
-func (s *sender) sendable() {
-	select { // Non-blocking
-	case s.credit <- struct{}{}:
-	default:
-	}
-}
-
-// run runs in a separate goroutine. It monitors the queue for messages and injects
-// a function to send them when there is credit
-func (s *sender) run() {
-	var q util.Queue // q is nil initially as we have no credit.
-	for {
-		select {
-		case _, ok := <-s.credit:
-			if !ok { // sender closed
-				return
-			}
-			q = s.q // We have credit, enable selecting on the queue.
-
-		case m, ok := <-q: // q is only enabled when we have credit.
-			if !ok { // queue closed
-				return
-			}
-			q = nil                      // Assume all credit will be used used, will be signaled otherwise.
-			s.h.injecter.Inject(func() { // Inject handler function to actually send
-				if s.h.senders[s.l] != s { // The sender has been closed by the remote end.
-					q.PutBack(m) // Put the message back on the queue but don't block
-					return
-				}
-				if s.sendOne(m) != nil {
-					return
-				}
-				// Send as many more messages as we can without blocking
-				for s.l.Credit() > 0 {
-					select { // Non blocking receive from q
-					case m, ok := <-s.q:
-						if ok {
-							s.sendOne(m)
-						}
-					default: // Queue is empty but we have credit, signal the run() goroutine.
-						s.sendable()
-					}
-				}
-			})
-		}
-	}
-}
-
-// sendOne runs in the handler goroutine. It sends a single message.
-func (s *sender) sendOne(m amqp.Message) error {
-	delivery, err := s.l.Send(m)
-	if err == nil {
-		delivery.Settle() // Pre-settled, unreliable.
-		util.Debugf("link %s sent %s", s.l, util.FormatMessage(m))
-	} else {
-		s.q.PutBack(m) // Put the message back on the queue, don't block
-	}
-	return err
-}
diff --git a/examples/go/util/queue.go b/examples/go/util/queue.go
deleted file mode 100644
index 2eaba72..0000000
--- a/examples/go/util/queue.go
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package util
-
-import (
-	"qpid.apache.org/amqp"
-	"sync"
-)
-
-// Use a buffered channel as a very simple queue.
-type Queue chan amqp.Message
-
-// Put a message back on the queue, does not block.
-func (q Queue) PutBack(m amqp.Message) {
-	select {
-	case q <- m:
-	default:
-		// Not an efficient implementation but ensures we don't block the caller.
-		go func() { q <- m }()
-	}
-}
-
-// Concurrent-safe map of queues.
-type Queues struct {
-	queueSize int
-	m         map[string]Queue
-	lock      sync.Mutex
-}
-
-func MakeQueues(queueSize int) Queues {
-	return Queues{queueSize: queueSize, m: make(map[string]Queue)}
-}
-
-// Create a queue if not found.
-func (qs *Queues) Get(name string) Queue {
-	qs.lock.Lock()
-	defer qs.lock.Unlock()
-	q := qs.m[name]
-	if q == nil {
-		q = make(Queue, qs.queueSize)
-		qs.m[name] = q
-	}
-	return q
-}
diff --git a/examples/go/util/util.go b/examples/go/util/util.go
deleted file mode 100644
index 20f2192..0000000
--- a/examples/go/util/util.go
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-// util contains utility types and functions to simplify parts of the example
-// code that are not related to the use of proton.
-package util
-
-import (
-	"flag"
-	"fmt"
-	"log"
-	"os"
-	"path"
-	"qpid.apache.org/amqp"
-)
-
-// Debug flag "-debug" enables debug output with Debugf
-var Debug = flag.Bool("debug", false, "Print detailed debug output")
-
-// Full flag "-full" enables full message output by FormatMessage
-var Full = flag.Bool("full", false, "Print full message not just body.")
-
-// Debugf logs debug messages if "-debug" flag is set.
-func Debugf(format string, data ...interface{}) {
-	if *Debug {
-		log.Printf(format, data...)
-	}
-}
-
-// Simple error handling for demo.
-func ExitIf(err error) {
-	if err != nil {
-		log.Fatal(err)
-	}
-}
-
-// FormatMessage formats a message as a string, just the body by default or
-// the full message (with properties etc.) if "-full" flag is set.
-func FormatMessage(m amqp.Message) string {
-	if *Full {
-		return fmt.Sprintf("%#v", m)
-	} else {
-		return fmt.Sprintf("%#v", m.Body())
-	}
-}
-
-// For example programs, use the program name as the log prefix.
-func init() {
-	log.SetFlags(0)
-	_, prog := path.Split(os.Args[0])
-	log.SetPrefix(fmt.Sprintf("%s(%d): ", prog, os.Getpid()))
-}
diff --git a/examples/javascript/messenger/client.js b/examples/javascript/messenger/client.js
deleted file mode 100755
index d128503..0000000
--- a/examples/javascript/messenger/client.js
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/env node
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-// Simple client for use with server.js illustrating request/response
-
-// Check if the environment is Node.js and if not log an error and exit.
-if (typeof process === 'object' && typeof require === 'function') {
-    var proton = require("qpid-proton-messenger");
-
-    var address = "amqp://0.0.0.0";
-    var subject = "UK.WEATHER";
-    var replyTo = "~/replies";
-    var msgtext = "Hello World!";
-    var tracker = null;
-
-    var message = new proton.Message();
-    var messenger = new proton.Messenger();
-
-    var pumpData = function() {
-        while (messenger.incoming()) {
-            var t = messenger.get(message);
-
-            console.log("Reply:");
-            console.log("Address: " + message.getAddress());
-            console.log("Subject: " + message.getSubject());
-
-            // body is the body as a native JavaScript Object, useful for most real cases.
-            //console.log("Content: " + message.body);
-
-            // data is the body as a proton.Data Object, used in this case because
-            // format() returns exactly the same representation as recv.c
-            console.log("Content: " + message.data.format());
-
-            messenger.accept(t);
-            messenger.stop();
-        }
-
-        if (messenger.isStopped()) {
-            message.free();
-            messenger.free();
-        }
-    };
-
-    var args = process.argv.slice(2);
-    if (args.length > 0) {
-        if (args[0] === '-h' || args[0] === '--help') {
-            console.log("Usage: node client.js [-r replyTo] [-s subject] <addr> (default " + address + ")");
-            console.log("Options:");
-            console.log("  -r <reply to> The message replyTo (default " + replyTo + ")");
-            console.log("  -s <subject> The message subject (default " + subject + ")");
-            process.exit(0);
-        }
-
-        for (var i = 0; i < args.length; i++) {
-            var arg = args[i];
-            if (arg.charAt(0) === '-') {
-                i++;
-                var val = args[i];
-                if (arg === '-r') {
-                    replyTo = val;
-                } else if (arg === '-s') {
-                    subject = val;
-                }
-            } else {
-                address = arg;
-            }
-        }
-    }
-
-    messenger.on('error', function(error) {console.log(error);});
-    messenger.on('work', pumpData);
-    messenger.setOutgoingWindow(1024);
-    messenger.recv(); // Receive as many messages as messenger can buffer.
-    messenger.start();
-
-    message.setAddress(address);
-    message.setSubject(subject);
-    message.setReplyTo(replyTo);
-    message.body = msgtext;
-
-    tracker = messenger.put(message);
-} else {
-    console.error("client.js should be run in Node.js");
-}
-
diff --git a/examples/javascript/messenger/drain.js b/examples/javascript/messenger/drain.js
deleted file mode 100755
index 1df6fd4..0000000
--- a/examples/javascript/messenger/drain.js
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/env node
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-// Check if the environment is Node.js and if not log an error and exit.
-if (typeof process === 'object' && typeof require === 'function') {
-    var proton = require("qpid-proton-messenger");
-
-    console.log("drain not implemented yet");
-    process.exit(0);
-
-    var address = "amqp://~0.0.0.0";
-    var message = new proton.Message();
-    var messenger = new proton.Messenger();
-
-    var pumpData = function() {
-        while (messenger.incoming()) {
-            var t = messenger.get(message);
-
-            console.log("Address: " + message.getAddress());
-            console.log("Subject: " + message.getSubject());
-    
-            // body is the body as a native JavaScript Object, useful for most real cases.
-            //console.log("Content: " + message.body);
-
-            // data is the body as a proton.Data Object, used in this case because
-            // format() returns exactly the same representation as recv.c
-            console.log("Content: " + message.data.format());
-
-            messenger.accept(t);
-        }
-    };
-
-    var args = process.argv.slice(2);
-    if (args.length > 0) {
-        if (args[0] === '-h' || args[0] === '--help') {
-            console.log("Usage: recv <addr> (default " + address + ").");
-            process.exit(0);
-        }
-
-        address = args[0];
-    }
-
-    messenger.on('error', function(error) {console.log(error);});
-    messenger.on('work', pumpData);
-    messenger.recv(); // Receive as many messages as messenger can buffer.
-    messenger.start();
-
-    messenger.subscribe(address);
-} else {
-    console.error("drain.js should be run in Node.js");
-}
-
diff --git a/examples/javascript/messenger/proxy.js b/examples/javascript/messenger/proxy.js
deleted file mode 100755
index cac5cf5..0000000
--- a/examples/javascript/messenger/proxy.js
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/usr/bin/env node
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/**
- * proxy.js is a simple node.js command line application that uses the ws2tcp.js
- * library to proxy from a WebSocket to a TCP Socket or vice versa.
- * <p>
- * Usage: node proxy.js [options]
- * Options:");
- *  -p <listen port>, --port  <listen port> (default 5673 for ws2tcp
- *                                                   5672 for tcp2ws)
- *  -t <target port>, --tport <target port> (default listen port - 1 for ws2tcp
- *                                                   listen port + 1 for tcp2ws)
- *  -h <target host>, --thost <target host> (default 0.0.0.0)
- *  -m <ws2tcp or tcp2ws>, --method <ws2tcp or tcp2ws> (default ws2tcp)
- * @Author Fraser Adams
- * @file
- */
-
-// Check if the environment is Node.js and if not log an error and exit.
-if (typeof process === 'object' && typeof require === 'function') {
-    var proxy = require('./ws2tcp.js');
-
-    var lport = 5673;
-    var tport = lport - 1;
-    var thost = '0.0.0.0';
-    var method = 'ws2tcp';
-
-    var args = process.argv.slice(2);
-    if (args.length > 0) {
-        if (args[0] === '-h' || args[0] === '--help') {
-            console.log("Usage: node proxy.js [options]");
-            console.log("Options:");
-            console.log("  -p <listen port>, --port  <listen port> (default " + lport + " for ws2tcp");
-            console.log("                                                   " + tport + " for tcp2ws)");
-            console.log("  -t <target port>, --tport <target port> (default listen port - 1 for ws2tcp");
-            console.log("                                                   listen port + 1 for tcp2ws)");
-            console.log("  -h <target host>, --thost <target host> (default " + thost + ")");
-            console.log("  -m <ws2tcp or tcp2ws>, --method <ws2tcp or tcp2ws> (default " + method + ")");
-            process.exit(0);
-        }
-
-        var lportSet = false;
-        var tportSet = false;
-        for (var i = 0; i < args.length; i++) {
-            var arg = args[i];
-            if (arg.charAt(0) === '-') {
-                i++;
-                var val = args[i];
-                if (arg === '-p' || arg === '--port') {
-                    lport = val;
-                    lportSet = true;
-                } else if (arg === '-t' || arg === '--tport') {
-                    tport = val;
-                    tportSet = true;
-                } else if (arg === '-h' || arg === '--thost') {
-                    thost = val;
-                } else if (arg === '-m' || arg === '--method') {
-                    method = val;
-                }
-            }
-        }
-
-        if (method === 'tcp2ws' && !lportSet) {
-            lport--;
-        }
-
-        if (!tportSet) {
-            tport = (method === 'ws2tcp') ? lport - 1 : +lport + 1;
-        }
-    }
-
-    if (method === 'tcp2ws') {
-        console.log("Proxying tcp -> ws");
-        console.log("Forwarding port " + lport + " to " + thost + ":" + tport);
-        proxy.tcp2ws(lport, thost, tport, 'AMQPWSB10');
-    } else if (method === 'ws2tcp') {
-        console.log("Proxying ws -> tcp");
-        console.log("Forwarding port " + lport + " to " + thost + ":" + tport);
-        proxy.ws2tcp(lport, thost, tport);
-    } else {
-        console.error("Method must be either ws2tcp or tcp2ws.");
-    }
-} else {
-    console.error("proxy.js should be run in Node.js");
-}
-
diff --git a/examples/javascript/messenger/qpid-config.js b/examples/javascript/messenger/qpid-config.js
deleted file mode 100755
index cf7201b..0000000
--- a/examples/javascript/messenger/qpid-config.js
+++ /dev/null
@@ -1,1511 +0,0 @@
-#!/usr/bin/env node
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/**
- * Port of qpid-config to JavaScript for Node.js, mainly intended as a demo to
- * illustrate using QMF2 in JavaScript using the proton.Messenger JS binding.
- * It illustrates a few things including how to use Messenger completely
- * asynchronously including using an async request/response pattern with
- * correlation IDs. It also proves interoperability of AMQP Map, List etc.
- * between C++ and JavaScript as QMF2 is pretty much all about Lists of Maps.
- * <p>
- * The actual QMF2 code is pretty simple as we're just doing a basic getObjects
- * it's made all the simpler because we can use JavaScript object literals as
- * the JavaScript binding serialises and deserialises directly between JavaScript
- * Objects and Lists and the AMQP type system so something that can be quite
- * involved in languages like C++ and Java becomes quite simple in JavaScript,
- * though the asynchronous nature of JavaScript provides its own opportunities
- * for complication best illustrated by the need for the correlator object.
- */
-
-// Check if the environment is Node.js and if not log an error and exit.
-if (typeof process === 'object' && typeof require === 'function') {
-
-    var qmf = {}; // Create qmf namespace object.
-    qmf.Console = function() { // qmf.Console Constructor.
-        var proton = require("qpid-proton-messenger");
-        var message = new proton.Message();
-        var messenger = new proton.Messenger();
-
-        var brokerAddress = '';
-        var replyTo = '';
-
-        /**
-         * The correlator object is a mechanism used to correlate requests with
-         * their aynchronous responses. It might possible be better to make use
-         * of Promises to implement part of this behaviour but a mechanism would
-         * still be needed to correlate a request with its response callback in
-         * order to wrap things up in a Promise, so much of the behaviour of this
-         * object would still be required. In addition it seemed to make sense to
-         * make this QMF2 implementation fairly free of dependencies and using
-         * Promises would require external libraries. Instead the correlator
-         * implements "Promise-like" semantics, you might say a broken Promise :-)
-         * <p>
-         * in particular the request method behaves a *bit* like Promise.all()
-         * though it is mostly fake and takes an array of functions that call
-         * the add() method which is really the method used to associate response
-         * objects by correlationID. The then method is used to register a
-         * listener that will be called when all the requests that have been
-         * registered have received responses.
-         * TODO error/timeout handling.
-         */
-        var correlator = {
-            _resolve: null,
-            _objects: {},
-            add: function(id) {
-                this._objects[id] = {complete: false, list: null};
-            },
-            request: function() {
-                this._resolve = function() {console.log("Warning: No resolver has been set")};
-                return this;
-            },
-            then: function(resolver) {
-                this._resolve = resolver ? resolver : this._resolve;
-            },
-            resolve: function() {
-                var opcode = message.properties['qmf.opcode'];
-                var correlationID = message.getCorrelationID();
-                var resp = this._objects[correlationID];
-                if (opcode === '_query_response') {
-                    if (resp.list) {
-                        Array.prototype.push.apply(resp.list, message.body); // This is faster than concat.
-                    } else {
-                        resp.list = message.body;
-                    }
-        
-                    var partial = message.properties['partial'];
-                    if (!partial) {
-                        resp.complete = true;
-                    }
-        
-                    this._objects[correlationID] = resp;
-                    this._checkComplete();
-                } else if (opcode === '_method_response' || opcode === '_exception') {
-                    resp.list = message.body;
-                    resp.complete = true;
-                    this._objects[correlationID] = resp;
-                    this._checkComplete();
-                } else {
-                    console.error("Bad Message response, qmf.opcode = " + opcode);
-                }
-            },
-            _checkComplete: function() {
-                var response = {};
-                for (var id in this._objects) {
-                    var object = this._objects[id];
-                    if (object.complete) {
-                        response[id] = object.list;
-                    } else {
-                        return;
-                    }
-                }
-    
-                this._objects = {}; // Clear state ready for next call.
-                this._resolve(response.method ? response.method : response);
-            }
-        };  // End of correlator object definition.
-
-        var pumpData = function() {
-            while (messenger.incoming()) {
-                // The second parameter forces Binary payloads to be decoded as
-                // strings this is useful because the broker QMF Agent encodes
-                // strings as AMQP binary unfortunately.
-                var t = messenger.get(message, true);
-                correlator.resolve();
-                messenger.accept(t);
-            }
-    
-            if (messenger.isStopped()) {
-                message.free();
-                messenger.free();
-            }
-        };
-    
-        this.getObjects = function(packageName, className) {
-            message.setAddress(brokerAddress);
-            message.setSubject('broker');
-            message.setReplyTo(replyTo);
-            message.setCorrelationID(className);
-            message.properties = {
-                "routing-key": "broker", // Added for Java Broker
-                "x-amqp-0-10.app-id": "qmf2",
-                "method": "request",
-                "qmf.opcode": "_query_request",
-            };
-            message.body = {
-                "_what": "OBJECT",
-                "_schema_id": {
-                    "_package_name": packageName,
-                    "_class_name": className
-                }
-            };
-    
-            correlator.add(className);
-            messenger.put(message);
-        };
-
-        this.invokeMethod = function(object, method, arguments) {
-            var correlationID = 'method';
-            message.setAddress(brokerAddress);
-            message.setSubject('broker');
-            message.setReplyTo(replyTo);
-            message.setCorrelationID(correlationID);
-            message.properties = {
-                "routing-key": "broker", // Added for Java Broker
-                "x-amqp-0-10.app-id": "qmf2",
-                "method": "request",
-                "qmf.opcode": "_method_request",
-            };
-            message.body = {
-                "_object_id": object._object_id,
-                "_method_name" : method,
-                "_arguments"   : arguments
-            };
-    
-            correlator.add(correlationID);
-            messenger.put(message);
-        };
-
-        this.addConnection = function(addr, callback) {
-            brokerAddress = addr + '/qmf.default.direct';
-            var replyAddress = addr + '/#';
-    
-            messenger.on('subscription', function(subscription) {
-                var subscriptionAddress = subscription.getAddress();
-                var splitAddress = subscriptionAddress.split('/');
-                replyTo = splitAddress[splitAddress.length - 1];
-                callback();
-            });
-
-            messenger.subscribe(replyAddress);
-        }
-
-        this.destroy = function() {
-            messenger.stop(); 
-        }
-
-        this.request = function() {return correlator.request();}
-
-        messenger.on('error', function(error) {console.log(error);});
-        messenger.on('work', pumpData);
-        messenger.setOutgoingWindow(1024);
-        messenger.recv(); // Receive as many messages as messenger can buffer.
-        messenger.start();
-    }; // End of qmf.Console
-
-/************************* qpid-config business logic ************************/
-
-    var brokerAgent = new qmf.Console();
-
-    var _usage =
-    'Usage:  qpid-config [OPTIONS]\n' +
-    '        qpid-config [OPTIONS] exchanges [filter-string]\n' +
-    '        qpid-config [OPTIONS] queues    [filter-string]\n' +
-    '        qpid-config [OPTIONS] add exchange <type> <name> [AddExchangeOptions]\n' +
-    '        qpid-config [OPTIONS] del exchange <name>\n' +
-    '        qpid-config [OPTIONS] add queue <name> [AddQueueOptions]\n' +
-    '        qpid-config [OPTIONS] del queue <name> [DelQueueOptions]\n' +
-    '        qpid-config [OPTIONS] bind   <exchange-name> <queue-name> [binding-key]\n' +
-    '                  <for type xml>     [-f -|filename]\n' +
-    '                  <for type header>  [all|any] k1=v1 [, k2=v2...]\n' +
-    '        qpid-config [OPTIONS] unbind <exchange-name> <queue-name> [binding-key]\n' +
-    '        qpid-config [OPTIONS] reload-acl\n' +
-    '        qpid-config [OPTIONS] add <type> <name> [--argument <property-name>=<property-value>]\n' +
-    '        qpid-config [OPTIONS] del <type> <name>\n' +
-    '        qpid-config [OPTIONS] list <type> [--show-property <property-name>]\n';
-
-    var usage = function() {
-        console.log(_usage);
-        process.exit(-1);
-    };
-
-    var _description =
-    'Examples:\n' +
-    '\n' +
-    '$ qpid-config add queue q\n' +
-    '$ qpid-config add exchange direct d -a localhost:5672\n' +
-    '$ qpid-config exchanges -b 10.1.1.7:10000\n' +
-    '$ qpid-config queues -b guest/guest@broker-host:10000\n' +
-    '\n' +
-    'Add Exchange <type> values:\n' +
-    '\n' +
-    '    direct     Direct exchange for point-to-point communication\n' +
-    '    fanout     Fanout exchange for broadcast communication\n' +
-    '    topic      Topic exchange that routes messages using binding keys with wildcards\n' +
-    '    headers    Headers exchange that matches header fields against the binding keys\n' +
-    '    xml        XML Exchange - allows content filtering using an XQuery\n' +
-    '\n' +
-    '\n' +
-    'Queue Limit Actions:\n' +
-    '\n' +
-    '    none (default) - Use broker\'s default policy\n' +
-    '    reject         - Reject enqueued messages\n' +
-    '    ring           - Replace oldest unacquired message with new\n' +
-    '\n' +
-    'Replication levels:\n' +
-    '\n' +
-    '    none           - no replication\n' +
-    '    configuration  - replicate queue and exchange existence and bindings, but not messages.\n' +
-    '    all            - replicate configuration and messages\n';
-    
-    var _options =
-    'Options:\n' +
-    '  -h, --help            show this help message and exit\n' +
-    '\n' +
-    '  General Options:\n' +
-    '    -t <secs>, --timeout=<secs>\n' +
-    '                        Maximum time to wait for broker connection (in\n' +
-    '                        seconds)\n' +
-    '    -r, --recursive     Show bindings in queue or exchange list\n' +
-    '    -b <address>, --broker=<address>\n' +
-    '                        Address of qpidd broker with syntax:\n' +
-    '                        [username/password@] hostname | ip-address [:<port>]\n' +
-    '    -a <address>, --broker-addr=<address>\n' +
-    /* TODO Connection options
-    '    --sasl-mechanism=<mech>\n' +
-    '                        SASL mechanism for authentication (e.g. EXTERNAL,\n' +
-    '                        ANONYMOUS, PLAIN, CRAM-MD5, DIGEST-MD5, GSSAPI). SASL\n' +
-    '                        automatically picks the most secure available\n' +
-    '                        mechanism - use this option to override.\n' +
-    '    --ssl-certificate=<cert>\n' +
-    '                        Client SSL certificate (PEM Format)\n' +
-    '    --ssl-key=<key>     Client SSL private key (PEM Format)\n' +
-    '    --ha-admin          Allow connection to a HA backup broker.\n' +
-    */
-    '\n' +
-    '  Options for Listing Exchanges and Queues:\n' +
-    '    --ignore-default    Ignore the default exchange in exchange or queue list\n' +
-    '\n' +
-    '  Options for Adding Exchanges and Queues:\n' +
-    '    --alternate-exchange=<aexname>\n' +
-    '                        Name of the alternate-exchange for the new queue or\n' +
-    '                        exchange. Exchanges route messages to the alternate\n' +
-    '                        exchange if they are unable to route them elsewhere.\n' +
-    '                        Queues route messages to the alternate exchange if\n' +
-    '                        they are rejected by a subscriber or orphaned by queue\n' +
-    '                        deletion.\n' +
-    '    --durable           The new queue or exchange is durable.\n' +
-    '    --replicate=<level>\n' +
-    '                        Enable automatic replication in a HA cluster. <level>\n' +
-    '                        is \'none\', \'configuration\' or \'all\').\n' +
-    '\n' +
-    '  Options for Adding Queues:\n' +
-    '    --file-count=<n>    Number of files in queue\'s persistence journal\n' +
-    '    --file-size=<n>     File size in pages (64KiB/page)\n' +
-    '    --max-queue-size=<n>\n' +
-    '                        Maximum in-memory queue size as bytes\n' +
-    '    --max-queue-count=<n>\n' +
-    '                        Maximum in-memory queue size as a number of messages\n' +
-    '    --limit-policy=<policy>\n' +
-    '                        Action to take when queue limit is reached\n' +
-    '    --lvq-key=<key>     Last Value Queue key\n' +
-    '    --generate-queue-events=<n>\n' +
-    '                        If set to 1, every enqueue will generate an event that\n' +
-    '                        can be processed by registered listeners (e.g. for\n' +
-    '                        replication). If set to 2, events will be generated\n' +
-    '                        for enqueues and dequeues.\n' +
-    '    --flow-stop-size=<n>\n' +
-    '                        Turn on sender flow control when the number of queued\n' +
-    '                        bytes exceeds this value.\n' +
-    '    --flow-resume-size=<n>\n' +
-    '                        Turn off sender flow control when the number of queued\n' +
-    '                        bytes drops below this value.\n' +
-    '    --flow-stop-count=<n>\n' +
-    '                        Turn on sender flow control when the number of queued\n' +
-    '                        messages exceeds this value.\n' +
-    '    --flow-resume-count=<n>\n' +
-    '                        Turn off sender flow control when the number of queued\n' +
-    '                        messages drops below this value.\n' +
-    '    --group-header=<header-name>\n' +
-    '                        Enable message groups. Specify name of header that\n' +
-    '                        holds group identifier.\n' +
-    '    --shared-groups     Allow message group consumption across multiple\n' +
-    '                        consumers.\n' +
-    '    --argument=<NAME=VALUE>\n' +
-    '                        Specify a key-value pair to add to queue arguments\n' +
-    '    --start-replica=<broker-url>\n' +
-    '                        Start replication from the same-named queue at\n' +
-    '                        <broker-url>\n' +
-    '\n' +
-    '  Options for Adding Exchanges:\n' +
-    '    --sequence          Exchange will insert a \'qpid.msg_sequence\' field in\n' +
-    '                        the message header\n' +
-    '    --ive               Exchange will behave as an \'initial-value-exchange\',\n' +
-    '                        keeping a reference  to the last message forwarded and\n' +
-    '                        enqueuing that message to newly bound queues.\n' +
-    '\n' +
-    '  Options for Deleting Queues:\n' +
-    '    --force             Force delete of queue even if it\'s currently used or\n' +
-    '                        it\'s not empty\n' +
-    '    --force-if-not-empty\n' +
-    '                        Force delete of queue even if it\'s not empty\n' +
-    '    --force-if-used     Force delete of queue even if it\'s currently used\n' +
-    '\n' +
-    '  Options for Declaring Bindings:\n' +
-    '    -f <file.xq>, --file=<file.xq>\n' +
-    '                        For XML Exchange bindings - specifies the name of a\n' +
-    '                        file containing an XQuery.\n' +
-    '\n' +
-    '  Formatting options for \'list\' action:\n' +
-    '    --show-property=<property-name>\n' +
-    '                        Specify a property of an object to be included in\n' +
-    '                        output\n';
-    
-    var REPLICATE_LEVELS = {"none" : true, "configuration": true, "all": true};
-    var DEFAULT_PROPERTIES = {"exchange": {"name": true, "type": true, "durable": true},
-                                 "queue": {"name": true, "durable": true, "autoDelete": true}};
-    
-    var getValue = function(r) {
-        var value = null;
-        if (r.length === 2) {
-            value = r[1];
-            if (!isNaN(value)) {
-                value = parseInt(value);
-            }
-        }
-    
-        return value;
-    };
-    
-    var config = {
-        _recursive      : false,
-        _host           : 'guest:guest@localhost:5673', // Note 5673 not 5672 as we use WebSocket transport.
-        _connTimeout    : 10,
-        _ignoreDefault  : false,
-        _altern_ex      : null,
-        _durable        : false,
-        _replicate      : null,
-        _if_empty       : true,
-        _if_unused      : true,
-        _fileCount      : null,
-        _fileSize       : null,
-        _maxQueueSize   : null,
-        _maxQueueCount  : null,
-        _limitPolicy    : null,
-        _msgSequence    : false,
-        _lvq_key        : null,
-        _ive            : null,
-        _eventGeneration: null,
-        _file           : null,
-        _flowStopCount  : null,
-        _flowResumeCount: null,
-        _flowStopSize   : null,
-        _flowResumeSize : null,
-        _msgGroupHeader : null,
-        _sharedMsgGroup : false,
-        _extra_arguments: [],
-        _start_replica  : null,
-        _returnCode     : 0,
-        _list_properties: null,
-    
-        getOptions: function() {
-            var options = {};
-            for (var a = 0; a < this._extra_arguments.length; a++) {
-                var r = this._extra_arguments[a].split('=');
-                options[r[0]] = getValue(r);
-            }
-            return options;
-        }
-    };
-    
-    var FILECOUNT = 'qpid.file_count';
-    var FILESIZE  = 'qpid.file_size';
-    var MAX_QUEUE_SIZE  = 'qpid.max_size';
-    var MAX_QUEUE_COUNT  = 'qpid.max_count';
-    var POLICY_TYPE  = 'qpid.policy_type';
-    var LVQ_KEY = 'qpid.last_value_queue_key';
-    var MSG_SEQUENCE = 'qpid.msg_sequence';
-    var IVE = 'qpid.ive';
-    var QUEUE_EVENT_GENERATION = 'qpid.queue_event_generation';
-    var FLOW_STOP_COUNT   = 'qpid.flow_stop_count';
-    var FLOW_RESUME_COUNT = 'qpid.flow_resume_count';
-    var FLOW_STOP_SIZE    = 'qpid.flow_stop_size';
-    var FLOW_RESUME_SIZE  = 'qpid.flow_resume_size';
-    var MSG_GROUP_HDR_KEY = 'qpid.group_header_key';
-    var SHARED_MSG_GROUP  = 'qpid.shared_msg_group';
-    var REPLICATE = 'qpid.replicate';
-    
-    /**
-     * There are various arguments to declare that have specific program
-     * options in this utility. However there is now a generic mechanism for
-     * passing arguments as well. The SPECIAL_ARGS list contains the
-     * arguments for which there are specific program options defined
-     * i.e. the arguments for which there is special processing on add and
-     * list
-    */
-    var SPECIAL_ARGS={};
-    SPECIAL_ARGS[FILECOUNT] = true;
-    SPECIAL_ARGS[FILESIZE] = true;
-    SPECIAL_ARGS[MAX_QUEUE_SIZE] = true;
-    SPECIAL_ARGS[MAX_QUEUE_COUNT] = true;
-    SPECIAL_ARGS[POLICY_TYPE] = true;
-    SPECIAL_ARGS[LVQ_KEY] = true;
-    SPECIAL_ARGS[MSG_SEQUENCE] = true;
-    SPECIAL_ARGS[IVE] = true;
-    SPECIAL_ARGS[QUEUE_EVENT_GENERATION] = true;
-    SPECIAL_ARGS[FLOW_STOP_COUNT] = true;
-    SPECIAL_ARGS[FLOW_RESUME_COUNT] = true;
-    SPECIAL_ARGS[FLOW_STOP_SIZE] = true;
-    SPECIAL_ARGS[FLOW_RESUME_SIZE] = true;
-    SPECIAL_ARGS[MSG_GROUP_HDR_KEY] = true;
-    SPECIAL_ARGS[SHARED_MSG_GROUP] = true;
-    SPECIAL_ARGS[REPLICATE] = true;
-    
-    // Returns a String representation of an ObjectID.
-    var oid = function(id) {
-        return id._agent_epoch + ':' + id._object_name
-    };
-    
-    // Check if the supplied name contains the supplied filter String.
-    var filterMatch = function(name, filter) {
-        if (filter === '') {
-            return true;
-        }
-        if (name.indexOf(filter) === -1) {
-            return false;
-        }
-        return true;
-    };
-    
-    // Take the supplied List of QMF2 Objects and return a Map keyed by ObjectID.
-    var idMap = function(list) {
-        var map = {};
-        for (var i = 0; i < list.length; i++) {
-            var item = list[i];
-            map[oid(item._object_id)] = item;
-        }
-        return map;
-    };
-    
-    // Pretty-print the supplied Object.
-    var renderObject = function(obj, list) {
-        if (!obj) {
-            return '';
-        }
-        var string = '';
-        var addComma = false;
-        for (var prop in obj) {
-            if (addComma) {
-                string += ', ';
-            }
-            if (obj.hasOwnProperty(prop)) {
-                if (list) {
-                    if (SPECIAL_ARGS[prop]) continue;
-                    string += " --argument " + prop + "=" + obj[prop];
-                } else {    
-                    string += "'" + prop + "'" + ": '" + obj[prop] + "'";
-                    addComma = true;
-                }
-            }
-        }
-    
-        if (addComma) {
-            return '{' + string + '}';
-        } else {
-            if (list) {
-                return string;
-            } else {
-                return '';
-            }
-        }
-    };
-    
-    /**
-     * The following methods illustrate the QMF2 class query mechanism which returns
-     * the list of QMF Objects for the specified class that are currently present
-     * on the Broker. The Schema <qpid>/cpp/src/qpid/broker/management-schema.xml
-     * describes the properties and statistics of each Management Object.
-     * <p>
-     * One slightly subtle part of QMF is that certain Objects are associated via
-     * references, for example Binding contains queueRef and exchangeRef, which lets
-     * Objects link to each other using their _object_id property.
-     * <p>
-     * The implementation of these methods attempts to follow the same general flow
-     * as the equivalent method in the "canonical" python based qpid-config version
-     * but has the added complication that JavaScript is entirely asynchronous.
-     * The approach that has been taken is to use the correlator object that lets a
-     * callback function be registered via the "then" method and actually calls the
-     * callback when all of the requests specified in the request method have
-     * returned their results (which get passed as the callback parameter).
-     */
-    
-    var overview = function() {
-        brokerAgent.request(
-            // Send the QMF query requests for the specified classes.
-            brokerAgent.getObjects('org.apache.qpid.broker', 'queue'),
-            brokerAgent.getObjects('org.apache.qpid.broker', 'exchange')
-        ).then(function(objects) {
-            var exchanges = objects.exchange;
-            var queues = objects.queue;
-            console.log("Total Exchanges: " + exchanges.length);
-            var etype = {};
-            for (var i = 0; i < exchanges.length; i++) {
-                var exchange = exchanges[i]._values;
-                if (!etype[exchange.type]) {
-                    etype[exchange.type] = 1;
-                } else {
-                    etype[exchange.type]++;
-                }
-            }
-            for (var typ in etype) {
-                var pad = Array(16 - typ.length).join(' ');
-                console.log(pad + typ + ": " + etype[typ]);
-            }
-    
-            console.log("\n   Total Queues: " + queues.length);
-            var durable = 0;
-            for (var i = 0; i < queues.length; i++) {
-                var queue = queues[i]._values;
-                if (queue.durable) {
-                    durable++;
-                }
-            }
-            console.log("        durable: " + durable);
-            console.log("    non-durable: " + (queues.length - durable));
-            brokerAgent.destroy();
-        });
-    };
-    
-    var exchangeList = function(filter) {
-        brokerAgent.request(
-            // Send the QMF query requests for the specified classes.
-            brokerAgent.getObjects('org.apache.qpid.broker', 'exchange')
-        ).then(function(objects) {
-            var exchanges = objects.exchange;
-            var exMap = idMap(exchanges);
-            var caption1 = "Type      ";
-            var caption2 = "Exchange Name";
-            var maxNameLen = caption2.length;
-            var found = false;
-            for (var i = 0; i < exchanges.length; i++) {
-                var exchange = exchanges[i]._values;
-                if (filterMatch(exchange.name, filter)) {
-                    if (exchange.name.length > maxNameLen) {
-                        maxNameLen = exchange.name.length;
-                    }
-                    found = true;
-                }
-            }
-            if (!found) {
-                config._returnCode = 1;
-                return;
-            }
-    
-            var pad = Array(maxNameLen + 1 - caption2.length).join(' ');
-            console.log(caption1 + caption2 + pad + "  Attributes");
-            console.log(Array(maxNameLen + caption1.length + 13).join('='));
-    
-            for (var i = 0; i < exchanges.length; i++) {
-                var exchange = exchanges[i]._values;
-                if (config._ignoreDefault && !exchange.name) continue;
-                if (filterMatch(exchange.name, filter)) {
-                    var pad1 = Array(11 - exchange.type.length).join(' ');
-                    var pad2 = Array(maxNameLen + 2 - exchange.name.length).join(' ');
-                    var string = exchange.type + pad1 + exchange.name + pad2;
-                    var args = exchange.arguments ? exchange.arguments : {};
-                    if (exchange.durable) {
-                        string += ' --durable';
-                    }
-                    if (args[REPLICATE]) {
-                        string += ' --replicate=' + args[REPLICATE];
-                    }
-                    if (args[MSG_SEQUENCE]) {
-                        string += ' --sequence';
-                    }
-                    if (args[IVE]) {
-                        string += ' --ive';
-                    }
-                    if (exchange.altExchange) {
-                        string += ' --alternate-exchange=' + exMap[oid(exchange.altExchange)]._values.name;
-                    }
-                    console.log(string);
-                }
-            }
-            brokerAgent.destroy();
-        });
-    };
-    
-    var exchangeListRecurse = function(filter) {
-        brokerAgent.request(
-            // Send the QMF query requests for the specified classes.
-            brokerAgent.getObjects('org.apache.qpid.broker', 'queue'),
-            brokerAgent.getObjects('org.apache.qpid.broker', 'exchange'),
-            brokerAgent.getObjects('org.apache.qpid.broker', 'binding')
-        ).then(function(objects) {
-            var exchanges = objects.exchange;
-            var bindings = objects.binding;
-            var queues = idMap(objects.queue);
-    
-            for (var i = 0; i < exchanges.length; i++) {
-                var exchange = exchanges[i];
-                var exchangeId = oid(exchange._object_id);
-                exchange = exchange._values;
-    
-                if (config._ignoreDefault && !exchange.name) continue;
-                if (filterMatch(exchange.name, filter)) {
-                    console.log("Exchange '" + exchange.name + "' (" + exchange.type + ")");
-                    for (var j = 0; j < bindings.length; j++) {
-                        var bind = bindings[j]._values;
-                        var exchangeRef = oid(bind.exchangeRef);
-    
-                        if (exchangeRef === exchangeId) {
-                            var queue = queues[oid(bind.queueRef)];
-                            var queueName = queue ? queue._values.name : "<unknown>";
-                            console.log("    bind [" + bind.bindingKey + "] => " + queueName + 
-                                        " " + renderObject(bind.arguments));
-                        }   
-                    }
-                }
-            }
-            brokerAgent.destroy();
-        });
-    };
-    
-    var queueList = function(filter) {
-        brokerAgent.request(
-            // Send the QMF query requests for the specified classes.
-            brokerAgent.getObjects('org.apache.qpid.broker', 'queue'),
-            brokerAgent.getObjects('org.apache.qpid.broker', 'exchange')
-        ).then(function(objects) {
-            var queues = objects.queue;
-            var exMap = idMap(objects.exchange);
-            var caption = "Queue Name";
-            var maxNameLen = caption.length;
-            var found = false;
-            for (var i = 0; i < queues.length; i++) {
-                var queue = queues[i]._values;
-                if (filterMatch(queue.name, filter)) {
-                    if (queue.name.length > maxNameLen) {
-                        maxNameLen = queue.name.length;
-                    }
-                    found = true;
-                }
-            }
-            if (!found) {
-                config._returnCode = 1;
-                return;
-            }
-    
-            var pad = Array(maxNameLen + 1 - caption.length).join(' ');
-            console.log(caption + pad + "  Attributes");
-            console.log(Array(maxNameLen + caption.length + 3).join('='));
-    
-            for (var i = 0; i < queues.length; i++) {
-                var queue = queues[i]._values;
-                if (filterMatch(queue.name, filter)) {
-                    var pad2 = Array(maxNameLen + 2 - queue.name.length).join(' ');
-                    var string = queue.name + pad2;
-                    var args = queue.arguments ? queue.arguments : {};
-                    if (queue.durable) {
-                        string += ' --durable';
-                    }
-                    if (args[REPLICATE]) {
-                        string += ' --replicate=' + args[REPLICATE];
-                    }
-                    if (queue.autoDelete) {
-                        string += ' auto-del';
-                    }
-                    if (queue.exclusive) {
-                        string += ' excl';
-                    }
-                    if (args[FILESIZE]) {
-                        string += ' --file-size=' + args[FILESIZE];
-                    }
-                    if (args[FILECOUNT]) {
-                        string += ' --file-count=' + args[FILECOUNT];
-                    }
-                    if (args[MAX_QUEUE_SIZE]) {
-                        string += ' --max-queue-size=' + args[MAX_QUEUE_SIZE];
-                    }
-                    if (args[MAX_QUEUE_COUNT]) {
-                        string += ' --max-queue-count=' + args[MAX_QUEUE_COUNT];
-                    }
-                    if (args[POLICY_TYPE]) {
-                        string += ' --limit-policy=' + args[POLICY_TYPE].replace("_", "-");
-                    }
-                    if (args[LVQ_KEY]) {
-                        string += ' --lvq-key=' + args[LVQ_KEY];
-                    }
-                    if (args[QUEUE_EVENT_GENERATION]) {
-                        string += ' --generate-queue-events=' + args[QUEUE_EVENT_GENERATION];
-                    }
-                    if (queue.altExchange) {
-                        string += ' --alternate-exchange=' + exMap[oid(queue.altExchange)]._values.name;
-                    }
-                    if (args[FLOW_STOP_SIZE]) {
-                        string += ' --flow-stop-size=' + args[FLOW_STOP_SIZE];
-                    }
-                    if (args[FLOW_RESUME_SIZE]) {
-                        string += ' --flow-resume-size=' + args[FLOW_RESUME_SIZE];
-                    }
-                    if (args[FLOW_STOP_COUNT]) {
-                        string += ' --flow-stop-count=' + args[FLOW_STOP_COUNT];
-                    }
-                    if (args[FLOW_RESUME_COUNT]) {
-                        string += ' --flow-resume-count=' + args[FLOW_RESUME_COUNT];
-                    }
-                    if (args[MSG_GROUP_HDR_KEY]) {
-                        string += ' --group-header=' + args[MSG_GROUP_HDR_KEY];
-                    }
-                    if (args[SHARED_MSG_GROUP] === 1) {
-                        string += ' --shared-groups';
-                    }
-                    string += ' ' + renderObject(args, true);
-                    console.log(string);
-                }
-            }
-            brokerAgent.destroy();
-        });
-    };
-    
-    var queueListRecurse = function(filter) {
-        brokerAgent.request(
-            // Send the QMF query requests for the specified classes.
-            brokerAgent.getObjects('org.apache.qpid.broker', 'queue'),
-            brokerAgent.getObjects('org.apache.qpid.broker', 'exchange'),
-            brokerAgent.getObjects('org.apache.qpid.broker', 'binding')
-        ).then(function(objects) {
-            var queues = objects.queue;
-            var bindings = objects.binding;
-            var exchanges = idMap(objects.exchange);
-    
-            for (var i = 0; i < queues.length; i++) {
-                var queue = queues[i];
-                var queueId = oid(queue._object_id);
-                queue = queue._values;
-    
-                if (filterMatch(queue.name, filter)) {
-                    console.log("Queue '" + queue.name + "'");
-                    for (var j = 0; j < bindings.length; j++) {
-                        var bind = bindings[j]._values;
-                        var queueRef = oid(bind.queueRef);
-    
-                        if (queueRef === queueId) {
-                            var exchange = exchanges[oid(bind.exchangeRef)];
-                            var exchangeName = "<unknown>";
-                            if (exchange) {
-                                exchangeName = exchange._values.name;
-                                if (exchangeName === '') {
-                                    if (config._ignoreDefault) continue;
-                                    exchangeName = "''";
-                                }
-                            }
-    
-                            console.log("    bind [" + bind.bindingKey + "] => " + exchangeName + 
-                                        " " + renderObject(bind.arguments));
-                        }   
-                    }
-                }
-            }
-            brokerAgent.destroy();
-        });
-    };
-    
-    /**
-     * The following methods implement adding and deleting various Broker Management
-     * Objects via QMF. Although <qpid>/cpp/src/qpid/broker/management-schema.xml
-     * describes the basic method schema, for example:
-     *   <method name="create" desc="Create an object of the specified type">
-     *     <arg name="type" dir="I" type="sstr" desc="The type of object to create"/>
-     *     <arg name="name" dir="I" type="sstr" desc="The name of the object to create"/>
-     *     <arg name="properties" dir="I" type="map" desc="Type specific object properties"/>
-     *     <arg name="strict" dir="I" type="bool" desc="If specified, treat unrecognised object properties as an error"/    >
-     *   </method>
-     *
-     *   <method name="delete" desc="Delete an object of the specified type">
-     *     <arg name="type" dir="I" type="sstr" desc="The type of object to delete"/>
-     *     <arg name="name" dir="I" type="sstr" desc="The name of the object to delete"/>
-     *     <arg name="options" dir="I" type="map" desc="Type specific object options for deletion"/>
-     *   </method>
-     *
-     * What the schema doesn't do however is to explain what the properties/options
-     * Map values actually mean, unfortunately these aren't documented anywhere so
-     * the only option is to look in the code, the best place to look is in:
-     * <qpid>/cpp/src/qpid/broker/Broker.cpp, the method Broker::ManagementMethod is
-     * the best place to start, then Broker::createObject and Broker::deleteObject
-     * even then it's pretty hard to figure out all that is possible.
-     */
-    
-    var handleMethodResponse = function(response, dontStop) {
-        if (response._arguments) {
-            //console.log(response._arguments);
-        } if (response._values) {
-            console.error("Exception from Agent: " + renderObject(response._values));
-        }
-        // Mostly we want to stop the Messenger Event loop and exit when a QMF method
-        // returns, but sometimes we don't, the dontStop flag prevents this behaviour.
-        if (!dontStop) {
-            brokerAgent.destroy();
-        }
-    }
-    
-    var addExchange = function(args) {
-        if (args.length < 2) {
-            usage();
-        }
-    
-        var etype = args[0];
-        var ename = args[1];
-        var declArgs = {};
-    
-        declArgs['exchange-type'] = etype;
-    
-        for (var a = 0; a < config._extra_arguments.length; a++) {
-            var r = config._extra_arguments[a].split('=');
-            declArgs[r[0]] = getValue(r);
-        }
-    
-        if (config._msgSequence) {
-            declArgs[MSG_SEQUENCE] = 1;
-        }
-    
-        if (config._ive) {
-            declArgs[IVE] = 1;
-        }
-    
-        if (config._altern_ex) {
-            declArgs['alternate-exchange'] = config._altern_ex;
-        }
-    
-        if (config._durable) {
-            declArgs['durable'] = 1;
-        }
-    
-        if (config._replicate) {
-            declArgs[REPLICATE] = config._replicate;
-        }
-    
-        brokerAgent.request(
-            // We invoke the CRUD methods on the broker object.
-            brokerAgent.getObjects('org.apache.qpid.broker', 'broker')
-        ).then(function(objects) {
-            var broker = objects.broker[0];
-            brokerAgent.request(
-                brokerAgent.invokeMethod(broker, 'create', {
-                    "type":      "exchange",
-                    "name":       ename,
-                    "properties": declArgs,
-                    "strict":     true})
-            ).then(handleMethodResponse);
-        });
-    };
-    
-    var delExchange = function(args) {
-        if (args.length < 1) {
-            usage();
-        }
-    
-        var ename = args[0];
-    
-        brokerAgent.request(
-            // We invoke the CRUD methods on the broker object.
-            brokerAgent.getObjects('org.apache.qpid.broker', 'broker')
-        ).then(function(objects) {
-            var broker = objects.broker[0];
-            brokerAgent.request(
-                brokerAgent.invokeMethod(broker, 'delete', {
-                    "type":   "exchange",
-                    "name":    ename})
-            ).then(handleMethodResponse);
-        });
-    };
-    
-    var addQueue = function(args) {
-        if (args.length < 1) {
-            usage();
-        }
-    
-        var qname = args[0];
-        var declArgs = {};
-    
-        for (var a = 0; a < config._extra_arguments.length; a++) {
-            var r = config._extra_arguments[a].split('=');
-            declArgs[r[0]] = getValue(r);
-        }
-    
-        if (config._durable) {
-            // allow the default fileCount and fileSize specified 
-            // in qpid config file to take prededence
-            if (config._fileCount) {
-                declArgs[FILECOUNT] = config._fileCount;
-            }
-            if (config._fileSize) {
-                declArgs[FILESIZE]  = config._fileSize;
-            }
-        }
-    
-        if (config._maxQueueSize != null) {
-            declArgs[MAX_QUEUE_SIZE] = config._maxQueueSize;
-        }
-    
-        if (config._maxQueueCount != null) {
-            declArgs[MAX_QUEUE_COUNT] = config._maxQueueCount;
-        }
-        
-        if (config._limitPolicy) {
-            if (config._limitPolicy === 'none') {
-            } else if (config._limitPolicy === 'reject') {
-                declArgs[POLICY_TYPE] = 'reject';
-            } else if (config._limitPolicy === 'ring') {
-                declArgs[POLICY_TYPE] = 'ring';
-            }
-        }
-    
-        if (config._lvq_key) {
-            declArgs[LVQ_KEY] = config._lvq_key;
-        }
-    
-        if (config._eventGeneration) {
-            declArgs[QUEUE_EVENT_GENERATION] = config._eventGeneration;
-        }
-    
-        if (config._flowStopSize != null) {
-            declArgs[FLOW_STOP_SIZE] = config._flowStopSize;
-        }
-    
-        if (config._flowResumeSize != null) {
-            declArgs[FLOW_RESUME_SIZE] = config._flowResumeSize;
-        }
-    
-        if (config._flowStopCount != null) {
-            declArgs[FLOW_STOP_COUNT] = config._flowStopCount;
-        }
-    
-        if (config._flowResumeCount != null) {
-            declArgs[FLOW_RESUME_COUNT] = config._flowResumeCount;
-        }
-    
-        if (config._msgGroupHeader) {
-            declArgs[MSG_GROUP_HDR_KEY] = config._msgGroupHeader;
-        }
-    
-        if (config._sharedMsgGroup) {
-            declArgs[SHARED_MSG_GROUP] = 1;
-        }
-    
-        if (config._altern_ex) {
-            declArgs['alternate-exchange'] = config._altern_ex;
-        }
-    
-        if (config._durable) {
-            declArgs['durable'] = 1;
-        }
-    
-        if (config._replicate) {
-            declArgs[REPLICATE] = config._replicate;
-        }
-    
-        // This block is a little complex and untidy, the real issue is that the
-        // correlator object isn't as good as a real Promise and doesn't support
-        // chaining of "then" calls, so where we have complex dependencies we still
-        // get somewhat into "callback hell". TODO improve the correlator.
-        brokerAgent.request(
-            // We invoke the CRUD methods on the broker object.
-            brokerAgent.getObjects('org.apache.qpid.broker', 'broker')
-        ).then(function(objects) {
-            var broker = objects.broker[0];
-            brokerAgent.request(
-                brokerAgent.invokeMethod(broker, 'create', {
-                    "type":      "queue",
-                    "name":       qname,
-                    "properties": declArgs,
-                    "strict":     true})
-            ).then(function(response) {
-                if (config._start_replica) {
-                    handleMethodResponse(response, true); // The second parameter prevents exiting.
-                    // TODO test this stuff!
-                    brokerAgent.request(
-                        brokerAgent.getObjects('org.apache.qpid.ha', 'habroker') // Not sure if this is correct
-                    ).then(function(objects) {
-                        if (objects.habroker.length > 0) {
-                            var habroker = objects.habroker[0];
-                            brokerAgent.request(
-                                brokerAgent.invokeMethod(habroker, 'replicate', {
-                                    "broker": config._start_replica,
-                                    "queue":  qname})
-                            ).then(handleMethodResponse);
-                        } else {
-                            brokerAgent.destroy();
-                        }
-                    });
-                } else {
-                    handleMethodResponse(response);
-                }
-            });
-        });
-    };
-    
-    var delQueue = function(args) {
-        if (args.length < 1) {
-            usage();
-        }
-    
-        var qname = args[0];
-    
-        brokerAgent.request(
-            // We invoke the CRUD methods on the broker object.
-            brokerAgent.getObjects('org.apache.qpid.broker', 'broker')
-        ).then(function(objects) {
-            var broker = objects.broker[0];
-            brokerAgent.request(
-                brokerAgent.invokeMethod(broker, 'delete', {
-                    "type":   "queue",
-                    "name":    qname,
-                    "options": {"if_empty":  config._if_empty,
-                                "if_unused": config._if_unused}})
-            ).then(handleMethodResponse);
-        });
-    };
-    
-    var snarf_header_args = function(args) {
-        if (args.length < 2) {
-            console.log("Invalid args to bind headers: need 'any'/'all' plus conditions");
-            return false;
-        }
-    
-        var op = args[0];
-        if (op === 'all' || op === 'any') {
-            kv = {};
-            var bindings = Array.prototype.slice.apply(args, [1]);
-            for (var i = 0; i < bindings.length; i++) {
-                var binding = bindings[i];
-                binding = binding.split(",")[0];
-                binding = binding.split("=");
-                kv[binding[0]] = binding[1];
-            }
-            kv['x-match'] = op;
-            return kv;
-        } else {
-            console.log("Invalid condition arg to bind headers, need 'any' or 'all', not '" + op + "'");
-            return false;
-        }
-    };
-    
-    var bind = function(args) {
-        if (args.length < 2) {
-            usage();
-        }
-    
-        var ename = args[0];
-        var qname = args[1];
-        var key   = '';
-    
-        if (args.length > 2) {
-            key = args[2];
-        }
-    
-        brokerAgent.request(
-            // We invoke the CRUD methods on the broker object.
-            brokerAgent.getObjects('org.apache.qpid.broker', 'broker'),
-            brokerAgent.getObjects('org.apache.qpid.broker', 'exchange') // Get exchanges to look up exchange type.
-        ).then(function(objects) {
-            var exchanges = objects.exchange;
-    
-            var etype = '';
-            for (var i = 0; i < exchanges.length; i++) {
-                var exchange = exchanges[i]._values;
-                if (exchange.name === ename) {
-                    etype = exchange.type;
-                    break;
-                }
-            }
-    
-            // type of the xchg determines the processing of the rest of
-            // argv.  if it's an xml xchg, we want to find a file
-            // containing an x-query, and pass that.  if it's a headers
-            // exchange, we need to pass either "any" or all, followed by a
-            // map containing key/value pairs.  if neither of those, extra
-            // args are ignored.
-            var declArgs = {};
-            if (etype === 'xml') {
-    
-    
-            } else if (etype === 'headers') {
-                declArgs = snarf_header_args(Array.prototype.slice.apply(args, [3]));
-            }
-    //console.log(declArgs);
-    
-            if (typeof declArgs !== 'object') {
-                process.exit(1);
-            }
-    
-            var broker = objects.broker[0];
-            brokerAgent.request(
-                brokerAgent.invokeMethod(broker, 'create', {
-                    "type":   "binding",
-                    "name":    ename + '/' + qname + '/' + key,
-                    "properties": declArgs,
-                    "strict":     true})
-            ).then(handleMethodResponse);
-        });
-    
-    /*
-    
-            ok = True
-            _args = {}
-            if not res:
-                pass
-            elif res.type == "xml":
-                # this checks/imports the -f arg
-                [ok, xquery] = snarf_xquery_args()
-                _args = { "xquery" : xquery }
-            else:
-                if res.type == "headers":
-                    [ok, op, kv] = snarf_header_args(args[3:])
-                    _args = kv
-                    _args["x-match"] = op
-    
-            if not ok:
-                sys.exit(1)
-    
-            self.broker.bind(ename, qname, key, _args)
-    */
-    
-    };
-    
-    var unbind = function(args) {
-        if (args.length < 2) {
-            usage();
-        }
-    
-        var ename = args[0];
-        var qname = args[1];
-        var key   = '';
-    
-        if (args.length > 2) {
-            key = args[2];
-        }
-    
-        brokerAgent.request(
-            // We invoke the CRUD methods on the broker object.
-            brokerAgent.getObjects('org.apache.qpid.broker', 'broker')
-        ).then(function(objects) {
-            var broker = objects.broker[0];
-            brokerAgent.request(
-                brokerAgent.invokeMethod(broker, 'delete', {
-                    "type":   "binding",
-                    "name":    ename + '/' + qname + '/' + key})
-            ).then(handleMethodResponse);
-        });
-    };
-
-    /**
-     * The following methods are "generic" create and delete methods to for arbitrary
-     * Management Objects e.g. Incoming, Outgoing, Domain, Topic, QueuePolicy,
-     * TopicPolicy etc. use --argument k1=v1 --argument k2=v2 --argument k3=v3 to
-     * pass arbitrary arguments as key/value pairs to the Object being created/deleted,
-     * for example to add a topic object that uses the fanout exchange:
-     * ./qpid-config.js add topic fanout --argument exchange=amq.fanout \
-     * --argument qpid.max_size=1000000 --argument qpid.policy_type=ring
-     */
-    
-    var createObject = function(type, name, args) {
-        brokerAgent.request(
-            // We invoke the CRUD methods on the broker object.
-            brokerAgent.getObjects('org.apache.qpid.broker', 'broker')
-        ).then(function(objects) {
-            var broker = objects.broker[0];
-            brokerAgent.request(
-                // Create an object of the specified type.
-                brokerAgent.invokeMethod(broker, 'create', {
-                    "type":       type,
-                    "name":       name,
-                    "properties": args,
-                    "strict":     true})
-            ).then(handleMethodResponse);
-        });
-    };
-    
-    var deleteObject = function(type, name, args) {
-        brokerAgent.request(
-            // We invoke the CRUD methods on the broker object.
-            brokerAgent.getObjects('org.apache.qpid.broker', 'broker')
-        ).then(function(objects) {
-            var broker = objects.broker[0];
-            brokerAgent.request(
-                // Create an object of the specified type and name.
-                brokerAgent.invokeMethod(broker, 'delete', {
-                    "type":    type,
-                    "name":    name,
-                    "options": args})
-            ).then(handleMethodResponse);
-        });
-    };
-    
-    /**
-     * This is a "generic" mechanism for listing arbitrary Management Objects.
-     */
-    var listObjects = function(type) {
-        brokerAgent.request(
-            brokerAgent.getObjects('org.apache.qpid.broker', type)
-        ).then(function(objects) {
-            // The correlator passes an object containing responses for all of the
-            // supplied requests so we index it by the supplied type to get our response.
-            objects = objects[type];
-    
-            // Collect available attributes, stringify the values and compute the max
-            // length of the value of each attribute so that we can later create a table.
-            var attributes = {};
-            var lengths = {};
-            for (var i = 0; i < objects.length; i++) {
-                var object = objects[i];
-                object = object._values;
-                for (var prop in object) {
-                    if (typeof object[prop] === 'object') { // Stringify Object properties.
-                        // Check if property is an ObjectID (reference property),
-                        // if so replace with the "name" part of the OID.
-                        if (object[prop]['_object_name']) {
-                            var parts = object[prop]['_object_name'].split(':');
-                            object[prop] = parts[parts.length - 1];
-                        } else {
-                            // Stringify general Object properties.
-                            object[prop] = renderObject(object[prop]);
-                        }
-                    } else {
-                        object[prop] = object[prop].toString(); // Stringify other property types.
-                    }
-    
-                    if (!lengths[prop] || object[prop].length > lengths[prop]) { // Compute lengths.
-                        lengths[prop] = object[prop].length > prop.length ? object[prop].length : prop.length;
-                    }
-    
-                    if (!config._list_properties || config._list_properties[prop]) { // Do we want this property?
-                        attributes[prop] = true;
-                    }
-                }
-            }
-    
-            if (!config._list_properties && DEFAULT_PROPERTIES[type]) {
-                attributes = DEFAULT_PROPERTIES[type];
-            }
-    
-            // Using the information we've previously prepared now render a table
-            // showing the required property values.
-            var desired = [];
-            var header = ''; // Table header showing the property names.
-            if (attributes['name']) {
-                desired.push('name');
-                delete attributes['name'];
-                header += 'name' + Array(lengths['name'] + 2 - 4).join(' ');
-            }
-    
-            for (var prop in attributes) {
-                desired.push(prop);
-                header += prop + Array(lengths[prop] + 2 - prop.length).join(' ');
-            }
-    
-            console.log("Objects of type '" + type + "'");
-            console.log(header);
-            console.log(Array(header.length).join('='));
-            for (var i = 0; i < objects.length; i++) {
-                var object = objects[i];
-                object = object._values;
-                var string = '';
-                for (var j = 0; j < desired.length; j++) {
-                    var key = desired[j];
-                    string += object[key] + Array(lengths[key] + 2 - object[key].length).join(' ');
-                }
-    
-                console.log(string);
-            }
-    
-            brokerAgent.destroy();
-        });
-    };
-    
-    var reloadAcl = function() {
-        brokerAgent.request(
-            brokerAgent.getObjects('org.apache.qpid.acl', 'acl')
-        ).then(function(objects) {
-            if (objects.acl.length > 0) {
-                var acl = objects.acl[0];
-                brokerAgent.request(
-                    // Create an object of the specified type.
-                    brokerAgent.invokeMethod(acl, 'reloadACLFile', {})
-                ).then(handleMethodResponse);
-            } else {
-                console.log("Failed: No ACL Loaded in Broker");
-                brokerAgent.destroy();
-            }
-        });
-    };
-    
-    
-    /********************* process command line options **********************/
-    
-    var params = [];
-    var extra_arguments = [];
-    var args = process.argv.slice(2);
-    if (args.length > 0) {
-        if (args[0] === '-h' || args[0] === '--help') {
-            console.log(_usage);
-            console.log(_description);
-            console.log(_options);
-            process.exit(0);
-        }
-    
-        for (var i = 0; i < args.length; i++) {
-            var arg = args[i];
-            if (arg === '-r' || arg === '--recursive') {
-                config._recursive = true;
-            } else if (arg === '--ignore-default') {
-                config._ignoreDefault = true;
-            } else if (arg === '--durable') {
-                config._durable = true;
-            } else if (arg === '--shared-groups') {
-                config._sharedMsgGroup = true;
-            } else if (arg === '--sequence') {
-                config._sequence = true;
-            } else if (arg === '--ive') {
-                config._ive = true;
-            } else if (arg === '--force') {
-                config._if_empty = false;
-                config._if_unused = false;
-            } else if (arg === '--force-if-not-empty') {
-                config._if_empty = false;
-            } else if (arg === '--force-if-used') {
-                config._if_unused = false;
-            } else if (arg === '--sequence') {
-                config._msgSequence = true;
-            } else if (arg.charAt(0) === '-') {
-                i++;
-                var val = args[i];
-                if (arg === '-t' || arg === '--timeout') {
-                    config._connTimeout = parseInt(val);
-                    if (config._connTimeout === 0) {
-                        config._connTimeout = null;
-                    }
-                } else if (arg === '-b' || arg === '--broker' || arg === '-a' || arg === '--broker-addr') {
-                    if (val != null) {
-                        config._host = val;
-                    }
-                } else if (arg === '--alternate-exchange') {
-                    config._altern_ex = val;
-                } else if (arg === '--replicate') {
-                    if (!REPLICATE_LEVELS[val]) {
-                        console.error("Invalid replication level " + val + ", should be one of 'none', 'configuration'  or 'all'");
-                    }
-                    config._replicate = val;
-                } else if (arg === '--file-count') {
-                    config._fileCount = parseInt(val);
-                } else if (arg === '--file-size') {
-                    config._fileSize = parseInt(val);
-                } else if (arg === '--max-queue-size') {
-                    config._maxQueueSize = parseInt(val);
-                } else if (arg === '--max-queue-count') {
-                    config._maxQueueCount = parseInt(val);
-                } else if (arg === '--limit-policy') {
-                    config._limitPolicy = val;
-                } else if (arg === '--lvq-key') {
-                    config._lvq_key = val;
-                } else if (arg === '--generate-queue-events') {
-                    config._eventGeneration = parseInt(val);
-                } else if (arg === '--flow-stop-size') {
-                    config._flowStopSize = parseInt(val);
-                } else if (arg === '--flow-resume-size') {
-                    config._flowResumeSize = parseInt(val);
-                } else if (arg === '--flow-stop-count') {
-                    config._flowStopCount = parseInt(val);
-                } else if (arg === '--flow-resume-count') {
-                    config._flowResumeCount = parseInt(val);
-                } else if (arg === '--group-header') {
-                    config._msgGroupHeader = val;
-                } else if (arg === '--argument') {
-                    extra_arguments.push(val);
-                } else if (arg === '--start-replica') {
-                    config._start_replica = val;
-                } else if (arg === '--f' || arg === '--file') { // TODO Won't work in node.js
-                    config._file = val;
-                } else if (arg === '--show-property') {
-                    if (config._list_properties === null) {
-                        config._list_properties = {};
-                    }
-                    config._list_properties[val] = true;
-                }
-            } else {
-                params.push(arg);
-            }
-        }
-    }
-    
-    config._extra_arguments = extra_arguments;
-    
-    // The command only *actually* gets called when the QMF connection has actually
-    // been established so we wrap up the function we want to get called in a lambda.
-    var command = function() {overview();};
-    if (params.length > 0) {
-        var cmd = params[0];
-        var modifier = '';
-        if (params.length > 1) {
-            modifier = params[1];
-        }
-    
-        if (cmd === 'exchanges') {
-            if (config._recursive) {
-                command = function() {exchangeListRecurse(modifier);};
-            } else {
-                command = function() {exchangeList(modifier);};
-            }
-        } else if (cmd === 'queues') {
-            if (config._recursive) {
-                command = function() {queueListRecurse(modifier);};
-            } else {
-                command = function() {queueList(modifier);};
-            }
-        } else if (cmd === 'add') {
-            if (modifier === 'exchange') {
-                command = function() {addExchange(Array.prototype.slice.apply(params, [2]));};
-            } else if (modifier === 'queue') {
-                command = function() {addQueue(Array.prototype.slice.apply(params, [2]));};
-            } else if (params.length > 2) {
-                command = function() {createObject(modifier, params[2], config.getOptions());};
-            } else {
-                usage();
-            }
-        } else if (cmd === 'del') {
-            if (modifier === 'exchange') {
-                command = function() {delExchange(Array.prototype.slice.apply(params, [2]));};
-            } else if (modifier === 'queue') {
-                command = function() {delQueue(Array.prototype.slice.apply(params, [2]));};
-            } else if (params.length > 2) {
-                command = function() {deleteObject(modifier, params[2], {});};
-            } else {
-                usage();
-            }
-        } else if (cmd === 'bind') {
-            command = function() {bind(Array.prototype.slice.apply(params, [1]));};
-        } else if (cmd === 'unbind') {
-            command = function() {unbind(Array.prototype.slice.apply(params, [1]));};
-        } else if (cmd === 'reload-acl') {
-            command = function() {reloadAcl();};
-        } else if (cmd === 'list' && params.length > 1) {
-            command = function() {listObjects(modifier);};
-        } else {
-            usage();
-        }
-    }
-    
-    //console.log(config._host);
-    brokerAgent.addConnection(config._host, command);    
-} else {
-    console.error("qpid-config.js should be run in Node.js");
-}
-
diff --git a/examples/javascript/messenger/recv.js b/examples/javascript/messenger/recv.js
deleted file mode 100755
index 79afb20..0000000
--- a/examples/javascript/messenger/recv.js
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/env node
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-// Check if the environment is Node.js and if not log an error and exit.
-if (typeof process === 'object' && typeof require === 'function') {
-    var proton = require("qpid-proton-messenger");
-
-    var address = "amqp://~0.0.0.0";
-    var message = new proton.Message();
-    var messenger = new proton.Messenger();
-
-    var pumpData = function() {
-        while (messenger.incoming()) {
-            var t = messenger.get(message);
-
-            console.log("Address: " + message.getAddress());
-            console.log("Subject: " + message.getSubject());
-    
-            // body is the body as a native JavaScript Object, useful for most real cases.
-            //console.log("Content: " + message.body);
-    
-            // data is the body as a proton.Data Object, used in this case because
-            // format() returns exactly the same representation as recv.c
-            console.log("Content: " + message.data.format());
-    
-            messenger.accept(t);
-        }
-    };
-
-    var args = process.argv.slice(2);
-    if (args.length > 0) {
-        if (args[0] === '-h' || args[0] === '--help') {
-            console.log("Usage: node recv.js <addr> (default " + address + ")");
-            process.exit(0);
-        }
-    
-        address = args[0];
-    }
-    
-    messenger.setIncomingWindow(1024);
-    
-    messenger.on('error', function(error) {console.log(error);});
-    messenger.on('work', pumpData);
-    messenger.recv(); // Receive as many messages as messenger can buffer.
-    messenger.start();
-
-    messenger.subscribe(address);
-} else {
-    console.error("recv.js should be run in Node.js");
-}
-
diff --git a/examples/javascript/messenger/send.html b/examples/javascript/messenger/send.html
deleted file mode 100644
index a33e025..0000000
--- a/examples/javascript/messenger/send.html
+++ /dev/null
@@ -1,122 +0,0 @@
-<!DOCTYPE html> <!-- HTML5 doctype -->
-
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-  
-    http://www.apache.org/licenses/LICENSE-2.0
-  
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-
-<html>
-
-<head>
-	<title>Simple Proton Messenger Send Example</title>
-	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
-
-<!--
-  Import the Messenger Binding proton.js. Note that this simple example pulls
-  it from the node_modules/qpid-proton/lib, which is created by the build process
-  so that the node.js based examples "just work", in a real Web App you would
-  clearly need to copy the proton.js to your own server.
-
-  In actual fact the CMake build actually builds proton.js into the directory:
-  <build>/proton-c/bindings/javascript
-  where <build> is the build directory created to run cmake from, it is then
-  copied to the node_modules/qpid-proton/lib directory.
-
-  In this example we also set the global variable PROTON_TOTAL_MEMORY in order to
-  increase the virtual heap available to the emscripten compiled C runtime. It
-  is not really necessary to do this for this application as the default value
-  of 16777216 is fine, it is simply done here to illustrate how to do it.
--->
-<script type="text/javascript">PROTON_TOTAL_MEMORY = 50000000;</script>
-<script type="text/javascript" src="../../../node_modules/qpid-proton-messenger/lib/proton-messenger.js"></script>
-
-<script type="text/javascript">
-var message = new proton.Message();
-var messenger = new proton.Messenger();
-
-var sendMessage = function() {
-    var address = document.getElementById("address").value;
-    var subject = document.getElementById("subject").value;
-    var body = document.getElementById("body").value;
-
-console.log("sendMessage");
-console.log("address = " + address);
-console.log("subject = " + subject);
-console.log("body = " + body);
-
-    message.setAddress(address);
-    message.setSubject(subject);
-    message.body = body;
-
-    messenger.put(message);
-    messenger.send();
-};
-
-var errorHandler = function(error) {
-    console.log("Received error " + error);
-};
-
-messenger.on('error', errorHandler);
-messenger.start();
-
-</script>
-
-<style>
-body
-{
-	font: 13px/1.5 Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif;
-    overflow-x: hidden; /* Hide horizontal scrollbar */
-    background: #dddddd;
-}
-
-label
-{
-    display: block;
-	font-size: 17px;
-}
-
-input, textarea
-{
-	font-size: 13px;
-    margin-bottom: 10px;
-}
-</style>
-
-</head>
-
-<body>
-<div>
-    <label for="address">Address:</label>
-    <input type="text" id="address" size="40"
-           placeholder="amqp://user:password@host:port"
-           name="address" value="amqp://guest:guest@0.0.0.0" />
-</div>
-<div>    
-    <label for="subject">Subject:</label>
-    <input type="text" id="subject" size="40"
-           name="subject" value="Browser Message" />
-</div>
-<div>
-    <label for="body">Message:</label>
-    <textarea id="body" name="body" rows="4" cols="40">Hello From Browser!</textarea>
-</div>
-<div>
-    <input type="button" value="send" onclick="sendMessage()"/>
-</div>
-</body>
-
-</html>
diff --git a/examples/javascript/messenger/send.js b/examples/javascript/messenger/send.js
deleted file mode 100755
index 608fab4..0000000
--- a/examples/javascript/messenger/send.js
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/usr/bin/env node
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-// Check if the environment is Node.js and if not log an error and exit.
-if (typeof process === 'object' && typeof require === 'function') {
-    // In this example we also set the global variable PROTON_TOTAL_MEMORY in order
-    // to increase the virtual heap available to the emscripten compiled C runtime.
-    // It is not really necessary to do this for this application as the default
-    // value of 16777216 is fine, it is simply done here to illustrate how to do it.
-    PROTON_TOTAL_MEMORY = 50000000;
-    var proton = require("qpid-proton-messenger");
-
-    var address = "amqp://0.0.0.0";
-    var subject = "UK.WEATHER";
-    var msgtext = "Hello World!";
-    var tracker = null;
-    var running = true;
-
-    var message = new proton.Message();
-    var messenger = new proton.Messenger();
-
-    // This is an asynchronous send, so we can't simply call messenger.put(message)
-    // at the end of the application as we would with a synchronous/blocking
-    // version, as the application would simply exit without actually sending.
-    // The following callback function (and messenger.setOutgoingWindow())
-    // gives us a means to wait until the consumer has received the message before
-    // exiting. The recv.js example explicitly accepts messages it receives.
-    var pumpData = function() {
-        var status = messenger.status(tracker);
-        if (status != proton.Status.PENDING) {
-            if (running) {
-                messenger.stop();
-                running = false;
-            } 
-        }
-
-        if (messenger.isStopped()) {
-            message.free();
-            messenger.free();
-        }
-    };
-
-    var args = process.argv.slice(2);
-    if (args.length > 0) {
-        if (args[0] === '-h' || args[0] === '--help') {
-            console.log("Usage: node send.js [options] [message]");
-            console.log("Options:");
-            console.log("  -a <addr> The target address [amqp[s]://domain[/name]] (default " + address + ")");
-            console.log("  -s <subject> The message subject (default " + subject + ")");
-            console.log("message A text string to send.");
-            process.exit(0);
-        }
-
-        for (var i = 0; i < args.length; i++) {
-            var arg = args[i];
-            if (arg.charAt(0) === '-') {
-                i++;
-                var val = args[i];
-                if (arg === '-a') {
-                    address = val;
-                } else if (arg === '-s') {
-                    subject = val;
-                }
-            } else {
-                msgtext = arg;
-            }
-        }
-    }
-
-    console.log("Address: " + address);
-    console.log("Subject: " + subject);
-    console.log("Content: " + msgtext);
-
-    messenger.on('error', function(error) {console.log(error);});
-    messenger.on('work', pumpData);
-    messenger.setOutgoingWindow(1024); // So we can track status of send message.
-    messenger.start();
-
-    message.setAddress(address);
-    message.setSubject(subject);
-    message.body = msgtext;
-
-    tracker = messenger.put(message);
-} else {
-    console.error("send.js should be run in Node.js");
-}
-
diff --git a/examples/javascript/messenger/server.js b/examples/javascript/messenger/server.js
deleted file mode 100755
index 6015321..0000000
--- a/examples/javascript/messenger/server.js
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/usr/bin/env node
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-// Simple server for use with client.js illustrating request/response
-
-// Check if the environment is Node.js and if not log an error and exit.
-if (typeof process === 'object' && typeof require === 'function') {
-    var proton = require("qpid-proton-messenger");
-
-    var address = "amqp://~0.0.0.0";
-    var message = new proton.Message();
-    var reply   = new proton.Message();
-    var messenger = new proton.Messenger();
-
-    var dispatch = function(request, response) {
-        var subject = request.getSubject();
-        if (subject) {
-            response.setSubject('Re: ' + subject);
-        }
-        response.properties = request.properties
-        console.log("Dispatched " + subject + " " + JSON.stringify(request.properties));
-    };
-
-    var pumpData = function() {
-        while (messenger.incoming()) {
-            var t = messenger.get(message);
-    
-            var replyTo = message.getReplyTo();
-            if (replyTo) {
-                console.log(replyTo);
-                reply.setAddress(replyTo);
-                reply.setCorrelationID(message.getCorrelationID());
-                reply.body = message.body;
-                dispatch(message, reply);
-                messenger.put(reply);
-            }
-    
-            messenger.accept(t);
-        }
-    };
-
-    var args = process.argv.slice(2);
-    if (args.length > 0) {
-        if (args[0] === '-h' || args[0] === '--help') {
-            console.log("Usage: node server.js <addr> (default " + address + ")");
-            process.exit(0);
-        }
-    
-        address = args[0];
-    }
-    
-    messenger.setIncomingWindow(1024);
-    
-    messenger.on('error', function(error) {console.log(error);});
-    messenger.on('work', pumpData);
-    messenger.recv(); // Receive as many messages as messenger can buffer.
-    messenger.start();
-    
-    messenger.subscribe(address);
-} else {
-    console.error("server.js should be run in Node.js");
-}
-
diff --git a/examples/javascript/messenger/spout.js b/examples/javascript/messenger/spout.js
deleted file mode 100755
index 013f79f..0000000
--- a/examples/javascript/messenger/spout.js
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/usr/bin/env node
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-// Check if the environment is Node.js and if not log an error and exit.
-if (typeof process === 'object' && typeof require === 'function') {
-    var proton = require("qpid-proton-messenger");
-
-    console.log("spout not implemented yet");
-    process.exit(0);
-    
-    var address = "amqp://0.0.0.0";
-    var subject = "UK.WEATHER";
-    var msgtext = "Hello World!";
-    var tracker = null;
-    var running = true;
-    
-    var message = new proton.Message();
-    var messenger = new proton.Messenger();
-
-    function pumpData() {
-        var status = messenger.status(tracker);
-        if (status != proton.Status.PENDING) {
-console.log("status = " + status);
-
-            if (running) {
-console.log("stopping");
-                messenger.stop();
-                running = false;
-            } 
-        }
-    
-        if (messenger.isStopped()) {
-console.log("exiting");
-            message.free();
-            messenger.free();
-        }
-    };
-
-    messenger.on('error', function(error) {console.log(error);});
-    messenger.on('work', pumpData);
-    messenger.setOutgoingWindow(1024);
-    messenger.start();
-
-    message.setAddress(address);
-    message.setSubject(subject);
-
-    message.body = msgtext;
-
-    tracker = messenger.put(message);
-} else {
-    console.error("spout.js should be run in Node.js");
-}
-
diff --git a/examples/javascript/messenger/ws2tcp.js b/examples/javascript/messenger/ws2tcp.js
deleted file mode 100644
index 1d90543..0000000
--- a/examples/javascript/messenger/ws2tcp.js
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/**
- * ws2tcp.js is a simple node.js library that proxies from a WebSocket to a TCP
- * Socket or vice versa. It has minimal dependencies - the standard node.js net
- * library and the ws WebSocket library (npm install ws).
- * <p>
- * Two fuctions are exported, ws2tcp proxies from a WebSocket to a TCP Socket and
- * tcp2ws proxies from a TCP Socket to a WebSocket.
- * @Author Fraser Adams
- * @file
- */
-
-var WebSocket = require('ws');
-var net = require('net');
-
-/**
- * This function is shared by ws2tcp and tcp2ws and takes care of cleaning up
- * and closing the WebSocket and Socket when things close down or error.
- * @param sock the TCP Socket instance we're registering cleanup handlers for.
- * @param ws the WebSocket instance we're registering cleanup handlers for.
- */
-var registerCleanupCallbacks = function(sock, ws) {
-    var cleanup = function(sock, ws) {
-        sock.removeAllListeners('close');	
-        sock.end();
-        ws.removeAllListeners('close');
-        ws.close();
-    };
-
-    sock.on('close', function() {
-        cleanup(sock, ws);
-    });
-
-    sock.on('error', function (e) {
-        console.log("socket error: " + e.code);
-        cleanup(sock, ws);
-    });
-
-    ws.on('close', function() {
-        cleanup(sock, ws);
-    });
-
-    ws.on('error', function (e) {
-        console.log("websocket error: " + e.code);
-        cleanup(sock, ws);
-    });
-};
-
-/**
- * This function establishes a proxy that listens on a specified TCP Socket port
- * and proxies data to a WebSocket on the target host listening on the specified
- * target port.
- * @param lport the listen port.
- * @param thost the target host.
- * @param tport the target port.
- * @param subProtocols a string containing a comma separated list of WebSocket sub-protocols.
- */
-var tcp2ws = function(lport, thost, tport, subProtocols) {
-    var opts = null;
-    if (subProtocols) {
-        // The regex trims the string (removes spaces at the beginning and end,
-        // then splits the string by <any space>,<any space> into an Array.
-        subProtocols = subProtocols.replace(/^ +| +$/g,"").split(/ *, */);
-        opts = {'protocol': subProtocols.toString()};
-    }
-
-    var server = net.createServer(function(sock) {
-        var url = 'ws://' + thost + ':' + tport;
-        var ws = new WebSocket(url, opts);
-        var ready = false;
-        var buffer = [];
-
-        registerCleanupCallbacks(sock, ws);
-
-        sock.on('data', function(data) {
-            if (ready) {
-                ws.send(data);
-            } else {
-                buffer.push(data);
-            }
-        });
-
-        ws.on('open', function () {
-            if (buffer.length > 0) {
-                ws.send(Buffer.concat(buffer));
-            }
-            ready = true;
-            buffer = null;
-        });
-
-        ws.on('message', function(m) {
-            sock.write(m);	
-        });
-    });
-    server.listen(lport);
-};
-
-/**
- * This function establishes a proxy that listens on a specified WebSocket port
- * and proxies data to a TCP Socket on the target host listening on the specified
- * target port.
- * @param lport the listen port.
- * @param thost the target host.
- * @param tport the target port.
- */
-var ws2tcp = function(lport, thost, tport) {
-    var server = new WebSocket.Server({port: lport});
-    server.on('connection', function(ws) {
-        var sock = net.connect(tport, thost);
-        var ready = false;
-        var buffer = [];
-
-        registerCleanupCallbacks(sock, ws);
-
-        ws.on('message', function(m) {
-            if (ready) {
-                sock.write(m);	
-            } else {
-                buffer.push(m);
-            }
-        });
-
-        sock.on('connect', function() {
-            if (buffer.length > 0) {
-                sock.write(Buffer.concat(buffer));
-            }
-            ready = true;
-            buffer = null;
-        });
-
-        sock.on('data', function(data) {
-            try {
-                ws.send(data);
-            } catch (e) {
-                console.log("error sending: " + e);
-            }
-        });
-    });
-    server.on('error', function(e) {
-        console.log("websocket server error: " + e.code);
-    });
-};
-
-// Export the two proxy functions.
-module.exports.ws2tcp = ws2tcp;
-module.exports.tcp2ws = tcp2ws;
-
diff --git a/examples/perl/messenger/async.pm b/examples/perl/messenger/async.pm
deleted file mode 100644
index 5cd350b..0000000
--- a/examples/perl/messenger/async.pm
+++ /dev/null
@@ -1,120 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-use qpid_proton;
-
-package async::CallbackAdapter;
-
-sub new {
-    my ($class) = @_;
-    my ($self) = {};
-
-    my $messenger = $_[1];
-
-    $self->{_messenger} = $messenger;
-    $messenger->set_blocking(0);
-    $messenger->set_incoming_window(1024);
-    $messenger->set_outgoing_window(1024);
-
-    my $message = qpid::proton::Message->new();
-    $self->{_message} = $message;
-    $self->{_incoming} = $message;
-    $self->{_tracked} = {};
-
-    bless $self, $class;
-    return $self;
-}
-
-sub run {
-    my ($self) = @_;
-
-    $self->{_running} = 1;
-
-    my $messenger = $self->{_messenger};
-
-    $messenger->start();
-    $self->on_start();
-
-    do {
-        $messenger->work;
-        $self->process_outgoing;
-        $self->process_incoming;
-    } while($self->{_running});
-
-    $messenger->stop();
-
-    while(!$messenger->stopped()) {
-        $messenger->work;
-        $self->process_outgoing;
-        $self->process_incoming;
-    }
-
-    $self->on_stop();
-}
-
-sub stop {
-    my ($self) = @_;
-
-    $self->{_running} = 0;
-}
-
-sub process_outgoing {
-    my ($self) = @_;
-    my $tracked = $self->{_tracked};
-
-    foreach $key (keys %{$tracked}) {
-        my $on_status = $tracked->{$key};
-        if (defined($on_status)) {
-            if (!($on_status eq qpid::proton::Tracker::PENDING)) {
-                $self->$on_status($status);
-                $self->{_messenger}->settle($t);
-                # delete the settled item
-                undef $tracked->{$key};
-            }
-        }
-    }
-}
-
-sub process_incoming {
-    my ($self) = @_;
-    my $messenger = $self->{_messenger};
-
-    while ($messenger->incoming > 0) {
-        my $message = $self->{_message};
-        my $t = $messenger->get($message);
-
-        $self->on_receive($message);
-        $messenger->accept($t);
-    }
-}
-
-sub send {
-    my ($self) = @_;
-    my $messenger = $self->{_messenger};
-    my $tracked = $self->{_tracked};
-    my $message = $_[1];
-    my $on_status = $_[2] || undef;
-
-    my $tracker = $messenger->put($message);
-
-    $tracked->{$tracker} = $on_status if (defined($on_status));
-}
-
-
-1;
diff --git a/examples/perl/messenger/client.pl b/examples/perl/messenger/client.pl
deleted file mode 100755
index a6d8378..0000000
--- a/examples/perl/messenger/client.pl
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/usr/bin/env perl
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-use strict;
-use warnings;
-use Getopt::Long;
-use Pod::Usage;
-
-use qpid_proton;
-
-my $reply_to = "~/replies";
-my $help = 0;
-my $man = 0;
-
-GetOptions(
-    "reply_to=s", \$reply_to,
-    man => \$man,
-    "help|?" => \$help
-    ) or pod2usage(2);
-pod2usage(1) if $help;
-pod2usage(-exitval => 0, -verbose => 2) if $man;
-
-# get the address to use and show help if it's missing
-my $address = $ARGV[0];
-pod2usage(1) if !$address;
-
-my $messenger = new qpid::proton::Messenger();
-$messenger->start;
-
-my $message = new qpid::proton::Message();
-$message->set_address($address);
-$message->set_reply_to($reply_to);
-$message->set_subject("Subject");
-$message->set_content("Yo!");
-
-print "Sending to: $address\n";
-
-$messenger->put($message);
-$messenger->send;
-
-if($reply_to =~ /^~\//) {
-    print "Waiting on returned message.\n";
-    $messenger->receive(1);
-
-    $messenger->get($message);
-    print $message->get_address . " " . $message->get_subject . "\n";
-}
-
-$messenger->stop;
-
-__END__
-
-=head1 NAME
-
-client - Proton example application for Perl.
-
-=head1 SYNOPSIS
-
-client.pl [OPTIONS] <address> <subject>
-
- Options:
-   --reply_to - The reply to address to be used. (default: ~/replies)
-   --help     - This help message.
-   --man      - Show the full docementation.
-
-=over 8
-
-=item B<--reply_to>
-
-Specifies the reply address to be used for responses from the server.
-
-=item B<--help>
-
-Prints a brief help message and exits.
-
-=item B<--man>
-
-Prints the man page and exits.
-
-=back
-
-=head2 ADDRESS
-
-The form an address takes is:
-
-[amqp://]<domain>[/name]
-
-=cut
diff --git a/examples/perl/messenger/recv.pl b/examples/perl/messenger/recv.pl
deleted file mode 100755
index 801f6a2..0000000
--- a/examples/perl/messenger/recv.pl
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/usr/bin/env perl
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-use warnings;
-
-use Scalar::Util qw(reftype);
-use Data::Dumper;
-
-use qpid_proton;
-
-sub usage {
-    exit(0);
-}
-
-my @addresses = @ARGV;
-@addresses = ("~0.0.0.0") unless $addresses[0];
-
-my $messenger = new qpid::proton::Messenger();
-my $msg = new qpid::proton::Message();
-
-$messenger->start();
-
-foreach (@addresses)
-{
-    print "Subscribing to $_\n";
-    $messenger->subscribe($_);
-}
-
-for(;;)
-{
-    $messenger->receive(10);
-
-    while ($messenger->incoming() > 0)
-    {
-        $messenger->get($msg);
-
-        print "\n";
-        print "Address: " . $msg->get_address() . "\n";
-        print "Subject: " . $msg->get_subject() . "\n" unless !defined($msg->get_subject());
-        print "Body:    ";
-
-        my $body = $msg->get_body();
-        my $body_type = $msg->get_body_type();
-
-        if (!defined($body_type)) {
-            print "The body type wasn't defined!\n";
-        } elsif ($body_type == qpid::proton::BOOL) {
-            print "[BOOL]\n";
-            print "" . ($body ? "TRUE" : "FALSE") . "\n";
-        } elsif ($body_type == qpid::proton::MAP) {
-            print "[HASH]\n";
-            print Dumper(\%{$body}) . "\n";
-        } elsif ($body_type == qpid::proton::ARRAY) {
-            print "[ARRAY]\n";
-            print Data::Dumper->Dump($body) . "\n";
-        } elsif ($body_type == qpid::proton::LIST) {
-            print "[LIST]\n";
-            print Data::Dumper->Dump($body) . "\n";
-        } else {
-            print "[$body_type]\n";
-            print "$body\n";
-        }
-
-        print "Properties:\n";
-        my $props = $msg->get_properties();
-        foreach (keys $props) {
-            print "\t$_=$props->{$_}\n";
-        }
-        print "Instructions:\n";
-        my $instructions = $msg->get_instructions;
-        foreach (keys $instructions) {
-            print "\t$_=" . $instructions->{$_} . "\n";
-        }
-        print "Annotations:\n";
-        my $annotations = $msg->get_annotations();
-        foreach (keys $annotations) {
-            print "\t$_=" . $annotations->{$_} . "\n";
-        }
-    }
-}
-
-die $@ if ($@);
diff --git a/examples/perl/messenger/recv_async.pl b/examples/perl/messenger/recv_async.pl
deleted file mode 100755
index 9a2195a..0000000
--- a/examples/perl/messenger/recv_async.pl
+++ /dev/null
@@ -1,84 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-use qpid_proton;
-use async;
-
-package async::Receiver;
-
-@ISA = (async::CallbackAdapter);
-
-sub on_start {
-    my ($self) = @_;
-    my $args = $_[1] || ("amqp://~0.0.0.0");
-    my $messenger = $self->{_messenger};
-
-    foreach $arg ($args) {
-        $messenger->subscribe($arg);
-    }
-
-    $messenger->receive();
-}
-
-sub on_receive {
-    my ($self) = @_;
-    my $msg = $_[1];
-    my $message = $self->{_message};
-    my $text = "";
-
-    if (defined($msg->get_body)) {
-        $text = $msg->get_body;
-        if ($text eq "die") {
-            $self->stop;
-        }
-    } else {
-        $text = $message->get_subject;
-    }
-
-    $text = "" if (!defined($text));
-
-    print "Received: $text\n";
-
-    if ($msg->get_reply_to) {
-        print "Sending reply to: " . $msg->get_reply_to . "\n";
-        $message->clear;
-        $message->set_address($msg->get_reply_to());
-        $message->set_body("Reply for ", $msg->get_body);
-        $self->send($message);
-    }
-}
-
-sub on_status {
-    my ($self) = @_;
-    my $messenger = $self->{_messenger};
-    my $status = $_[1];
-
-    print "Status: ", $status, "\n";
-}
-
-sub on_stop {
-    print "Stopped.\n"
-}
-
-package main;
-
-our $messenger = new qpid::proton::Messenger();
-our $app = new async::Receiver($messenger);
-
-$app->run();
diff --git a/examples/perl/messenger/send.pl b/examples/perl/messenger/send.pl
deleted file mode 100755
index 27893ce..0000000
--- a/examples/perl/messenger/send.pl
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/usr/bin/env perl
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-use strict;
-use warnings;
-use Getopt::Std;
-
-use qpid_proton;
-
-$Getopt::Std::STANDARD_HELP_VERSION = 1;
-
-sub VERSION_MESSAGE() {
-}
-
-sub HELP_MESSAGE() {
-    print "Usage: send.pl [OPTIONS] -a <ADDRESS>\n";
-    print "Options:\n";
-    print "\t-s        - the message subject\n";
-    print "\t-C        - the message content\n";
-    print "\t<ADDRESS> - amqp://<domain>[/<name>]\n";
-    print "\t-h        - this message\n";
-
-    exit;
-}
-
-my %options = ();
-getopts("a:C:s:h:", \%options) or HELP_MESSAGE();
-
-my $address = $options{a} || "amqp://0.0.0.0";
-my $subject = $options{s} || localtime(time);
-my $content = $options{C} || "";
-
-my $msg  = new qpid::proton::Message();
-my $messenger = new qpid::proton::Messenger();
-
-$messenger->start();
-
-my @messages = @ARGV;
-@messages = ("This is a test. " . localtime(time)) unless $messages[0];
-
-foreach (@messages)
-{
-    $msg->set_address($address);
-    $msg->set_subject($subject);
-    $msg->set_body($content);
-    # try a few different body types
-    my $body_type = int(rand(6));
-    $msg->set_property("sent", "" . localtime(time));
-    $msg->get_instructions->{"fold"} = "yes";
-    $msg->get_instructions->{"spindle"} = "no";
-    $msg->get_instructions->{"mutilate"} = "no";
-    $msg->get_annotations->{"version"} = 1.0;
-    $msg->get_annotations->{"pill"} = "RED";
-
-  SWITCH: {
-      $body_type == 0 && do { $msg->set_body("It is now " . localtime(time));};
-      $body_type == 1 && do { $msg->set_body(rand(65536)); };
-      $body_type == 2 && do { $msg->set_body(int(rand(2)), qpid::proton::BOOL); };
-      $body_type == 3 && do { $msg->set_body({"foo" => "bar"}); };
-      $body_type == 4 && do { $msg->set_body([4, [1, 2, 3.1, 3.4E-5], 8, 15, 16, 23, 42]); };
-      $body_type == 5 && do { $msg->set_body(int(rand(65535))); }
-    }
-
-    $messenger->put($msg);
-    print "Sent: " . $msg->get_body . " [CONTENT TYPE: " . $msg->get_body_type . "]\n";
-}
-
-$messenger->send();
-$messenger->stop();
-
-die $@ if ($@);
diff --git a/examples/perl/messenger/send_async.pl b/examples/perl/messenger/send_async.pl
deleted file mode 100644
index 2f9408a..0000000
--- a/examples/perl/messenger/send_async.pl
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-use Getopt::Std;
-use qpid_proton;
-use async;
-
-$Getopt::Std::STANDARD_HELP_VERSION = 1;
-
-sub VERSION_MESSAGE() {}
-
-sub HELP_MESSAGE() {
-    print "Usage: send_async.pl [OPTIONS] <msg_0> <msg_1> ...\n";
-    print "Options:\n";
-    print "\t-a     - the message address (def. amqp://0.0.0.0)\n";
-    print "\t-r     - the reply-to address: //<domain>[/<name>]\n";
-    print "\t msg_# - a text string to send\n";
-}
-
-my %optons = ();
-getopts("a:r:", \%options) or usage();
-
-our $address = $options{a} || "amqp://0.0.0.0";
-our $replyto = $options{r} || "~/#";
-
-package async::Sender;
-
-@ISA = (async::CallbackAdapter);
-
-sub on_start {
-    my ($self) = @_;
-    my $message = $self->{_message};
-    my $messenger = $self->{_messenger};
-    my $args = $_[1] || ("Hello world!");
-
-    print "Started\n";
-
-    $message->clear;
-    $message->set_address("amqp://0.0.0.0");
-    $message->set_reply_to($replyto) if (defined($replyto));
-
-    foreach $arg ($args) {
-        $message->set_body($arg);
-        if ($replyto) {
-            $message->set_reply_to($replyto);
-        }
-        $self->send($message, "on_status");
-    }
-
-    $messenger->receive() if (defined($replyto));
-}
-
-sub on_status {
-    my ($self) = @_;
-    my $messenger = $self->{_messenger};
-    my $status = $_[1] || "";
-
-    print "Status: ", $status, "\n";
-}
-
-sub on_receive {
-    my ($self) = @_;
-    my $message = $_[1];
-    my $text = $message->get_body || "[empty]";
-
-    print "Received: " . $text . "\n";
-
-    $self->stop();
-}
-
-sub on_stop {
-    print "Stopped\n";
-}
-
-
-package main;
-
-our $msgr = new qpid::proton::Messenger();
-our $app = async::Sender->new($msgr);
-
-$app->run;
diff --git a/examples/perl/messenger/server.pl b/examples/perl/messenger/server.pl
deleted file mode 100755
index c13d4d5..0000000
--- a/examples/perl/messenger/server.pl
+++ /dev/null
@@ -1,123 +0,0 @@
-#!/usr/bin/env perl
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-use strict;
-use warnings;
-use Getopt::Long;
-use Pod::Usage;
-
-use qpid_proton;
-
-my $help = 0;
-my $man = 0;
-
-GetOptions(
-    man => \$man,
-    "help|?" => \$help
-    ) or pod2usage(2);
-
-pod2usage(1) if $help;
-pod2usage(-exitval => 0, -verbose => 2) if $man;
-
-pod2usage(2) unless scalar(@ARGV);
-
-# create a messenger for receiving and holding
-# incoming messages
-our $messenger = new qpid::proton::Messenger;
-$messenger->start;
-
-# subscribe the messenger to all addresses specified sources
-foreach (@ARGV) {
-    $messenger->subscribe($_);
-}
-
-sub dispatch {
-    my $request = $_[0];
-    my $reply   = $_[1];
-
-    if ($request->get_subject) {
-        $reply->set_subject("Re: " . $request->get_subject);
-    }
-
-    $reply->set_properties($request->get_properties);
-    print "Dispatched " . $request->get_subject . "\n";
-    my $properties = $request->get_properties;
-    foreach (keys %{$properties}) {
-        my $value = $properties->{%_};
-        print "\t$_: $value\n";
-    }
-}
-
-our $message = new qpid::proton::Message;
-our $reply   = new qpid::proton::Message;
-
-while(1) {
-    $messenger->receive(1) if $messenger->incoming < 10;
-
-    if ($messenger->incoming > 0) {
-        $messenger->get($message);
-
-        if ($message->get_reply_to) {
-            print $message->get_reply_to . "\n";
-            $reply->set_address($message->get_reply_to);
-            $reply->set_correlation_id($message->get_correlation_id);
-            $reply->set_body($message->get_body);
-        }
-        dispatch($message, $reply);
-        $messenger->put($reply);
-        $messenger->send;
-    }
-}
-
-$message->stop;
-
-__END__
-
-=head1 NAME
-
-server - Proton example server application for Perl.
-
-=head1 SYNOPSIS
-
-server.pl [OPTIONS] <addr1> ... <addrn>
-
- Options:
-   --help - This help message.
-   --man  - Show the full documentation.
-
-=over 8
-
-=item B<--help>
-
-Prints a brief help message and exits.
-
-=item B<--man>
-
-Prints the man page and exits.
-
-=back
-
-=head2 ADDRESS
-
-The form an address takes is:
-
-[amqp://]<domain>[/name]
-
-=cut
diff --git a/examples/php/messenger/recv.php b/examples/php/messenger/recv.php
deleted file mode 100644
index 05ece80..0000000
--- a/examples/php/messenger/recv.php
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- **/
-
-include("proton.php");
-
-$mess = new Messenger();
-$mess->start();
-
-if ($argv[1]) {
-  $mess->subscribe($argv[1]);
-} else {
-  $mess->subscribe("amqp://~0.0.0.0");
-}
-
-$msg = new Message();
-while (true) {
-  $mess->recv(10);
-  while ($mess->incoming) {
-    try {
-      $mess->get($msg);
-    } catch (Exception $e) {
-      print "$e\n";
-      continue;
-    }
-
-    print "$msg->address, $msg->subject, $msg->body\n";
-  }
-}
-
-$mess->stop();
-?>
diff --git a/examples/php/messenger/send.php b/examples/php/messenger/send.php
deleted file mode 100644
index 599f7eb..0000000
--- a/examples/php/messenger/send.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- **/
-
-include("proton.php");
-
-$mess = new Messenger();
-$mess->start();
-
-$msg = new Message();
-if ($argv[1]) {
-  $msg->address = $argv[1];
-} else {
-  $msg->address = "amqp://0.0.0.0";
-}
-$msg->subject = "Hello World!";
-$msg->body = "this is a test";
-
-$mess->put($msg);
-$mess->send();
-print "sent: $msg->subject\n";
-
-$mess->stop();
-?>
diff --git a/examples/python/README b/examples/python/README
deleted file mode 100644
index 9051187..0000000
--- a/examples/python/README
+++ /dev/null
@@ -1,187 +0,0 @@
-Most (though not all) of the current examples require a broker or
-similar intermediary that supports the AMQP 1.0 protocol, allows
-anonymous connections and accepts links to and from a node named
-'examples'. A very simple broker emulating script - broker.py - is
-provided against which the examples can also be run (transactions are
-not yet supported in this script).
-
-Note: For builds that include SASL support via the cyrus sasl library,
-those examples that accept incoming connections may require some SASL
-configuration which is described below.
-
-------------------------------------------------------------------
-
-helloworld.py
-
-Basic example that connects to an intermediary on localhost:5672,
-establishes a subscription from the 'examples' node on that
-intermediary, then creates a sending link to the same node and sends
-one message. On receving the message back via the subcription, the
-connection is closed.
-
-helloworld_blocking.py
-
-The same as the basic helloworld.py, but using a
-synchronous/sequential style wrapper on top of the
-asynchronous/reactive API. The purpose of this example is just to show
-how different functionality can be easily layered should it be
-desired.
-
-helloworld_direct.py
-
-A variant of the basic helloworld example, that does not use an
-intermediary, but listens for incoming connections itself. It
-establishes a connection to itself with a link over which a single
-message is sent. This demonstrates the ease with which a simple daemon
-can be built using the API.
-
-helloworld_tornado.py
-helloworld_direct_tornado.py
-
-These are variant of the helloworld.py and helloworld_direct.py
-examples that use the event loop from the tornado library, rather than
-that provided within proton itself and demonstrate how proton can be
-used with external loops.
-
--------------------------------------------------------------------
-
-simple_send.py
-
-An example of sending a fixed number of messages and tracking their
-(asynchronous) acknowledgement. Handles disconnection while
-maintaining an at-least-once guarantee (there may be duplicates, but
-no message in the sequence should be lost). Messages are sent through
-the 'examples' node on an intermediary accessible on port 5672 on
-localhost.
-
-simple_recv.py
-
-Subscribes to the 'examples' node on an intermediary accessible on port 5672 on
-localhost. Simply prints out the body of received messages.
-
-db_send.py
-
-A more realistic sending example, where the messages come from records
-in a simple database table. On being acknowledged the records can be
-deleted from the table. The database access is done in a separate
-thread, so as not to block the event thread during data
-access. Messages are sent through the 'examples' node on an
-intermediary accessible on port 5672 on localhost.
-
-db_recv.py
-
-A receiving example that records messages received from the 'examples'
-node on localhost:5672 in a database table and only acknowledges them
-when the insert completes. Database access is again done in a separate
-thread from the event loop.
-
-db_ctrl.py
-
-A utility for setting up the database tables for the two examples
-above. Takes two arguments, the action to perform and the name of the
-database on which to perfom it. The database used by db_send.py is
-src_db, that by db_recv.py is dst_db. The valid actions are 'init',
-which creates the table, 'list' which displays the contents and
-'insert' which inserts records from standard-in and is used to
-populate src_db, e.g. for i in `seq 1 50`; do echo "Message-$i"; done
-| ./db_ctrl.py insert src_db.
-
-tx_send.py
-
-A sender that sends messages in atomic batches using local
-transactions (this example does not persist the messages in any way).
-
-tx_recv.py
-
-A receiver example that accepts batches of messages using local
-transactions.
-
-tx_recv_interactive.py
-
-A testing utility that allow interactive control of the
-transactions. Actions are keyed in to the console, 'fetch' will
-request another message, 'abort' will abort the transaction, 'commit'
-will commit it.
-
-The various send/recv examples can be mixed and matched if desired.
-
-direct_send.py
-
-An example that accepts incoming links and connections over which it
-will then send out messages. Can be used with simple_recv.py or
-db_recv.py for direct, non-intermediated communication.
-
-direct_recv.py
-
-An example that accepts incoming links and connections over which it
-will then receive messages, printing out the content. Can be used with
-simple_send.py or db_send.py for direct, non-intermediated
-communication.
-
--------------------------------------------------------------------
-
-client.py
-
-The client part of a request-response example. Sends requests and
-prints out responses. Requires an intermediary that supports the AMQP
-1.0 dynamic nodes on which the responses are received. The requests
-are sent through the 'examples' node.
-
-server.py
-
-The server part of a request-response example, that receives requests
-via the examples node, converts the body to uppercase and sends the
-result back to the indicated reply address.
-
-sync_client.py
-
-A variant of the client part, that uses a blocking/synchronous style
-instead of the reactive/asynchronous style.
-
-client_http.py
-
-A variant of the client part that takes the input to be submitted in
-the request over HTTP (point your browser to localhost:8888/client)
-
-server_tx.py
-
-A variant of the server part that consumes the request and sends out
-the response atomically in a local transaction.
-
-direct_server.py
-
-A variant of the server part of a request-response example, that
-accepts incoming connections and does not need an intermediary. Much
-like the original server, it receives incoming requests, converts the
-body to uppercase and sends the result back to the indicated reply
-address. Can be used in conjunction with any of the client
-alternatives.
-
--------------------------------------------------------------------
-
-selected_recv.py
-
-An example that uses a selector filter.
-
--------------------------------------------------------------------
-
-recurring_timer.py
-
-An example showing a simple timer event.
-
-recurring_timer_tornado.py
-
-A variant of the above that uses the tornado eventloop instead.
-
--------------------------------------------------------------------
-
-SASL configuration
-
-If your build includes extra SASL support (provided via the cyrus SASL
-library), you may need to provide some configuration to enable
-examples that accept incoming connections (i.e. those with 'direct' in
-the name). This is done by supplying a config file name
-proton-server.conf. The directory in which it is in can be specified
-via the PN_SASL_CONFIG_PATH environment variable. A simple example
-config file is included along with these examples, enabling only the
-EXTERNAL and ANONYMOUS mechanisms by default.
\ No newline at end of file
diff --git a/examples/python/abstract_server.py b/examples/python/abstract_server.py
deleted file mode 100755
index fed7fb2..0000000
--- a/examples/python/abstract_server.py
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-from proton_server import Server
-
-class Application(Server):
-    def __init__(self, host, address):
-        super(Application, self).__init__(host, address)
-
-    def on_request(self, request, reply_to):
-        response = request.upper()
-        self.send(response, reply_to)
-        print("Request from: %s" % reply_to)
-
-try:
-    Application("localhost:5672", "examples").run()
-except KeyboardInterrupt: pass
-
diff --git a/examples/python/broker.py b/examples/python/broker.py
deleted file mode 100755
index 8769268..0000000
--- a/examples/python/broker.py
+++ /dev/null
@@ -1,124 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-import collections, optparse
-from proton import Endpoint, generate_uuid
-from proton.handlers import MessagingHandler
-from proton.reactor import Container
-
-class Queue(object):
-    def __init__(self, dynamic=False):
-        self.dynamic = dynamic
-        self.queue = collections.deque()
-        self.consumers = []
-
-    def subscribe(self, consumer):
-        self.consumers.append(consumer)
-
-    def unsubscribe(self, consumer):
-        if consumer in self.consumers:
-            self.consumers.remove(consumer)
-        return len(self.consumers) == 0 and (self.dynamic or self.queue.count == 0)
-
-    def publish(self, message):
-        self.queue.append(message)
-        self.dispatch()
-
-    def dispatch(self, consumer=None):
-        if consumer:
-            c = [consumer]
-        else:
-            c = self.consumers
-        while self._deliver_to(c): pass
-
-    def _deliver_to(self, consumers):
-        try:
-            result = False
-            for c in consumers:
-                if c.credit:
-                    c.send(self.queue.popleft())
-                    result = True
-            return result
-        except IndexError: # no more messages
-            return False
-
-class Broker(MessagingHandler):
-    def __init__(self, url):
-        super(Broker, self).__init__()
-        self.url = url
-        self.queues = {}
-
-    def on_start(self, event):
-        self.acceptor = event.container.listen(self.url)
-
-    def _queue(self, address):
-        if address not in self.queues:
-            self.queues[address] = Queue()
-        return self.queues[address]
-
-    def on_link_opening(self, event):
-        if event.link.is_sender:
-            if event.link.remote_source.dynamic:
-                address = str(generate_uuid())
-                event.link.source.address = address
-                q = Queue(True)
-                self.queues[address] = q
-                q.subscribe(event.link)
-            elif event.link.remote_source.address:
-                event.link.source.address = event.link.remote_source.address
-                self._queue(event.link.source.address).subscribe(event.link)
-        elif event.link.remote_target.address:
-            event.link.target.address = event.link.remote_target.address
-
-    def _unsubscribe(self, link):
-        if link.source.address in self.queues and self.queues[link.source.address].unsubscribe(link):
-            del self.queues[link.source.address]
-
-    def on_link_closing(self, event):
-        if event.link.is_sender:
-            self._unsubscribe(event.link)
-
-    def on_connection_closing(self, event):
-        self.remove_stale_consumers(event.connection)
-
-    def on_disconnected(self, event):
-        self.remove_stale_consumers(event.connection)
-
-    def remove_stale_consumers(self, connection):
-        l = connection.link_head(Endpoint.REMOTE_ACTIVE)
-        while l:
-            if l.is_sender:
-                self._unsubscribe(l)
-            l = l.next(Endpoint.REMOTE_ACTIVE)
-
-    def on_sendable(self, event):
-        self._queue(event.link.source.address).dispatch(event.link)
-
-    def on_message(self, event):
-        self._queue(event.link.target.address).publish(event.message)
-
-parser = optparse.OptionParser(usage="usage: %prog [options]")
-parser.add_option("-a", "--address", default="localhost:5672",
-                  help="address router listens on (default %default)")
-opts, args = parser.parse_args()
-
-try:
-    Container(Broker(opts.address)).run()
-except KeyboardInterrupt: pass
diff --git a/examples/python/client.py b/examples/python/client.py
deleted file mode 100755
index 86f2c76..0000000
--- a/examples/python/client.py
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function, unicode_literals
-import optparse
-from proton import Message
-from proton.handlers import MessagingHandler
-from proton.reactor import Container, DynamicNodeProperties
-
-class Client(MessagingHandler):
-    def __init__(self, url, requests):
-        super(Client, self).__init__()
-        self.url = url
-        self.requests = requests
-
-    def on_start(self, event):
-        self.sender = event.container.create_sender(self.url)
-        self.receiver = event.container.create_receiver(self.sender.connection, None, dynamic=True)
-
-    def next_request(self):
-        if self.receiver.remote_source.address:
-            req = Message(reply_to=self.receiver.remote_source.address, body=self.requests[0])
-            self.sender.send(req)
-
-    def on_link_opened(self, event):
-        if event.receiver == self.receiver:
-            self.next_request()
-
-    def on_message(self, event):
-        print("%s => %s" % (self.requests.pop(0), event.message.body))
-        if self.requests:
-            self.next_request()
-        else:
-            event.connection.close()
-
-REQUESTS= ["Twas brillig, and the slithy toves",
-           "Did gire and gymble in the wabe.",
-           "All mimsy were the borogroves,",
-           "And the mome raths outgrabe."]
-
-parser = optparse.OptionParser(usage="usage: %prog [options]",
-                               description="Send requests to the supplied address and print responses.")
-parser.add_option("-a", "--address", default="localhost:5672/examples",
-                  help="address to which messages are sent (default %default)")
-opts, args = parser.parse_args()
-
-Container(Client(opts.address, args or REQUESTS)).run()
-
diff --git a/examples/python/client_http.py b/examples/python/client_http.py
deleted file mode 100755
index bf65639..0000000
--- a/examples/python/client_http.py
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import tornado.ioloop
-import tornado.web
-from proton import Message
-from proton.handlers import MessagingHandler
-from proton_tornado import Container
-
-class Client(MessagingHandler):
-    def __init__(self, host, address):
-        super(Client, self).__init__()
-        self.host = host
-        self.address = address
-        self.sent = []
-        self.pending = []
-        self.reply_address = None
-        self.sender = None
-        self.receiver = None
-
-    def on_start(self, event):
-        conn = event.container.connect(self.host)
-        self.sender = event.container.create_sender(conn, self.address)
-        self.receiver = event.container.create_receiver(conn, None, dynamic=True)
-
-    def on_link_opened(self, event):
-        if event.receiver == self.receiver:
-            self.reply_address = event.link.remote_source.address
-            self.do_request()
-
-    def on_sendable(self, event):
-        self.do_request()
-
-    def on_message(self, event):
-        if self.sent:
-            request, handler = self.sent.pop(0)
-            print("%s => %s" % (request, event.message.body))
-            handler(event.message.body)
-            self.do_request()
-
-    def do_request(self):
-        if self.pending and self.reply_address and self.sender.credit:
-            request, handler = self.pending.pop(0)
-            self.sent.append((request, handler))
-            req = Message(reply_to=self.reply_address, body=request)
-            self.sender.send(req)
-
-    def request(self, body, handler):
-        self.pending.append((body, handler))
-        self.do_request()
-        self.container.touch()
-
-class ExampleHandler(tornado.web.RequestHandler):
-    def initialize(self, client):
-        self.client = client
-
-    def get(self):
-        self._write_open()
-        self._write_form()
-        self._write_close()
-
-    @tornado.web.asynchronous
-    def post(self):
-        client.request(self.get_body_argument("message"), lambda x: self.on_response(x))
-
-    def on_response(self, body):
-        self.set_header("Content-Type", "text/html")
-        self._write_open()
-        self._write_form()
-        self.write("Response: " + body)
-        self._write_close()
-        self.finish()
-
-    def _write_open(self):
-        self.write('<html><body>')
-
-    def _write_close(self):
-        self.write('</body></html>')
-
-    def _write_form(self):
-        self.write('<form action="/client" method="POST">'
-                   'Request: <input type="text" name="message">'
-                   '<input type="submit" value="Submit">'
-                   '</form>')
-
-
-loop = tornado.ioloop.IOLoop.instance()
-client = Client("localhost:5672", "examples")
-client.container = Container(client, loop=loop)
-client.container.initialise()
-app = tornado.web.Application([tornado.web.url(r"/client", ExampleHandler, dict(client=client))])
-app.listen(8888)
-try:
-    loop.start()
-except KeyboardInterrupt:
-    loop.stop()
diff --git a/examples/python/db_common.py b/examples/python/db_common.py
deleted file mode 100755
index 54af87b..0000000
--- a/examples/python/db_common.py
+++ /dev/null
@@ -1,118 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-try:
-    import Queue
-except:
-    import queue as Queue
-
-import sqlite3
-import threading
-
-class Db(object):
-    def __init__(self, db, injector):
-        self.db = db
-        self.injector = injector
-        self.tasks = Queue.Queue()
-        self.position = None
-        self.pending_events = []
-        self.running = True
-        self.thread = threading.Thread(target=self._process)
-        self.thread.daemon=True
-        self.thread.start()
-
-    def close(self):
-        self.tasks.put(lambda conn: self._close())
-
-    def reset(self):
-        self.tasks.put(lambda conn: self._reset())
-
-    def load(self, records, event=None):
-        self.tasks.put(lambda conn: self._load(conn, records, event))
-
-    def get_id(self, event):
-        self.tasks.put(lambda conn: self._get_id(conn, event))
-
-    def insert(self, id, data, event=None):
-        self.tasks.put(lambda conn: self._insert(conn, id, data, event))
-
-    def delete(self, id, event=None):
-        self.tasks.put(lambda conn: self._delete(conn, id, event))
-
-    def _reset(self, ignored=None):
-        self.position = None
-
-    def _close(self, ignored=None):
-        self.running = False
-
-    def _get_id(self, conn, event):
-        cursor = conn.execute("SELECT * FROM records ORDER BY id DESC")
-        row = cursor.fetchone()
-        if event:
-            if row:
-                event.id = row['id']
-            else:
-                event.id = 0
-            self.injector.trigger(event)
-
-    def _load(self, conn, records, event):
-        if self.position:
-            cursor = conn.execute("SELECT * FROM records WHERE id > ? ORDER BY id", (self.position,))
-        else:
-            cursor = conn.execute("SELECT * FROM records ORDER BY id")
-        while not records.full():
-            row = cursor.fetchone()
-            if row:
-                self.position = row['id']
-                records.put(dict(row))
-            else:
-                break
-        if event:
-            self.injector.trigger(event)
-
-    def _insert(self, conn, id, data, event):
-        if id:
-            conn.execute("INSERT INTO records(id, description) VALUES (?, ?)", (id, data))
-        else:
-            conn.execute("INSERT INTO records(description) VALUES (?)", (data,))
-        if event:
-            self.pending_events.append(event)
-
-    def _delete(self, conn, id, event):
-        conn.execute("DELETE FROM records WHERE id=?", (id,))
-        if event:
-            self.pending_events.append(event)
-
-    def _process(self):
-        conn = sqlite3.connect(self.db)
-        conn.row_factory = sqlite3.Row
-        with conn:
-            while self.running:
-                f = self.tasks.get(True)
-                try:
-                    while True:
-                        f(conn)
-                        f = self.tasks.get(False)
-                except Queue.Empty: pass
-                conn.commit()
-                for event in self.pending_events:
-                    self.injector.trigger(event)
-                self.pending_events = []
-        self.injector.close()
diff --git a/examples/python/db_ctrl.py b/examples/python/db_ctrl.py
deleted file mode 100755
index 04770ce..0000000
--- a/examples/python/db_ctrl.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import sqlite3
-import sys
-
-if len(sys.argv) < 3:
-    print("Usage: %s [init|insert|list] db" % sys.argv[0])
-else:
-    conn = sqlite3.connect(sys.argv[2])
-    with conn:
-        if sys.argv[1] == "init":
-            conn.execute("DROP TABLE IF EXISTS records")
-            conn.execute("CREATE TABLE records(id INTEGER PRIMARY KEY AUTOINCREMENT, description TEXT)")
-            conn.commit()
-        elif sys.argv[1] == "list":
-            cursor = conn.cursor()
-            cursor.execute("SELECT * FROM records")
-            rows = cursor.fetchall()
-            for r in rows:
-                print(r)
-        elif sys.argv[1] == "insert":
-            while True:
-                l = sys.stdin.readline()
-                if not l: break
-                conn.execute("INSERT INTO records(description) VALUES (?)", (l.rstrip(),))
-            conn.commit()
-        else:
-            print("Unrecognised command: %s" %  sys.argv[1])
diff --git a/examples/python/db_recv.py b/examples/python/db_recv.py
deleted file mode 100755
index 8c79049..0000000
--- a/examples/python/db_recv.py
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import optparse
-from proton.handlers import MessagingHandler
-from proton.reactor import ApplicationEvent, Container, EventInjector
-from db_common import Db
-
-class Recv(MessagingHandler):
-    def __init__(self, url, count):
-        super(Recv, self).__init__(auto_accept=False)
-        self.url = url
-        self.delay = 0
-        self.last_id = None
-        self.expected = count
-        self.received = 0
-        self.accepted = 0
-        self.db = Db("dst_db", EventInjector())
-
-    def on_start(self, event):
-        event.container.selectable(self.db.injector)
-        e = ApplicationEvent("id_loaded")
-        e.container = event.container
-        self.db.get_id(e)
-
-    def on_id_loaded(self, event):
-        self.last_id = event.id
-        event.container.create_receiver(self.url)
-
-    def on_record_inserted(self, event):
-        self.accept(event.delivery)
-        self.accepted += 1
-        if self.accepted == self.expected:
-            event.connection.close()
-            self.db.close()
-
-    def on_message(self, event):
-        id = int(event.message.id)
-        if (not self.last_id) or id > self.last_id:
-            if self.received < self.expected:
-                self.received += 1
-                self.last_id = id
-                self.db.insert(id, event.message.body, ApplicationEvent("record_inserted", delivery=event.delivery))
-                print("inserted message %s" % id)
-            else:
-                self.release(event.delivery)
-        else:
-            self.accept(event.delivery)
-
-parser = optparse.OptionParser(usage="usage: %prog [options]")
-parser.add_option("-a", "--address", default="localhost:5672/examples",
-                  help="address from which messages are received (default %default)")
-parser.add_option("-m", "--messages", type="int", default=0,
-                  help="number of messages to receive; 0 receives indefinitely (default %default)")
-opts, args = parser.parse_args()
-
-try:
-    Container(Recv(opts.address, opts.messages)).run()
-except KeyboardInterrupt: pass
-
-
-
diff --git a/examples/python/db_send.py b/examples/python/db_send.py
deleted file mode 100755
index c07dcc0..0000000
--- a/examples/python/db_send.py
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function, unicode_literals
-import optparse
-import time
-try:
-    import Queue
-except:
-    import queue as Queue
-
-
-from proton import Message
-from proton.handlers import MessagingHandler
-from proton.reactor import ApplicationEvent, Container, EventInjector
-from db_common import Db
-
-class Send(MessagingHandler):
-    def __init__(self, url, count):
-        super(Send, self).__init__()
-        self.url = url
-        self.delay = 0
-        self.sent = 0
-        self.confirmed = 0
-        self.load_count = 0
-        self.records = Queue.Queue(maxsize=50)
-        self.target = count
-        self.db = Db("src_db", EventInjector())
-
-    def keep_sending(self):
-        return self.target == 0 or self.sent < self.target
-
-    def on_start(self, event):
-        self.container = event.container
-        self.container.selectable(self.db.injector)
-        self.sender = self.container.create_sender(self.url)
-
-    def on_records_loaded(self, event):
-        if self.records.empty():
-            if event.subject == self.load_count:
-                print("Exhausted available data, waiting to recheck...")
-                # check for new data after 5 seconds
-                self.container.schedule(5, self)
-        else:
-            self.send()
-
-    def request_records(self):
-        if not self.records.full():
-            print("loading records...")
-            self.load_count += 1
-            self.db.load(self.records, event=ApplicationEvent("records_loaded", link=self.sender, subject=self.load_count))
-
-    def on_sendable(self, event):
-        self.send()
-
-    def send(self):
-        while self.sender.credit and not self.records.empty():
-            if not self.keep_sending(): return
-            record = self.records.get(False)
-            id = record['id']
-            self.sender.send(Message(id=id, durable=True, body=record['description']), tag=str(id))
-            self.sent += 1
-            print("sent message %s" % id)
-        self.request_records()
-
-    def on_settled(self, event):
-        id = int(event.delivery.tag)
-        self.db.delete(id)
-        print("settled message %s" % id)
-        self.confirmed += 1
-        if self.confirmed == self.target:
-            event.connection.close()
-            self.db.close()
-
-    def on_disconnected(self, event):
-        self.db.reset()
-        self.sent = self.confirmed
-
-    def on_timer_task(self, event):
-        print("Rechecking for data...")
-        self.request_records()
-
-parser = optparse.OptionParser(usage="usage: %prog [options]",
-                               description="Send messages to the supplied address.")
-parser.add_option("-a", "--address", default="localhost:5672/examples",
-                  help="address to which messages are sent (default %default)")
-parser.add_option("-m", "--messages", type="int", default=0,
-                  help="number of messages to send; 0 sends indefinitely (default %default)")
-opts, args = parser.parse_args()
-
-try:
-    Container(Send(opts.address, opts.messages)).run()
-except KeyboardInterrupt: pass
-
diff --git a/examples/python/direct_recv.py b/examples/python/direct_recv.py
deleted file mode 100755
index 1c6bf36..0000000
--- a/examples/python/direct_recv.py
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import optparse
-from proton.handlers import MessagingHandler
-from proton.reactor import Container
-
-class Recv(MessagingHandler):
-    def __init__(self, url, count):
-        super(Recv, self).__init__()
-        self.url = url
-        self.expected = count
-        self.received = 0
-
-    def on_start(self, event):
-        self.acceptor = event.container.listen(self.url)
-
-    def on_message(self, event):
-        if event.message.id and event.message.id < self.received:
-            # ignore duplicate message
-            return
-        if self.expected == 0 or self.received < self.expected:
-            print(event.message.body)
-            self.received += 1
-            if self.received == self.expected:
-                event.receiver.close()
-                event.connection.close()
-                self.acceptor.close()
-
-parser = optparse.OptionParser(usage="usage: %prog [options]")
-parser.add_option("-a", "--address", default="localhost:5672/examples",
-                  help="address from which messages are received (default %default)")
-parser.add_option("-m", "--messages", type="int", default=100,
-                  help="number of messages to receive; 0 receives indefinitely (default %default)")
-opts, args = parser.parse_args()
-
-try:
-    Container(Recv(opts.address, opts.messages)).run()
-except KeyboardInterrupt: pass
-
-
-
diff --git a/examples/python/direct_send.py b/examples/python/direct_send.py
deleted file mode 100755
index 35bd2f5..0000000
--- a/examples/python/direct_send.py
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function, unicode_literals
-import optparse
-from proton import Message
-from proton.handlers import MessagingHandler
-from proton.reactor import Container
-
-class Send(MessagingHandler):
-    def __init__(self, url, messages):
-        super(Send, self).__init__()
-        self.url = url
-        self.sent = 0
-        self.confirmed = 0
-        self.total = messages
-
-    def on_start(self, event):
-        self.acceptor = event.container.listen(self.url)
-
-    def on_sendable(self, event):
-        while event.sender.credit and self.sent < self.total:
-            msg = Message(id=(self.sent+1), body={'sequence':(self.sent+1)})
-            event.sender.send(msg)
-            self.sent += 1
-
-    def on_accepted(self, event):
-        self.confirmed += 1
-        if self.confirmed == self.total:
-            print("all messages confirmed")
-            event.connection.close()
-            self.acceptor.close()
-
-    def on_disconnected(self, event):
-        self.sent = self.confirmed
-
-parser = optparse.OptionParser(usage="usage: %prog [options]",
-                               description="Send messages to the supplied address.")
-parser.add_option("-a", "--address", default="localhost:5672/examples",
-                  help="address to which messages are sent (default %default)")
-parser.add_option("-m", "--messages", type="int", default=100,
-                  help="number of messages to send (default %default)")
-opts, args = parser.parse_args()
-
-try:
-    Container(Send(opts.address, opts.messages)).run()
-except KeyboardInterrupt: pass
diff --git a/examples/python/helloworld.py b/examples/python/helloworld.py
deleted file mode 100755
index 7a91aa4..0000000
--- a/examples/python/helloworld.py
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function, unicode_literals
-from proton import Message
-from proton.handlers import MessagingHandler
-from proton.reactor import Container
-
-class HelloWorld(MessagingHandler):
-    def __init__(self, server, address):
-        super(HelloWorld, self).__init__()
-        self.server = server
-        self.address = address
-
-    def on_start(self, event):
-        conn = event.container.connect(self.server)
-        event.container.create_receiver(conn, self.address)
-        event.container.create_sender(conn, self.address)
-
-    def on_sendable(self, event):
-        event.sender.send(Message(body="Hello World!"))
-        event.sender.close()
-
-    def on_message(self, event):
-        print(event.message.body)
-        event.connection.close()
-
-Container(HelloWorld("localhost:5672", "examples")).run()
diff --git a/examples/python/helloworld_blocking.py b/examples/python/helloworld_blocking.py
deleted file mode 100755
index 5a5ce6d..0000000
--- a/examples/python/helloworld_blocking.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-from proton import Message
-from proton.utils import BlockingConnection
-from proton.handlers import IncomingMessageHandler
-
-conn = BlockingConnection("localhost:5672")
-receiver = conn.create_receiver("examples")
-sender = conn.create_sender("examples")
-sender.send(Message(body="Hello World!"));
-msg = receiver.receive(timeout=30)
-print(msg.body)
-receiver.accept()
-conn.close()
-
diff --git a/examples/python/helloworld_direct.py b/examples/python/helloworld_direct.py
deleted file mode 100755
index 0292abe..0000000
--- a/examples/python/helloworld_direct.py
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function, unicode_literals
-from proton import Message
-from proton.handlers import MessagingHandler
-from proton.reactor import Container
-
-class HelloWorld(MessagingHandler):
-    def __init__(self, url):
-        super(HelloWorld, self).__init__()
-        self.url = url
-
-    def on_start(self, event):
-        self.acceptor = event.container.listen(self.url)
-        event.container.create_sender(self.url)
-
-    def on_sendable(self, event):
-        event.sender.send(Message(body="Hello World!"))
-        event.sender.close()
-
-    def on_message(self, event):
-        print(event.message.body)
-
-    def on_accepted(self, event):
-        event.connection.close()
-
-    def on_connection_closed(self, event):
-        self.acceptor.close()
-
-Container(HelloWorld("localhost:8888/examples")).run()
diff --git a/examples/python/helloworld_direct_tornado.py b/examples/python/helloworld_direct_tornado.py
deleted file mode 100755
index a3b017a..0000000
--- a/examples/python/helloworld_direct_tornado.py
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-from proton import Message
-from proton.handlers import MessagingHandler
-from proton_tornado import Container
-
-class HelloWorld(MessagingHandler):
-    def __init__(self, url):
-        super(HelloWorld, self).__init__()
-        self.url = url
-
-    def on_start(self, event):
-        self.acceptor = event.container.listen(self.url)
-        event.container.create_sender(self.url)
-
-    def on_sendable(self, event):
-        event.sender.send(Message(body="Hello World!"))
-        event.sender.close()
-
-    def on_message(self, event):
-        print(event.message.body)
-
-    def on_accepted(self, event):
-        event.connection.close()
-
-    def on_connection_closed(self, event):
-        self.acceptor.close()
-
-Container(HelloWorld("localhost:8888/examples")).run()
diff --git a/examples/python/helloworld_tornado.py b/examples/python/helloworld_tornado.py
deleted file mode 100755
index 0781bbb..0000000
--- a/examples/python/helloworld_tornado.py
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-from proton import Message
-from proton.handlers import MessagingHandler
-from proton_tornado import Container
-
-class HelloWorld(MessagingHandler):
-    def __init__(self, server, address):
-        super(HelloWorld, self).__init__()
-        self.server = server
-        self.address = address
-
-    def on_start(self, event):
-        conn = event.container.connect(self.server)
-        event.container.create_receiver(conn, self.address)
-        event.container.create_sender(conn, self.address)
-
-    def on_sendable(self, event):
-        event.sender.send(Message(body="Hello World!"))
-        event.sender.close()
-
-    def on_message(self, event):
-        print(event.message.body)
-        event.connection.close()
-
-Container(HelloWorld("localhost:5672", "examples")).run()
diff --git a/examples/python/messenger/README.txt b/examples/python/messenger/README.txt
deleted file mode 100644
index c26ba76..0000000
--- a/examples/python/messenger/README.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-This directory contains example scripts using the messenger API.
-
-  send.py - a simple example of using the messenger API to send messages
-  recv.py - a simple example of using the messenger API to receive messages
-
-Note that depending on the address passed into these scripts, you can
-use them in either a peer to peer or a brokered scenario.
-
-For brokered usage:
-
-  recv.py amqp://<broker>/<queue>
-
-  send.py -a amqp://<broker>/<queue> msg_1 ... msg_n
-
-For peer to peer usage:
-
-  # execute on <host> to receive messages from all local network interfaces
-  recv.py amqp://~0.0.0.0
-
-  send.py -a amqp://<host> msg_1 ... msg_n
diff --git a/examples/python/messenger/async.py b/examples/python/messenger/async.py
deleted file mode 100755
index a1b0292..0000000
--- a/examples/python/messenger/async.py
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-from __future__ import print_function
-import sys
-from proton import *
-
-class CallbackAdapter:
-
-    def __init__(self, messenger):
-        self.messenger = messenger
-        self.messenger.blocking = False
-        self.messenger.outgoing_window = 1024
-        self.messenger.incoming_window = 1024
-        # for application use
-        self.message = Message()
-        self._incoming_message = Message()
-        self.tracked = {}
-
-    def run(self):
-        self.running = True
-        self.messenger.start()
-        self.on_start()
-
-        while self.running:
-            self.messenger.work()
-            self._process()
-
-        self.messenger.stop()
-
-        while not self.messenger.stopped:
-            self.messenger.work()
-            self._process()
-
-        self.on_stop()
-
-    def stop(self):
-        self.running = False
-
-    def _process(self):
-        self._process_outgoing()
-        self._process_incoming()
-
-    def _process_outgoing(self):
-        for t, on_status in list(self.tracked.items()):
-            status = self.messenger.status(t)
-            if status != PENDING:
-                on_status(status)
-                self.messenger.settle(t)
-                del self.tracked[t]
-
-    def _process_incoming(self):
-        while self.messenger.incoming:
-            t = self.messenger.get(self._incoming_message)
-            try:
-                self.on_recv(self._incoming_message)
-                self.messenger.accept(t)
-            except:
-                ex = sys.exc_info()[1]
-                print("Exception:", ex)
-                self.messenger.reject(t)
-
-    def send(self, message, on_status=None):
-        t = self.messenger.put(message)
-        if on_status:
-            self.tracked[t] = on_status
diff --git a/examples/python/messenger/client.py b/examples/python/messenger/client.py
deleted file mode 100755
index 62fc16e..0000000
--- a/examples/python/messenger/client.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-from __future__ import print_function
-import sys, optparse
-from proton import *
-
-parser = optparse.OptionParser(usage="usage: %prog <addr> <subject>",
-                               description="simple message server")
-
-parser.add_option("-r", "--reply_to", default="~/replies",
-                  help="address: [amqp://]<domain>[/<name>] (default %default)")
-
-opts, args = parser.parse_args()
-
-if len(args) != 2:
-  parser.error("incorrect number of arguments")
-
-address, subject = args
-
-mng = Messenger()
-mng.start()
-
-msg = Message()
-msg.address = address
-msg.subject = subject
-msg.reply_to = opts.reply_to
-
-mng.put(msg)
-mng.send()
-
-if opts.reply_to[:2] == "~/":
-  mng.recv(1)
-  try:
-    mng.get(msg)
-    print(msg.address, msg.subject)
-  except Exception as e:
-    print(e)
-
-mng.stop()
diff --git a/examples/python/messenger/recv.py b/examples/python/messenger/recv.py
deleted file mode 100755
index 5771bd7..0000000
--- a/examples/python/messenger/recv.py
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-from __future__ import print_function
-import sys, optparse
-from proton import *
-
-parser = optparse.OptionParser(usage="usage: %prog [options] <addr_1> ... <addr_n>",
-                               description="simple message receiver")
-parser.add_option("-c", "--certificate", help="path to certificate file")
-parser.add_option("-k", "--private-key", help="path to private key file")
-parser.add_option("-p", "--password", help="password for private key file")
-
-opts, args = parser.parse_args()
-
-if not args:
-  args = ["amqp://~0.0.0.0"]
-
-mng = Messenger()
-mng.certificate=opts.certificate
-mng.private_key=opts.private_key
-mng.password=opts.password
-mng.start()
-
-for a in args:
-  mng.subscribe(a)
-
-msg = Message()
-while True:
-  mng.recv()
-  while mng.incoming:
-    try:
-      mng.get(msg)
-    except Exception as e:
-      print(e)
-    else:
-      print(msg.address, msg.subject or "(no subject)", msg.properties, msg.body)
-
-mng.stop()
diff --git a/examples/python/messenger/recv_async.py b/examples/python/messenger/recv_async.py
deleted file mode 100755
index b38c31a..0000000
--- a/examples/python/messenger/recv_async.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-from __future__ import print_function
-import sys, optparse
-from async import *
-
-parser = optparse.OptionParser(usage="usage: %prog [options] <addr_1> ... <addr_n>",
-                               description="simple message receiver")
-
-opts, args = parser.parse_args()
-
-if not args:
-  args = ["amqp://~0.0.0.0"]
-
-class App(CallbackAdapter):
-
-    def on_start(self):
-        print("Started")
-        for a in args:
-            print("Subscribing to:", a)
-            self.messenger.subscribe(a)
-        self.messenger.recv()
-
-    def on_recv(self, msg):
-        print("Received:", msg)
-        if msg.body == "die":
-            self.stop()
-        if msg.reply_to:
-            self.message.clear()
-            self.message.address = msg.reply_to
-            self.message.body = "Reply for: %s" % msg.body
-            print("Replied:", self.message)
-            self.send(self.message)
-
-    def on_stop(self):
-        print("Stopped")
-
-a = App(Messenger())
-a.run()
diff --git a/examples/python/messenger/send.py b/examples/python/messenger/send.py
deleted file mode 100755
index c274656..0000000
--- a/examples/python/messenger/send.py
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-from __future__ import print_function
-import sys, optparse
-from proton import *
-
-parser = optparse.OptionParser(usage="usage: %prog [options] <msg_1> ... <msg_n>",
-                               description="simple message sender")
-parser.add_option("-a", "--address", default="amqp://0.0.0.0",
-                  help="address: //<domain>[/<name>] (default %default)")
-
-opts, args = parser.parse_args()
-if not args:
-  args = ["Hello World!"]
-
-mng = Messenger()
-mng.start()
-
-msg = Message()
-for m in args:
-  msg.address = opts.address
-  msg.body = str(m)
-  mng.put(msg)
-
-mng.send()
-print("sent:", ", ".join(args))
-
-mng.stop()
diff --git a/examples/python/messenger/send_async.py b/examples/python/messenger/send_async.py
deleted file mode 100755
index 50f7a68..0000000
--- a/examples/python/messenger/send_async.py
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-from __future__ import print_function
-import sys, optparse
-from async import *
-
-parser = optparse.OptionParser(usage="usage: %prog [options] <msg_1> ... <msg_n>",
-                               description="simple message sender")
-parser.add_option("-a", "--address", default="amqp://0.0.0.0",
-                  help="address: //<domain>[/<name>] (default %default)")
-parser.add_option("-r", "--reply_to", help="reply_to: //<domain>[/<name>]")
-
-opts, args = parser.parse_args()
-if not args:
-  args = ["Hello World!"]
-
-class App(CallbackAdapter):
-
-    def on_start(self):
-        print("Started")
-        self.message.clear()
-        self.message.address = opts.address
-        self.message.reply_to = opts.reply_to
-        for a in args:
-            self.message.body = a
-            self.send(self.message, self.on_status)
-
-        if opts.reply_to:
-            self.messenger.recv()
-
-    def on_status(self, status):
-        print("Status:", status)
-        if not opts.reply_to or opts.reply_to[0] != "~":
-            args.pop(0)
-            if not args: self.stop()
-
-    def on_recv(self, msg):
-        print("Received:", msg)
-        if opts.reply_to and opts.reply_to[0] == "~":
-            args.pop(0)
-            if not args: self.stop()
-
-    def on_stop(self):
-        print("Stopped")
-
-a = App(Messenger())
-a.run()
diff --git a/examples/python/messenger/server.py b/examples/python/messenger/server.py
deleted file mode 100755
index 8c25879..0000000
--- a/examples/python/messenger/server.py
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-from __future__ import print_function
-import sys, optparse
-from proton import *
-
-parser = optparse.OptionParser(usage="usage: %prog <addr_1> ... <addr_n>",
-                               description="simple message server")
-
-opts, args = parser.parse_args()
-
-if not args:
-  args = ["amqp://~0.0.0.0"]
-
-mng = Messenger()
-mng.start()
-
-for a in args:
-  mng.subscribe(a)
-
-def dispatch(request, response):
-  if request.subject:
-    response.subject = "Re: %s" % request.subject
-  response.properties = request.properties
-  print("Dispatched %s %s" % (request.subject, request.properties))
-
-msg = Message()
-reply = Message()
-
-while True:
-  if mng.incoming < 10:
-    mng.recv(10)
-
-  if mng.incoming > 0:
-    mng.get(msg)
-    if msg.reply_to:
-      print(msg.reply_to)
-      reply.address = msg.reply_to
-      reply.correlation_id = msg.correlation_id
-      reply.body = msg.body
-    dispatch(msg, reply)
-    mng.put(reply)
-    mng.send()
-
-mng.stop()
diff --git a/examples/python/proton-server.conf b/examples/python/proton-server.conf
deleted file mode 100644
index 6d236fe..0000000
--- a/examples/python/proton-server.conf
+++ /dev/null
@@ -1 +0,0 @@
-mech_list: EXTERNAL ANONYMOUS
diff --git a/examples/python/proton_server.py b/examples/python/proton_server.py
deleted file mode 100755
index 9351f55..0000000
--- a/examples/python/proton_server.py
+++ /dev/null
@@ -1,51 +0,0 @@
-from __future__ import print_function
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from proton import Message
-from proton.reactor import Container
-from proton.handlers import MessagingHandler
-
-class Server(MessagingHandler):
-    def __init__(self, host, address):
-        super(Server, self).__init__()
-        self.container = Container(self)
-        self.conn = self.container.connect(host)
-        self.receiver = self.container.create_receiver(self.conn, address)
-        self.sender = self.container.create_sender(self.conn, None)
-
-    def on_message(self, event):
-        self.on_request(event.message.body, event.message.reply_to)
-
-    def on_connection_close(self, endpoint, error):
-        if error: print("Closed due to %s" % error)
-        self.conn.close()
-
-    def run(self):
-        self.container.run()
-
-    def send(self, response, reply_to):
-        msg = Message(body=response)
-        if self.sender:
-            msg.address = reply_to
-        self.sender.send(msg)
-
-    def on_request(self, request, reply_to):
-        pass
-
diff --git a/examples/python/proton_tornado.py b/examples/python/proton_tornado.py
deleted file mode 100755
index 7c787d5..0000000
--- a/examples/python/proton_tornado.py
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-import tornado.ioloop
-from proton.reactor import Container as BaseContainer
-from proton.handlers import IOHandler
-
-class TornadoLoopHandler:
-
-    def __init__(self, loop=None, handler_base=None):
-        self.loop = loop or tornado.ioloop.IOLoop.instance()
-        self.io = handler_base or IOHandler()
-        self.count = 0
-
-    def on_reactor_init(self, event):
-        self.reactor = event.reactor
-
-    def on_reactor_quiesced(self, event):
-        event.reactor.yield_()
-
-    def on_unhandled(self, name, event):
-        event.dispatch(self.io)
-
-    def _events(self, sel):
-        events = self.loop.ERROR
-        if sel.reading:
-            events |= self.loop.READ
-        if sel.writing:
-            events |= self.loop.WRITE
-        return events
-
-    def _schedule(self, sel):
-        if sel.deadline:
-            self.loop.add_timeout(sel.deadline, lambda: self._expired(sel))
-
-    def _expired(self, sel):
-        sel.expired()
-
-    def _process(self):
-        self.reactor.process()
-        if not self.reactor.quiesced:
-            self.loop.add_callback(self._process)
-
-    def _callback(self, sel, events):
-        if self.loop.READ & events:
-            sel.readable()
-        if self.loop.WRITE & events:
-            sel.writable()
-        self._process()
-
-    def on_selectable_init(self, event):
-        sel = event.context
-        if sel.fileno() >= 0:
-            self.loop.add_handler(sel.fileno(), lambda fd, events: self._callback(sel, events), self._events(sel))
-        self._schedule(sel)
-        self.count += 1
-
-    def on_selectable_updated(self, event):
-        sel = event.context
-        if sel.fileno() > 0:
-            self.loop.update_handler(sel.fileno(), self._events(sel))
-        self._schedule(sel)
-
-    def on_selectable_final(self, event):
-        sel = event.context
-        if sel.fileno() > 0:
-            self.loop.remove_handler(sel.fileno())
-        sel.release()
-        self.count -= 1
-        if self.count == 0:
-            self.loop.add_callback(self._stop)
-
-    def _stop(self):
-        self.reactor.stop()
-        self.loop.stop()
-
-class Container(object):
-    def __init__(self, *handlers, **kwargs):
-        self.tornado_loop = kwargs.get('loop', tornado.ioloop.IOLoop.instance())
-        kwargs['global_handler'] = TornadoLoopHandler(self.tornado_loop, kwargs.get('handler_base', None))
-        self.container = BaseContainer(*handlers, **kwargs)
-
-    def initialise(self):
-        self.container.start()
-        self.container.process()
-
-    def run(self):
-        self.initialise()
-        self.tornado_loop.start()
-
-    def touch(self):
-        self._process()
-
-    def _process(self):
-        self.container.process()
-        if not self.container.quiesced:
-            self.tornado_loop.add_callback(self._process)
diff --git a/examples/python/queue_browser.py b/examples/python/queue_browser.py
deleted file mode 100755
index 34d2377..0000000
--- a/examples/python/queue_browser.py
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-from proton.reactor import Container, Copy
-from proton.handlers import MessagingHandler
-
-class Recv(MessagingHandler):
-    def __init__(self):
-        super(Recv, self).__init__()
-
-    def on_start(self, event):
-        conn = event.container.connect("localhost:5672")
-        event.container.create_receiver(conn, "examples", options=Copy())
-
-    def on_message(self, event):
-        print(event.message)
-        if event.receiver.queued == 0 and event.receiver.drained:
-            event.connection.close()
-
-try:
-    Container(Recv()).run()
-except KeyboardInterrupt: pass
-
-
-
diff --git a/examples/python/reactor/README.md b/examples/python/reactor/README.md
deleted file mode 100644
index b08fdbd..0000000
--- a/examples/python/reactor/README.md
+++ /dev/null
@@ -1,34 +0,0 @@
-The examples in this directory provide a basic introduction to the
-proton reactor API and are best viewed in the order presented below.
-
-The examples contain comments that explain things in a tutorial-style
-manner. At some point soon this content will be pulled out into a
-proper tutorial that references the relevant code snippets from these
-examples. Until then please bear with this clumsy style of
-presentation.
-
-This API is present in C as well and most of these examples will
-transliterate into C in a fairly straightforward way.
-
-  - hello-world.py
-  - goodbye-world.py
-
-  - scheduling.py
-  - counter.py
-  - count-randomly.py
-
-  - unhandled.py
-  - reactor-logger.py
-  - global-logger.py
-  - delegates.py
-
-  - handlers.py
-
-  - echo.py
-  - cat.py
-
-  - send.py
-  - recv.py
-
-  - tornado-hello-world.py
-  - tornado-send.py
diff --git a/examples/python/reactor/cat.py b/examples/python/reactor/cat.py
deleted file mode 100755
index 82ebd27..0000000
--- a/examples/python/reactor/cat.py
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import sys, os
-from proton.reactor import Reactor
-
-class Echo:
-
-    def __init__(self, source):
-        self.source = source
-
-    def on_selectable_init(self, event):
-        sel = event.context # XXX: no selectable property yet
-
-        # We can configure a selectable with any file descriptor we want.
-        sel.fileno(self.source.fileno())
-        # Ask to be notified when the file is readable.
-        sel.reading = True
-        event.reactor.update(sel)
-
-    def on_selectable_readable(self, event):
-        sel = event.context
-
-        # The on_selectable_readable event tells us that there is data
-        # to be read, or the end of stream has been reached.
-        data = os.read(sel.fileno(), 1024)
-        if data:
-            print(data, end=' ')
-        else:
-            sel.terminate()
-            event.reactor.update(sel)
-
-class Program:
-
-    def on_reactor_init(self, event):
-        event.reactor.selectable(Echo(open(sys.argv[1])))
-
-r = Reactor(Program())
-r.run()
diff --git a/examples/python/reactor/count-randomly.py b/examples/python/reactor/count-randomly.py
deleted file mode 100755
index fb3709a..0000000
--- a/examples/python/reactor/count-randomly.py
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import time, random
-from proton.reactor import Reactor
-
-# Let's try to modify our counter example. In addition to counting to
-# 10 in quarter second intervals, let's also print out a random number
-# every half second. This is not a super easy thing to express in a
-# purely sequential program, but not so difficult using events.
-
-class Counter:
-
-    def __init__(self, limit):
-        self.limit = limit
-        self.count = 0
-
-    def on_timer_task(self, event):
-        self.count += 1
-        print(self.count)
-        if not self.done():
-            event.reactor.schedule(0.25, self)
-
-    # add a public API to check for doneness
-    def done(self):
-        return self.count >= self.limit
-
-class Program:
-
-    def on_reactor_init(self, event):
-        self.start = time.time()
-        print("Hello, World!")
-
-        # Save the counter instance in an attribute so we can refer to
-        # it later.
-        self.counter = Counter(10)
-        event.reactor.schedule(0.25, self.counter)
-
-        # Now schedule another event with a different handler. Note
-        # that the timer tasks go to separate handlers, and they don't
-        # interfere with each other.
-        event.reactor.schedule(0.5, self)
-
-    def on_timer_task(self, event):
-        # keep on shouting until we are done counting
-        print("Yay, %s!" % random.randint(10, 100))
-        if not self.counter.done():
-            event.reactor.schedule(0.5, self)
-
-    def on_reactor_final(self, event):
-        print("Goodbye, World! (after %s long seconds)" % (time.time() - self.start))
-
-# In hello-world.py we said the reactor exits when there are no more
-# events to process. While this is true, it's not actually complete.
-# The reactor exits when there are no more events to process and no
-# possibility of future events arising. For that reason the reactor
-# will keep running until there are no more scheduled events and then
-# exit.
-r = Reactor(Program())
-r.run()
diff --git a/examples/python/reactor/counter.py b/examples/python/reactor/counter.py
deleted file mode 100755
index 7c8167a..0000000
--- a/examples/python/reactor/counter.py
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import time
-from proton.reactor import Reactor
-
-class Counter:
-
-    def __init__(self, limit):
-        self.limit = limit
-        self.count = 0
-
-    def on_timer_task(self, event):
-        self.count += 1
-        print(self.count)
-        if self.count < self.limit:
-            # A recurring task can be acomplished by just scheduling
-            # another event.
-            event.reactor.schedule(0.25, self)
-
-class Program:
-
-    def on_reactor_init(self, event):
-        self.start = time.time()
-        print("Hello, World!")
-
-        # Note that unlike the previous scheduling example, we pass in
-        # a separate object for the handler. This means that the timer
-        # event we just scheduled will not be seen by Program as it is
-        # being handled by the Counter instance we create.
-        event.reactor.schedule(0.25, Counter(10))
-
-    def on_reactor_final(self, event):
-        print("Goodbye, World! (after %s long seconds)" % (time.time() - self.start))
-
-# In hello-world.py we said the reactor exits when there are no more
-# events to process. While this is true, it's not actually complete.
-# The reactor exits when there are no more events to process and no
-# possibility of future events arising. For that reason the reactor
-# will keep running until there are no more scheduled events and then
-# exit.
-r = Reactor(Program())
-r.run()
diff --git a/examples/python/reactor/delegates.py b/examples/python/reactor/delegates.py
deleted file mode 100755
index 1a8e1e9..0000000
--- a/examples/python/reactor/delegates.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import time
-from proton.reactor import Reactor
-
-# Events know how to dispatch themselves to handlers. By combining
-# this with on_unhandled, you can provide a kind of inheritance
-# between handlers using delegation.
-
-class Hello:
-
-    def on_reactor_init(self, event):
-        print("Hello, World!")
-
-class Goodbye:
-
-    def on_reactor_final(self, event):
-        print("Goodbye, World!")
-
-class Program:
-
-    def __init__(self, *delegates):
-        self.delegates = delegates
-
-    def on_unhandled(self, name, event):
-        for d in self.delegates:
-            event.dispatch(d)
-
-r = Reactor(Program(Hello(), Goodbye()))
-r.run()
diff --git a/examples/python/reactor/echo.py b/examples/python/reactor/echo.py
deleted file mode 100755
index 17529d9..0000000
--- a/examples/python/reactor/echo.py
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import sys, os
-from proton.reactor import Reactor
-
-class Echo:
-
-    def __init__(self, source):
-        self.source = source
-
-    def on_selectable_init(self, event):
-        sel = event.context # XXX: no selectable property yet
-
-        # We can configure a selectable with any file descriptor we want.
-        sel.fileno(self.source.fileno())
-        # Ask to be notified when the file is readable.
-        sel.reading = True
-        event.reactor.update(sel)
-
-    def on_selectable_readable(self, event):
-        sel = event.context
-
-        # The on_selectable_readable event tells us that there is data
-        # to be read, or the end of stream has been reached.
-        data = os.read(sel.fileno(), 1024)
-        if data:
-            print(data, end=' ')
-        else:
-            sel.terminate()
-            event.reactor.update(sel)
-
-class Program:
-
-    def on_reactor_init(self, event):
-        # Every selectable is a possible source of future events. Our
-        # selectable stays alive until it reads the end of stream
-        # marker. This will keep the whole reactor running until we
-        # type Control-D.
-        print("Type whatever you want and then use Control-D to exit:")
-        event.reactor.selectable(Echo(sys.stdin))
-
-r = Reactor(Program())
-r.run()
diff --git a/examples/python/reactor/global-logger.py b/examples/python/reactor/global-logger.py
deleted file mode 100755
index 3cbe11c..0000000
--- a/examples/python/reactor/global-logger.py
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import time
-from proton.reactor import Reactor
-
-# Not every event goes to the reactor's event handler. If we have a
-# separate handler for something like a scheduled task, then those
-# events aren't logged by the logger associated with the reactor's
-# handler. Sometimes this is useful if you don't want to see them, but
-# sometimes you want the global picture.
-
-class Logger:
-
-    def on_unhandled(self, name, event):
-        print("LOG:", name, event)
-
-class Task:
-
-    def on_timer_task(self, event):
-        print("Mission accomplished!")
-
-class Program:
-
-    def on_reactor_init(self, event):
-        print("Hello, World!")
-        event.reactor.schedule(0, Task())
-
-    def on_reactor_final(self, event):
-        print("Goodbye, World!")
-
-r = Reactor(Program())
-
-# In addition to having a regular handler, the reactor also has a
-# global handler that sees every event. By adding the Logger to the
-# global handler instead of the regular handler, we can log every
-# single event that occurs in the system regardless of whether or not
-# there are specific handlers associated with the objects that are the
-# target of those events.
-r.global_handler.add(Logger())
-r.run()
diff --git a/examples/python/reactor/goodbye-world.py b/examples/python/reactor/goodbye-world.py
deleted file mode 100755
index f251c8a..0000000
--- a/examples/python/reactor/goodbye-world.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-from proton.reactor import Reactor
-
-# So far the reactive hello-world doesn't look too different from a
-# regular old non-reactive hello-world. The on_reactor_init method can
-# be used roughly as a 'main' method would. A program that only uses
-# that one event, however, isn't going to be very reactive. By using
-# other events, we can write a fully reactive program.
-
-class Program:
-
-    # As before we handle the reactor init event.
-    def on_reactor_init(self, event):
-        print("Hello, World!")
-
-    # In addition to an initial event, the reactor also produces an
-    # event when it is about to exit. This may not behave much
-    # differently than just putting the goodbye print statement inside
-    # on_reactor_init, but as we grow our program, this piece of it
-    # will always be what happens last, and will always happen
-    # regardless of what other paths the main logic of our program
-    # might take.
-    def on_reactor_final(self, event):
-        print("Goodbye, World!")
-
-r = Reactor(Program())
-r.run()
diff --git a/examples/python/reactor/handlers.py b/examples/python/reactor/handlers.py
deleted file mode 100755
index ee8d807..0000000
--- a/examples/python/reactor/handlers.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import time
-from proton.reactor import Reactor
-
-
-class World:
-
-    def on_reactor_init(self, event):
-        print("World!")
-
-class Goodbye:
-
-    def on_reactor_final(self, event):
-        print("Goodbye, World!")
-
-class Hello:
-
-    def __init__(self):
-        # When an event dispatches itself to a handler, it also checks
-        # if that handler has a "handlers" attribute and dispatches
-        # the event to any children.
-        self.handlers = [World(), Goodbye()]
-
-    # The parent handler always receives the event first.
-    def on_reactor_init(self, event):
-        print("Hello", end=' ')
-
-r = Reactor(Hello())
-r.run()
diff --git a/examples/python/reactor/hello-world.py b/examples/python/reactor/hello-world.py
deleted file mode 100755
index f1708db..0000000
--- a/examples/python/reactor/hello-world.py
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-from proton.reactor import Reactor
-
-# The proton reactor provides a general purpose event processing
-# library for writing reactive programs. A reactive program is defined
-# by a set of event handlers. An event handler is just any class or
-# object that defines the "on_<event>" methods that it cares to
-# handle.
-
-class Program:
-
-    # The reactor init event is produced by the reactor itself when it
-    # starts.
-    def on_reactor_init(self, event):
-        print("Hello, World!")
-
-# When you construct a reactor, you give it a handler.
-r = Reactor(Program())
-
-# When you call run, the reactor will process events. The reactor init
-# event is what kicks off everything else. When the reactor has no
-# more events to process, it exits.
-r.run()
diff --git a/examples/python/reactor/reactor-logger.py b/examples/python/reactor/reactor-logger.py
deleted file mode 100755
index 2d3f9de..0000000
--- a/examples/python/reactor/reactor-logger.py
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import time
-from proton.reactor import Reactor
-
-class Logger:
-
-    def on_unhandled(self, name, event):
-        print("LOG:", name, event)
-
-class Program:
-
-    def on_reactor_init(self, event):
-        print("Hello, World!")
-
-    def on_reactor_final(self, event):
-        print("Goodbye, World!")
-
-# You can pass multiple handlers to a reactor when you construct it.
-# Each of these handlers will see every event the reactor sees. By
-# combining this with on_unhandled, you can log each event that goes
-# to the reactor.
-r = Reactor(Program(), Logger())
-r.run()
-
-# Note that if you wanted to add the logger later, you could also
-# write the above as below. All arguments to the reactor are just
-# added to the default handler for the reactor.
-
-def logging_enabled():
-    return False
-
-r = Reactor(Program())
-if logging_enabled():
-    r.handler.add(Logger())
-r.run()
diff --git a/examples/python/reactor/recv.py b/examples/python/reactor/recv.py
deleted file mode 100755
index c6f07f1..0000000
--- a/examples/python/reactor/recv.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-from proton import Message
-from proton.reactor import Reactor
-from proton.handlers import CHandshaker, CFlowController
-
-class Program:
-
-    def __init__(self):
-        self.handlers = [CHandshaker(), CFlowController()]
-        self.message = Message()
-
-    def on_reactor_init(self, event):
-        # Create an amqp acceptor.
-        event.reactor.acceptor("0.0.0.0", 5672)
-        # There is an optional third argument to the Reactor.acceptor
-        # call. Using it, we could supply a handler here that would
-        # become the handler for all accepted connections. If we omit
-        # it, the reactor simply inherets all the connection events.
-
-    def on_delivery(self, event):
-        # XXX: we could make rcv.recv(self.message) work here to
-        # compliment the similar thing on send
-        rcv = event.receiver
-        if rcv and self.message.recv(rcv):
-            print(self.message)
-            event.delivery.settle()
-
-r = Reactor(Program())
-r.run()
diff --git a/examples/python/reactor/scheduling.py b/examples/python/reactor/scheduling.py
deleted file mode 100755
index 8956821..0000000
--- a/examples/python/reactor/scheduling.py
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import time
-from proton.reactor import Reactor
-
-class Program:
-
-    def on_reactor_init(self, event):
-        self.start = time.time()
-        print("Hello, World!")
-
-        # We can schedule a task event for some point in the future.
-        # This will cause the reactor to stick around until it has a
-        # chance to process the event.
-
-        # The first argument is the delay. The second argument is the
-        # handler for the event. We are just using self for now, but
-        # we could pass in another object if we wanted.
-        task = event.reactor.schedule(1.0, self)
-
-        # We can ignore the task if we want to, but we can also use it
-        # to pass stuff to the handler.
-        task.something_to_say = "Yay"
-
-    def on_timer_task(self, event):
-        task = event.context # xxx: don't have a task property on event yet
-        print(task.something_to_say, "my task is complete!")
-
-    def on_reactor_final(self, event):
-        print("Goodbye, World! (after %s long seconds)" % (time.time() - self.start))
-
-r = Reactor(Program())
-r.run()
diff --git a/examples/python/reactor/send.py b/examples/python/reactor/send.py
deleted file mode 100755
index 4356da1..0000000
--- a/examples/python/reactor/send.py
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-import sys
-from proton import Message, Url
-from proton.reactor import Reactor
-from proton.handlers import CHandshaker
-
-# This is a send in terms of low level AMQP events. There are handlers
-# that can streamline this significantly if you don't want to worry
-# about all the details, but it is useful to see how the AMQP engine
-# classes interact with handlers and events.
-
-class Send:
-
-    def __init__(self, message, target):
-        self.message = message
-        self.target = target if target is not None else "examples"
-        # Use the handlers property to add some default handshaking
-        # behaviour.
-        self.handlers = [CHandshaker()]
-
-    def on_connection_init(self, event):
-        conn = event.connection
-
-        # Every session or link could have their own handler(s) if we
-        # wanted simply by setting the "handler" slot on the
-        # given session or link.
-        ssn = conn.session()
-
-        # If a link doesn't have an event handler, the events go to
-        # its parent session. If the session doesn't have a handler
-        # the events go to its parent connection. If the connection
-        # doesn't have a handler, the events go to the reactor.
-        snd = ssn.sender("sender")
-        snd.target.address = self.target
-        conn.open()
-        ssn.open()
-        snd.open()
-
-    def on_transport_error(self, event):
-        print event.transport.condition
-
-    def on_link_flow(self, event):
-        snd = event.sender
-        if snd.credit > 0:
-            dlv = snd.send(self.message)
-            dlv.settle()
-            snd.close()
-            snd.session.close()
-            snd.connection.close()
-
-class Program:
-
-    def __init__(self, url, content):
-        self.url = url
-        self.content = content
-
-    def on_reactor_init(self, event):
-        # You can use the connection method to create AMQP connections.
-
-        # This connection's handler is the Send object. All the events
-        # for this connection will go to the Send object instead of
-        # going to the reactor. If you were to omit the Send object,
-        # all the events would go to the reactor.
-        event.reactor.connection_to_host(self.url.host, self.url.port,
-                                         Send(Message(self.content),
-                                              self.url.path))
-
-args = sys.argv[1:]
-url = Url(args.pop() if args else "localhost:5672/examples")
-content = args.pop() if args else "Hello World!"
-
-r = Reactor(Program(url, content))
-r.run()
diff --git a/examples/python/reactor/tornado-hello-world.py b/examples/python/reactor/tornado-hello-world.py
deleted file mode 100755
index d06cd1b..0000000
--- a/examples/python/reactor/tornado-hello-world.py
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import tornado.ioloop
-from tornado_app import TornadoApp
-
-# The proton reactor provides a general purpose event processing
-# library for writing reactive programs. A reactive program is defined
-# by a set of event handlers. An event handler is just any class or
-# object that defines the "on_<event>" methods that it cares to
-# handle.
-
-class Program:
-
-    # The reactor init event is produced by the reactor itself when it
-    # starts.
-    def on_reactor_init(self, event):
-        print("Hello, World!")
-
-# The TornadoApp integrates a Reactor into tornado's ioloop.
-TornadoApp(Program())
-
-# Now the tornado main loop will behave like the reactor's main loop.
-tornado.ioloop.IOLoop.instance().start()
diff --git a/examples/python/reactor/tornado-send.py b/examples/python/reactor/tornado-send.py
deleted file mode 100755
index c69876a..0000000
--- a/examples/python/reactor/tornado-send.py
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-import sys, tornado.ioloop
-from tornado_app import TornadoApp
-from proton import Message, Url
-from proton.handlers import CHandshaker
-
-class Send:
-
-    def __init__(self, message, target):
-        self.message = message
-        self.target = target if target is not None else "examples"
-        # Use the handlers property to add some default handshaking
-        # behaviour.
-        self.handlers = [CHandshaker()]
-
-    def on_connection_init(self, event):
-        conn = event.connection
-
-        # Every session or link could have their own handler(s) if we
-        # wanted simply by setting the "handler" slot on the
-        # given session or link.
-        ssn = conn.session()
-
-        # If a link doesn't have an event handler, the events go to
-        # its parent session. If the session doesn't have a handler
-        # the events go to its parent connection. If the connection
-        # doesn't have a handler, the events go to the reactor.
-        snd = ssn.sender("sender")
-        snd.target.address = self.target
-        conn.open()
-        ssn.open()
-        snd.open()
-
-    def on_link_flow(self, event):
-        snd = event.sender
-        if snd.credit > 0:
-            dlv = snd.send(self.message)
-            dlv.settle()
-            snd.close()
-            snd.session.close()
-            snd.connection.close()
-
-class Program:
-
-    def __init__(self, url, content):
-        self.url = url
-        self.content = content
-
-    def on_reactor_init(self, event):
-        # You can use the connection method to create AMQP connections.
-
-        # This connection's handler is the Send object. All the events
-        # for this connection will go to the Send object instead of
-        # going to the reactor. If you were to omit the Send object,
-        # all the events would go to the reactor.
-        event.reactor.connection_to_host(self.url.host, self.url.port,
-                                         Send(Message(self.content),
-                                              self.url.path))
-
-args = sys.argv[1:]
-url = Url(args.pop() if args else "localhost:5672/examples")
-content = args.pop() if args else "Hello World!"
-
-TornadoApp(Program(url, content))
-tornado.ioloop.IOLoop.instance().start()
diff --git a/examples/python/reactor/tornado_app.py b/examples/python/reactor/tornado_app.py
deleted file mode 100644
index 966ac8b..0000000
--- a/examples/python/reactor/tornado_app.py
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-import tornado.ioloop
-from proton.reactor import Reactor
-from proton.handlers import IOHandler
-
-class TornadoApp:
-
-    def __init__(self, *args):
-        self.reactor = Reactor(*args)
-        self.reactor.global_handler = self
-        self.io = IOHandler()
-        self.loop = tornado.ioloop.IOLoop.instance()
-        self.count = 0
-        self.reactor.start()
-        self.reactor.process()
-
-    def on_reactor_quiesced(self, event):
-        event.reactor.yield_()
-
-    def on_unhandled(self, name, event):
-        event.dispatch(self.io)
-
-    def _events(self, sel):
-        events = self.loop.ERROR
-        if sel.reading:
-            events |= self.loop.READ
-        if sel.writing:
-            events |= self.loop.WRITE
-        return events
-
-    def _schedule(self, sel):
-        if sel.deadline:
-            self.loop.add_timeout(sel.deadline, lambda: self.expired(sel))
-
-    def _expired(self, sel):
-        sel.expired()
-
-    def _process(self):
-        self.reactor.process()
-        if not self.reactor.quiesced:
-            self.loop.add_callback(self._process)
-
-    def _callback(self, sel, events):
-        if self.loop.READ & events:
-            sel.readable()
-        if self.loop.WRITE & events:
-            sel.writable()
-        self._process()
-
-    def on_selectable_init(self, event):
-        sel = event.context
-        if sel.fileno() >= 0:
-            self.loop.add_handler(sel.fileno(), lambda fd, events: self._callback(sel, events), self._events(sel))
-        self._schedule(sel)
-        self.count += 1
-
-    def on_selectable_updated(self, event):
-        sel = event.context
-        if sel.fileno() > 0:
-            self.loop.update_handler(sel.fileno(), self._events(sel))
-        self._schedule(sel)
-
-    def on_selectable_final(self, event):
-        sel = event.context
-        if sel.fileno() > 0:
-            self.loop.remove_handler(sel.fileno())
-        sel.release()
-        self.count -= 1
-        if self.count == 0:
-            self.loop.add_callback(self._stop)
-
-    def _stop(self):
-        self.reactor.stop()
-        self.loop.stop()
diff --git a/examples/python/reactor/unhandled.py b/examples/python/reactor/unhandled.py
deleted file mode 100755
index 9ab2212..0000000
--- a/examples/python/reactor/unhandled.py
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import time
-from proton.reactor import Reactor
-
-class Program:
-
-    # If an event occurs and its handler doesn't have an on_<event>
-    # method, the reactor will attempt to call the on_unhandled method
-    # if it exists. This can be useful not only for debugging, but for
-    # logging and for delegating/inheritance.
-    def on_unhandled(self, name, event):
-        print(name, event)
-
-r = Reactor(Program())
-r.run()
diff --git a/examples/python/recurring_timer.py b/examples/python/recurring_timer.py
deleted file mode 100755
index b59dbe1..0000000
--- a/examples/python/recurring_timer.py
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-from proton.reactor import Container, Handler
-
-class Recurring(Handler):
-    def __init__(self, period):
-        self.period = period
-
-    def on_reactor_init(self, event):
-        self.container = event.reactor
-        self.container.schedule(self.period, self)
-
-    def on_timer_task(self, event):
-        print("Tick...")
-        self.container.schedule(self.period, self)
-
-try:
-    container = Container(Recurring(1.0))
-    container.run()
-except KeyboardInterrupt:
-    container.stop()
-    print()
-
-
diff --git a/examples/python/recurring_timer_tornado.py b/examples/python/recurring_timer_tornado.py
deleted file mode 100755
index 07ebd26..0000000
--- a/examples/python/recurring_timer_tornado.py
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import time
-from proton.reactor import Handler
-from proton_tornado import TornadoLoop
-
-class Recurring(Handler):
-    def __init__(self, period):
-        self.period = period
-
-    def on_start(self, event):
-        self.container = event.container
-        self.container.schedule(time.time() + self.period, subject=self)
-
-    def on_timer(self, event):
-        print("Tick...")
-        self.container.schedule(time.time() + self.period, subject=self)
-
-try:
-    container = TornadoLoop(Recurring(1.0))
-    container.run()
-except KeyboardInterrupt:
-    container.stop()
-    print()
-
-
diff --git a/examples/python/selected_recv.py b/examples/python/selected_recv.py
deleted file mode 100755
index dc062d5..0000000
--- a/examples/python/selected_recv.py
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-from proton.reactor import Container, Selector
-from proton.handlers import MessagingHandler
-
-class Recv(MessagingHandler):
-    def __init__(self):
-        super(Recv, self).__init__()
-
-    def on_start(self, event):
-        conn = event.container.connect("localhost:5672")
-        event.container.create_receiver(conn, "examples", options=Selector("colour = 'green'"))
-
-    def on_message(self, event):
-        print(event.message.body)
-
-try:
-    Container(Recv()).run()
-except KeyboardInterrupt: pass
-
-
-
diff --git a/examples/python/server.py b/examples/python/server.py
deleted file mode 100755
index 8cebaad..0000000
--- a/examples/python/server.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-from proton import Message
-from proton.handlers import MessagingHandler
-from proton.reactor import Container
-
-class Server(MessagingHandler):
-    def __init__(self, url, address):
-        super(Server, self).__init__()
-        self.url = url
-        self.address = address
-
-    def on_start(self, event):
-        print("Listening on", self.url)
-        self.container = event.container
-        self.conn = event.container.connect(self.url)
-        self.receiver = event.container.create_receiver(self.conn, self.address)
-        self.server = self.container.create_sender(self.conn, None)
-
-    def on_message(self, event):
-        print("Received", event.message)
-        self.server.send(Message(address=event.message.reply_to, body=event.message.body.upper(),
-                            correlation_id=event.message.correlation_id))
-
-try:
-    Container(Server("0.0.0.0:5672", "examples")).run()
-except KeyboardInterrupt: pass
-
-
-
diff --git a/examples/python/server_direct.py b/examples/python/server_direct.py
deleted file mode 100755
index a9910f1..0000000
--- a/examples/python/server_direct.py
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-from proton import generate_uuid, Message
-from proton.handlers import MessagingHandler
-from proton.reactor import Container
-
-class Server(MessagingHandler):
-    def __init__(self, url):
-        super(Server, self).__init__()
-        self.url = url
-        self.senders = {}
-
-    def on_start(self, event):
-        print("Listening on", self.url)
-        self.container = event.container
-        self.acceptor = event.container.listen(self.url)
-
-    def on_link_opening(self, event):
-        if event.link.is_sender:
-            if event.link.remote_source and event.link.remote_source.dynamic:
-                event.link.source.address = str(generate_uuid())
-                self.senders[event.link.source.address] = event.link
-            elif event.link.remote_target and event.link.remote_target.address:
-                event.link.target.address = event.link.remote_target.address
-                self.senders[event.link.remote_target.address] = event.link
-            elif event.link.remote_source:
-                event.link.source.address = event.link.remote_source.address
-        elif event.link.remote_target:
-            event.link.target.address = event.link.remote_target.address
-
-    def on_message(self, event):
-        print("Received", event.message)
-        sender = self.senders.get(event.message.reply_to)
-        if not sender:
-            print("No link for reply")
-            return
-        sender.send(Message(address=event.message.reply_to, body=event.message.body.upper(),
-                            correlation_id=event.message.correlation_id))
-
-try:
-    Container(Server("0.0.0.0:8888")).run()
-except KeyboardInterrupt: pass
-
-
-
diff --git a/examples/python/server_tx.py b/examples/python/server_tx.py
deleted file mode 100755
index 51e734c..0000000
--- a/examples/python/server_tx.py
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-from proton import Message
-from proton.reactor import Container
-from proton.handlers import MessagingHandler, TransactionHandler
-
-class TxRequest(TransactionHandler):
-    def __init__(self, response, sender, request_delivery):
-        super(TxRequest, self).__init__()
-        self.response = response
-        self.sender = sender
-        self.request_delivery = request_delivery
-
-    def on_transaction_declared(self, event):
-        event.transaction.send(self.sender, self.response)
-        event.transaction.accept(self.request_delivery)
-        event.transaction.commit()
-
-    def on_transaction_committed(self, event):
-        print("Request processed successfully")
-
-    def on_transaction_aborted(self, event):
-        print("Request processing aborted")
-
-
-class TxServer(MessagingHandler):
-    def __init__(self, host, address):
-        super(TxServer, self).__init__(auto_accept=False)
-        self.host = host
-        self.address = address
-
-    def on_start(self, event):
-        self.container = event.container
-        self.conn = event.container.connect(self.host, reconnect=False)
-        self.receiver = event.container.create_receiver(self.conn, self.address)
-        self.senders = {}
-        self.relay = None
-
-    def on_message(self, event):
-        sender = self.relay
-        if not sender:
-            sender = self.senders.get(event.message.reply_to)
-        if not sender:
-            sender = self.container.create_sender(self.conn, event.message.reply_to)
-            self.senders[event.message.reply_to] = sender
-
-        response = Message(address=event.message.reply_to, body=event.message.body.upper(),
-                           correlation_id=event.message.correlation_id)
-        self.container.declare_transaction(self.conn, handler=TxRequest(response, sender, event.delivery))
-
-    def on_connection_open(self, event):
-        if event.connection.remote_offered_capabilities and 'ANONYMOUS-RELAY' in event.connection.remote_offered_capabilities:
-            self.relay = self.container.create_sender(self.conn, None)
-
-try:
-    Container(TxServer("localhost:5672", "examples")).run()
-except KeyboardInterrupt: pass
-
-
-
diff --git a/examples/python/simple_recv.py b/examples/python/simple_recv.py
deleted file mode 100755
index 5322500..0000000
--- a/examples/python/simple_recv.py
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import optparse
-from proton.handlers import MessagingHandler
-from proton.reactor import Container
-
-class Recv(MessagingHandler):
-    def __init__(self, url, count):
-        super(Recv, self).__init__()
-        self.url = url
-        self.expected = count
-        self.received = 0
-
-    def on_start(self, event):
-        event.container.create_receiver(self.url)
-
-    def on_message(self, event):
-        if event.message.id and event.message.id < self.received:
-            # ignore duplicate message
-            return
-        if self.expected == 0 or self.received < self.expected:
-            print(event.message.body)
-            self.received += 1
-            if self.received == self.expected:
-                event.receiver.close()
-                event.connection.close()
-
-parser = optparse.OptionParser(usage="usage: %prog [options]")
-parser.add_option("-a", "--address", default="localhost:5672/examples",
-                  help="address from which messages are received (default %default)")
-parser.add_option("-m", "--messages", type="int", default=100,
-                  help="number of messages to receive; 0 receives indefinitely (default %default)")
-opts, args = parser.parse_args()
-
-try:
-    Container(Recv(opts.address, opts.messages)).run()
-except KeyboardInterrupt: pass
-
-
-
diff --git a/examples/python/simple_send.py b/examples/python/simple_send.py
deleted file mode 100755
index 7717a16..0000000
--- a/examples/python/simple_send.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function, unicode_literals
-import optparse
-from proton import Message
-from proton.handlers import MessagingHandler
-from proton.reactor import Container
-
-class Send(MessagingHandler):
-    def __init__(self, url, messages):
-        super(Send, self).__init__()
-        self.url = url
-        self.sent = 0
-        self.confirmed = 0
-        self.total = messages
-
-    def on_start(self, event):
-        event.container.create_sender(self.url)
-
-    def on_sendable(self, event):
-        while event.sender.credit and self.sent < self.total:
-            msg = Message(id=(self.sent+1), body={'sequence':(self.sent+1)})
-            event.sender.send(msg)
-            self.sent += 1
-
-    def on_accepted(self, event):
-        self.confirmed += 1
-        if self.confirmed == self.total:
-            print("all messages confirmed")
-            event.connection.close()
-
-    def on_disconnected(self, event):
-        self.sent = self.confirmed
-
-parser = optparse.OptionParser(usage="usage: %prog [options]",
-                               description="Send messages to the supplied address.")
-parser.add_option("-a", "--address", default="localhost:5672/examples",
-                  help="address to which messages are sent (default %default)")
-parser.add_option("-m", "--messages", type="int", default=100,
-                  help="number of messages to send (default %default)")
-opts, args = parser.parse_args()
-
-try:
-    Container(Send(opts.address, opts.messages)).run()
-except KeyboardInterrupt: pass
diff --git a/examples/python/sync_client.py b/examples/python/sync_client.py
deleted file mode 100755
index 0b7b045..0000000
--- a/examples/python/sync_client.py
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-"""
-Demonstrates the client side of the synchronous request-response pattern
-(also known as RPC or Remote Procecure Call) using proton.
-
-"""
-from __future__ import print_function, unicode_literals
-
-import optparse
-from proton import Message, Url, ConnectionException, Timeout
-from proton.utils import SyncRequestResponse, BlockingConnection
-from proton.handlers import IncomingMessageHandler
-import sys
-
-parser = optparse.OptionParser(usage="usage: %prog [options]",
-                               description="Send requests to the supplied address and print responses.")
-parser.add_option("-a", "--address", default="localhost:5672/examples",
-                  help="address to which messages are sent (default %default)")
-parser.add_option("-t", "--timeout", type="float", default=5,
-                  help="Give up after this time out (default %default)")
-opts, args = parser.parse_args()
-
-url = Url(opts.address)
-client = SyncRequestResponse(BlockingConnection(url, timeout=opts.timeout), url.path)
-
-try:
-    REQUESTS= ["Twas brillig, and the slithy toves",
-               "Did gire and gymble in the wabe.",
-               "All mimsy were the borogroves,",
-               "And the mome raths outgrabe."]
-    for request in REQUESTS:
-        response = client.call(Message(body=request))
-        print("%s => %s" % (request, response.body))
-finally:
-    client.connection.close()
-
diff --git a/examples/python/test_examples.py b/examples/python/test_examples.py
deleted file mode 100644
index 7ecde61..0000000
--- a/examples/python/test_examples.py
+++ /dev/null
@@ -1,151 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-import sys
-import subprocess
-import time
-import unittest
-
-if sys.version_info[0] == 2:
-    _unicode_prefix = 'u'
-else:
-    _unicode_prefix = ''
-
-
-class ExamplesTest(unittest.TestCase):
-    def test_helloworld(self, example="helloworld.py"):
-        p = subprocess.Popen([example], stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
-                             universal_newlines=True)
-        p.wait()
-        output = [l.strip() for l in p.stdout]
-        self.assertEqual(output, ['Hello World!'])
-
-    def test_helloworld_direct(self):
-        self.test_helloworld('helloworld_direct.py')
-
-    def test_helloworld_blocking(self):
-        self.test_helloworld('helloworld_blocking.py')
-
-    def test_helloworld_tornado(self):
-        self.test_helloworld('helloworld_tornado.py')
-
-    def test_helloworld_direct_tornado(self):
-        self.test_helloworld('helloworld_direct_tornado.py')
-
-    def test_simple_send_recv(self, recv='simple_recv.py', send='simple_send.py'):
-        r = subprocess.Popen([recv], stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
-                             universal_newlines=True)
-        s = subprocess.Popen([send], stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
-                             universal_newlines=True)
-        s.wait()
-        r.wait()
-        actual = [l.strip() for l in r.stdout]
-        expected = ["{%s'sequence': int32(%i)}" % (_unicode_prefix, (i+1)) for i in range(100)]
-        self.assertEqual(actual, expected)
-
-    def test_client_server(self, client=['client.py'], server=['server.py'], sleep=0):
-        s = subprocess.Popen(server, stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
-                             universal_newlines=True)
-        if sleep:
-            time.sleep(sleep)
-        c = subprocess.Popen(client, stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
-                             universal_newlines=True)
-        c.wait()
-        s.terminate()
-        actual = [l.strip() for l in c.stdout]
-        inputs = ["Twas brillig, and the slithy toves",
-                    "Did gire and gymble in the wabe.",
-                    "All mimsy were the borogroves,",
-                    "And the mome raths outgrabe."]
-        expected = ["%s => %s" % (l, l.upper()) for l in inputs]
-        self.assertEqual(actual, expected)
-
-    def test_sync_client_server(self):
-        self.test_client_server(client=['sync_client.py'])
-
-    def test_client_server_tx(self):
-        self.test_client_server(server=['server_tx.py'])
-
-    def test_sync_client_server_tx(self):
-        self.test_client_server(client=['sync_client.py'], server=['server_tx.py'])
-
-    def test_client_server_direct(self):
-        self.test_client_server(client=['client.py', '-a', 'localhost:8888/examples'], server=['server_direct.py'], sleep=0.5)
-
-    def test_sync_client_server_direct(self):
-        self.test_client_server(client=['sync_client.py', '-a', 'localhost:8888/examples'], server=['server_direct.py'], sleep=0.5)
-
-    def test_db_send_recv(self):
-        self.maxDiff = None
-        # setup databases
-        subprocess.check_call(['db_ctrl.py', 'init', './src_db'])
-        subprocess.check_call(['db_ctrl.py', 'init', './dst_db'])
-        fill = subprocess.Popen(['db_ctrl.py', 'insert', './src_db'],
-                                stdin=subprocess.PIPE, stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
-                                universal_newlines=True)
-        for i in range(100):
-            fill.stdin.write("Message-%i\n" % (i+1))
-        fill.stdin.close()
-        fill.wait()
-        # run send and recv
-        r = subprocess.Popen(['db_recv.py', '-m', '100'], stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
-                             universal_newlines=True)
-        s = subprocess.Popen(['db_send.py', '-m', '100'], stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
-                             universal_newlines=True)
-        s.wait()
-        r.wait()
-        # verify output of receive
-        actual = [l.strip() for l in r.stdout]
-        expected = ["inserted message %i" % (i+1) for i in range(100)]
-        self.assertEqual(actual, expected)
-        # verify state of databases
-        v = subprocess.Popen(['db_ctrl.py', 'list', './dst_db'], stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
-                             universal_newlines=True)
-        v.wait()
-        expected = ["(%i, %s'Message-%i')" % ((i+1), _unicode_prefix, (i+1)) for i in range(100)]
-        actual = [l.strip() for l in v.stdout]
-        self.assertEqual(actual, expected)
-
-    def test_tx_send_tx_recv(self):
-        self.test_simple_send_recv(recv='tx_recv.py', send='tx_send.py')
-
-    def test_simple_send_direct_recv(self):
-        self.maxDiff = None
-        r = subprocess.Popen(['direct_recv.py', '-a', 'localhost:8888'], stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
-                             universal_newlines=True)
-        time.sleep(0.5)
-        s = subprocess.Popen(['simple_send.py', '-a', 'localhost:8888'], stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
-                             universal_newlines=True)
-        s.wait()
-        r.wait()
-        actual = [l.strip() for l in r.stdout]
-        expected = ["{%s'sequence': int32(%i)}" % (_unicode_prefix, (i+1)) for i in range(100)]
-        self.assertEqual(actual, expected)
-
-    def test_direct_send_simple_recv(self):
-        s = subprocess.Popen(['direct_send.py', '-a', 'localhost:8888'], stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
-                             universal_newlines=True)
-        time.sleep(0.5)
-        r = subprocess.Popen(['simple_recv.py', '-a', 'localhost:8888'], stderr=subprocess.STDOUT, stdout=subprocess.PIPE,
-                             universal_newlines=True)
-        r.wait()
-        s.wait()
-        actual = [l.strip() for l in r.stdout]
-        expected = ["{%s'sequence': int32(%i)}" % (_unicode_prefix, (i+1)) for i in range(100)]
-        self.assertEqual(actual, expected)
diff --git a/examples/python/tx_recv.py b/examples/python/tx_recv.py
deleted file mode 100755
index 4baddcf..0000000
--- a/examples/python/tx_recv.py
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import optparse
-from proton import Url
-from proton.reactor import Container
-from proton.handlers import MessagingHandler, TransactionHandler
-
-class TxRecv(MessagingHandler, TransactionHandler):
-    def __init__(self, url, messages, batch_size):
-        super(TxRecv, self).__init__(prefetch=0, auto_accept=False)
-        self.url = Url(url)
-        self.expected = messages
-        self.batch_size = batch_size
-        self.current_batch = 0
-        self.committed = 0
-
-    def on_start(self, event):
-        self.container = event.container
-        self.conn = self.container.connect(self.url)
-        self.receiver = self.container.create_receiver(self.conn, self.url.path)
-        self.container.declare_transaction(self.conn, handler=self)
-        self.transaction = None
-
-    def on_message(self, event):
-        print(event.message.body)
-        self.transaction.accept(event.delivery)
-        self.current_batch += 1
-        if self.current_batch == self.batch_size:
-            self.transaction.commit()
-            self.transaction = None
-
-    def on_transaction_declared(self, event):
-        self.receiver.flow(self.batch_size)
-        self.transaction = event.transaction
-
-    def on_transaction_committed(self, event):
-        self.committed += self.current_batch
-        self.current_batch = 0
-        if self.expected == 0 or self.committed < self.expected:
-            self.container.declare_transaction(self.conn, handler=self)
-        else:
-            event.connection.close()
-
-    def on_disconnected(self, event):
-        self.current_batch = 0
-
-parser = optparse.OptionParser(usage="usage: %prog [options]")
-parser.add_option("-a", "--address", default="localhost:5672/examples",
-                  help="address from which messages are received (default %default)")
-parser.add_option("-m", "--messages", type="int", default=100,
-                  help="number of messages to receive; 0 receives indefinitely (default %default)")
-parser.add_option("-b", "--batch-size", type="int", default=10,
-                  help="number of messages in each transaction (default %default)")
-opts, args = parser.parse_args()
-
-try:
-    Container(TxRecv(opts.address, opts.messages, opts.batch_size)).run()
-except KeyboardInterrupt: pass
-
-
-
diff --git a/examples/python/tx_recv_interactive.py b/examples/python/tx_recv_interactive.py
deleted file mode 100755
index c38f651..0000000
--- a/examples/python/tx_recv_interactive.py
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import sys
-import threading
-from proton.reactor import ApplicationEvent, Container, EventInjector
-from proton.handlers import MessagingHandler, TransactionHandler
-
-class TxRecv(MessagingHandler, TransactionHandler):
-    def __init__(self):
-        super(TxRecv, self).__init__(prefetch=0, auto_accept=False)
-
-    def on_start(self, event):
-        self.container = event.container
-        self.conn = self.container.connect("localhost:5672")
-        self.receiver = self.container.create_receiver(self.conn, "examples")
-        self.container.declare_transaction(self.conn, handler=self, settle_before_discharge=True)
-        self.transaction = None
-
-    def on_message(self, event):
-        print(event.message.body)
-        self.transaction.accept(event.delivery)
-
-    def on_transaction_declared(self, event):
-        self.transaction = event.transaction
-        print("transaction declared")
-
-    def on_transaction_committed(self, event):
-        print("transaction committed")
-        self.container.declare_transaction(self.conn, handler=self)
-
-    def on_transaction_aborted(self, event):
-        print("transaction aborted")
-        self.container.declare_transaction(self.conn, handler=self)
-
-    def on_commit(self, event):
-        self.transaction.commit()
-
-    def on_abort(self, event):
-        self.transaction.abort()
-
-    def on_fetch(self, event):
-        self.receiver.flow(1)
-
-    def on_quit(self, event):
-        c = self.receiver.connection
-        self.receiver.close()
-        c.close()
-
-try:
-    reactor = Container(TxRecv())
-    events = EventInjector()
-    reactor.selectable(events)
-    thread = threading.Thread(target=reactor.run)
-    thread.daemon=True
-    thread.start()
-
-    print("Enter 'fetch', 'commit' or 'abort'")
-    while True:
-        line = sys.stdin.readline()
-        if line:
-            events.trigger(ApplicationEvent(line.strip()))
-        else:
-            break
-except KeyboardInterrupt: pass
-
-
diff --git a/examples/python/tx_send.py b/examples/python/tx_send.py
deleted file mode 100755
index bda6780..0000000
--- a/examples/python/tx_send.py
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function, unicode_literals
-import optparse
-from proton import Message, Url
-from proton.reactor import Container
-from proton.handlers import MessagingHandler, TransactionHandler
-
-class TxSend(MessagingHandler, TransactionHandler):
-    def __init__(self, url, messages, batch_size):
-        super(TxSend, self).__init__()
-        self.url = Url(url)
-        self.current_batch = 0
-        self.committed = 0
-        self.confirmed = 0
-        self.total = messages
-        self.batch_size = batch_size
-
-    def on_start(self, event):
-        self.container = event.container
-        self.conn = self.container.connect(self.url)
-        self.sender = self.container.create_sender(self.conn, self.url.path)
-        self.container.declare_transaction(self.conn, handler=self)
-        self.transaction = None
-
-    def on_transaction_declared(self, event):
-        self.transaction = event.transaction
-        self.send()
-
-    def on_sendable(self, event):
-        self.send()
-
-    def send(self):
-        while self.transaction and self.sender.credit and (self.committed + self.current_batch) < self.total:
-            seq = self.committed + self.current_batch + 1
-            msg = Message(id=seq, body={'sequence':seq})
-            self.transaction.send(self.sender, msg)
-            self.current_batch += 1
-            if self.current_batch == self.batch_size:
-                self.transaction.commit()
-                self.transaction = None
-
-    def on_accepted(self, event):
-        if event.sender == self.sender:
-            self.confirmed += 1
-
-    def on_transaction_committed(self, event):
-        self.committed += self.current_batch
-        if self.committed == self.total:
-            print("all messages committed")
-            event.connection.close()
-        else:
-            self.current_batch = 0
-            self.container.declare_transaction(self.conn, handler=self)
-
-    def on_disconnected(self, event):
-        self.current_batch = 0
-
-parser = optparse.OptionParser(usage="usage: %prog [options]",
-                               description="Send messages transactionally to the supplied address.")
-parser.add_option("-a", "--address", default="localhost:5672/examples",
-                  help="address to which messages are sent (default %default)")
-parser.add_option("-m", "--messages", type="int", default=100,
-                  help="number of messages to send (default %default)")
-parser.add_option("-b", "--batch-size", type="int", default=10,
-                  help="number of messages in each transaction (default %default)")
-opts, args = parser.parse_args()
-
-try:
-    Container(TxSend(opts.address, opts.messages, opts.batch_size)).run()
-except KeyboardInterrupt: pass
diff --git a/examples/ruby/engine_recv.rb b/examples/ruby/engine_recv.rb
deleted file mode 100644
index 1529964..0000000
--- a/examples/ruby/engine_recv.rb
+++ /dev/null
@@ -1,158 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-require "qpid_examples"
-require "optparse"
-
-DEFAULT_PORT = 5672
-
-options = {
-  :port => DEFAULT_PORT,
-  :debug => false,
-  :verbose => false,
-}
-
-OptionParser.new do |opts|
-  opts.banner = "Usage: engine_recv.rb [options]"
-
-  opts.on("-p [port]", "--port [port]",
-          "The port to use  (def. #{DEFAULT_PORT})") do |port|
-    options[:port] = port
-  end
-
-  opts.on("-v", "--verbose",
-          "Enable verbose output") do
-    options[:verbose] = true
-  end
-
-  opts.on("-d",
-          "--debug", "Enable debugging") do
-    options[:debug] = true
-  end
-
-  opts.parse!
-end
-
-server = TCPServer.new('localhost', options[:port])
-
-last_time = Time.now
-
-message_count = 0
-driver = Driver.new
-
-collector = Qpid::Proton::Event::Collector.new
-
-loop do
-  begin
-    client = server.accept_nonblock
-  rescue Errno::EAGAIN, Errno::ECONNABORTED, Errno::EINTR, Errno::EWOULDBLOCK => error
-
-  end
-
-  unless client.nil?
-    puts "Connection from #{client.peeraddr.last}"
-    connection = Qpid::Proton::Connection.new
-    connection.collect(collector)
-    transport = Qpid::Proton::Transport.new(Qpid::Proton::Transport::SERVER)
-    transport.bind(connection)
-    selectable = Selectable.new(transport, client)
-    driver.add(selectable)
-  end
-
-  # let the driver process data
-  driver.process
-
-  event = collector.peek
-
-  while !event.nil?
-    puts "EVENT: #{event}" if options[:debug]
-
-    case event.type
-    when Qpid::Proton::Event::CONNECTION_INIT
-      conn = event.connection
-      if conn.state & Qpid::Proton::Endpoint::REMOTE_UNINIT
-        conn.transport.sasl.done(Qpid::Proton::SASL::OK)
-      end
-
-    when Qpid::Proton::Event::CONNECTION_BOUND
-      conn = event.connection
-      if conn.state & Qpid::Proton::Endpoint::LOCAL_UNINIT
-        conn.open
-      end
-
-    when Qpid::Proton::Event::CONNECTION_REMOTE_CLOSE
-      conn = event.context
-      if !(conn.state & Qpid::Proton::Endpoint::LOCAL_CLOSED)
-        conn.close
-      end
-
-    when Qpid::Proton::Event::SESSION_REMOTE_OPEN
-      session = event.session
-      if session.state & Qpid::Proton::Endpoint::LOCAL_UNINIT
-        session.incoming_capacity = 1000000
-        session.open
-      end
-
-    when Qpid::Proton::Event::SESSION_REMOTE_CLOSE
-      session = event.session
-      if !(session.state & Qpid::Proton::Endpoint::LOCAL_CLOSED)
-        session.close
-      end
-
-    when Qpid::Proton::Event::LINK_REMOTE_OPEN
-      link = event.link
-      if link.state & Qpid::Proton::Endpoint::LOCAL_UNINIT
-        link.open
-        link.flow 400
-      end
-
-    when Qpid::Proton::Event::LINK_REMOTE_CLOSE
-      link = event.context
-      if !(link.state & Qpid::Proton::Endpoint::LOCAL_CLOSED)
-        link.close
-      end
-
-    when Qpid::Proton::Event::DELIVERY
-      link = event.link
-      delivery = event.delivery
-      if delivery.readable? && !delivery.partial?
-        # decode the message and display it
-        msg = Qpid::Proton::Util::Engine.receive_message(delivery)
-        message_count += 1
-        puts "Received:"
-        puts " Count=#{message_count}" if options[:verbose]
-        puts " From=#{msg.id}" if msg.id
-        puts " Reply to=#{msg.reply_to}" if msg.reply_to
-        puts " Subject=#{msg.subject}" if msg.subject
-        puts " Body=#{msg.body}" if msg.body
-        puts ""
-        delivery.settle
-        credit = link.credit
-        link.flow(200) if credit <= 200
-      end
-
-    when Qpid::Proton::Event::TRANSPORT
-      driver.process
-
-    end
-
-    collector.pop
-    event = collector.peek
-  end
-end
diff --git a/examples/ruby/engine_send.rb b/examples/ruby/engine_send.rb
deleted file mode 100644
index 189c7fd..0000000
--- a/examples/ruby/engine_send.rb
+++ /dev/null
@@ -1,143 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-require 'qpid_examples'
-require "optparse"
-
-DEFAULT_ADDRESS = "0.0.0.0:5672"
-
-options = {
-  :address => DEFAULT_ADDRESS,
-  :debug => false,
-  :verbose => false,
-  :count => 1,
-  :content => "This message was sent #{Time.new}"
-}
-
-OptionParser.new do |opts|
-  opts.banner = "Usage: engine_recv.rb [options]"
-
-  opts.on("-a [address]", "--address [address]",
-          "The target address (def. #{DEFAULT_ADDRESS})") do |address|
-    options[:address] = address
-  end
-
-  opts.on("-C [content]", "--content [content]",
-          "The message content") do |content|
-    options[:content] = content
-  end
-
-  opts.on("-c [count]", "--count [count]",
-          "The number of messages to send (def. 1)") do |count|
-    options[:count] = count.to_i
-  end
-
-  opts.on("-v", "--verbose",
-          "Enable verbose output") do
-    options[:verbose] = true
-  end
-
-  opts.on("-d",
-          "--debug", "Enable debugging") do
-    options[:debug] = true
-  end
-
-  opts.parse!
-end
-
-
-driver = Driver.new
-
-conn = Qpid::Proton::Connection.new
-collector = Qpid::Proton::Event::Collector.new
-conn.collect(collector)
-
-session = conn.session
-conn.open
-session.open
-
-sender = session.sender("tvc_15_1")
-sender.target.address = "queue"
-sender.open
-
-transport = Qpid::Proton::Transport.new
-transport.bind(conn)
-
-address, port = options[:address].split(":")
-
-socket = TCPSocket.new(address, port)
-selectable = Selectable.new(transport, socket)
-sent_count = 0
-
-sent_count = 0
-
-driver.add(selectable)
-
-loop do
-  # let the driver process
-  driver.process
-
-  event = collector.peek
-
-  unless event.nil?
-
-    print "EVENT: #{event}\n" if options[:debug]
-
-    case event.type
-
-    when Qpid::Proton::Event::LINK_FLOW
-      sender = event.sender
-      credit = sender.credit
-
-      message = Qpid::Proton::Message.new
-
-      if credit > 0 && sent_count < options[:count]
-        sent_count = sent_count.next
-        message.clear
-        message.address = options[:address]
-        message.subject = "Message #{sent_count}..."
-        message.body = options[:content]
-
-        delivery = sender.delivery("#{sent_count}")
-        sender.send(message.encode)
-        delivery.settle
-        sender.advance
-        credit = sender.credit
-      else
-        sender.close
-      end
-
-    when Qpid::Proton::Event::LINK_LOCAL_CLOSE
-      link = event.link
-      link.close
-      link.session.close
-
-    when Qpid::Proton::Event::SESSION_LOCAL_CLOSE
-      session = event.session
-      session.connection.close
-
-    when Qpid::Proton::Event::CONNECTION_LOCAL_CLOSE
-      break
-
-    end
-
-    collector.pop
-    event = collector.peek
-  end
-end
diff --git a/examples/ruby/example_test.rb b/examples/ruby/example_test.rb
deleted file mode 100755
index 9a01964..0000000
--- a/examples/ruby/example_test.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/usr/bin/enc ruby
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-require 'test/unit'
-require 'qpid_proton'
-require 'socket'
-
-$port = Random.new.rand(10000) + 10000
-
-class ExampleTest < Test::Unit::TestCase
-
-  def run_script(script, port)
-    assert File.exist? script
-    cmd = [RbConfig.ruby, script]
-    cmd += ["-a", ":#{port}/examples"] if port
-    return IO.popen(cmd)
-  end
-
-
-  def assert_output(script, want, port=nil)
-    out = run_script(script, port)
-    assert_equal want, out.read.strip
-  end
-
-  def test_helloworld
-    assert_output("reactor/helloworld.rb", "Hello world!", $port)
-  end
-
-  def test_send_recv
-    assert_output("reactor/simple_send.rb", "All 100 messages confirmed!", $port)
-    want = (0..99).reduce("") { |x,y| x << "Received: sequence #{y}\n" }
-    assert_output("reactor/simple_recv.rb", want.strip, $port)
-  end
-
-  def test_client_server
-    want =  <<EOS
--> Twas brillig, and the slithy toves
-<- TWAS BRILLIG, AND THE SLITHY TOVES
--> Did gire and gymble in the wabe.
-<- DID GIRE AND GYMBLE IN THE WABE.
--> All mimsy were the borogroves,
-<- ALL MIMSY WERE THE BOROGROVES,
--> And the mome raths outgrabe.
-<- AND THE MOME RATHS OUTGRABE.
-EOS
-    srv = run_script("reactor/server.rb", $port)
-    assert_output("reactor/client.rb", want.strip, $port)
-
-  ensure
-    Process.kill :TERM, srv.pid if srv
-  end
-end
-
-begin
-  broker = spawn("#{RbConfig.ruby} reactor/broker.rb -a :#{$port}")
-  # Wait for the broker to be listening.
-  while true
-    begin
-      s = TCPSocket.open "", $port
-      puts "Broker ready at #{$port}"
-      s.close
-      break
-    rescue Errno::ECONNREFUSED
-      puts "Retry connection to #{$port}"
-      sleep(0.1)
-    end
-  end
-
-  Test::Unit::AutoRunner.run
-
-ensure
-  Process.kill :TERM, broker if broker
-end
diff --git a/examples/ruby/lib/debugging.rb b/examples/ruby/lib/debugging.rb
deleted file mode 100644
index 5065d51..0000000
--- a/examples/ruby/lib/debugging.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Debugging
-
-  def debug(text)
-    print "[#{Time.now.strftime('%s')}] #{text}\n"
-  end
-
-end
diff --git a/examples/ruby/lib/driver.rb b/examples/ruby/lib/driver.rb
deleted file mode 100644
index 4e223d0..0000000
--- a/examples/ruby/lib/driver.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-class Driver
-
-  def initialize
-    @selectables = {}
-  end
-
-  def add(selectable)
-    @selectables[selectable.fileno] = selectable
-  end
-
-  def process
-    reading = []
-    writing = []
-
-    @selectables.each_value do |sel|
-      if sel.closed? || sel.fileno.nil?
-        @selectables.delete(sel.fileno)
-      else
-        begin
-          reading << sel.to_io if sel.reading?
-          writing << sel.to_io if sel.writing?
-        rescue Exception => error
-          puts "Error: #{error}"
-          puts error.backtrace.join("\n");
-          # @selectables.delete(sel.fileno)
-        end
-      end
-    end
-
-    read_from, write_to = IO.select(reading, writing, [], 0)
-
-    unless read_from.nil?
-      read_from.each do |r|
-        sel = @selectables[r.fileno]
-        sel.readable unless sel.nil? || sel.closed?
-      end
-    end
-
-    begin
-      unless write_to.nil?
-        write_to.each do |w|
-          sel = @selectables[w.fileno]
-          sel.writable unless sel.nil? || sel.closed?
-        end
-      end
-
-    end
-  end
-
-end
diff --git a/examples/ruby/lib/qpid_examples.rb b/examples/ruby/lib/qpid_examples.rb
deleted file mode 100644
index 8503fbe..0000000
--- a/examples/ruby/lib/qpid_examples.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-require "qpid_proton"
-
-require "selectable"
-require "driver"
-require "socket"
-require "monitor"
-
-include Socket::Constants
-
diff --git a/examples/ruby/lib/selectable.rb b/examples/ruby/lib/selectable.rb
deleted file mode 100644
index 779ea24..0000000
--- a/examples/ruby/lib/selectable.rb
+++ /dev/null
@@ -1,120 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-class Selectable
-
-  attr_reader :transport
-
-  def initialize(transport, socket)
-    @transport = transport
-    @socket = socket
-    @socket.autoclose = true
-    @write_done = false
-    @read_done = false
-  end
-
-  def closed?
-    return true if @socket.closed?
-    return false if !@read_done && !@write_done
-    @socket.close
-    true
-  end
-
-  def fileno
-    @socket.fileno unless @socket.closed?
-  end
-
-  def to_io
-    @socket
-  end
-
-  def reading?
-    return false if @read_done
-    c = @transport.capacity
-    if c > 0
-      return true
-    elsif c < 0
-      @read_done = true
-      return false
-    else
-      return false
-    end
-  end
-
-  def writing?
-    return false if @write_done
-    begin
-      p = @transport.pending
-      if p > 0
-        return true
-      elsif p < 0
-        @write_done = true
-        return false
-      else
-        return false
-      end
-    rescue Qpid::Proton::TransportError => error
-      @write_done = true
-      return false
-    end
-  end
-
-  def readable
-    c = @transport.capacity
-    if c > 0
-      begin
-        data = @socket.recv(c)
-        if data
-          @transport.push(data)
-        else
-          @transport.close_tail
-        end
-      rescue Exception => error
-        puts "read error; #{error}"
-        @transport.close_tail
-        @read_done = true
-      end
-    elsif c < 0
-      @read_done = true
-    end
-  end
-
-  def writable
-    begin
-      p = @transport.pending
-      if p > 0
-        data = @transport.peek(p)
-        n = @socket.send(data, 0)
-        @transport.pop(n)
-      elsif p < 0
-        @write_done = true
-      end
-    rescue Exception => error
-      puts "write error: #{error}"
-      puts error.backtrace.join("\n")
-      @transport.close_head
-      @write_done = true
-    end
-  end
-
-  def tick(now)
-    @transport.tick(now)
-  end
-
-end
diff --git a/examples/ruby/lib/send_and_receive.rb b/examples/ruby/lib/send_and_receive.rb
deleted file mode 100644
index 9fd7417..0000000
--- a/examples/ruby/lib/send_and_receive.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-class ExampleSend < Qpid::Proton::Handler::MessagingHandler
-
-  attr_reader :url
-
-  def initialize(url, expected)
-    super()
-    @url = url
-    @sent = 0
-    @confirmed = 0
-    @expected = expected
-  end
-
-  def on_sendable(event)
-    while event.sender.credit > 0 && @sent < @expected
-      msg = Qpid::Proton::Message.new
-      msg.body = "sequence #{@sent}"
-      msg.id = @sent
-      event.sender.send(msg)
-      @sent = @sent + 1
-    end
-  end
-
-  def on_accepted(event)
-    @confirmed = @confirmed + 1
-    if self.finished?
-      puts "#{@expected > 1 ? 'All ' : ''}#{@expected} message#{@expected > 1 ? 's' : ''} confirmed!"
-      event.connection.close
-    end
-  end
-
-  def on_disconnected(event)
-    @sent = @confirmed
-  end
-
-  def finished?
-    @confirmed == @expected
-  end
-
-end
-
-class ExampleReceive < Qpid::Proton::Handler::MessagingHandler
-
-  attr_reader :url
-
-  def initialize(url, expected)
-    super()
-    @url = url
-    @expected = expected
-    @received = 0
-  end
-
-  def on_message(event)
-    if event.message.id.nil? || event.message.id < @received
-      puts "Missing or old message id: id=#{event.message.id}"
-      return
-    end
-    if @expected.zero? || (@received < @expected)
-      puts "Received: #{event.message.body}"
-      @received = @received + 1
-      if finished?
-        event.receiver.close
-        event.connection.close
-      end
-    end
-  end
-
-  def finished?
-    @received == @expected
-  end
-
-end
diff --git a/examples/ruby/messenger/README.md b/examples/ruby/messenger/README.md
deleted file mode 100644
index 7cc8dee..0000000
--- a/examples/ruby/messenger/README.md
+++ /dev/null
@@ -1,163 +0,0 @@
-## Simple Messenger Examples
-
-The Messenger APIs, contained in the Qpid::Proton::Messenger class, represent the simplest means for sending and receive messages. An application need only create an instance of Messenger to have an endpoint for sending and receiving messages.
-
-Example applications, currently located in the messenger subdirectory, include:
-
-* **send.rb** - Sends one or more messages to a specific address.
-* **recv.rb** - Listens for messages sent to one or more addresses.
-
-### Sending A Simple Message Directly (Without A Broker)
-
-The goal of this example is to demonstrate how to send and receive messages directly between applications. To do that we've broken out the examples into two applciations: **send.rb** and **recv.rb**.
-
-First we need to start the receiver who will listen for an incoming connection:
-
-```
- $ ruby recv.rb ~0.0.0.0:8888
-```
-
-**NOTE:** Be sure to include the **tilda (~)** at the beginning of each address to be used. This tells the Messenger that it's going to be listening for connections on that port. And be sure to pick a free port for each of the addresses used.
-
-Now you can send messages with:
-
-```
- $ ruby send.rb -a 0.0.0.0:8888 "Hello world"
-```
-
-**NOTE:** Here you *don't* use a **tilda (~)** at the beginning of the address since you're specifying the receiver address rather than the address on which to listen.
-
-On the receiver side you should see something like:
-
-```
-Address: 0.0.0.0:8888
-Subject: How are you?
-Body: This is a test.
-Properties: {"sent"=>1432651492, "hostname"=>"mcpierce-laptop"}
-Instructions: {"fold"=>"yes", "spindle"=>"no", "mutilate"=>"no"}
-Annotations: {"version"=>1.0, "pill"=>"RED"}
-
-```
-
-This tells us the message we received as expected.
-
-### Sending A Simple Message Through A Broker
-
-To send a message via an intermediary, such as the Qpid broker, we need to give both the sender and the receiver a little bit more information, such as the hostname and port for the broker and the name of the queue where messages will be sent and received.
-
-If you're using the Qpid broker, this can be done using the **qpid-config**
-tool. Simply start your broker and then create our queue, which we'll call "examples":
-
-```
- $ qpid-config add queue examples
-```
-
-As of this point you can begin sending messages *without* starting the receiver. This is the benefit of using a broker, the ability to have something store messages for retrieval.
-
-Now let's send a bunch of messages to the queue using **send.rb**:
-
-```
- $ for which in $(seq 1 10); do ruby send.rb --address amqp://localhost/examples "This is test ${which}."; done
-```
-
-This example sends 10 messages to the our queue on the broker, where they will stay until retrieved.
-
-With this scenario we needed to specify the hostname of the broker and also the name of the queue in the address. After the sending completes you can verify the content of the queue using the **qpid-stat** command:
-
-```
-$ qpid-stat -q
-Queues
-  queue                                     dur  autoDel  excl  msg   msgIn  msgOut  bytes  bytesIn  bytesOut  cons  bind
-  =========================================================================================================================
-  examples                                                        10    10      0    2.65k  2.65k       0         0     1
-  fa4b8acb-03b6-4cff-9277-eeb2efe3c88a:0.0       Y        Y        0     0      0       0      0        0         1     2
-```
-
-Now to retrieve the messages. Start the **recv.rb** example using:
-
-```
-$ ruby recv.rb "amqp://127.0.0.1:5672/examples"
-```
-
-Once it connects to the broker, it will subscribe to the queue and begin receiving messages. You should see something like the following:
-
-```
-Address: amqp://localhost/examples
-Subject: How are you?
-Body: This is test 1.
-Properties: {"sent"=>1432837902, "hostname"=>"mcpierce-laptop"}
-Instructions: {"fold"=>"yes", "spindle"=>"no", "mutilate"=>"no"}
-Annotations: {"version"=>1.0, "pill"=>"RED"}
-Address: amqp://localhost/examples
-Subject: How are you?
-Body: This is test 2.
-Properties: {"sent"=>1432837903, "hostname"=>"mcpierce-laptop"}
-Instructions: {"fold"=>"yes", "spindle"=>"no", "mutilate"=>"no"}
-Annotations: {"version"=>1.0, "pill"=>"RED"}
-Address: amqp://localhost/examples
-Subject: How are you?
-Body: This is test 3.
-... truncating the remainder of the output ...
-```
-
-As with the sending, we specific the protocol to use and the address and port on the host to connect to the broker.
-
-##  Non-Blocking Receive With The Messenger APIs
-
-One of the downsides of Messenger is that, out of the box, it's a blocking set of APIs; i.e., when attempting to receive messages the Ruby VM is halted until the call returns.
-
-Enter **non-blocking mode**!
-
-When working in non-blocking mode you set a flag on your messenger to put it into non-blocking mode.
-
-```
-messenger = Qpid::Proton::Messenger.new
-messenger.passive = true
-```
-
-At this point the application is responsible for monitoring the set of file descriptors associated with those Messengers. It takes a little more code but the benefit is that the application can spawn this in a separate thread and not have the entire VM block during I/O operations. The **nonblocking_recv.rb** example app demonstrates how to perform this properly, how to wrap the file descriptor in a Selectable type, monitor it for when there's data to send or receive and then work with the instance of Messenger.
-
-For more details on how to do this, take a look at the comments in the example application.
-
-
-### Running The Non-Blocking Receiver
-
-To start the non-blocking receiver, simply start the example application like this:
-
-```
- $ ruby nonblocking_recv.rb ~0.0.0.0:8888
- This is a side thread:
-The time is now 11:39:24.
-The time is now 11:39:25.
-The time is now 11:39:26.
-```
-
-As the receiver runs it outputs the current time every second to show that a separate thread is running.
-
-Now you can launch the **client.rb** example to send a message to the receiver and then wait for a reply:
-
-```
- $ ruby client.rb -r "~/#" 0.0.0.0:8888 "This is a test." "Here is my message."
- amqp://c19f3e88-866a-46ae-8284-d229acf8a5cb/#, RE: This is a test.
-```
-
-As you see, in the command line we specify "~/#" as the address to which any reply should be sent. It's outside of the scope of this example, but the tilda (~) is expanded into a unique address by Proton and used for receiving any responses.
-
-On the receiver side you should see something like this:
-
-```
-The time is now 11:42:04.
-The time is now 11:42:05.
-The time is now 11:42:06.
-Address: 0.0.0.0:8888
-Subject: This is a test.
-Body:
-Properties: {}
-Instructions: {}
-Annotations: {}
-=== Sending a reply to amqp://c19f3e88-866a-46ae-8284-d229acf8a5cb/#
-The time is now 11:42:07.
-The time is now 11:42:08.
-```
-
-Notice in the receiver's output how the reply was sent to the address on the sender that was created by our specifying "~/#"
diff --git a/examples/ruby/messenger/client.rb b/examples/ruby/messenger/client.rb
deleted file mode 100644
index a2c2564..0000000
--- a/examples/ruby/messenger/client.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/usr/bin/env ruby
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-require 'qpid_proton'
-require 'optparse'
-
-
-$options  = {
-  :verbose => false,
-  :hostname => "0.0.0.0",
-  :subject => "",
-  :replyto => "~/replies"
-}
-
-
-OptionParser.new do |opts|
-  opts.banner = "Usage: client [options] <addr> <subject>"
-
-  opts.on("-r", "--reply-to", String, :REQUIRED,
-          "Reply address") do |replyto|
-    $options[:replyto] = replyto
-  end
-
-  opts.on("-v", "--verbose", :NONE,
-          "Enable verbose output") do
-    $options[:verbose] = true
-  end
-
-  opts.on("-h", "--help", :NONE,
-          "Show this help message") do
-    puts opts
-    exit
-  end
-
-  begin
-    ARGV << "-h" if ARGV.empty?
-    opts.parse!(ARGV)
-  rescue OptionParser::ParseError => error
-    STDERR.puts error.message, "\n", opts
-    exit 1
-  end
-
-  ($options[:address], $options[:subject]) = ARGV
-
-  abort "No address specified" if $options[:hostname].nil?
-  abort "No subject specified" if $options[:subject].nil?
-
-end
-
-def log(text)
-  printf "#{Time.new}: #{text}\n" if $options[:verbose]
-end
-
-msgr = Qpid::Proton::Messenger::Messenger.new
-msgr.start
-
-msg = Qpid::Proton::Message.new
-msg.address = $options[:address]
-msg.subject = $options[:subject]
-msg.reply_to = $options[:replyto]
-
-msgr.put(msg)
-msgr.send
-
-if $options[:replyto].start_with? "~/"
-  msgr.receive(1)
-  begin
-    msgr.get(msg)
-    puts "#{msg.address}, #{msg.subject}"
-  rescue error
-    puts error
-  end
-end
-
-msgr.stop
diff --git a/examples/ruby/messenger/mailserver.rb b/examples/ruby/messenger/mailserver.rb
deleted file mode 100644
index 594a0e3..0000000
--- a/examples/ruby/messenger/mailserver.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/usr/bin/env ruby
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-require 'qpid_proton'
-require 'optparse'
-
-FAILED         = 0
-CONNECTION_UP  = 1
-AUTHENTICATING = 2
-
-$options  = {
-  :verbose => false,
-  :address => ["amqp://~0.0.0.0"],
-}
-
-OptionParser.new do |opts|
-  opts.banner = "Usage: mailserver [options] <addr_1> ... <addr_n>"
-
-  opts.on("-v", "--verbose", :NONE,
-          "Print status messages to stdout") do |f|
-    $options[:verbose] = true
-  end
-
-  opts.parse!
-
-  if ARGV.length > 0
-    $options[:address] = []
-    ARGV.each {|address| $options[:address] << address}
-  end
-end
-
-def log(text)
-  STDOUT.puts "#{Time.new}: #{text}" if $options[:verbose]
-end
-
-msgr = Qpid::Proton::Messenger::Messenger.new
-msgr.start
-
-$options[:address].each {|addr| msgr.subscribe(addr)}
-
-def dispatch(request, response)
-  response.subject = "Re: #{request.subject}" if !request.subject.empty?
-  response.properties = request.properties
-  puts "Dispatched #{request.subject} #{request.properties}"
-end
-
-msg = Qpid::Proton::Message.new
-reply = Qpid::Proton::Message.new
-
-loop do
-  msgr.receive(10) if msgr.incoming < 10
-
-  if msgr.incoming > 0
-    msgr.get(msg)
-    if !msg.reply_to.nil? && !msg.reply_to.empty?
-      puts msg.reply_to
-      reply.address = msg.reply_to
-      reply.correlation_id = msg.correlation_id
-      reply.body = msg.body
-    end
-    dispatch(msg, reply)
-    msgr.put(reply)
-    msgr.send
-  end
-end
-
-msgr.stop
diff --git a/examples/ruby/messenger/nonblocking_recv.rb b/examples/ruby/messenger/nonblocking_recv.rb
deleted file mode 100644
index 09dc3f9..0000000
--- a/examples/ruby/messenger/nonblocking_recv.rb
+++ /dev/null
@@ -1,145 +0,0 @@
-#!/usr/bin/env ruby
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-require 'qpid_proton'
-require 'optparse'
-
-Thread.new do
-  print "This is a side thread:\n"
-  loop do
-    print "The time is now #{Time.new.strftime('%I:%M:%S')}.\n"
-    sleep 1
-  end
-end
-
-addresses = []
-
-OptionParser.new do |opts|
-  opts.banner = "Usage: recv.rb <addr1> ... <addrn>"
-  opts.parse!
-
-  addresses = ARGV
-end
-
-addresses = ["~0.0.0.0"] if addresses.empty?
-
-messenger = Qpid::Proton::Messenger::Messenger.new
-messenger.passive = true
-
-begin
-  messenger.start
-rescue ProtonError => error
-  print "ERROR: #{error.message}\n"
-  print error.backtrace.join("\n")
-  exit
-end
-
-addresses.each do |address|
-  begin
-    messenger.subscribe(address)
-  rescue Qpid::Proton::ProtonError => error
-    print "ERROR: #{error.message}\n"
-    exit
-  end
-end
-
-msg = Qpid::Proton::Message.new
-
-read_array = []
-write_array = []
-selectables = {}
-
-loop do
-
-  # wait for incoming messages
-  sel = messenger.selectable
-  while !sel.nil?
-    if sel.terminal?
-      selectables.delete(sel.fileno)
-      read_array.delete(sel)
-      write_array.delete(sel)
-      sel.free
-    else
-      if !sel.registered?
-        read_array << sel
-        write_array << sel
-        selectables[sel.fileno] = sel
-        sel.registered = true
-      end
-    end
-    sel = messenger.selectable
-  end
-
-  unless selectables.empty?
-    rarray = []; read_array.each {|fd| rarray << fd.to_io }
-    warray = []; write_array.each {|fd| warray << fd.to_io }
-
-    if messenger.deadline > 0.0
-      result = IO.select(rarray, warray, nil, messenger.deadline)
-    else
-      result = IO.select(rarray, warray)
-    end
-
-    unless result.nil? && result.empty?
-      result.flatten.each do |io|
-        sel = selectables[io.fileno]
-
-        sel.writable
-        sel.readable
-      end
-    end
-
-    begin
-      messenger.receive(10)
-    rescue Qpid::Proton::ProtonError => error
-      print "ERROR: #{error.message}\n"
-      exit
-    end
-
-    while messenger.incoming.nonzero?
-      begin
-        messenger.get(msg)
-      rescue Qpid::Proton::Error => error
-        print "ERROR: #{error.message}\n"
-        exit
-      end
-
-      print "Address: #{msg.address}\n"
-      subject = msg.subject || "(no subject)"
-      print "Subject: #{subject}\n"
-      print "Body: #{msg.body}\n"
-      print "Properties: #{msg.properties}\n"
-      print "Instructions: #{msg.instructions}\n"
-      print "Annotations: #{msg.annotations}\n"
-
-      if msg.reply_to
-        print "=== Sending a reply to #{msg.reply_to}\n"
-        reply = Qpid::Proton::Message.new
-        reply.address = msg.reply_to
-        reply.subject = "RE: #{msg.subject}"
-        reply.body = "Thanks for the message!"
-
-        messenger.put(reply)
-        messenger.send
-      end
-    end
-  end
-end
-
-messenger.stop
diff --git a/examples/ruby/messenger/recv.rb b/examples/ruby/messenger/recv.rb
deleted file mode 100644
index 960de4d..0000000
--- a/examples/ruby/messenger/recv.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/usr/bin/env ruby
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-require 'qpid_proton'
-require 'optparse'
-
-addresses = []
-
-OptionParser.new do |opts|
-  opts.banner = "Usage: recv.rb <addr1> ... <addrn>"
-  opts.parse!
-
-  addresses = ARGV
-end
-
-addresses = ["~0.0.0.0"] if addresses.empty?
-
-messenger = Qpid::Proton::Messenger::Messenger.new
-
-begin
-  messenger.start
-rescue ProtonError => error
-  puts "ERROR: #{error.message}"
-  puts error.backtrace.join("\n")
-  exit
-end
-
-addresses.each do |address|
-  begin
-    messenger.subscribe(address)
-  rescue Qpid::Proton::ProtonError => error
-    puts "ERROR: #{error.message}"
-    exit
-  end
-end
-
-msg = Qpid::Proton::Message.new
-
-loop do
-  begin
-    messenger.receive(10)
-  rescue Qpid::Proton::ProtonError => error
-    puts "ERROR: #{error.message}"
-    exit
-  end
-
-  while messenger.incoming.nonzero?
-    begin
-      messenger.get(msg)
-    rescue Qpid::Proton::Error => error
-      puts "ERROR: #{error.message}"
-      exit
-    end
-
-    puts "Address: #{msg.address}"
-    subject = msg.subject || "(no subject)"
-    puts "Subject: #{subject}"
-    puts "Body: #{msg.body}"
-    puts "Properties: #{msg.properties}"
-    puts "Instructions: #{msg.instructions}"
-    puts "Annotations: #{msg.annotations}"
-  end
-end
-
-messenger.stop
-
diff --git a/examples/ruby/messenger/send.rb b/examples/ruby/messenger/send.rb
deleted file mode 100644
index bdbeb4d..0000000
--- a/examples/ruby/messenger/send.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env ruby
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-require 'qpid_proton'
-require 'optparse'
-
-options = {}
-messages = []
-
-OptionParser.new do |opts|
-  opts.banner = "Usage: send.rb [options] <msg1> ... <msgn>"
-  opts.on("-a", "--address [addr]", "The receiver's address (def. 0.0.0.0)") do |f|
-    options[:address] = f
-  end
-
-  opts.parse!
-
-  messages = ARGV
-end
-
-options[:address] = "0.0.0.0" unless options[:address]
-messages << "Hello world!" if messages.empty?
-
-messenger = Qpid::Proton::Messenger::Messenger.new
-messenger.start
-msg = Qpid::Proton::Message.new
-
-messages.each do |message|
-  msg.address = options[:address]
-  msg.subject = "How are you?"
-  msg["sent"] = Time.new
-  msg["hostname"] = ENV["HOSTNAME"]
-  msg.instructions["fold"] = "yes"
-  msg.instructions["spindle"] = "no"
-  msg.instructions["mutilate"] = "no"
-  msg.annotations["version"] = 1.0
-  msg.annotations["pill"] = :RED
-  msg.body = message
-
-  begin
-    messenger.put(msg)
-  rescue Qpid::Proton::ProtonError => error
-    puts "ERROR: #{error.message}"
-    exit
-  end
-end
-
-begin
-  messenger.send
-rescue Qpid::Proton::ProtonError => error
-  puts "ERROR: #{error.message}"
-  puts error.backtrace.join("\n")
-  exit
-end
-
-puts "SENT: " + messages.join(",")
-
-messenger.stop
diff --git a/examples/ruby/reactor/README.md b/examples/ruby/reactor/README.md
deleted file mode 100644
index 38cc6ba..0000000
--- a/examples/ruby/reactor/README.md
+++ /dev/null
@@ -1,103 +0,0 @@
-## What Is The Reactor?
-
-A little outside of the scope of this document, but the reactor is an event source for letting an application know about events in the Proton messaging system. With this set of APIs an application can be register handlers that are notified when a connection is created, a message received, or a session closes.
-
-### Handlers
-
-An application creates **handlers**, objects which provide methods through which the reactor notifies the application's components of events and allows them each to handle the ones in which they are interested (see the Chain Of Responsibility design pattern for more on this idea). There are some pre-defined handlers for responding to incoming message events, outgoing message events, data flow and managing the AMQP endpoints. Look in the **Qpid::Proton::Handlers** package for more details on these classes.
-
-## Simple Reactor Examples
-
-### The Broker
-
-The reactor examples come with a sample broker which can be used by other examples and which also works as an example itself. For now we'll just start up the broker example and tell it to listen on port 8888:
-
-````
-$ ruby ../examples/ruby/reactor/broker.rb  --address=0.0.0.0:8888
-Listening on 0.0.0.0:8888
-````
-
-This example broker will receive messages, create queues as needed, and deliver messages to endpoints.
-
-### Hello World Using A Broker
-
-Our first example creates an endpoint that sends messages to a queue to which it is subscribed. So it both sends and receives its message in one pass.
-
-To start it, simply run:
-
-```
-$ ruby ../examples/ruby/reactor/helloworld.rb --address=0.0.0.0:8888 --queue=examples
-Hello world!
-```
-
-As you can see, the classic message was output by the example. Now let's take a look at what's going on under the covers.
-
-#### Events When Talking To A Broker
-
-The following events occur while **helloworld.rb** runs:
-
- * **on_start** - Fired when the application is started.
- * **on_sendable** - Fired when a message can be sent.
- * **on_message** - Fired when a message is received.
-
-### Hello World Without A Broker required
-
-The next example we'll look at will send the classic "Hello world" message to itself directly. This example shows some very fundamental elements of the reactor APIs that you should understand.
-
-To launch the example:
-
-```
- $ ruby helloworld_direct.rb --address=0.0.0.0:8888/examples
- Hello world!
-```
-
-Not very different from the example that uses the broker, which is what we'd expect from the outside. But let's take a look inside of the example and see how it's different at that level
-
-The direct version takes on the responsibility for listening to incoming connections as well as making an outgoing connection. So we see the following additional events occurring:
-
- * **on_accepted** - Fired when a message is received.
- * **on_connection_closed** - Fired when an endpoint closes its connection.
-
-## More Complex Reactor Examples
-
-Now that we've covered the basics with the archetypical hello world app, let's look at some more interesting examples.
-
-There are four example applications that demonstrate how to send and receive messages both directly and through an intermediary, such as a broker:
-
- * **simple_send.rb** - sends messages to a receiver at a specific address and receives responses via an intermediary,
- * **simple_recv.rb** - receives messages from via an intermediary,
- * **direct_send.rb** - sends messages directly to a receiver and listens for responses itself, and
- * **direct_recv.rb** - receives messages directly.
-
- Simple send and direct send may, at first, seem to be so similar that you wonder why they're not just the same applciation. And I know for me I was wonder as I wrote the list above why there were two examples. The reason is that **simple_send.rb** uses the intermediary transfer responses to the messages it sends, while **direct_send.rb** uses an *Acceptor* to listen for an process responses.
-
- You can use the examples in the follow ways:
-
- ```
- simple_send.rb -> broker <- simple_recv.rb
- simple_send.rb -> direct_recv.rb
- direct_send.rb -> simple_recv.rb
- ```
-
-In this set of examples we see the following event occurring, in addition to what we've seen before:
-
- * **on_disconnected** - Fired when the transport is closed.
-
-## Now About That Broker example
-
-The **broker.rb** example application is a nice demonstration of doing something more interesting in Ruby with Proton.
-
-The way the broker works is to listen to incoming connections, examine the components of the address for that connection, attach that connection to an exchange managing that address and then it sends any messages destined for that address to them.
-
-The components of the broker example include:
- * **Broker** - A class that extends the MessagingHandler class. It accepts incoming connections, manages subscribing them to exchanges, and transfers messages between them.
- * **Exchange** - A class that represents a message queue, tracking what endpoints are subscribed to it.
-
-The Broker manages a map connecting a queue address to the instance of Exchange that holds references to the endpoints of interest.
-
-The broker application demonstrates a new set of reactor events:
-
- * **on_link_opening** - Fired when a remote link is opened but the local end is not yet open. From this event the broker grabs the address and subscribes the link to an exchange for that address.
- * **on_link_closing** - Fired when a remote link is closed but the local end is still open. From this event the broker grabs the address and unsubscribes the link from that exchange.
- * **on_connection_closing** - Fired when a remote connection is closed but the local end is still open.
- * **on_disconnected** - Fired when the protocol transport has closed. The broker removes all links for the disconnected connection, avoiding workign with endpoints that are now gone.
diff --git a/examples/ruby/reactor/broker.rb b/examples/ruby/reactor/broker.rb
deleted file mode 100644
index 7882d9a..0000000
--- a/examples/ruby/reactor/broker.rb
+++ /dev/null
@@ -1,200 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-require 'qpid_proton'
-require 'optparse'
-require 'pathname'
-
-require_relative '../lib/debugging'
-
-class Exchange
-
-  include Debugging
-
-  def initialize(dynamic = false)
-    @dynamic = dynamic
-    @queue = Queue.new
-    @consumers = []
-  end
-
-  def subscribe(consumer)
-    debug("subscribing #{consumer}") if $options[:debug]
-    @consumers << (consumer)
-    debug(" there are #{@consumers.size} consumers") if $options[:debug]
-  end
-
-  def unsubscribe(consumer)
-    debug("unsubscribing #{consumer}") if $options[:debug]
-    if @consumers.include?(consumer)
-      @consumers.delete(consumer)
-    else
-      debug(" consumer doesn't exist") if $options[:debug]
-    end
-    debug("  there are #{@consumers.size} consumers") if $options[:debug]
-    @consumers.empty? && (@dynamic || @queue.empty?)
-  end
-
-  def publish(message)
-    debug("queueing message: #{message.body}") if $options[:debug]
-    @queue << message
-    self.dispatch
-  end
-
-  def dispatch(consumer = nil)
-    debug("dispatching: consumer=#{consumer}") if $options[:debug]
-    if consumer
-      c = [consumer]
-    else
-      c = @consumers
-    end
-
-    while self.deliver_to(c) do
-    end
-  end
-
-  def deliver_to(consumers)
-    debug("delivering to #{consumers.size} consumer(s)") if $options[:debug]
-    result = false
-    consumers.each do |consumer|
-      debug(" current consumer=#{consumer} credit=#{consumer.credit}") if $options[:debug]
-      if consumer.credit > 0 && !@queue.empty?
-        consumer.send(@queue.pop(true))
-        result = true
-      end
-    end
-    return result
-  end
-
-end
-
-class Broker < Qpid::Proton::Handler::MessagingHandler
-
-  include Debugging
-
-  def initialize(url)
-    super()
-    @url = url
-    @queues = {}
-  end
-
-  def on_start(event)
-    debug("on_start event") if $options[:debug]
-    @acceptor = event.container.listen(@url)
-    print "Listening on #{@url}\n"
-  end
-
-  def queue(address)
-    debug("fetching queue for #{address}: (there are #{@queues.size} queues)") if $options[:debug]
-    unless @queues.has_key?(address)
-      debug(" creating new queue") if $options[:debug]
-      @queues[address] = Exchange.new
-    else
-      debug(" using existing queue") if $options[:debug]
-    end
-    result = @queues[address]
-    debug(" returning #{result}") if $options[:debug]
-    return result
-  end
-
-  def on_link_opening(event)
-    debug("processing on_link_opening") if $options[:debug]
-    debug("link is#{event.link.sender? ? '' : ' not'} a sender") if $options[:debug]
-    if event.link.sender?
-      if event.link.remote_source.dynamic?
-        address = SecureRandom.uuid
-        event.link.source.address = address
-        q = Exchange.new(true)
-        @queues[address] = q
-        q.subscribe(event.link)
-      elsif event.link.remote_source.address
-        event.link.source.address = event.link.remote_source.address
-        self.queue(event.link.source.address).subscribe(event.link)
-      end
-    elsif event.link.remote_target.address
-      event.link.target.address = event.link.remote_target.address
-    end
-  end
-
-  def unsubscribe(link)
-    debug("unsubscribing #{link.address}") if $options[:debug]
-    if @queues.has_key?(link.source.address)
-      if @queues[link.source.address].unsubscribe(link)
-        @queues.delete(link.source.address)
-      end
-    end
-  end
-
-  def on_link_closing(event)
-    self.unsubscribe(event.link) if event.link.sender?
-  end
-
-  def on_connection_closing(event)
-    self.remove_stale_consumers(event.connection)
-  end
-
-  def on_disconnected(event)
-    self.remove_stale_consumers(event.connection)
-  end
-
-  def remove_stale_consumers(connection)
-    l = connection.link_head(Qpid::Proton::Endpoint::REMOTE_ACTIVE)
-    while !l.nil?
-      self.unsubscribe(l) if l.sender?
-      l = l.next(Qpid::Proton::Endpoint::REMOTE_ACTIVE)
-    end
-  end
-
-  def on_sendable(event)
-    debug("on_sendable event") if $options[:debug]
-    q = self.queue(event.link.source.address)
-    debug(" dispatching #{event.message} to #{q}") if $options[:debug]
-    q.dispatch(event.link)
-  end
-
-  def on_message(event)
-    debug("on_message event") if $options[:debug]
-    q = self.queue(event.link.target.address)
-    debug(" dispatching #{event.message} to #{q}") if $options[:debug]
-    q.publish(event.message)
-  end
-
-end
-
-$options = {
-  :address => "localhost:5672",
-  :debug => false
-}
-
-OptionParser.new do |opts|
-  opts.banner = "Usage: #{Pathname.new(__FILE__).basename} [$options]"
-
-  opts.on("-a", "--address=ADDRESS", "Send messages to ADDRESS (def. #{$options[:address]}).") do |address|
-    $options[:address] = address
-  end
-
-  opts.on("-d", "--debug", "Enable debugging output (def. #{$options[:debug]})") do
-    $options[:debug] = true
-  end
-
-end.parse!
-
-begin
-  Qpid::Proton::Reactor::Container.new(Broker.new($options[:address])).run
-rescue Interrupt
-end
diff --git a/examples/ruby/reactor/client.rb b/examples/ruby/reactor/client.rb
deleted file mode 100644
index 8c38f38..0000000
--- a/examples/ruby/reactor/client.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-require 'qpid_proton'
-require 'optparse'
-
-class Client < Qpid::Proton::Handler::MessagingHandler
-
-  def initialize(url, requests)
-    super()
-    @url = url
-    @requests = requests
-  end
-
-  def on_start(event)
-    @sender = event.container.create_sender(@url)
-    @receiver = event.container.create_receiver(@sender.connection, :dynamic => true)
-  end
-
-  def next_request
-    if @receiver.remote_source.address
-      req = Qpid::Proton::Message.new
-      req.reply_to = @receiver.remote_source.address
-      req.body = @requests.first
-      puts "-> #{req.body}"
-      @sender.send(req)
-    end
-  end
-
-  def on_link_opened(event)
-    if event.receiver == @receiver
-      next_request
-    end
-  end
-
-  def on_message(event)
-    puts "<- #{event.message.body}"
-    @requests.delete_at(0)
-    if !@requests.empty?
-      next_request
-    else
-      event.connection.close
-    end
-  end
-
-  def on_transport_error(event)
-    raise "Connection error: #{event.transport.condition}"
-  end
-
-end
-
-REQUESTS = ["Twas brillig, and the slithy toves",
-            "Did gire and gymble in the wabe.",
-            "All mimsy were the borogroves,",
-            "And the mome raths outgrabe."]
-
-options = {
-  :address => "localhost:5672/examples",
-}
-
-OptionParser.new do |opts|
-  opts.banner = "Usage: client.rb [options]"
-  opts.on("-a", "--address=ADDRESS", "Send messages to ADDRESS (def. #{options[:address]}).") { |address| options[:address] = address }
-end.parse!
-
-Qpid::Proton::Reactor::Container.new(Client.new(options[:address], REQUESTS)).run
diff --git a/examples/ruby/reactor/direct_recv.rb b/examples/ruby/reactor/direct_recv.rb
deleted file mode 100644
index 2e19b04..0000000
--- a/examples/ruby/reactor/direct_recv.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-require 'qpid_proton'
-require 'optparse'
-
-require_relative '../lib/send_and_receive'
-
-class DirectReceive < ExampleReceive
-
-  def initialize(url, expected)
-    super
-  end
-
-  def on_start(event)
-    @acceptor = event.container.listen(self.url)
-  end
-
-  def on_message(event)
-    super(event)
-    @acceptor.close if self.finished?
-  end
-
-end
-
-options = {
-  :address => "localhost:5672/examples",
-  :messages => 100,
-}
-
-OptionParser.new do |opts|
-  opts.banner = "Usage: simple_send.rb [options]"
-
-  opts.on("-a", "--address=ADDRESS", "Send messages to ADDRESS (def. #{options[:address]}).") do |address|
-    options[:address] = address
-  end
-
-  opts.on("-m", "--messages=COUNT", "The number of messages to send (def. #{options[:messages]}",
-    OptionParser::DecimalInteger) do |messages|
-    options[:messages] = messages
-  end
-end.parse!
-
-Qpid::Proton::Reactor::Container.new(DirectReceive.new(options[:address], options[:messages])).run
diff --git a/examples/ruby/reactor/direct_send.rb b/examples/ruby/reactor/direct_send.rb
deleted file mode 100644
index 22ce7de..0000000
--- a/examples/ruby/reactor/direct_send.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-require 'qpid_proton'
-require 'optparse'
-
-require_relative '../lib/send_and_receive'
-
-options = {
-  :address => "localhost:5672/examples",
-  :messages => 100,
-}
-
-class SimpleSend < ExampleSend
-
-  def initialize(url, messages)
-    super(url, messages)
-  end
-
-  def on_start(event)
-    @acceptor = event.container.listen(url)
-  end
-
-end
-
-OptionParser.new do |opts|
-  opts.banner = "Usage: simple_send.rb [options]"
-
-  opts.on("-a", "--address=ADDRESS", "Send messages to ADDRESS (def. #{options[:address]}).") do |address|
-    options[:address] = address
-  end
-
-  opts.on("-m", "--messages=COUNT", "The number of messages to send (def. #{options[:messages]}",
-    OptionParser::DecimalInteger) do |messages|
-    options[:messages] = messages
-  end
-end.parse!
-
-begin
-  Qpid::Proton::Reactor::Container.new(SimpleSend.new(options[:address], options[:messages])).run
-rescue Interrupt => error
-  puts "ERROR: #{error}"
-end
diff --git a/examples/ruby/reactor/helloworld.rb b/examples/ruby/reactor/helloworld.rb
deleted file mode 100644
index 9b02e8a..0000000
--- a/examples/ruby/reactor/helloworld.rb
+++ /dev/null
@@ -1,73 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-require 'qpid_proton'
-require 'optparse'
-
-class HelloWorld < Qpid::Proton::Handler::MessagingHandler
-
-  def initialize(server, address)
-    super()
-    @server = server
-    @address = address
-  end
-
-  def on_start(event)
-    conn = event.container.connect(:address => @server)
-    event.container.create_sender(conn, :target => @address)
-    event.container.create_receiver(conn, :source => @address)
-  end
-
-  def on_sendable(event)
-    msg = Qpid::Proton::Message.new
-    msg.body = "Hello world!"
-    event.sender.send(msg)
-    event.sender.close
-  end
-
-  def on_message(event)
-    puts event.message.body
-    event.connection.close
-  end
-
-  def on_transport_error(event)
-    raise "Connection error: #{event.transport.condition}"
-  end
-end
-
-options = {
-  :address => "localhost:5672",
-  :queue => "examples"
-}
-
-OptionParser.new do |opts|
-  opts.banner = "Usage: helloworld_direct.rb [options]"
-
-  opts.on("-a", "--address=ADDRESS", "Send messages to ADDRESS (def. #{options[:address]}).") do |address|
-    options[:address] = address
-  end
-
-  opts.on("-q", "--queue=QUEUE", "Send messages to QUEUE (def. #{options[:queue]})") do |queue|
-    options[:queue] = queue
-  end
-
-end.parse!
-
-hw = HelloWorld.new(options[:address], "examples")
-Qpid::Proton::Reactor::Container.new(hw).run
diff --git a/examples/ruby/reactor/helloworld_direct.rb b/examples/ruby/reactor/helloworld_direct.rb
deleted file mode 100644
index e98cc1f..0000000
--- a/examples/ruby/reactor/helloworld_direct.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-require 'qpid_proton'
-require 'optparse'
-
-options = {
-  :address => "localhost:5672/examples",
-}
-
-class HelloWorldDirect < Qpid::Proton::Handler::MessagingHandler
-
-  include Qpid::Proton::Util::Wrapper
-
-  def initialize(url)
-    super()
-    @url = url
-  end
-
-  def on_start(event)
-    @acceptor = event.container.listen(@url)
-    event.container.create_sender(@url)
-  end
-
-  def on_sendable(event)
-    msg = Qpid::Proton::Message.new
-    msg.body = "Hello world!"
-    event.sender.send(msg)
-    event.sender.close
-  end
-
-  def on_message(event)
-    puts "#{event.message.body}"
-  end
-
-  def on_accepted(event)
-    event.connection.close
-  end
-
-  def on_connection_closed(event)
-    @acceptor.close
-  end
-
-end
-
-OptionParser.new do |opts|
-  opts.banner = "Usage: helloworld_direct.rb [options]"
-
-  opts.on("-a", "--address=ADDRESS", "Send messages to ADDRESS (def. #{options[:address]}).") do |address|
-    options[:address] = address
-  end
-
-end.parse!
-
-begin
-  Qpid::Proton::Reactor::Container.new(HelloWorldDirect.new(options[:address])).run
-rescue Interrupt => error
-end
diff --git a/examples/ruby/reactor/server.rb b/examples/ruby/reactor/server.rb
deleted file mode 100644
index 9373272..0000000
--- a/examples/ruby/reactor/server.rb
+++ /dev/null
@@ -1,76 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-require 'qpid_proton'
-require 'optparse'
-
-class Server < Qpid::Proton::Handler::MessagingHandler
-
-  def initialize(url)
-    super()
-    @url = Qpid::Proton::URL.new url
-    @address = @url.path
-    @senders = {}
-  end
-
-  def on_start(event)
-    @container = event.container
-    @conn = @container.connect(:url => @url)
-    @receiver = @container.create_receiver(@conn, :source => @address)
-    @relay = nil
-  end
-
-  def on_connection_opened(event)
-    if event.connection.remote_offered_capabilities &&
-      event.connection.remote_offered_capabilities.contain?("ANONYMOUS-RELAY")
-      @relay = @container.create_sender(@conn, nil)
-    end
-  end
-
-  def on_message(event)
-    msg = event.message
-    puts "<- #{msg.body}"
-    sender = @relay || @senders[msg.reply_to]
-    if sender.nil?
-      sender = @container.create_sender(@conn, :target => msg.reply_to)
-      @senders[msg.reply_to] = sender
-    end
-    reply = Qpid::Proton::Message.new
-    reply.address = msg.reply_to
-    reply.body = msg.body.upcase
-    puts "-> #{reply.body}"
-    reply.correlation_id = msg.correlation_id
-    sender.send(reply)
-  end
-
-  def on_transport_error(event)
-    raise "Connection error: #{event.transport.condition}"
-  end
-end
-
-options = {
-  :address => "localhost:5672/examples",
-}
-
-OptionParser.new do |opts|
-  opts.banner = "Usage: server.rb [options]"
-  opts.on("-a", "--address=ADDRESS", "Send messages to ADDRESS (def. #{options[:address]}).") { |address| options[:address] = address }
-end.parse!
-
-Qpid::Proton::Reactor::Container.new(Server.new(options[:address])).run()
diff --git a/examples/ruby/reactor/simple_recv.rb b/examples/ruby/reactor/simple_recv.rb
deleted file mode 100644
index 55a37ee..0000000
--- a/examples/ruby/reactor/simple_recv.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-require 'qpid_proton'
-require 'optparse'
-
-require_relative '../lib/send_and_receive'
-
-class Receiver < ExampleReceive
-
-  def initialize(url, count)
-    super(url, count)
-  end
-
-  def on_start(event)
-    event.container.create_receiver(@url)
-  end
-
-end
-
-options = {
-  :address => "localhost:5672/examples",
-  :messages => 100,
-}
-
-OptionParser.new do |opts|
-  opts.banner = "Usage: simple_send.rb [options]"
-
-  opts.on("-a", "--address=ADDRESS", "Send messages to ADDRESS (def. #{options[:address]}).") do |address|
-    options[:address] = address
-  end
-
-  opts.on("-m", "--messages=COUNT", "The number of messages to send (def. #{options[:messages]}",
-    OptionParser::DecimalInteger) do |messages|
-    options[:messages] = messages
-  end
-end.parse!
-
-begin
-  Qpid::Proton::Reactor::Container.new(Receiver.new(options[:address], options[:messages])).run
-rescue Interrupt
-end
diff --git a/examples/ruby/reactor/simple_send.rb b/examples/ruby/reactor/simple_send.rb
deleted file mode 100644
index 1dd4150..0000000
--- a/examples/ruby/reactor/simple_send.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-require 'qpid_proton'
-require 'optparse'
-
-require_relative '../lib/send_and_receive'
-
-options = {
-  :address => "localhost:5672/examples",
-  :messages => 100,
-}
-
-class SimpleSend < ExampleSend
-
-  def initialize(url, messages)
-    super(url, messages)
-  end
-
-  def on_start(event)
-    event.container.create_sender(url)
-  end
-
-end
-
-OptionParser.new do |opts|
-  opts.banner = "Usage: simple_send.rb [options]"
-
-  opts.on("-a", "--address=ADDRESS", "Send messages to ADDRESS (def. #{options[:address]}).") do |address|
-    options[:address] = address
-  end
-
-  opts.on("-m", "--messages=COUNT", "The number of messages to send (def. #{options[:messages]}",
-    OptionParser::DecimalInteger) do |messages|
-    options[:messages] = messages
-  end
-end.parse!
-
-Qpid::Proton::Reactor::Container.new(SimpleSend.new(options[:address], options[:messages])).run
diff --git a/examples/ruby/registry_test.rb b/examples/ruby/registry_test.rb
deleted file mode 100644
index b4b1f6c..0000000
--- a/examples/ruby/registry_test.rb
+++ /dev/null
@@ -1,76 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-require 'qpid_proton'
-require 'weakref'
-
-def show_registry(registry)
-  registry.each_pair do |key, value|
-    registry.delete(key) if value.weakref_alive?
-  end
-  puts "The contents of the registry: size=#{registry.size}"
-end
-
-def show_object_count(clazz)
-  puts "There are #{ObjectSpace.each_object(clazz).count} instances of #{clazz}."
-end
-
-impl = Cproton.pn_transport
-implclazz = impl.class
-transport = Qpid::Proton::Transport.wrap(impl)
-
-puts "Initial setup:"
-show_object_count(Qpid::Proton::Transport)
-show_object_count(implclazz)
-
-transport = nil
-
-show_registry(Qpid::Proton.registry)
-
-ObjectSpace.garbage_collect
-
-puts "After garbage collection:"
-show_object_count(Qpid::Proton::Transport)
-show_object_count(implclazz)
-
-MAXCOUNT=100000
-(1..MAXCOUNT).each do |which|
-  nimpl = Cproton.pn_transport
-  Cproton.pn_incref(nimpl)
-  transport = Qpid::Proton::Transport.wrap(nimpl)
-  transport = Qpid::Proton::Transport.wrap(nimpl)
-end
-
-transport = nil
-
-puts "After creating #{MAXCOUNT} instances"
-show_object_count(Qpid::Proton::Transport)
-show_object_count(implclazz)
-show_registry(Qpid::Proton.registry)
-
-ObjectSpace.garbage_collect
-
-transport = Qpid::Proton::Transport.wrap(impl)
-
-puts "After garbage collection:"
-puts "impl=#{impl}"
-puts "transport=#{transport}"
-show_object_count(Qpid::Proton::Transport)
-show_object_count(implclazz)
-show_registry(Qpid::Proton.registry)
diff --git a/examples/ruby/wrapper_test.rb b/examples/ruby/wrapper_test.rb
deleted file mode 100644
index ca7e250..0000000
--- a/examples/ruby/wrapper_test.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-require 'qpid_proton'
-
-def how_many_transports?(expected)
-  count = ObjectSpace.each_object(Qpid::Proton::Transport).count
-  if expected.min == expected.max
-    expectation = "#{expected.min}"
-  else
-    expectation = "#{expected.min} <= count <= #{expected.max}"
-  end
-  puts "Transport count: found #{count}, expected #{expectation} (#{expected.include?(count) ? 'Good' : 'Bad'})"
-end
-
-transport = Qpid::Proton::Transport.new
-timpl = transport.impl
-
-puts "================================="
-puts "= Storing my original transport ="
-puts "================================="
-puts "   Stored transport=#{transport} (#{Cproton.pni_address_of(timpl).to_s(16)})"
-how_many_transports?(1..1)
-puts "================================="
-transport.instance_eval { @first_name = "Darryl"; @last_name = "Pierce", @instance_id = 717 }
-transport = nil
-
-
-puts ""
-max = 1000
-puts "Creating #{max} instances of Transport"
-(0...max).each do |which|
-  t = Qpid::Proton::Transport.new
-  t.instance_eval { @instance_id = which }
-  t = nil
-end
-
-puts ""
-puts "===================================="
-puts "= Retrieving my original transport ="
-puts "===================================="
-transport = Qpid::Proton::Transport.wrap(timpl)
-puts "Retrieved transport=#{transport} (#{Cproton.pni_address_of(timpl).to_s(16)})"
-how_many_transports?(1..1001)
-puts "===================================="
-puts "My transport attributes:"
-puts transport
-
-transport = nil
-GC.start
-how_many_transports?(1..1)
-
-puts ""
-puts "======================================"
-puts "= Throwing away the Transport object ="
-puts "======================================"
-transport = nil
-timpl.instance_eval { @proton_wrapper = nil }
-GC.start
-begin
-  transport = Qpid::Proton::Transport.wrap(timpl)
-  puts "!!! This should fail!"
-rescue Qpid::Proton::ProtonError => error
-  puts "Good, it failed..."
-end
-how_many_transports?(0..0)
diff --git a/proton-c/.gitignore b/proton-c/.gitignore
deleted file mode 100644
index 223c5c6..0000000
--- a/proton-c/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-*.pyc
-*.o
-*.d
-src/codec/encodings.h
-src/protocol.h
-src/proton
-src/test
-src/libqpidproton.so
diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt
deleted file mode 100644
index 5f26d43..0000000
--- a/proton-c/CMakeLists.txt
+++ /dev/null
@@ -1,751 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-include(CheckLibraryExists)
-include(CheckSymbolExists)
-
-include(soversion.cmake)
-
-add_custom_target(docs)
-add_custom_target(doc DEPENDS docs)
-
-# Set the default SSL/TLS implementation
-find_package(OpenSSL)
-find_package(PythonInterp REQUIRED)
-find_package(SWIG)
-# FindSwig.cmake "forgets" make its outputs advanced like a good citizen
-mark_as_advanced(SWIG_DIR SWIG_EXECUTABLE SWIG_VERSION)
-
-# See if Cyrus SASL is available
-find_library(CYRUS_SASL_LIBRARY sasl2)
-find_path(CYRUS_SASL_INCLUDE_DIR sasl/sasl.h PATH_SUFFIXES include)
-find_package_handle_standard_args(CyrusSASL DEFAULT_MSG CYRUS_SASL_LIBRARY CYRUS_SASL_INCLUDE_DIR)
-mark_as_advanced(CYRUS_SASL_LIBRARY CYRUS_SASL_INCLUDE_DIR)
-
-# Find saslpasswd2 executable to generate test config
-find_program(SASLPASSWD_EXE saslpasswd2 DOC "Program used to make SASL user db for testing")
-mark_as_advanced(SASLPASSWD_EXE)
-
-if(WIN32 AND NOT CYGWIN)
-  # linking against Windows native libraries, including mingw
-  set (PN_WINAPI TRUE)
-endif(WIN32 AND NOT CYGWIN)
-
-set(ssl_impl, none)
-if(PN_WINAPI)
-  set(ssl_impl schannel)
-  set(ssl_providers "'none','schannel','openssl'")
-else(PN_WINAPI)
-  if (OPENSSL_FOUND)
-    set(ssl_impl openssl)
-  endif (OPENSSL_FOUND)
-  set(ssl_providers "'none','openssl'")
-endif(PN_WINAPI)
-set(SSL_IMPL ${ssl_impl} CACHE STRING "Library to use for SSL/TLS support. Valid values: ${ssl_providers}")
-
-set(sasl_providers cyrus none)
-if (CYRUSSASL_FOUND)
-  set (sasl_impl cyrus)
-else ()
-  set (sasl_impl none)
-endif ()
-set(SASL_IMPL ${sasl_impl} CACHE STRING "Library to use for SASL support. Valid values: ${sasl_providers}")
-
-configure_file (
-  "${CMAKE_CURRENT_SOURCE_DIR}/include/proton/version.h.in"
-  "${CMAKE_CURRENT_BINARY_DIR}/include/proton/version.h"
-  )
-
-include_directories ("${CMAKE_CURRENT_BINARY_DIR}/src")
-include_directories ("${CMAKE_CURRENT_BINARY_DIR}/include")
-include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/src")
-include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/include")
-
-set (env_py ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/env.py)
-
-add_custom_command (
-  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/src/encodings.h
-  COMMAND ${env_py} PYTHONPATH=${CMAKE_CURRENT_SOURCE_DIR} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/src/encodings.h.py > ${CMAKE_CURRENT_BINARY_DIR}/src/encodings.h
-  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/encodings.h.py
-  )
-
-add_custom_command (
-  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/src/protocol.h
-  COMMAND ${env_py} PYTHONPATH=${CMAKE_CURRENT_SOURCE_DIR} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/src/protocol.h.py > ${CMAKE_CURRENT_BINARY_DIR}/src/protocol.h
-  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/protocol.h.py
-  )
-
-add_custom_target(
-  generated_c_files
-  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/src/protocol.h ${CMAKE_CURRENT_BINARY_DIR}/src/encodings.h
-  )
-
-# Select IO impl
-if(PN_WINAPI)
-  set (pn_io_impl src/reactor/io/windows/io.c src/reactor/io/windows/iocp.c src/reactor/io/windows/write_pipeline.c)
-  set (pn_selector_impl src/reactor/io/windows/selector.c)
-else(PN_WINAPI)
-  set (pn_io_impl src/reactor/io/posix/io.c)
-  set (pn_selector_impl src/reactor/io/posix/selector.c)
-endif(PN_WINAPI)
-
-# Link in SASL if present
-if (SASL_IMPL STREQUAL cyrus)
-  set(pn_sasl_impl src/sasl/sasl.c src/sasl/cyrus_sasl.c)
-  include_directories (${CYRUS_SASL_INCLUDE_DIR})
-  set(SASL_LIB ${CYRUS_SASL_LIBRARY} -lpthread)
-elseif (SASL_IMPL STREQUAL none)
-  set(pn_sasl_impl src/sasl/sasl.c src/sasl/none_sasl.c)
-endif ()
-
-# Set Compiler extra flags for Solaris when using SunStudio
-if(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro" )
-    set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mt" )
-endif()
-
-if(CMAKE_C_COMPILER_ID STREQUAL "SunPro" )
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mt")
-endif()
-
-# Link in openssl if present
-if (SSL_IMPL STREQUAL openssl)
-  set (pn_ssl_impl src/ssl/openssl.c)
-  include_directories (${OPENSSL_INCLUDE_DIR})
-  set (SSL_LIB ${OPENSSL_LIBRARIES})
-elseif (SSL_IMPL STREQUAL schannel)
-  set (pn_ssl_impl src/ssl/schannel.c)
-  set (SSL_LIB Crypt32.lib Secur32.lib)
-else ()
-  set (pn_ssl_impl src/ssl/ssl_stub.c)
-endif ()
-
-# First check whether we get clock_gettime without any special library linked
-CHECK_SYMBOL_EXISTS(clock_gettime "time.h" CLOCK_GETTIME_IN_LIBC)
-if (CLOCK_GETTIME_IN_LIBC)
-  list(APPEND PLATFORM_DEFINITIONS "USE_CLOCK_GETTIME")
-else (CLOCK_GETTIME_IN_LIBC)
-  CHECK_LIBRARY_EXISTS (rt clock_gettime "" CLOCK_GETTIME_IN_RT)
-  if (CLOCK_GETTIME_IN_RT)
-    set (TIME_LIB rt)
-    list(APPEND PLATFORM_DEFINITIONS "USE_CLOCK_GETTIME")
-  else (CLOCK_GETTIME_IN_RT)
-    CHECK_SYMBOL_EXISTS(GetSystemTimeAsFileTime "windows.h" WINDOWS_FILETIME)
-    if (WINDOWS_FILETIME)
-      list(APPEND PLATFORM_DEFINITIONS "USE_WIN_FILETIME")
-    else (WINDOWS_FILETIME)
-      list(APPEND PLATFORM_DEFINITIONS "USE_GETTIMEOFDAY")
-    endif (WINDOWS_FILETIME)
-  endif (CLOCK_GETTIME_IN_RT)
-endif (CLOCK_GETTIME_IN_LIBC)
-
-if (PN_WINAPI)
-  CHECK_SYMBOL_EXISTS(strerror_s "string.h" STRERROR_S_IN_WINAPI)
-  if (STRERROR_S_IN_WINAPI)
-    list(APPEND PLATFORM_DEFINITIONS "USE_STRERROR_S")
-  else (STRERROR_S_IN_WINAPI)
-    if (MINGW)
-      message (STATUS, "NOTE: your MinGW version lacks a thread safe strerror")
-      list(APPEND PLATFORM_DEFINITIONS "USE_OLD_STRERROR")
-    endif (MINGW)
-  endif (STRERROR_S_IN_WINAPI)
-else (PN_WINAPI)
-  CHECK_SYMBOL_EXISTS(strerror_r "string.h" STRERROR_R_IN_LIBC)
-  if (STRERROR_R_IN_LIBC)
-    list(APPEND PLATFORM_DEFINITIONS "USE_STRERROR_R")
-  endif (STRERROR_R_IN_LIBC)
-endif (PN_WINAPI)
-
-CHECK_SYMBOL_EXISTS(atoll "stdlib.h" C99_ATOLL)
-if (C99_ATOLL)
-  list(APPEND PLATFORM_DEFINITIONS "USE_ATOLL")
-else (C99_ATOLL)
-  CHECK_SYMBOL_EXISTS(_atoi64 "stdlib.h" WINAPI_ATOI64)
-  if (WINAPI_ATOI64)
-    list(APPEND PLATFORM_DEFINITIONS "USE_ATOI64")
-  else (WINAPI_ATOI64)
-    message(FATAL_ERROR "No atoll API found")
-  endif (WINAPI_ATOI64)
-endif (C99_ATOLL)
-
-if (PN_WINAPI)
-  set (PLATFORM_LIBS ws2_32 Rpcrt4)
-  list(APPEND PLATFORM_DEFINITIONS "PN_WINAPI")
-endif (PN_WINAPI)
-
-# Try to keep any platform specific overrides together here:
-
-# MacOS has a bunch of differences in build tools and process and so we have to turn some things
-# off if building there:
-if (APPLE)
-  set (NOBUILD_PHP ON)
-  set (NOENABLE_WARNING_ERROR ON)
-  set (NOENABLE_UNDEFINED_ERROR ON)
-endif (APPLE)
-
-# Make LTO default to off until we can figure out the valgrind issues
-set (NOENABLE_LINKTIME_OPTIMIZATION ON)
-
-# Add options here called <whatever> they will turn into "ENABLE_<whatever" and can be
-# overridden on a platform specific basis above by NOENABLE_<whatever>
-set (OPTIONS WARNING_ERROR UNDEFINED_ERROR LINKTIME_OPTIMIZATION HIDE_UNEXPORTED_SYMBOLS)
-
-foreach (OPTION ${OPTIONS})
-  if (NOT NOENABLE_${OPTION})
-    set ("DEFAULT_${OPTION}" ON)
-  endif ()
-endforeach (OPTION)
-
-# And add the option here too with help text
-option(ENABLE_WARNING_ERROR "Consider compiler warnings to be errors" ${DEFAULT_WARNING_ERROR})
-option(ENABLE_UNDEFINED_ERROR "Check for unresolved library symbols" ${DEFAULT_UNDEFINED_ERROR})
-option(ENABLE_LINKTIME_OPTIMIZATION "Perform link time optimization" ${DEFAULT_LINKTIME_OPTIMIZATION})
-option(ENABLE_HIDE_UNEXPORTED_SYMBOLS "Only export library symbols that are explicitly requested" ${DEFAULT_HIDE_UNEXPORTED_SYMBOLS})
-
-# Set any additional compiler specific flags
-if (CMAKE_COMPILER_IS_GNUCC)
-  if (ENABLE_WARNING_ERROR)
-    set (WERROR "-Werror")
-  endif (ENABLE_WARNING_ERROR)
-  set (COMPILE_WARNING_FLAGS "${WERROR} -Wall -pedantic-errors")
-  # C++ allow "%z" format specifier and variadic macros
-  set (CXX_WARNING_FLAGS "${COMPILE_WARNING_FLAGS} -Wno-format -Wno-variadic-macros")
-  if (NOT BUILD_WITH_CXX)
-    set (COMPILE_WARNING_FLAGS "${COMPILE_WARNING_FLAGS} -Wstrict-prototypes")
-    set (COMPILE_LANGUAGE_FLAGS "-std=c99")
-    set (COMPILE_PLATFORM_FLAGS "-std=gnu99")
-
-    execute_process(COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} ${CMAKE_C_COMPILER_ARG2} -dumpversion OUTPUT_VARIABLE GCC_VERSION
-      OUTPUT_STRIP_TRAILING_WHITESPACE)
-    if (${GCC_VERSION} VERSION_LESS "4.3.0")
-      # Only a concern if contibuting code back.
-      message (STATUS "Old gcc version detected.  C++ compatibility checks disabled")
-    else (${GCC_VERSION} VERSION_LESS "4.3.0")
-      set (COMPILE_WARNING_FLAGS "${COMPILE_WARNING_FLAGS} -Wc++-compat -Wvla -Wsign-compare -Wwrite-strings")
-    endif (${GCC_VERSION} VERSION_LESS "4.3.0")
-  else (NOT BUILD_WITH_CXX)
-    set (COMPILE_WARNING_FLAGS "${CXX_WARNING_FLAGS}")
-  endif (NOT BUILD_WITH_CXX)
-
-  if (ENABLE_UNDEFINED_ERROR)
-    set (CATCH_UNDEFINED "-Wl,--no-undefined")
-    set (ALLOW_UNDEFINED "-Wl,--allow-shlib-undefined")
-  endif (ENABLE_UNDEFINED_ERROR)
-
-  if (ENABLE_LINKTIME_OPTIMIZATION)
-    set (LTO "-flto")
-  endif (ENABLE_LINKTIME_OPTIMIZATION)
-
-  if (ENABLE_HIDE_UNEXPORTED_SYMBOLS)
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
-  endif (ENABLE_HIDE_UNEXPORTED_SYMBOLS)
-elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
-  if (ENABLE_HIDE_UNEXPORTED_SYMBOLS)
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -xldscope=hidden")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -xldscope=hidden")
-  endif (ENABLE_HIDE_UNEXPORTED_SYMBOLS)
-endif (CMAKE_COMPILER_IS_GNUCC)
-
-if (CMAKE_C_COMPILER_ID MATCHES "Clang")
-  if (ENABLE_WARNING_ERROR)
-    set (COMPILE_WARNING_FLAGS "-Werror -Wall -pedantic")
-  endif (ENABLE_WARNING_ERROR)
-endif()
-
-if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-  if (ENABLE_WARNING_ERROR)
-    set (WERROR "-Werror")
-  endif (ENABLE_WARNING_ERROR)
-  # TODO aconway 2016-01-06: we should be able to clean up the code and turn on
-  # some of these warnings.
-  set (CXX_WARNING_FLAGS "${WERROR} -pedantic -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-float-equal -Wno-padded -Wno-sign-conversion -Wno-switch-enum -Wno-weak-vtables -Wno-exit-time-destructors -Wno-global-constructors -Wno-shorten-64-to-32 -Wno-documentation -Wno-documentation-unknown-command -Wno-old-style-cast -Wno-missing-noreturn")
-endif()
-
-# Make flags visible to examples.
-set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS}" PARENT_SCOPE)
-set(COMPILE_WARNING_FLAGS "${COMPILE_WARNING_FLAGS}" PARENT_SCOPE)
-set(COMPILE_LANGUAGE_FLAGS "${COMPILE_LANGUAGE_FLAGS}" PARENT_SCOPE)
-set(LINK_TIME_OPTIMIZATION "${LTO}" PARENT_SCOPE)
-
-
-if (MSVC)
-    set(CMAKE_DEBUG_POSTFIX "d")
-    add_definitions(
-        /wd4244
-        /wd4267
-        /wd4800
-        /wd4996
-    )
-    set (qpid-proton-platform src/compiler/msvc/snprintf.c)
-endif (MSVC)
-
-macro (pn_absolute_install_dir NAME VALUE PREFIX)
-  if(IS_ABSOLUTE ${VALUE})
-    set(${NAME} "${VALUE}")
-  elseif(IS_ABSOLUTE ${PREFIX})
-    set(${NAME} "${PREFIX}/${VALUE}")
-  else()
-    set(${NAME} "${CMAKE_BINARY_DIR}/${PREFIX}/${VALUE}")
-  endif(IS_ABSOLUTE ${VALUE})
-  get_filename_component(${NAME} ${${NAME}} ABSOLUTE)
-endmacro()
-
-pn_absolute_install_dir(PREFIX "." ${CMAKE_INSTALL_PREFIX})
-pn_absolute_install_dir(EXEC_PREFIX "." ${CMAKE_INSTALL_PREFIX})
-pn_absolute_install_dir(LIBDIR ${LIB_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX})
-pn_absolute_install_dir(INCLUDEDIR ${INCLUDE_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX})
-
-add_subdirectory(docs/api)
-add_subdirectory(../tests/tools/apps/c ../tests/tools/apps/c)
-
-# for full source distribution:
-set (qpid-proton-platform-all
-  src/platform/platform.c
-  src/reactor/io/windows/io.c
-  src/reactor/io/windows/iocp.c
-  src/reactor/io/windows/write_pipeline.c
-  src/reactor/io/windows/selector.c
-  src/reactor/io/posix/io.c
-  src/reactor/io/posix/selector.c
-  )
-
-# platform specific library build:
-set (qpid-proton-platform-io
-  src/platform/platform.c
-  ${pn_io_impl}
-  ${pn_selector_impl}
-  )
-
-# for full source distribution:
-set (qpid-proton-layers-all
-  src/sasl/sasl.c
-  src/sasl/cyrus_sasl.c
-  src/sasl/none_sasl.c
-  src/ssl/openssl.c
-  src/ssl/schannel.c
-  src/ssl/ssl_stub.c
-  )
-
-# for current build system's environment:
-set (qpid-proton-layers
-  ${pn_sasl_impl}
-  ${pn_ssl_impl}
-  )
-
-set (qpid-proton-core
-  src/core/object/object.c
-  src/core/object/list.c
-  src/core/object/map.c
-  src/core/object/string.c
-  src/core/object/iterator.c
-  src/core/object/record.c
-
-  src/core/log.c
-  src/core/util.c
-  src/core/error.c
-  src/core/buffer.c
-  src/core/types.c
-
-  src/core/framing.c
-
-  src/core/codec.c
-  src/core/decoder.c
-  src/core/encoder.c
-
-  src/core/dispatcher.c
-  src/core/connection_driver.c
-  src/core/engine.c
-  src/core/event.c
-  src/core/autodetect.c
-  src/core/transport.c
-  src/core/message.c
-  )
-
-set (qpid-proton-include-generated
-  ${CMAKE_CURRENT_BINARY_DIR}/src/encodings.h
-  ${CMAKE_CURRENT_BINARY_DIR}/src/protocol.h
-  ${CMAKE_CURRENT_BINARY_DIR}/include/proton/version.h
-  )
-
-set (qpid-proton-private-includes
-  src/extra/scanner.h
-  src/messenger/store.h
-  src/messenger/subscription.h
-  src/messenger/messenger.h
-  src/messenger/transform.h
-  src/ssl/ssl-internal.h
-  src/sasl/sasl-internal.h
-  src/core/autodetect.h
-  src/core/log_private.h
-  src/core/config.h
-  src/core/encoder.h
-  src/core/dispatch_actions.h
-  src/core/engine-internal.h
-  src/core/transport.h
-  src/core/framing.h
-  src/core/buffer.h
-  src/core/util.h
-  src/core/dispatcher.h
-  src/core/data.h
-  src/core/decoder.h
-  src/reactor/io/windows/iocp.h
-  src/reactor/selector.h
-  src/reactor/io.h
-  src/reactor/reactor.h
-  src/reactor/selectable.h
-  src/platform/platform.h
-  src/platform/platform_fmt.h
-  )
-
-set (qpid-proton-extra
-  src/extra/parser.c
-  src/extra/scanner.c
-  src/extra/url.c
-
-  src/reactor/reactor.c
-  src/reactor/handler.c
-  src/reactor/connection.c
-  src/reactor/acceptor.c
-  src/reactor/selectable.c
-  src/reactor/timer.c
-
-  src/handlers/handshaker.c
-  src/handlers/iohandler.c
-  src/handlers/flowcontroller.c
-
-  src/messenger/messenger.c
-  src/messenger/subscription.c
-  src/messenger/store.c
-  src/messenger/transform.c
-  )
-
-set (qpid-proton-include
-  include/proton/cid.h
-  include/proton/codec.h
-  include/proton/condition.h
-  include/proton/connection.h
-  include/proton/connection_driver.h
-  include/proton/delivery.h
-  include/proton/disposition.h
-  include/proton/engine.h
-  include/proton/error.h
-  include/proton/event.h
-  include/proton/import_export.h
-  include/proton/link.h
-  include/proton/log.h
-  include/proton/message.h
-  include/proton/object.h
-  include/proton/sasl.h
-  include/proton/session.h
-  include/proton/ssl.h
-  include/proton/terminus.h
-  include/proton/transport.h
-  include/proton/type_compat.h
-  include/proton/types.h
-)
-
-set (qpid-proton-include-extra
-  include/proton/handlers.h
-  include/proton/messenger.h
-  include/proton/parser.h
-  include/proton/reactor.h
-  include/proton/selectable.h
-  include/proton/url.h
-)
-
-# note: process bindings after the source lists have been defined so
-# the bindings can reference them
-add_subdirectory(bindings)
-
-source_group("API Header Files" FILES ${qpid-proton-include} ${qpid-proton-include-extra})
-
-set_source_files_properties (
-  ${qpid-proton-core}
-  ${qpid-proton-layers}
-  ${qpid-proton-extra}
-  PROPERTIES
-  COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_LANGUAGE_FLAGS} ${LTO}"
-  )
-
-set_source_files_properties (
-  ${qpid-proton-platform}
-  ${qpid-proton-platform-io}
-  PROPERTIES
-  COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_PLATFORM_FLAGS} ${LTO}"
-  COMPILE_DEFINITIONS "${PLATFORM_DEFINITIONS}"
-  )
-
-if (BUILD_WITH_CXX)
-  set_source_files_properties (
-    ${qpid-proton-core}
-    ${qpid-proton-layers}
-    ${qpid-proton-extra}
-    ${qpid-proton-platform}
-    ${qpid-proton-platform-io}
-    PROPERTIES LANGUAGE CXX
-    )
-endif (BUILD_WITH_CXX)
-
-add_library (
-  qpid-proton-core SHARED
-  ${qpid-proton-core}
-  ${qpid-proton-layers}
-  ${qpid-proton-platform}
-  ${qpid-proton-include}
-  ${qpid-proton-include-generated}
-  )
-add_dependencies(qpid-proton-core generated_c_files)
-
-target_link_libraries (qpid-proton-core ${UUID_LIB} ${SSL_LIB} ${SASL_LIB} ${TIME_LIB} ${PLATFORM_LIBS})
-
-set_target_properties (
-  qpid-proton-core
-  PROPERTIES
-  VERSION   "${PN_LIB_SOMAJOR}.${PN_LIB_SOMINOR}"
-  SOVERSION "${PN_LIB_SOMAJOR}"
-  LINK_FLAGS "${CATCH_UNDEFINED} ${LTO}"
-  )
-
-add_library(
-  qpid-proton SHARED
-  # Proton Core
-  ${qpid-proton-core}
-  ${qpid-proton-layers}
-  ${qpid-proton-platform}
-  ${qpid-proton-include}
-  ${qpid-proton-include-generated}
-
-  # Proton Reactor/Messenger
-  ${qpid-proton-extra}
-  ${qpid-proton-platform-io}
-  ${qpid-proton-include-extra}
-  )
-add_dependencies(qpid-proton generated_c_files)
-
-target_link_libraries (qpid-proton ${UUID_LIB} ${SSL_LIB} ${SASL_LIB} ${TIME_LIB} ${PLATFORM_LIBS})
-
-set_target_properties (
-  qpid-proton
-  PROPERTIES
-  VERSION   "${PN_LIB_SOMAJOR}.${PN_LIB_SOMINOR}"
-  SOVERSION "${PN_LIB_SOMAJOR}"
-  LINK_FLAGS "${CATCH_UNDEFINED} ${LTO}"
-  )
-
-if (MSVC)
-  # guard against use of C99 violating functions on Windows
-  include(WindowsC99CheckDef)
-endif(MSVC)
-
-# Install executables and libraries
-install (TARGETS qpid-proton qpid-proton-core
-  EXPORT  proton
-  RUNTIME DESTINATION bin
-  ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
-  LIBRARY DESTINATION ${LIB_INSTALL_DIR})
-
-# Install windows qpid-proton pdb files
-if (MSVC)
-  install(FILES $<TARGET_PDB_FILE:qpid-proton>
-    DESTINATION bin
-    CONFIGURATIONS RelWithDebInfo Debug
-    OPTIONAL)
-endif (MSVC)
-
-# Install header files
-file(GLOB headers "include/proton/*.[hi]")
-install (FILES ${headers} DESTINATION ${INCLUDE_INSTALL_DIR}/proton)
-install (FILES  ${CMAKE_CURRENT_BINARY_DIR}/include/proton/version.h
-         DESTINATION ${INCLUDE_INSTALL_DIR}/proton)
-
-# Pkg config file
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/src/libqpid-proton.pc.in
-  ${CMAKE_CURRENT_BINARY_DIR}/libqpid-proton.pc @ONLY)
-install (FILES
-  ${CMAKE_CURRENT_BINARY_DIR}/libqpid-proton.pc
-  DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/src/libqpid-proton-core.pc.in
-  ${CMAKE_CURRENT_BINARY_DIR}/libqpid-proton-core.pc @ONLY)
-install (FILES
-  ${CMAKE_CURRENT_BINARY_DIR}/libqpid-proton-core.pc
-  DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-
-
-if (DEFINED CMAKE_IMPORT_LIBRARY_PREFIX)
-set(PROTONLIB ${CMAKE_IMPORT_LIBRARY_PREFIX}qpid-proton${CMAKE_IMPORT_LIBRARY_SUFFIX})
-set(PROTONLIBDEBUG ${CMAKE_IMPORT_LIBRARY_PREFIX}qpid-proton${CMAKE_DEBUG_POSTFIX}${CMAKE_IMPORT_LIBRARY_SUFFIX})
-set(PROTONCORELIB ${CMAKE_IMPORT_LIBRARY_PREFIX}qpid-proton-core${CMAKE_IMPORT_LIBRARY_SUFFIX})
-set(PROTONCORELIBDEBUG ${CMAKE_IMPORT_LIBRARY_PREFIX}qpid-proton-core${CMAKE_DEBUG_POSTFIX}${CMAKE_IMPORT_LIBRARY_SUFFIX})
-else ()
-set(PROTONLIB ${CMAKE_SHARED_LIBRARY_PREFIX}qpid-proton${CMAKE_SHARED_LIBRARY_SUFFIX})
-set(PROTONLIBDEBUG ${CMAKE_SHARED_LIBRARY_PREFIX}qpid-proton${CMAKE_DEBUG_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX})
-set(PROTONCORELIB ${CMAKE_SHARED_LIBRARY_PREFIX}qpid-proton-core${CMAKE_SHARED_LIBRARY_SUFFIX})
-set(PROTONCORELIBDEBUG ${CMAKE_SHARED_LIBRARY_PREFIX}qpid-proton-core${CMAKE_DEBUG_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX})
-endif ()
-
-include(WriteBasicConfigVersionFile)
-
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/src/ProtonConfig.cmake.in
-  ${CMAKE_CURRENT_BINARY_DIR}/ProtonConfig.cmake @ONLY)
-write_basic_config_version_file(
-  ${CMAKE_CURRENT_BINARY_DIR}/ProtonConfigVersion.cmake
-  VERSION ${PN_VERSION}
-  COMPATIBILITY AnyNewerVersion)
-install (FILES
-  ${CMAKE_CURRENT_BINARY_DIR}/ProtonConfig.cmake
-  ${CMAKE_CURRENT_BINARY_DIR}/ProtonConfigVersion.cmake
-  DESTINATION ${LIB_INSTALL_DIR}/cmake/Proton)
-
-# c tests:
-
-add_subdirectory(src/tests)
-
-if (CMAKE_SYSTEM_NAME STREQUAL Windows)
-  # No change needed for windows already use correct separator
-  function(to_native_path path result)
-    file (TO_NATIVE_PATH "${path}" path)
-    set (${result} ${path} PARENT_SCOPE)
-  endfunction()
-else (CMAKE_SYSTEM_NAME STREQUAL Windows)
-  # Just change ';'->':'
-  function(to_native_path path result)
-    file (TO_NATIVE_PATH "${path}" path)
-    string (REGEX REPLACE ";" ":" path "${path}")
-    set (${result} ${path} PARENT_SCOPE)
-  endfunction()
-endif (CMAKE_SYSTEM_NAME STREQUAL Windows)
-
-# python test: tests/python/proton-test
-if (BUILD_PYTHON)
-  set (py_root "${pn_test_root}/python")
-  set (py_src "${CMAKE_CURRENT_SOURCE_DIR}/bindings/python")
-  set (py_bin "${CMAKE_CURRENT_BINARY_DIR}/bindings/python")
-  set (py_dll "$<TARGET_FILE_DIR:_cproton>")
-  set (py_bld "$<TARGET_FILE_DIR:qpid-proton>") # For windows
-  set (app_path $<TARGET_FILE_DIR:msgr-send> "${pn_test_root}/tools/apps/python")
-  set (py_path ${py_bld} ${app_path} $ENV{PATH})
-  set (py_pythonpath ${py_root} ${py_src} ${py_bin} ${py_dll} $ENV{PYTHONPATH})
-  to_native_path ("${py_pythonpath}" py_pythonpath)
-  to_native_path ("${py_path}" py_path)
-
-  add_test (NAME python-test
-            COMMAND ${env_py}
-              "PATH=${py_path}" "PYTHONPATH=${py_pythonpath}"
-              "CLASSPATH=${CMAKE_BINARY_DIR}/proton-j/proton-j.jar"
-              "SASLPASSWD=${SASLPASSWD_EXE}"
-              ${VALGRIND_ENV}
-              ${PYTHON_EXECUTABLE} "${py_root}/proton-test")
-  set_tests_properties(python-test PROPERTIES PASS_REGULAR_EXPRESSION "Totals: .* 0 failed")
-
-  # Eventually, we'll get rid of this check when other
-  # platforms will be supported. Since `setup.py` will skip
-  # the build for non linux plaforms, it doesn't make sense
-  # to try to run them.
-  option(TOX_TEST "Enable muti-version python testing with TOX" ON)
-  if (CMAKE_SYSTEM_NAME STREQUAL Linux AND TOX_TEST)
-    find_program(TOX_EXE "tox")
-    if (CMAKE_BUILD_TYPE MATCHES "Coverage")
-      message(STATUS "Building for coverage analysis; skipping the python-tox-tests")
-    elseif (TOX_EXE)
-      configure_file(
-        "${CMAKE_CURRENT_SOURCE_DIR}/tox.ini.in"
-        "${CMAKE_CURRENT_BINARY_DIR}/tox.ini")
-      add_test (NAME python-tox-test
-                COMMAND ${env_py}
-                  "PATH=${py_path}"
-                  "CLASSPATH=${CMAKE_BINARY_DIR}/proton-j/proton-j.jar"
-                  "SASLPASSWD=${SASLPASSWD_EXE}"
-                  "SWIG=${SWIG_EXECUTABLE}"
-                  ${VALGRIND_ENV}
-                  ${TOX_EXE})
-      set_tests_properties(python-tox-test
-                           PROPERTIES
-                             PASS_REGULAR_EXPRESSION "Totals: .* ignored, 0 failed"
-                             FAIL_REGULAR_EXPRESSION "ERROR:[ ]+py[0-9]*: commands failed")
-    else (TOX_EXE)
-      message(STATUS "The tox tool is not available; skipping the python-tox-tests")
-    endif ()
-  endif (CMAKE_SYSTEM_NAME STREQUAL Linux AND TOX_TEST)
-
-  set (perf_pythonpath "${py_pythonpath}" "${CMAKE_SOURCE_DIR}/examples/cpp")
-  to_native_path ("${perf_pythonpath}" perf_pythonpath)
-  add_custom_target(quick_perf_c ${env_py} -- "PATH=${py_path}" "PYTHONPATH=${perf_pythonpath}"
-                           ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/tests/perf/quick_perf.py" "C")
-  add_dependencies(quick_perf_c reactor-send reactor-recv)
-
-  add_custom_target(quick_perf_py COMMAND ${env_py} --
-                    "PATH=${py_path}" "PYTHONPATH=${perf_pythonpath}"
-                    ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/tests/perf/quick_perf.py" "PYTHON"
-                    WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/tests/tools/apps/python")
-  add_dependencies(quick_perf_py reactor-recv _cproton)
-
-endif (BUILD_PYTHON)
-
-find_program(RUBY_EXE "ruby")
-if (RUBY_EXE AND BUILD_RUBY)
-  set (rb_root "${pn_test_root}/ruby")
-  set (rb_src "${CMAKE_CURRENT_SOURCE_DIR}/bindings/ruby")
-  set (rb_lib "${CMAKE_CURRENT_SOURCE_DIR}/bindings/ruby/lib")
-  set (rb_bin "${CMAKE_CURRENT_BINARY_DIR}/bindings/ruby")
-  set (rb_bld "$<TARGET_FILE_DIR:qpid-proton>")
-  set (rb_path $ENV{PATH} ${rb_bin} ${rb_bld})
-  set (rb_rubylib ${rb_root} ${rb_src} ${rb_bin} ${rb_bld} ${rb_lib})
-  to_native_path("${rb_path}" rb_path)
-  to_native_path("${rb_rubylib}" rb_rubylib)
-
-  # ruby example tests have no dependencies other than standard ruby.
-  add_test(NAME ruby-example-test
-    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/examples/ruby
-    COMMAND ${env_py} -- "PATH=${rb_path}" "RUBYLIB=${rb_rubylib}"
-    ${RUBY_EXE} example_test.rb -v)
-
-  # ruby unit tests:  tests/ruby/proton-test
-  # only enable the tests if the Ruby gem dependencies were found
-  if (DEFAULT_RUBY_TESTING)
-    add_test (NAME ruby-unit-test
-              COMMAND ${env_py} "PATH=${rb_path}" "RUBYLIB=${rb_rubylib}"
-                      "${rb_root}/proton-test")
-
-    # ruby spec tests
-    find_program(RSPEC_EXE rspec)
-    if (RSPEC_EXE)
-      add_test (NAME ruby-spec-test
-                WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bindings/ruby
-                COMMAND ${env_py} "PATH=${rb_path}" "RUBYLIB=${rb_rubylib}"
-                        ${RSPEC_EXE})
-
-    else(RSPEC_EXE)
-      message (STATUS "Cannot find rspec, skipping rspec tests")
-    endif(RSPEC_EXE)
-  else (DEFAULT_RUBY_TESTING)
-    message(STATUS "Skipping Ruby tests: missing dependencies")
-  endif (DEFAULT_RUBY_TESTING)
-else (RUBY_EXE)
-  message (STATUS "Cannot find ruby, skipping ruby tests")
-endif()
-
-mark_as_advanced (RUBY_EXE RSPEC_EXE)
-
-if (BUILD_JAVASCRIPT)
-  add_test (javascript-codec ${env_py} node ${pn_test_root}/javascript/codec.js)
-  add_test (javascript-message ${env_py} node ${pn_test_root}/javascript/message.js)
-endif (BUILD_JAVASCRIPT)
diff --git a/proton-c/bindings/CMakeLists.txt b/proton-c/bindings/CMakeLists.txt
deleted file mode 100644
index 37943dc..0000000
--- a/proton-c/bindings/CMakeLists.txt
+++ /dev/null
@@ -1,144 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Add bindings that do not require swig here - the directory name must be the same as the binding name
-# See below for swig bindings
-set(BINDINGS javascript cpp go)
-
-# Prerequisites for javascript.
-#
-# It uses a C/C++ to JavaScript cross-compiler called emscripten (https://github.com/kripken/emscripten). Emscripten takes C/C++
-# and compiles it into a highly optimisable subset of JavaScript called asm.js (http://asmjs.org/) that can be
-# aggressively optimised and run at near-native speed (usually between 1.5 to 10 times slower than native C/C++).
-find_package(Emscripten)
-if (EMSCRIPTEN_FOUND)
-  set (DEFAULT_JAVASCRIPT ON)
-endif (EMSCRIPTEN_FOUND)
-
-# Prerequisites for C++
-if (CMAKE_CXX_COMPILER)
-  set (DEFAULT_CPP ON)
-endif (CMAKE_CXX_COMPILER)
-
-# Prerequisites for Go
-find_program(GO_EXE go)
-mark_as_advanced(GO_EXE)
-if (GO_EXE)
-  if(WIN32)
-    # Go on windows requires gcc tool chain
-    set (DEFAULT_GO OFF)
-  else()
-    set (DEFAULT_GO ON)
-  endif()
-endif (GO_EXE)
-
-if(SWIG_FOUND)
-  # Add any new swig bindings here - the directory name must be the same as the binding name
-  list(APPEND BINDINGS python ruby php perl)
-
-  include(UseSWIG)
-
-  # All swig modules should include ${PROTON_HEADERS} in SWIG_MODULE_<name>_EXTRA_DEPS
-  file(GLOB PROTON_HEADERS "${CMAKE_SOURCE_DIR}/proton-c/include/proton/*.h")
-  # All swig modules should include ${BINDING_DEPS} in swig_link_libraries
-  set (BINDING_DEPS qpid-proton)
-
-  # If swig version is 3.0 or greater then we can build some additional bindings
-  if (${SWIG_VERSION} VERSION_GREATER 3.0 OR ${SWIG_VERSION} VERSION_EQUAL 3.0)
-    list(APPEND SWIG_BINDINGS node)
-  endif()
-
-  # Add a block here to detect the prerequisites to build each language binding:
-  #
-  # If the prerequisites for the binding are present set a variable called
-  # DEFAULT_{uppercase name of binding} to ON
-
-  # Prerequisites for Python wrapper:
-  find_package (PythonLibs ${PYTHON_VERSION_STRING} EXACT)
-  if (PYTHONLIBS_FOUND)
-    set (DEFAULT_PYTHON ON)
-  endif (PYTHONLIBS_FOUND)
-
-  # Prerequisites for Ruby:
-  find_program(GEM_EXE "gem")
-  mark_as_advanced(GEM_EXE)
-  macro(CheckRubyGem varname gemname)
-    execute_process(COMMAND ${GEM_EXE} list --local ${gemname}
-      OUTPUT_VARIABLE CHECK_OUTPUT)
-
-    set (${varname} OFF)
-
-    if (CHECK_OUTPUT MATCHES "${gemname}[ ]+\(.*\)")
-      message(STATUS "Found Ruby gem: ${gemname}")
-      set (${varname} ON)
-    else()
-      message(STATUS "Missing Ruby gem dependency: ${gemname}")
-      set (${varname} OFF)
-    endif()
-  endmacro()
-
-  find_package(Ruby)
-  if (RUBY_FOUND)
-    set (DEFAULT_RUBY ON)
-
-    CheckRubyGem("HAS_RUBY_GEM_RSPEC"     "rspec")
-    CheckRubyGem("HAS_RUBY_GEM_SIMPLECOV" "simplecov")
-
-    if (HAS_RUBY_GEM_RSPEC AND HAS_RUBY_GEM_SIMPLECOV)
-      set (DEFAULT_RUBY_TESTING ON CACHE INTERNAL "")
-    else()
-      message(STATUS "Skipping Ruby bindings due to missing dependencies...")
-      set (DEFAULT_RUBY_TESTING OFF CACHE INTERNAL "")
-      set (DEFAULT_RUBY OFF)
-    endif (HAS_RUBY_GEM_RSPEC AND HAS_RUBY_GEM_SIMPLECOV)
-  endif (RUBY_FOUND)
-
-  # Prerequites for PHP:
-  # For now, assume PHP support if the 'php-config' tool is present.
-  # @todo: allow user to specify which php-config if multiple PHP sources installed!
-  find_program(PHP_CONFIG_EXE php-config)
-  if (PHP_CONFIG_EXE)
-    find_program(PHP_EXE php)
-    mark_as_advanced (PHP_EXE)
-    if (PHP_EXE)
-      set (DEFAULT_PHP ON)
-    endif (PHP_EXE)
-  endif (PHP_CONFIG_EXE)
-  mark_as_advanced (PHP_CONFIG_EXE)
-
-  # Prerequisites for Perl:
-  include(ProtonFindPerl)
-  if (PERLLIBS_FOUND)
-    set (DEFAULT_PERL ON)
-  endif (PERLLIBS_FOUND)
-
-endif()
-
-# Shouldn't need to modify below here when adding new language binding
-foreach(BINDING ${BINDINGS})
-  string(TOUPPER ${BINDING} UBINDING)
-  # Check whether default was overridden
-  if ("NOBUILD_${UBINDING}")
-    set ("DEFAULT_${UBINDING}" OFF)
-  endif ()
-  option("BUILD_${UBINDING}" "Build ${BINDING} language binding" ${DEFAULT_${UBINDING}})
-  if (BUILD_${UBINDING})
-    add_subdirectory(${BINDING})
-  endif ()
-endforeach(BINDING)
diff --git a/proton-c/bindings/cpp/CMakeLists.txt b/proton-c/bindings/cpp/CMakeLists.txt
deleted file mode 100644
index 0cc4024..0000000
--- a/proton-c/bindings/cpp/CMakeLists.txt
+++ /dev/null
@@ -1,182 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-include(cpp.cmake) # Compiler checks
-
-include_directories(
-  "${CMAKE_SOURCE_DIR}/proton-c/include"
-  "${CMAKE_CURRENT_SOURCE_DIR}/include"
-  "${CMAKE_CURRENT_SOURCE_DIR}/src/include")
-
-add_definitions(${CXX_WARNING_FLAGS})
-
-set(qpid-proton-cpp-source
-  src/binary.cpp
-  src/byte_array.cpp
-  src/cached_map.cpp
-  src/connection.cpp
-  src/connection_options.cpp
-  src/connector.cpp
-  src/container.cpp
-  src/container_impl.cpp
-  src/contexts.cpp
-  src/data.cpp
-  src/decimal.cpp
-  src/decoder.cpp
-  src/delivery.cpp
-  src/duration.cpp
-  src/encoder.cpp
-  src/endpoint.cpp
-  src/error.cpp
-  src/error_condition.cpp
-  src/event_loop.cpp
-  src/handler.cpp
-  src/io/connection_driver.cpp
-  src/io/link_namer.cpp
-  src/link.cpp
-  src/listener.cpp
-  src/message.cpp
-  src/messaging_adapter.cpp
-  src/node_options.cpp
-  src/object.cpp
-  src/proton_bits.cpp
-  src/proton_event.cpp
-  src/proton_handler.cpp
-  src/reactor.cpp
-  src/receiver.cpp
-  src/receiver_options.cpp
-  src/reconnect_timer.cpp
-  src/sasl.cpp
-  src/scalar_base.cpp
-  src/sender.cpp
-  src/sender_options.cpp
-  src/session.cpp
-  src/session_options.cpp
-  src/source.cpp
-  src/ssl.cpp
-  src/ssl_domain.cpp
-  src/target.cpp
-  src/terminus.cpp
-  src/timestamp.cpp
-  src/tracker.cpp
-  src/transfer.cpp
-  src/transport.cpp
-  src/type_id.cpp
-  src/url.cpp
-  src/uuid.cpp
-  src/value.cpp
-  )
-
-set_source_files_properties (
-  ${qpid-proton-cpp-source}
-  PROPERTIES
-  COMPILE_FLAGS "${LTO}"
-  )
-
-add_library(qpid-proton-cpp SHARED ${qpid-proton-cpp-source})
-
-target_link_libraries (qpid-proton-cpp ${PLATFORM_LIBS} qpid-proton)
-
-set_target_properties (
-  qpid-proton-cpp
-  PROPERTIES
-  LINKER_LANGUAGE CXX
-  VERSION   "${PN_LIB_SOMAJOR}.${PN_LIB_SOMINOR}"
-  SOVERSION "${PN_LIB_SOMAJOR}"
-  LINK_FLAGS "${CATCH_UNDEFINED} ${LTO}"
-  )
-
-## Install
-
-install(TARGETS qpid-proton-cpp
-  EXPORT  proton-cpp
-  RUNTIME DESTINATION bin
-  ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
-  LIBRARY DESTINATION ${LIB_INSTALL_DIR})
-
-# Install windows qpid-proton-cpp pdb files
-if (MSVC)
-  install(FILES $<TARGET_PDB_FILE:qpid-proton-cpp>
-    DESTINATION bin
-    CONFIGURATIONS RelWithDebInfo Debug
-    OPTIONAL)
-endif (MSVC)
-
-install (DIRECTORY "include/proton" DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.hpp")
-
-add_subdirectory(docs)
-add_subdirectory(${CMAKE_SOURCE_DIR}/tests/tools/apps/cpp ${CMAKE_BINARY_DIR}/tests/tools/apps/cpp)
-
-# Pkg config file
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/libqpid-proton-cpp.pc.in
-  ${CMAKE_CURRENT_BINARY_DIR}/libqpid-proton-cpp.pc @ONLY)
-install (FILES
-  ${CMAKE_CURRENT_BINARY_DIR}/libqpid-proton-cpp.pc
-  DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-
-if (DEFINED CMAKE_IMPORT_LIBRARY_PREFIX)
-set(PROTONCPPLIB ${CMAKE_IMPORT_LIBRARY_PREFIX}qpid-proton-cpp${CMAKE_IMPORT_LIBRARY_SUFFIX})
-set(PROTONCPPLIBDEBUG ${CMAKE_IMPORT_LIBRARY_PREFIX}qpid-proton-cpp${CMAKE_DEBUG_POSTFIX}${CMAKE_IMPORT_LIBRARY_SUFFIX})
-else ()
-set(PROTONCPPLIB ${CMAKE_SHARED_LIBRARY_PREFIX}qpid-proton-cpp${CMAKE_SHARED_LIBRARY_SUFFIX})
-set(PROTONCPPLIBDEBUG ${CMAKE_SHARED_LIBRARY_PREFIX}qpid-proton-cpp${CMAKE_DEBUG_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX})
-endif ()
-
-include(WriteBasicConfigVersionFile)
-
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/ProtonCppConfig.cmake.in
-  ${CMAKE_CURRENT_BINARY_DIR}/ProtonCppConfig.cmake @ONLY)
-write_basic_config_version_file(
-  ${CMAKE_CURRENT_BINARY_DIR}/ProtonCppConfigVersion.cmake
-  VERSION ${PN_VERSION}
-  COMPATIBILITY AnyNewerVersion)
-install (FILES
-  ${CMAKE_CURRENT_BINARY_DIR}/ProtonCppConfig.cmake
-  ${CMAKE_CURRENT_BINARY_DIR}/ProtonCppConfigVersion.cmake
-  DESTINATION ${LIB_INSTALL_DIR}/cmake/ProtonCpp)
-
-## Test
-if (ENABLE_VALGRIND AND VALGRIND_EXE)
-  set(memcheck-cmd ${VALGRIND_EXE} --error-exitcode=42 --quiet --leak-check=full --trace-children=yes)
-endif ()
-
-macro(add_cpp_test test)
-  add_executable (${test} src/${test}.cpp)
-  target_link_libraries (${test} qpid-proton qpid-proton-cpp)
-  if (CMAKE_SYSTEM_NAME STREQUAL Windows)
-    add_test (NAME cpp-${test}
-      COMMAND ${env_py}
-      "PATH=$<TARGET_FILE_DIR:qpid-proton>"
-      $<TARGET_FILE:${test}> ${ARGN})
-  else ()
-    add_test (NAME cpp-${test} COMMAND ${memcheck-cmd} ${CMAKE_CURRENT_BINARY_DIR}/${test} ${ARGN})
-  endif ()
-endmacro(add_cpp_test)
-
-add_cpp_test(codec_test)
-#add_cpp_test(engine_test)
-add_cpp_test(thread_safe_test)
-add_cpp_test(interop_test ${CMAKE_SOURCE_DIR}/tests)
-add_cpp_test(message_test)
-add_cpp_test(scalar_test)
-add_cpp_test(value_test)
-add_cpp_test(container_test)
-add_cpp_test(url_test)
diff --git a/proton-c/bindings/cpp/ProtonCppConfig.cmake.in b/proton-c/bindings/cpp/ProtonCppConfig.cmake.in
deleted file mode 100644
index 0068067..0000000
--- a/proton-c/bindings/cpp/ProtonCppConfig.cmake.in
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Name: Proton
-# Description: Qpid Proton C library
-# Version: @PN_VERSION@
-# URL: http://qpid.apache.org/proton/
-
-set (ProtonCpp_VERSION       @PN_VERSION@)
-
-set (ProtonCpp_INCLUDE_DIRS  @INCLUDEDIR@)
-set (ProtonCpp_LIBRARIES     optimized @LIBDIR@/@PROTONCPPLIB@ debug @LIBDIR@/@PROTONCPPLIBDEBUG@)
-
-set (ProtonCpp_FOUND True)
diff --git a/proton-c/bindings/cpp/README.md b/proton-c/bindings/cpp/README.md
deleted file mode 100644
index bedfd0d..0000000
--- a/proton-c/bindings/cpp/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-# Qpid Proton C++
-
-This is a C++ binding for the Proton API.
-
-The documentation includes a tutorial and API documentation.
-
-To generate the documentation go to your build directory, run `make
-docs-cpp`, and open `proton-c/bindings/cpp/docs/html/index.html` in a
-browser.
-
-## Todo
-
-### Tests
-
-- Interop/type testing: proton/tests/interop, new interop suite
-- More unit testing, measured code coverage
-- Test examples against ActiveMQ and qpidd
-
-### Bugs
-
-- Error handling:
-  - examples exit silently on broker exit/not running, core on
-    no-such-queue (e.g., with qpidd)
-
-### Features
-
-- SASL/SSL support with interop tests.
-- Reconnection
-- Browsing
-- Selectors
-- AMQP described types and arrays, full support and tests
-- Durable subscriptions & demos (see python changes)
-- Transactions
-- Heartbeats
-
-### Nice to have
-
-- C++11 lambda version of handlers
-- Helpers (or at least doc) for multi-threaded use (container per connection)
-- Usable support for decimal types
-- Expose endpoint conditions as C++ proton::condition error class
-- Selectables and 3rd party event loop support
-- More efficient shared_ptr (single family per proton object)
diff --git a/proton-c/bindings/cpp/cpp.cmake b/proton-c/bindings/cpp/cpp.cmake
deleted file mode 100644
index 51980d7..0000000
--- a/proton-c/bindings/cpp/cpp.cmake
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Check C++ capabilities.
-
-include(CheckCXXSourceCompiles)
-
-if (CMAKE_CXX_COMPILER)
-  set(CMAKE_REQUIRED_FLAGS "${CXX_WARNING_FLAGS}")
-  check_cxx_source_compiles("long long ll; int main(int, char**) { return 0; }" HAS_LONG_LONG)
-  if (HAS_LONG_LONG)
-    add_definitions(-DPN_CPP_HAS_LONG_LONG=1)
-  endif()
-  check_cxx_source_compiles("#include <memory>\nstd::shared_ptr<int> i; std::unique_ptr<int> u; int main(int, char**) { return 0; }" HAS_STD_PTR)
-  if (HAS_STD_PTR)
-    add_definitions(-DPN_CPP_HAS_STD_PTR=1)
-  endif()
-  check_cxx_source_compiles("#if defined(__cplusplus) && __cplusplus >= 201100\nint main(int, char**) { return 0; }\n#endif" HAS_CPP11)
-endif()
diff --git a/proton-c/bindings/cpp/docs/CMakeLists.txt b/proton-c/bindings/cpp/docs/CMakeLists.txt
deleted file mode 100644
index d512d15..0000000
--- a/proton-c/bindings/cpp/docs/CMakeLists.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-find_package(Doxygen)
-
-if (DOXYGEN_FOUND)
-  configure_file (
-    ${CMAKE_CURRENT_SOURCE_DIR}/user.doxygen.in
-    ${CMAKE_CURRENT_BINARY_DIR}/user.doxygen)
-
-  file(GLOB_RECURSE headers ../include/proton/*.hpp)
-  add_custom_target (docs-cpp
-    COMMAND ${CMAKE_COMMAND} -E remove_directory html # get rid of old files
-    COMMAND ${DOXYGEN_EXECUTABLE} user.doxygen
-    DEPENDS ${headers}
-    )
-  add_dependencies (docs docs-cpp)
-  # HTML files are generated to ./html - put those in the install.
-  install (DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html/"
-    DESTINATION "${PROTON_SHARE}/docs/api-cpp"
-    COMPONENT documentation
-    OPTIONAL)
-endif (DOXYGEN_FOUND)
-
-set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES html)
diff --git a/proton-c/bindings/cpp/docs/io.md b/proton-c/bindings/cpp/docs/io.md
deleted file mode 100644
index 230e538..0000000
--- a/proton-c/bindings/cpp/docs/io.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# IO integration {#io_page}
-
-**Experimental** - The `proton::io` interfaces are new and remain
-subject to change.
-
-The `proton::io` namespace contains a service provider interface (SPI)
-that allows you to implement the Proton API over alternative IO or
-threading libraries.
-
-The `proton::io::connection_driver` class converts an AMQP-encoded
-byte stream, read from any IO source, into `proton::messaging_handler`
-calls. It generates an AMQP-encoded byte stream as output that can be
-written to any IO destination.
-
-The connection driver is deliberately very simple and low level. It
-performs no IO of its own, no thread-related locking, and is written
-in simple C++98-compatible code.
-
-The connection dirver can be used standalone as an AMQP translator, or
-you can implement the following two interfaces to provide a complete
-implementation of the Proton API that can run any Proton application:
-
- - `proton::container` lets the user initiate or listen for connections.
- - `proton::event_loop` lets the user serialize work with respect to a
-   connection.
-
-@see @ref mt/epoll\_container.cpp for an example.
diff --git a/proton-c/bindings/cpp/docs/main.md b/proton-c/bindings/cpp/docs/main.md
deleted file mode 100644
index 93ba2c0..0000000
--- a/proton-c/bindings/cpp/docs/main.md
+++ /dev/null
@@ -1,128 +0,0 @@
-# Introduction {#mainpage}
-
-This is the C++ API for the Proton AMQP protocol engine. It allows you
-to write client and server applications that send and receive AMQP
-messages.
-
-The best way to start is with the @ref tutorial.
-
-## An overview of the AMQP model
-
-Messages are transferred between connected peers over *links*. The
-sending end of a link is a `proton::sender`, and the receiving end is
-a `proton::receiver`.  Links have named 'source' and 'target'
-addresses.  See "Sources and Targets" below for more information.
-
-Links are grouped in a `proton::session`. Messages for links in the
-same session are sent sequentially.  Messages on different sessions
-can be interleaved, so a large message being sent on one session does
-not block messages being sent on other sessions.
-
-Sessions are created over a `proton::connection`, which represents the
-network connection. You can create links directly on a connection
-using its default session if you don't need multiple sessions.
-
-`proton::message` represents the message: the body (content),
-properties, headers, and annotations. A `proton::delivery` represents
-a message being received over a link. The receiver acknowledges the
-delivery by accepting or rejecting it.  The corresponding message
-sender uses a `proton::tracker` to follow the state of the delivery.
-
-The delivery is *settled* when both ends are done with it.  Different
-settlement methods give different levels of reliability:
-*at-most-once*, *at-least-once*, and *exactly-once*. See "Delivery
-Guarantees" below for details.
-
-## Sources and targets
-
-Every link has two addresses, *source* and *target*. The most common
-pattern for using these addresses is as follows:
-
-When a client creates a *receiver* link, it sets the *source*
-address. This means "I want to receive messages from this source."
-This is often referred to as "subscribing" to the source. When a
-client creates a *sender* link, it sets the *target* address. This
-means "I want to send to this target."
-
-In the case of a broker, the source or target usually refers to a
-queue or topic. In general they can refer to any AMQP-capable node.
-
-In the *request-response* pattern, a request message carries a
-*reply-to* address for the response message. This can be any AMQP
-address, but it is often useful to create a temporary address for just
-the response message.
-
-The most common approach is for the client to create a *receiver* for
-the response with the *dynamic* flag set. This asks the server to
-generate a unique *source* address automatically and discard it when
-the link closes. The client uses this "dynamic" source address as the
-reply-to when it sends the request, and the response is delivered to
-the client's dynamic receiver.
-
-In the case of a broker, a dynamic address usually corresponds to a
-temporary queue, but any AMQP request-response server can use this
-technique. The @ref server_direct.cpp example illustrates how to
-implement a queueless request-response server.
-
-## Delivery guarantees
-
-Proton offers three levels of message delivery guarantee:
-*at-most-once*, *at-least-once*, and *exactly-once*.
-
-For *at-most-once*, the sender settles the message as soon as it sends
-it. If the connection is lost before the message is received by the
-receiver, the message will not be delivered.
-
-For *at-least-once*, the receiver accepts and settles the message on
-receipt. If the connection is lost before the sender is informed of
-the settlement, then the delivery is considered in-doubt and should be
-retried. This will ensure it eventually gets delivered (provided of
-course the connection and link can be reestablished). It may mean that
-it is delivered multiple times, however.
-
-Finally, for *exactly-once*, the receiver accepts the message but
-doesn't settle it. The sender settles once it is aware that the
-receiver accepted it. In this way the receiver retains knowledge of an
-accepted message until it is sure the sender knows it has been
-accepted. If the connection is lost before settlement, the receiver
-informs the sender of all the unsettled deliveries it knows about, and
-from this the sender can deduce which need to be redelivered. The
-sender likewise informs the receiver which deliveries it knows about,
-from which the receiver can deduce which have already been settled.
-
-## Anatomy of a Proton application
-
-To send AMQP commands, call methods on classes like `proton::connection`,
-`proton::sender`, `proton::receiver`, or `proton::delivery`.
-
-To handle incoming commands, subclass the `proton::messaging_handler`
-interface. The handler member functions are called when AMQP protocol
-events occur on a connection. For example
-`proton::messaging_handler::on_message` is called when a message is
-received.
-
-Messages are represented by `proton::message`. AMQP defines a type
-encoding that you can use for interoperability, but you can also use
-any encoding you wish and pass binary data as the
-`proton::message::body`. `proton::value` and `proton::scalar` provide
-conversion between AMQP and C++ data types.
-
-There are several ways to manage handlers and AMQP objects, for
-different types of application. All of them use the same
-`proton::messaging_handler` subclasses so code can be re-used if you
-change your approach.
-
-### %proton::default_container - Easy single-threaded applications
-
-`proton::container` is the top-level object in a proton application.
-Use proton::container::connect() and proton::container::listen() to
-create connections. The container polls multiple connections and calls
-protocol events on your `proton::messaging_handler` subclasses.
-
-The default container implementation is created using
-`proton::default_container`.
-
-You can implement your own container to integrate proton with any IO
-provider using the `proton::io::connection_driver`.
-
-@see @ref io_page
diff --git a/proton-c/bindings/cpp/docs/mt.md b/proton-c/bindings/cpp/docs/mt.md
deleted file mode 100644
index 1a63ea6..0000000
--- a/proton-c/bindings/cpp/docs/mt.md
+++ /dev/null
@@ -1,44 +0,0 @@
-# Multithreaded Proton applications {#mt_page}
-
-For an example see @ref mt/broker.cpp
-
-Most classes in namespace @ref proton are not thread-safe. Objects
-belonging to a single connection (`proton::connection`,
-`proton::sender`, `proton::receiver`, and so on) *must not* be used
-concurrently. Objects associated with *different* connections *can* be
-used concurrently in separate threads.
-
-A multithreaded container calls event-handling functions for each
-connection *sequentially* but can process *different* connections
-concurrently in different threads. If you use a *separate*
-`proton::messaging_handler` for each connection, then event-handling
-functions can can use their parameters and the handler's own data
-members without locks. The handler functions will never be called
-concurrently. You can set the handlers for each connection using
-`proton::container::connect()` and `proton::container::listen()`.
-
-The example @ref mt/broker.cpp is a multithreaded broker using this
-approach.  It creates a new handler for each incoming connection to
-manage the state of that connection's `proton::sender` and
-`proton::receiver` links. The handler needs no lock because it only
-deals with state in the context of one connection.
-
-The `proton::event_loop` class represents the sequence of events
-associated with a connection.  `proton::event_loop::inject()` allows
-another thread to "inject" work to be executed in sequence with the
-rest of the events so it can operate safely on data associated with
-the connection.
-
-In the @ref mt/broker.cpp example, a queue can receive messages from
-one connection but have subscribers on another connection. Subscribers
-pass a function object to the queue which uses
-`proton::event_loop::inject()` to call a notification callback on the
-handler for that connection. The callback is executed in the
-connection's event loop so it can use a `proton::sender` object to
-send the message safely.
-
-*Note*: It is possible to share a single handler between more than one
-connection.  In that case it *can* be called concurrently on behalf of
-different connections, so you will need suitable locking.
-
-@see @ref io_page - Implementing your own container.
diff --git a/proton-c/bindings/cpp/docs/types.md b/proton-c/bindings/cpp/docs/types.md
deleted file mode 100644
index 6a56be0..0000000
--- a/proton-c/bindings/cpp/docs/types.md
+++ /dev/null
@@ -1,77 +0,0 @@
-# AMQP and C++ types {#types_page}
-
-An AMQP message body can hold binary data using any encoding you
-like. AMQP also defines its own encoding and types. The AMQP encoding
-is often used in message bodies because it is supported by AMQP
-libraries on many languages and platforms. You also need to use the
-AMQP types to set and examine message properties.
-
-## Scalar types
-
-Each type is identified by a proton::type_id.
-
-C++ type            | AMQP type_id         | Description
---------------------|----------------------|-----------------------
-bool                | proton::BOOLEAN      | Boolean true or false
-uint8_t             | proton::UBYTE        | 8-bit unsigned byte
-int8_t              | proton::BYTE         | 8-bit signed byte
-uint16_t            | proton::USHORT       | 16-bit unsigned integer
-int16_t             | proton::SHORT        | 16-bit signed integer
-uint32_t            | proton::UINT         | 32-bit unsigned integer
-int32_t             | proton::INT          | 32-bit signed integer
-uint64_t            | proton::ULONG        | 64-bit unsigned integer
-int64_t             | proton::LONG         | 64-bit signed integer
-wchar_t             | proton::CHAR         | 32-bit unicode code point
-float               | proton::FLOAT        | 32-bit binary floating point
-double              | proton::DOUBLE       | 64-bit binary floating point
-proton::timestamp   | proton::TIMESTAMP    | 64-bit signed milliseconds since 00:00:00 (UTC), 1 January 1970.
-proton::decimal32   | proton::DECIMAL32    | 32-bit decimal floating point
-proton::decimal64   | proton::DECIMAL64    | 64-bit decimal floating point
-proton::decimal128  | proton::DECIMAL128   | 128-bit decimal floating point
-proton::uuid        | proton::UUID         | 128-bit universally-unique identifier
-std::string         | proton::STRING       | UTF-8 encoded Unicode string
-proton::symbol      | proton::SYMBOL       | 7-bit ASCII encoded string
-proton::binary      | proton::BINARY       | Variable-length binary data
-
-proton::scalar is a holder that can accept a scalar value of any type.
-
-## Compound types
-
-C++ type            | AMQP type_id         | Description
---------------------|----------------------|-----------------------
-See below           | proton::ARRAY        | Sequence of values of the same type
-See below           | proton::LIST         | Sequence of values of mixed types
-See below           | proton::MAP          | Map of key-value pairs
-
-proton::value is a holder that can accept any AMQP value, scalar or
-compound.
-
-proton::ARRAY converts to and from C++ sequences: std::vector,
-std::deque, std::list, and std::forward_list.
-
-proton::LIST converts to and from sequences of proton::value or
-proton::scalar, which can hold mixed types of data.
-
-proton::MAP converts to and from std::map, std::unordered_map, and
-sequences of std::pair.
-
-When decoding, the encoded map types must be convertible to the element type of the
-C++ sequence or the key-value types of the C++ map.  Use proton::value as the
-element or key-value type to decode any ARRAY, LIST, or MAP.
-
-For example you can decode any AMQP MAP into:
-
-    std::map<proton::value, proton::value>
-
-You can decode any AMQP LIST or ARRAY into:
-
-    std::vector<proton::value>
-
-## Include files
-
-You can simply include proton/types.hpp to get all the type
-definitions and conversions. Alternatively, you can selectively
-include only what you need:
-
- - Include proton/types_fwd.hpp: forward declarations for all types.
- - Include individual `.hpp` files as per the table above.
diff --git a/proton-c/bindings/cpp/docs/user.doxygen.in b/proton-c/bindings/cpp/docs/user.doxygen.in
deleted file mode 100644
index a56eb98..0000000
--- a/proton-c/bindings/cpp/docs/user.doxygen.in
+++ /dev/null
@@ -1,78 +0,0 @@
-##
-## Licensed to the Apache Software Foundation (ASF) under one
-## or more contributor license agreements.  See the NOTICE file
-## distributed with this work for additional information
-## regarding copyright ownership.  The ASF licenses this file
-## to you under the Apache License, Version 2.0 (the
-## "License"); you may not use this file except in compliance
-## with the License.  You may obtain a copy of the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing,
-## software distributed under the License is distributed on an
-## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-## KIND, either express or implied.  See the License for the
-## specific language governing permissions and limitations
-## under the License.
-##
-
-# Project options
-
-PROJECT_NAME            = "Qpid Proton C++"
-PROJECT_NUMBER          = @PN_VERSION_MAJOR@.@PN_VERSION_MINOR@.@PN_VERSION_POINT@
-OUTPUT_DIRECTORY        = .
-OUTPUT_LANGUAGE         = English
-BRIEF_MEMBER_DESC       = YES
-REPEAT_BRIEF            = YES
-ALWAYS_DETAILED_SEC     = NO
-INLINE_INHERITED_MEMB   = YES
-JAVADOC_AUTOBRIEF       = YES
-MULTILINE_CPP_IS_BRIEF  = NO
-INHERIT_DOCS            = YES
-BUILTIN_STL_SUPPORT     = YES
-INLINE_SIMPLE_STRUCTS   = YES
-HIDE_UNDOC_CLASSES      = YES
-HIDE_COMPOUND_REFERENCE = YES
-HIDE_SCOPE_NAMES        = YES
-MAX_INITIALIZER_LINES   = 0
-ALPHABETICAL_INDEX      = NO
-
-# Redefine protected as private and strip out the PN_CPP_EXTERN macro
-
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = YES
-EXPAND_ONLY_PREDEF = YES
-PREDEFINED = protected=private PN_CPP_EXTERN= PN_CPP_OVERRIDE= PN_CPP_HAS_CPP11=1 PN_CPP_HAS_SHARED_PTR=1 PN_CPP_HAS_UNIQUE_PTR=1 PN_CPP_HAS_LONG_LONG=1 PN_CPP_HAS_NULLPTR=1 PN_CPP_HAS_RVALUE_REFERENCES=1 PN_CPP_HAS_OVERRIDE=override PN_CPP_HAS_EXPLICIT_CONVERSIONS=1 PN_CPP_HAS_DEFAULTED_FUNCTIONS=1 PN_CPP_HAS_DELETED_FUNCTIONS=1 PN_CPP_HAS_STD_FUNCTION=1 PN_CPP_HAS_CHRONO=1
-EXCLUDE_SYMBOLS = internal internal::*
-
-# Configuration options related to warning and progress messages
-
-QUIET                  = YES
-WARNINGS               = YES
-
-# Configuration options related to the input files
-
-INPUT = @CMAKE_SOURCE_DIR@/proton-c/bindings/cpp/include @CMAKE_SOURCE_DIR@/proton-c/bindings/cpp/docs @CMAKE_SOURCE_DIR@/examples/cpp
-FILE_PATTERNS          = *.hpp *.md *.dox
-EXCLUDE_PATTERNS       = @CMAKE_SOURCE_DIR@/examples/*.?pp  # Don't parse example sources, only *.dox
-FULL_PATH_NAMES        = YES
-RECURSIVE              = YES
-STRIP_FROM_PATH        = @CMAKE_SOURCE_DIR@/proton-c/bindings/cpp/include
-EXAMPLE_PATH           = @CMAKE_SOURCE_DIR@/examples/cpp
-EXAMPLE_RECURSIVE      = YES
-
-# View and list options
-
-GENERATE_TREEVIEW       = YES
-GENERATE_TODOLIST       = NO
-GENERATE_TESTLIST       = NO
-GENERATE_BUGLIST        = NO
-GENERATE_DEPRECATEDLIST = YES
-
-# Configuration options related to the output format
-
-GENERATE_HTML          = YES
-HTML_OUTPUT            = html
-HTML_FILE_EXTENSION    = .html
-GENERATE_LATEX         = NO
diff --git a/proton-c/bindings/cpp/include/proton/annotation_key.hpp b/proton-c/bindings/cpp/include/proton/annotation_key.hpp
deleted file mode 100644
index 4995141..0000000
--- a/proton-c/bindings/cpp/include/proton/annotation_key.hpp
+++ /dev/null
@@ -1,84 +0,0 @@
-#ifndef PROTON_ANNOTATION_KEY_HPP
-#define PROTON_ANNOTATION_KEY_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./scalar_base.hpp"
-#include "./symbol.hpp"
-
-#include <proton/type_compat.h>
-
-namespace proton {
-
-/// A key for use with AMQP annotation maps.
-///
-/// An annotation_key can contain either a uint64_t or a proton::symbol.
-class annotation_key : public scalar_base {
-  public:
-    /// An empty annotation key.
-    annotation_key() {}
-
-    /// Construct from any type that can be assigned.
-    template <class T> annotation_key(const T& x) { *this = x; }
-
-    /// @name Assign from a uint64_t or symbol.
-    /// @{
-    annotation_key& operator=(uint64_t x) { put_(x); return *this; }
-    annotation_key& operator=(const symbol& x) { put_(x); return *this; }
-    /// @}
-
-    /// @name Extra conversions for strings, treated as codec::SYMBOL.
-    /// @{
-    annotation_key& operator=(const std::string& x) { put_(symbol(x)); return *this; }
-    annotation_key& operator=(const char *x) { put_(symbol(x)); return *this; }
-    /// @}
-
-    /// @cond INTERNAL
-  friend class message;
-  friend class codec::decoder;
-    /// @endcond
-};
-
-/// @cond INTERNAL
-/// Primary template for get<T>(message_id), specialized for legal types.
-template <class T> T get(const annotation_key& x);
-/// @endcond
-
-/// Get the uint64_t value or throw conversion_error.
-///
-/// @related annotation_key
-template<> inline uint64_t get<uint64_t>(const annotation_key& x) { return internal::get<uint64_t>(x); }
-
-/// Get the @ref symbol value or throw conversion_error.
-///
-/// @related annotation_key
-template<> inline symbol get<symbol>(const annotation_key& x) { return internal::get<symbol>(x); }
-
-/// Get the @ref binary value or throw conversion_error.
-///
-/// @copydoc scalar::coerce
-/// @related annotation_key
-template<class T> T coerce(const annotation_key& x) { return internal::coerce<T>(x); }
-
-} // proton
-
-#endif // PROTON_ANNOTATION_KEY_HPP
diff --git a/proton-c/bindings/cpp/include/proton/binary.hpp b/proton-c/bindings/cpp/include/proton/binary.hpp
deleted file mode 100644
index cf4c7a2..0000000
--- a/proton-c/bindings/cpp/include/proton/binary.hpp
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef PROTON_BINARY_HPP
-#define PROTON_BINARY_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./internal/export.hpp"
-#include "./types_fwd.hpp"
-
-#include <proton/type_compat.h>
-
-#include <iosfwd>
-#include <string>
-#include <vector>
-
-namespace proton {
-
-/// Arbitrary binary data.
-class binary : public std::vector<uint8_t> {
-  public:
-    /// @name Constructors
-    /// @{
-    explicit binary() : std::vector<value_type>() {}
-    explicit binary(size_t n) : std::vector<value_type>(n) {}
-    explicit binary(size_t n, value_type x) : std::vector<value_type>(n, x) {}
-    explicit binary(const std::string& s) : std::vector<value_type>(s.begin(), s.end()) {}
-    template <class Iter> binary(Iter first, Iter last) : std::vector<value_type>(first, last) {}
-    /// @}
-
-    /// Convert to std::string
-    operator std::string() const { return std::string(begin(), end()); }
-
-    /// Assignment
-    binary& operator=(const std::string& x) { assign(x.begin(), x.end()); return *this; }
-};
-
-/// Print a binary value
-PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const binary&);
-
-} // proton
-
-#endif // PROTON_BINARY_HPP
diff --git a/proton-c/bindings/cpp/include/proton/byte_array.hpp b/proton-c/bindings/cpp/include/proton/byte_array.hpp
deleted file mode 100644
index 9040133..0000000
--- a/proton-c/bindings/cpp/include/proton/byte_array.hpp
+++ /dev/null
@@ -1,99 +0,0 @@
-#ifndef PROTON_BYTE_ARRAY_HPP
-#define PROTON_BYTE_ARRAY_HPP
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "./internal/export.hpp"
-#include "./internal/comparable.hpp"
-#include "./types_fwd.hpp"
-
-#include <proton/type_compat.h>
-
-#include <algorithm>
-#include <iterator>
-
-namespace proton {
-
-namespace internal {
-PN_CPP_EXTERN void print_hex(std::ostream& o, const uint8_t* p, size_t n);
-}
-
-/// Arbitrary fixed-size data.
-///    
-/// Used to represent fixed-sized data types that don't have a natural
-/// C++ representation as an array of bytes.
-template <size_t N> class byte_array : private internal::comparable<byte_array<N> > {
-  public:
-    /// @name Sequence container typedefs
-    /// @{
-    typedef uint8_t                                   value_type;
-    typedef value_type*			              pointer;
-    typedef const value_type*                         const_pointer;
-    typedef value_type&                   	      reference;
-    typedef const value_type&             	      const_reference;
-    typedef value_type*          		      iterator;
-    typedef const value_type*			      const_iterator;
-    typedef std::size_t                    	      size_type;
-    typedef std::ptrdiff_t                   	      difference_type;
-    typedef std::reverse_iterator<iterator>	      reverse_iterator;
-    typedef std::reverse_iterator<const_iterator>     const_reverse_iterator;
-    /// @}
-
-    /// Zero-initialized byte array
-    byte_array() { std::fill(bytes_, bytes_+N, '\0'); }
-
-    /// Size of the array
-    static size_t size() { return N; }
-
-    /// @name Array operators
-    /// @{
-    value_type* begin() { return bytes_; }
-    value_type* end() { return bytes_+N; }
-    value_type& operator[](size_t i) { return bytes_[i]; }
-
-    const value_type* begin() const { return bytes_; }
-    const value_type* end() const { return bytes_+N; }
-    const value_type& operator[](size_t i) const { return bytes_[i]; }
-    /// @}
-
-    /// @name Comparison operators
-    /// @{
-  friend bool operator==(const byte_array& x, const byte_array& y) {
-      return std::equal(x.begin(), x.end(), y.begin());
-  }
-
-  friend bool operator<(const byte_array& x, const byte_array& y) {
-      return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end());
-  }
-    /// @}
-
-    /// Print byte array in hex
-  friend std::ostream& operator<<(std::ostream& o, const byte_array& b) {
-      internal::print_hex(o, b.begin(), b.size());
-      return o;
-  }
-
-  private:
-    value_type bytes_[N];
-};
-
-} // proton
-
-#endif // PROTON_BYTE_ARRAY_HPP
diff --git a/proton-c/bindings/cpp/include/proton/codec/amqp_types.hpp b/proton-c/bindings/cpp/include/proton/codec/amqp_types.hpp
deleted file mode 100644
index 5456225..0000000
--- a/proton-c/bindings/cpp/include/proton/codec/amqp_types.hpp
+++ /dev/null
@@ -1,111 +0,0 @@
-#ifndef PROTON_CODEC_AMQP_TYPES_HPP
-#define PROTON_CODEC_AMQP_TYPES_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/// @cond INTERNAL
-/// XXX Remove this entirely
-    
-namespace proton {
-namespace codec {
-
-/// @name Experimental - Typedefs for AMQP scalar types.
-///
-/// These typedefs associate AMQP scalar type names with the
-/// corresponding C++ types. They are provided as a convenience for
-/// those familiar with AMQP, but you do not need to use them.  You
-/// can use the C++ types directly.
-///
-/// The typedef names have a `_type` suffix to avoid ambiguity with
-/// C++ reserved and std library type names.
-///    
-/// @{
-
-// XXX Consider prefixing these with amqp_ and dropping _type, now
-// that they're in the codec namespace
-    
-/// True or false.
-typedef bool boolean_type;
-
-/// 8-bit unsigned byte 
-typedef uint8_t ubyte_type;
-
-/// 8-bit signed byte
-typedef int8_t byte_type;
-
-/// 16-bit unsigned short integer
-typedef uint16_t ushort_type;
-
-/// 16-bit signed short integer
-typedef int16_t short_type;
-
-/// 32-bit unsigned integer
-typedef uint32_t uint_type;
-
-/// 32-bit signed integer
-typedef int32_t int_type;
-
-/// 64-bit unsigned long integer
-typedef uint64_t ulong_type;
-
-/// 64-bit signed long integer
-typedef int64_t long_type;
-
-/// 32-bit unicode code point
-typedef wchar_t char_type;
-
-/// 32-bit binary floating point
-typedef float float_type;
-
-/// 64-bit binary floating point
-typedef double double_type;
-
-/// An AMQP string is unicode UTF-8 encoded.
-typedef std::string string_type;
-
-/// An AMQP symbol is ASCII 7-bit encoded.
-typedef proton::symbol symbol_type;
-
-/// An AMQP binary contains variable length raw binary data.
-typedef proton::binary binary_type;
-
-/// A timestamp in milliseconds since the epoch 00:00:00 (UTC), 1 January 1970.
-typedef proton::timestamp timestamp_type;
-
-/// A 16-byte universally unique identifier.
-typedef proton::uuid uuid_type;
-
-/// 32-bit decimal floating point
-typedef proton::decimal32 decimal32_type;
-
-/// 64-bit decimal floating point
-typedef proton::decimal64 decimal64_type;
-
-/// 128-bit decimal floating point
-typedef proton::decimal128 decimal128_type;
-
-} // codec
-} // proton
-
-/// @endcond
-
-#endif // PROTON_CODEC_AMQP_TYPES_HPP
diff --git a/proton-c/bindings/cpp/include/proton/codec/common.hpp b/proton-c/bindings/cpp/include/proton/codec/common.hpp
deleted file mode 100644
index e8d8ce5..0000000
--- a/proton-c/bindings/cpp/include/proton/codec/common.hpp
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef PROTON_CODEC_COMMON_HPP
-#define PROTON_CODEC_COMMON_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "../type_id.hpp"
-
-namespace proton {
-namespace codec {
-
-/// **Experimental** - Start encoding a complex type.
-struct start {
-    /// @cond INTERNAL
-    /// XXX Document
-    start(type_id type_=NULL_TYPE, type_id element_=NULL_TYPE,
-          bool described_=false, size_t size_=0) :
-        type(type_), element(element_), is_described(described_), size(size_) {}
-
-    type_id type;            ///< The container type: ARRAY, LIST, MAP or DESCRIBED.
-    type_id element;         ///< the element type for array only.
-    bool is_described;       ///< true if first value is a descriptor.
-    size_t size;             ///< the element count excluding the descriptor (if any)
-    /// @endcond
-
-    /// @cond INTERNAL
-    /// XXX Document
-    static start array(type_id element, bool described=false) { return start(ARRAY, element, described); }
-    static start list() { return start(LIST); }
-    static start map() { return start(MAP); }
-    static start described() { return start(DESCRIBED, NULL_TYPE, true); }
-    /// @endcond
-};
-
-/// **Experimental** - Finish inserting or extracting a complex type.
-struct finish {};
-
-} // codec
-} // proton
-
-#endif // PROTON_CODEC_COMMON_HPP
diff --git a/proton-c/bindings/cpp/include/proton/codec/decoder.hpp b/proton-c/bindings/cpp/include/proton/codec/decoder.hpp
deleted file mode 100644
index 3dc6d57..0000000
--- a/proton-c/bindings/cpp/include/proton/codec/decoder.hpp
+++ /dev/null
@@ -1,214 +0,0 @@
-#ifndef PROTON_CODEC_DECODER_HPP
-#define PROTON_CODEC_DECODER_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "../internal/data.hpp"
-#include "../internal/type_traits.hpp"
-#include "../types_fwd.hpp"
-#include "./common.hpp"
-
-#include <proton/type_compat.h>
-
-#include <utility>
-
-namespace proton {
-
-class annotation_key;
-class message_id;
-class scalar;
-class value;
-
-namespace internal {
-class value_base;
-}
-
-namespace codec {
-
-/// **Experimental** - Stream-like decoder from AMQP bytes to C++
-/// values.
-///
-/// For internal use only.
-///
-/// @see @ref types_page for the recommended ways to manage AMQP data
-class decoder : public internal::data {
-  public:
-    /// Wrap a Proton C data object.  The exact flag if set means
-    /// decode only when there is an exact match between the AMQP and
-    /// C++ type. If not set then perform automatic conversions.
-    explicit decoder(const data& d, bool exact=false) : data(d), exact_(exact) {}
-
-    /// Attach decoder to a proton::value. The decoder is rewound to
-    /// the start of the data.
-    PN_CPP_EXTERN explicit decoder(const internal::value_base&, bool exact=false);
-
-    /// Decode AMQP data from a buffer and add it to the end of the
-    /// decoders stream.
-    PN_CPP_EXTERN void decode(const char* buffer, size_t size);
-
-    /// Decode AMQP data from a std::string and add it to the end of
-    /// the decoders stream.
-    PN_CPP_EXTERN void decode(const std::string&);
-
-    /// Return true if there are more value to extract at the current level.
-    PN_CPP_EXTERN bool more();
-
-    /// Get the type of the next value that will be read by
-    /// operator>>.
-    ///
-    /// @throw conversion_error if no more values. @see
-    /// decoder::more().
-    PN_CPP_EXTERN type_id next_type();
-
-    /// @name Extract built-in types
-    ///
-    /// @throw conversion_error if the decoder is empty or has an
-    /// incompatible type.
-    ///
-    /// @{
-    PN_CPP_EXTERN decoder& operator>>(bool&);
-    PN_CPP_EXTERN decoder& operator>>(uint8_t&);
-    PN_CPP_EXTERN decoder& operator>>(int8_t&);
-    PN_CPP_EXTERN decoder& operator>>(uint16_t&);
-    PN_CPP_EXTERN decoder& operator>>(int16_t&);
-    PN_CPP_EXTERN decoder& operator>>(uint32_t&);
-    PN_CPP_EXTERN decoder& operator>>(int32_t&);
-    PN_CPP_EXTERN decoder& operator>>(wchar_t&);
-    PN_CPP_EXTERN decoder& operator>>(uint64_t&);
-    PN_CPP_EXTERN decoder& operator>>(int64_t&);
-    PN_CPP_EXTERN decoder& operator>>(timestamp&);
-    PN_CPP_EXTERN decoder& operator>>(float&);
-    PN_CPP_EXTERN decoder& operator>>(double&);
-    PN_CPP_EXTERN decoder& operator>>(decimal32&);
-    PN_CPP_EXTERN decoder& operator>>(decimal64&);
-    PN_CPP_EXTERN decoder& operator>>(decimal128&);
-    PN_CPP_EXTERN decoder& operator>>(uuid&);
-    PN_CPP_EXTERN decoder& operator>>(std::string&);
-    PN_CPP_EXTERN decoder& operator>>(symbol&);
-    PN_CPP_EXTERN decoder& operator>>(binary&);
-    PN_CPP_EXTERN decoder& operator>>(message_id&);
-    PN_CPP_EXTERN decoder& operator>>(annotation_key&);
-    PN_CPP_EXTERN decoder& operator>>(scalar&);
-    PN_CPP_EXTERN decoder& operator>>(internal::value_base&);
-    PN_CPP_EXTERN decoder& operator>>(null&);
-    ///@}
-
-    /// Start decoding a container type, such as an ARRAY, LIST or
-    /// MAP.  This "enters" the container, more() will return false at
-    /// the end of the container.  Call finish() to "exit" the
-    /// container and move on to the next value.
-    PN_CPP_EXTERN decoder& operator>>(start&);
-
-    /// Finish decoding a container type, and move on to the next
-    /// value in the stream.
-    PN_CPP_EXTERN decoder& operator>>(const finish&);
-
-    /// @cond INTERNAL
-    template <class T> struct sequence_ref { T& ref; sequence_ref(T& r) : ref(r) {} };
-    template <class T> struct associative_ref { T& ref; associative_ref(T& r) : ref(r) {} };
-    template <class T> struct pair_sequence_ref { T& ref;  pair_sequence_ref(T& r) : ref(r) {} };
-
-    template <class T> static sequence_ref<T> sequence(T& x) { return sequence_ref<T>(x); }
-    template <class T> static associative_ref<T> associative(T& x) { return associative_ref<T>(x); }
-    template <class T> static pair_sequence_ref<T> pair_sequence(T& x) { return pair_sequence_ref<T>(x); }
-    /// @endcond
-
-    /// Extract any AMQP sequence (ARRAY, LIST or MAP) to a C++
-    /// sequence container of T if the elements types are convertible
-    /// to T. A MAP is extracted as `[key1, value1, key2, value2...]`.
-    template <class T> decoder& operator>>(sequence_ref<T> r)  {
-        start s;
-        *this >> s;
-        if (s.is_described) next();
-        r.ref.resize(s.size);
-        for (typename T::iterator i = r.ref.begin(); i != r.ref.end(); ++i)
-            *this >> *i;
-        return *this;
-    }
-
-    /// Extract an AMQP MAP to a C++ associative container
-    template <class T> decoder& operator>>(associative_ref<T> r)  {
-        using namespace internal;
-        start s;
-        *this >> s;
-        assert_type_equal(MAP, s.type);
-        r.ref.clear();
-        for (size_t i = 0; i < s.size/2; ++i) {
-            typename remove_const<typename T::key_type>::type k;
-            typename remove_const<typename T::mapped_type>::type v;
-            *this >> k >> v;
-            r.ref[k] = v;
-        }
-        return *this;
-    }
-
-    /// Extract an AMQP MAP to a C++ push_back sequence of pairs
-    /// preserving encoded order.
-    template <class T> decoder& operator>>(pair_sequence_ref<T> r)  {
-        using namespace internal;
-        start s;
-        *this >> s;
-        assert_type_equal(MAP, s.type);
-        r.ref.clear();
-        for (size_t i = 0; i < s.size/2; ++i) {
-            typedef typename T::value_type value_type;
-            typename remove_const<typename value_type::first_type>::type k;
-            typename remove_const<typename value_type::second_type>::type v;
-            *this >> k >> v;
-            r.ref.push_back(value_type(k, v));
-        }
-        return *this;
-    }
-
-  private:
-    type_id pre_get();
-    template <class T, class U> decoder& extract(T& x, U (*get)(pn_data_t*));
-    bool exact_;
-
-  friend class message;
-};
-
-/// @cond INTERNAL
-/// XXX Document this
-template<class T> T get(decoder& d) {
-    assert_type_equal(internal::type_id_of<T>::value, d.next_type());
-    T x;
-    d >> x;
-    return x;
-}
-/// @endcond
-
-/// operator>> for integer types that are not covered by the standard
-/// overrides.
-template <class T> typename internal::enable_if<internal::is_unknown_integer<T>::value, decoder&>::type
-operator>>(decoder& d, T& i)  {
-    using namespace internal;
-    typename integer_type<sizeof(T), is_signed<T>::value>::type v;
-    d >> v;                     // Extract as a known integer type
-    i = v;                      // C++ conversion to the target type.
-    return d;
-}
-
-} // codec
-} // proton
-
-#endif // PROTON_CODEC_DECODER_HPP
diff --git a/proton-c/bindings/cpp/include/proton/codec/deque.hpp b/proton-c/bindings/cpp/include/proton/codec/deque.hpp
deleted file mode 100644
index 2f570a4..0000000
--- a/proton-c/bindings/cpp/include/proton/codec/deque.hpp
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef PROTON_CODEC_DEQUE_HPP
-#define PROTON_CODEC_DEQUE_HPP
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "./encoder.hpp"
-#include "./decoder.hpp"
-
-#include <deque>
-#include <utility>
-
-namespace proton {
-namespace codec {
-
-/// std::deque<T> for most T is encoded as an amqp::ARRAY (same type elements)
-template <class T, class A>
-encoder& operator<<(encoder& e, const std::deque<T, A>& x) {
-    return e << encoder::array(x, internal::type_id_of<T>::value);
-}
-
-/// std::deque<value> encodes as codec::list_type (mixed type elements)
-template <class A>
-encoder& operator<<(encoder& e, const std::deque<value, A>& x) { return e << encoder::list(x); }
-
-/// std::deque<scalar> encodes as codec::list_type (mixed type elements)
-template <class A>
-encoder& operator<<(encoder& e, const std::deque<scalar, A>& x) { return e << encoder::list(x); }
-
-/// std::deque<std::pair<k,t> > encodes as codec::map_type.
-/// Map entries are encoded in order they appear in the list.
-template <class A, class K, class T>
-encoder& operator<<(encoder& e, const std::deque<std::pair<K,T>, A>& x) { return e << encoder::map(x); }
-
-/// Decode to std::deque<T> from an amqp::LIST or amqp::ARRAY.
-template <class T, class A> decoder& operator>>(decoder& d, std::deque<T, A>& x) { return d >> decoder::sequence(x); }
-
-/// Decode to std::deque<std::pair<K, T> from an amqp::MAP.
-template <class A, class K, class T> decoder& operator>>(decoder& d, std::deque<std::pair<K, T> , A>& x) { return d >> decoder::pair_sequence(x); }
-
-} // codec
-} // proton
-
-#endif // PROTON_CODEC_DEQUE_HPP
diff --git a/proton-c/bindings/cpp/include/proton/codec/encoder.hpp b/proton-c/bindings/cpp/include/proton/codec/encoder.hpp
deleted file mode 100644
index 222e95b..0000000
--- a/proton-c/bindings/cpp/include/proton/codec/encoder.hpp
+++ /dev/null
@@ -1,202 +0,0 @@
-#ifndef PROTON_CODEC_ENCODER_HPP
-#define PROTON_CODEC_ENCODER_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "../internal/data.hpp"
-#include "../internal/type_traits.hpp"
-#include "../types_fwd.hpp"
-#include "./common.hpp"
-
-#include <proton/type_compat.h>
-
-namespace proton {
-class scalar_base;
-
-namespace internal{
-class value_base;
-}
-
-namespace codec {
-
-/// **Experimental** - Stream-like encoder from C++ values to AMQP
-/// bytes.
-///
-/// For internal use only.
-///
-/// @see @ref types_page for the recommended ways to manage AMQP data
-class encoder : public internal::data {
-  public:
-    /// Wrap Proton-C data object.
-    explicit encoder(const data& d) : data(d) {}
-
-    /// Encoder into v. Clears any current value in v.
-    PN_CPP_EXTERN explicit encoder(internal::value_base& v);
-
-    /// Encode the current values into buffer and update size to reflect the
-    /// number of bytes encoded.
-    ///
-    /// Clears the encoder.
-    ///
-    /// @return if buffer == 0 or size is too small, then return false
-    /// and size to the required size.  Otherwise, return true and set
-    /// size to the number of bytes encoded.
-    PN_CPP_EXTERN bool encode(char* buffer, size_t& size);
-
-    /// Encode the current values into a std::string and resize the
-    /// string if necessary. Clears the encoder.
-    PN_CPP_EXTERN void encode(std::string&);
-
-    /// Encode the current values into a std::string. Clears the
-    /// encoder.
-    PN_CPP_EXTERN std::string encode();
-
-    /// @name Insert built-in types
-    /// @{
-    PN_CPP_EXTERN encoder& operator<<(bool);
-    PN_CPP_EXTERN encoder& operator<<(uint8_t);
-    PN_CPP_EXTERN encoder& operator<<(int8_t);
-    PN_CPP_EXTERN encoder& operator<<(uint16_t);
-    PN_CPP_EXTERN encoder& operator<<(int16_t);
-    PN_CPP_EXTERN encoder& operator<<(uint32_t);
-    PN_CPP_EXTERN encoder& operator<<(int32_t);
-    PN_CPP_EXTERN encoder& operator<<(wchar_t);
-    PN_CPP_EXTERN encoder& operator<<(uint64_t);
-    PN_CPP_EXTERN encoder& operator<<(int64_t);
-    PN_CPP_EXTERN encoder& operator<<(timestamp);
-    PN_CPP_EXTERN encoder& operator<<(float);
-    PN_CPP_EXTERN encoder& operator<<(double);
-    PN_CPP_EXTERN encoder& operator<<(decimal32);
-    PN_CPP_EXTERN encoder& operator<<(decimal64);
-    PN_CPP_EXTERN encoder& operator<<(decimal128);
-    PN_CPP_EXTERN encoder& operator<<(const uuid&);
-    PN_CPP_EXTERN encoder& operator<<(const std::string&);
-    PN_CPP_EXTERN encoder& operator<<(const symbol&);
-    PN_CPP_EXTERN encoder& operator<<(const binary&);
-    PN_CPP_EXTERN encoder& operator<<(const scalar_base&);
-    PN_CPP_EXTERN encoder& operator<<(const null&);
-    /// @}
-
-    /// Insert a proton::value.
-    ///
-    /// @internal NOTE insert value_base, not value to avoid recursive
-    /// implicit conversions.
-    PN_CPP_EXTERN encoder& operator<<(const internal::value_base&);
-
-    /// Start a complex type
-    PN_CPP_EXTERN encoder& operator<<(const start&);
-
-    /// Finish a complex type
-    PN_CPP_EXTERN encoder& operator<<(const finish&);
-
-    /// @cond INTERNAL
-
-    // Undefined template to  prevent pointers being implicitly converted to bool.
-    template <class T> void* operator<<(const T*);
-
-    template <class T> struct list_cref { T& ref; list_cref(T& r) : ref(r) {} };
-    template <class T> struct map_cref { T& ref;  map_cref(T& r) : ref(r) {} };
-
-    template <class T> struct array_cref {
-        start array_start;
-        T& ref;
-        array_cref(T& r, type_id el, bool described) : array_start(ARRAY, el, described), ref(r) {}
-    };
-
-    template <class T> static list_cref<T> list(T& x) { return list_cref<T>(x); }
-    template <class T> static map_cref<T> map(T& x) { return map_cref<T>(x); }
-    template <class T> static array_cref<T> array(T& x, type_id element, bool described=false) {
-        return array_cref<T>(x, element, described);
-    }
-
-    template <class T> encoder& operator<<(const map_cref<T>& x) {
-        internal::state_guard sg(*this);
-        *this << start::map();
-        for (typename T::const_iterator i = x.ref.begin(); i != x.ref.end(); ++i)
-            *this << i->first << i->second;
-        *this << finish();
-        return *this;
-    }
-
-    template <class T> encoder& operator<<(const list_cref<T>& x) {
-        internal::state_guard sg(*this);
-        *this << start::list();
-        for (typename T::const_iterator i = x.ref.begin(); i != x.ref.end(); ++i)
-            *this << *i;
-        *this << finish();
-        return *this;
-    }
-
-    template <class T> encoder& operator<<(const array_cref<T>& x) {
-        internal::state_guard sg(*this);
-        *this << x.array_start;
-        for (typename T::const_iterator i = x.ref.begin(); i != x.ref.end(); ++i)
-            *this << *i;
-        *this << finish();
-        return *this;
-    }
-    /// @endcond
-
-  private:
-    template<class T, class U> encoder& insert(const T& x, int (*put)(pn_data_t*, U));
-    void check(long result);
-};
-
-/// Treat char* as string
-inline encoder& operator<<(encoder& e, const char* s) { return e << std::string(s); }
-
-/// operator << for integer types that are not covered by the standard overrides.
-template <class T> typename internal::enable_if<internal::is_unknown_integer<T>::value, encoder&>::type
-operator<<(encoder& e, T i)  {
-    using namespace internal;
-    return e << static_cast<typename integer_type<sizeof(T), is_signed<T>::value>::type>(i);
-}
-
-/// @cond INTERNAL
-
-namespace is_encodable_impl {   // Protect the world from fallback operator<<
-
-using namespace internal;
-
-sfinae::no operator<<(encoder const&, const sfinae::any_t &); // Fallback
-
-template<typename T> struct is_encodable : public sfinae {
-    static yes test(encoder&);
-    static no test(...);         // Failed test, no match.
-    static encoder* e;
-    static const T* t;
-    static bool const value = sizeof(test(*e << *t)) == sizeof(yes);
-};
-
-// Avoid recursion
-template <> struct is_encodable<value> : public true_type {};
-
-} // is_encodable_impl
-
-using is_encodable_impl::is_encodable;
-
-/// @endcond
-
-} // codec
-} // proton
-
-#endif /// PROTON_CODEC_ENCODER_HPP
diff --git a/proton-c/bindings/cpp/include/proton/codec/forward_list.hpp b/proton-c/bindings/cpp/include/proton/codec/forward_list.hpp
deleted file mode 100644
index 0038b8f..0000000
--- a/proton-c/bindings/cpp/include/proton/codec/forward_list.hpp
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef PROTON_CODEC_FORWARD_LIST_HPP
-#define PROTON_CODEC_FORWARD_LIST_HPP
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "./encoder.hpp"
-#include "./decoder.hpp"
-
-#include <forward_list>
-#include <utility>
-
-namespace proton {
-namespace codec {
-
-/// std::forward_list<T> for most T is encoded as an AMQP array.
-template <class T, class A>
-encoder& operator<<(encoder& e, const std::forward_list<T, A>& x) {
-    return e << encoder::array(x, internal::type_id_of<T>::value);
-}
-
-/// Specialize for std::forward_list<value>, encode as AMQP forward_list (variable type)
-template <class A>
-encoder& operator<<(encoder& e, const std::forward_list<value, A>& x) { return e << encoder::list(x); }
-
-/// Specialize for std::forward_list<scalar>, encode as AMQP list (variable type)
-template <class A>
-encoder& operator<<(encoder& e, const std::forward_list<scalar, A>& x) { return e << encoder::list(x); }
-
-/// Specialize for std::forward_list<std::pair<k,t> >, encode as AMQP map.
-/// Allows control over the order of encoding map entries.
-template <class A, class K, class T>
-encoder& operator<<(encoder& e, const std::forward_list<std::pair<K,T>, A>& x) { return e << encoder::map(x); }
-
-/// Decode to std::forward_list<T> from an amqp::LIST or amqp::ARRAY.
-template <class T, class A> decoder& operator>>(decoder& d, std::forward_list<T, A>& x) { return d >> decoder::sequence(x); }
-
-/// Decode to std::forward_list<std::pair<K, T> from an amqp::MAP.
-template <class A, class K, class T> decoder& operator>>(decoder& d, std::forward_list<std::pair<K, T> , A>& x) { return d >> decoder::pair_sequence(x); }
-
-} // codec
-} // proton
-
-#endif // PROTON_CODEC_FORWARD_LIST_HPP
diff --git a/proton-c/bindings/cpp/include/proton/codec/list.hpp b/proton-c/bindings/cpp/include/proton/codec/list.hpp
deleted file mode 100644
index a2c71b8..0000000
--- a/proton-c/bindings/cpp/include/proton/codec/list.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef PROTON_CODEC_LIST_HPP
-#define PROTON_CODEC_LIST_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./encoder.hpp"
-#include "./decoder.hpp"
-
-#include <list>
-#include <utility>
-
-namespace proton {
-namespace codec {
-
-/// std::list<T> for most T is encoded as an AMQP array.
-template <class T, class A>
-encoder& operator<<(encoder& e, const std::list<T, A>& x) {
-    return e << encoder::array(x, internal::type_id_of<T>::value);
-}
-
-/// Specialize for std::list<value>, encode as AMQP list (variable type)
-template <class A>
-encoder& operator<<(encoder& e, const std::list<value, A>& x) { return e << encoder::list(x); }
-
-/// Specialize for std::list<scalar>, encode as AMQP list (variable type)
-template <class A>
-encoder& operator<<(encoder& e, const std::list<scalar, A>& x) { return e << encoder::list(x); }
-
-/// Specialize for std::list<std::pair<k,t> >, encode as AMQP map.
-/// Allows control over the order of encoding map entries.
-template <class A, class K, class T>
-encoder& operator<<(encoder& e, const std::list<std::pair<K,T>, A>& x) { return e << encoder::map(x); }
-
-/// Decode to std::list<T> from an amqp::LIST or amqp::ARRAY.
-template <class T, class A> decoder& operator>>(decoder& d, std::list<T, A>& x) { return d >> decoder::sequence(x); }
-
-/// Decode to std::list<std::pair<K, T> from an amqp::MAP.
-template <class A, class K, class T> decoder& operator>>(decoder& d, std::list<std::pair<K, T> , A>& x) { return d >> decoder::pair_sequence(x); }
-
-} // codec
-} // proton
-
-#endif // PROTON_CODEC_LIST_HPP
diff --git a/proton-c/bindings/cpp/include/proton/codec/map.hpp b/proton-c/bindings/cpp/include/proton/codec/map.hpp
deleted file mode 100644
index d3b0c4d..0000000
--- a/proton-c/bindings/cpp/include/proton/codec/map.hpp
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef PROTON_CODEC_MAP_HPP
-#define PROTON_CODEC_MAP_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./encoder.hpp"
-#include "./decoder.hpp"
-
-#include <map>
-
-namespace proton {
-namespace codec {
-
-/// Encode std::map<K, T> as amqp::MAP.
-template <class K, class T, class C, class A>
-encoder& operator<<(encoder& e, const std::map<K, T, C, A>& m) { return e << encoder::map(m); }
-
-/// Decode to std::map<K, T> from amqp::MAP.
-template <class K, class T, class C, class A>
-decoder& operator>>(decoder& d, std::map<K, T, C, A>& m) { return d >> decoder::associative(m); }
-
-} // codec
-} // proton
-
-#endif // PROTON_CODEC_MAP_HPP
diff --git a/proton-c/bindings/cpp/include/proton/codec/unordered_map.hpp b/proton-c/bindings/cpp/include/proton/codec/unordered_map.hpp
deleted file mode 100644
index b081ff8..0000000
--- a/proton-c/bindings/cpp/include/proton/codec/unordered_map.hpp
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef PROTON_CODEC_UNORDERED_MAP_HPP
-#define PROTON_CODEC_UNORDERED_MAP_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./encoder.hpp"
-#include "./decoder.hpp"
-
-#include <unordered_map>
-
-namespace proton {
-namespace codec {
-
-/// Encode std::unordered_map<K, T> as amqp::UNORDERED_MAP.
-template <class K, class T, class C, class A>
-encoder& operator<<(encoder& e, const std::unordered_map<K, T, C, A>& m) { return e << encoder::map(m); }
-
-/// Decode to std::unordered_map<K, T> from amqp::UNORDERED_MAP.
-template <class K, class T, class C, class A>
-decoder& operator>>(decoder& d, std::unordered_map<K, T, C, A>& m) { return d >> decoder::associative(m); }
-
-} // codec
-} // proton
-
-#endif // PROTON_CODEC_UNORDERED_MAP_HPP
diff --git a/proton-c/bindings/cpp/include/proton/codec/vector.hpp b/proton-c/bindings/cpp/include/proton/codec/vector.hpp
deleted file mode 100644
index 4edae25..0000000
--- a/proton-c/bindings/cpp/include/proton/codec/vector.hpp
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef PROTON_CODEC_VECTOR_HPP
-#define PROTON_CODEC_VECTOR_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./encoder.hpp"
-#include "./decoder.hpp"
-
-#include <vector>
-#include <utility>
-
-namespace proton {
-namespace codec {
-
-/// Encode std::vector<T> as amqp::ARRAY (same type elements)
-template <class T, class A> encoder& operator<<(encoder& e, const std::vector<T, A>& x) {
-    return e << encoder::array(x, internal::type_id_of<T>::value);
-}
-
-/// Encode std::vector<value> encode as amqp::LIST (mixed type elements)
-template <class A> encoder& operator<<(encoder& e, const std::vector<value, A>& x) { return e << encoder::list(x); }
-
-/// Encode std::vector<scalar> as amqp::LIST (mixed type elements)
-template <class A> encoder& operator<<(encoder& e, const std::vector<scalar, A>& x) { return e << encoder::list(x); }
-
-/// Encode std::deque<std::pair<k,t> > as amqp::MAP, preserves order of entries.
-template <class A, class K, class T>
-encoder& operator<<(encoder& e, const std::vector<std::pair<K,T>, A>& x) { return e << encoder::map(x); }
-
-/// Decode to std::vector<T> from an amqp::LIST or amqp::ARRAY.
-template <class T, class A> decoder& operator>>(decoder& d, std::vector<T, A>& x) { return d >> decoder::sequence(x); }
-
-/// Decode to std::vector<std::pair<K, T> from an amqp::MAP.
-template <class A, class K, class T> decoder& operator>>(decoder& d, std::vector<std::pair<K, T> , A>& x) { return d >> decoder::pair_sequence(x); }
-
-} // codec
-} // proton
-
-#endif // PROTON_CODEC_VECTOR_HPP
diff --git a/proton-c/bindings/cpp/include/proton/connection.hpp b/proton-c/bindings/cpp/include/proton/connection.hpp
deleted file mode 100644
index a4046be..0000000
--- a/proton-c/bindings/cpp/include/proton/connection.hpp
+++ /dev/null
@@ -1,142 +0,0 @@
-#ifndef PROTON_CONNECTION_HPP
-#define PROTON_CONNECTION_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./internal/export.hpp"
-#include "./internal/object.hpp"
-#include "./endpoint.hpp"
-#include "./session.hpp"
-
-#include <proton/type_compat.h>
-
-#include <string>
-
-struct pn_connection_t;
-
-namespace proton {
-
-/// A connection to a remote AMQP peer.
-class
-PN_CPP_CLASS_EXTERN connection : public internal::object<pn_connection_t>, public endpoint {
-    /// @cond INTERNAL
-    PN_CPP_EXTERN connection(pn_connection_t* c) : internal::object<pn_connection_t>(c) {}
-    /// @endcond
-
-  public:
-    /// Create an empty connection.
-    connection() : internal::object<pn_connection_t>(0) {}
-
-    PN_CPP_EXTERN bool uninitialized() const;
-    PN_CPP_EXTERN bool active() const;
-    PN_CPP_EXTERN bool closed() const;
-
-    PN_CPP_EXTERN class error_condition error() const;
-
-    /// Get the container.
-    ///
-    /// @throw proton::error if this connection is not managed by a
-    /// container
-    PN_CPP_EXTERN class container &container() const;
-
-    /// Get the transport for the connection.
-    PN_CPP_EXTERN class transport transport() const;
-
-    /// Return the AMQP hostname attribute for the connection.
-    PN_CPP_EXTERN std::string virtual_host() const;
-
-    /// Return the container ID for the connection.
-    PN_CPP_EXTERN std::string container_id() const;
-
-    /// Return authenticated user for the connection
-    /// Note: The value returned is not stable until the on_transport_open event is received
-    PN_CPP_EXTERN std::string user() const;
-
-    /// Open the connection.
-    ///
-    /// @see endpoint_lifecycle
-    PN_CPP_EXTERN void open();
-
-    /// @copydoc open
-    PN_CPP_EXTERN void open(const connection_options &);
-
-    PN_CPP_EXTERN void close();
-    PN_CPP_EXTERN void close(const error_condition&);
-
-    /// Open a new session.
-    PN_CPP_EXTERN session open_session();
-
-    /// @copydoc open_session
-    PN_CPP_EXTERN session open_session(const session_options &);
-
-    /// Get the default session.  A default session is created on the
-    /// first call and reused for the lifetime of the connection.
-    PN_CPP_EXTERN session default_session();
-
-    /// Open a sender for `addr` on default_session().
-    PN_CPP_EXTERN sender open_sender(const std::string &addr);
-
-    /// @copydoc open_sender
-    PN_CPP_EXTERN sender open_sender(const std::string &addr, const sender_options &);
-
-    /// Open a receiver for `addr` on default_session().
-    PN_CPP_EXTERN receiver open_receiver(const std::string &addr);
-
-    /// @copydoc open_receiver
-    PN_CPP_EXTERN receiver open_receiver(const std::string &addr,
-                                         const receiver_options &);
-
-    /// Return all sessions on this connection.
-    PN_CPP_EXTERN session_range sessions() const;
-
-    /// Return all receivers on this connection.
-    PN_CPP_EXTERN receiver_range receivers() const;
-
-    /// Return all senders on this connection.
-    PN_CPP_EXTERN sender_range senders() const;
-
-    /// Get the maximum frame size.
-    ///
-    /// @see @ref connection_options::max_frame_size
-    PN_CPP_EXTERN uint32_t max_frame_size() const;
-
-    /// Get the maximum number of open sessions.
-    ///
-    /// @see @ref connection_options::max_sessions
-    PN_CPP_EXTERN uint16_t max_sessions() const;
-
-    /// Get the idle timeout.
-    ///
-    /// @see @ref connection_options::idle_timeout
-    PN_CPP_EXTERN uint32_t idle_timeout() const;
-
-    /// @cond INTERNAL
-  friend class internal::factory<connection>;
-  friend class container;
-  friend class proton::thread_safe<connection>;
-    /// @endcond
-};
-
-} // proton
-
-#endif // PROTON_CONNECTION_HPP
diff --git a/proton-c/bindings/cpp/include/proton/connection_options.hpp b/proton-c/bindings/cpp/include/proton/connection_options.hpp
deleted file mode 100644
index 9c7923e..0000000
--- a/proton-c/bindings/cpp/include/proton/connection_options.hpp
+++ /dev/null
@@ -1,167 +0,0 @@
-#ifndef PROTON_CONNECTION_OPTIONS_H
-#define PROTON_CONNECTION_OPTIONS_H
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./types_fwd.hpp"
-#include "./internal/config.hpp"
-#include "./internal/export.hpp"
-#include "./internal/pn_unique_ptr.hpp"
-#include "./duration.hpp"
-
-#include <proton/type_compat.h>
-
-#include <vector>
-#include <string>
-
-struct pn_connection_t;
-
-namespace proton {
-
-/// Options for creating a connection.
-///
-/// Options can be "chained" like this:
-///
-/// @code
-/// c = container.connect(url, connection_options().handler(h).max_frame_size(1234));
-/// @endcode
-///
-/// You can also create an options object with common settings and use
-/// it as a base for different connections that have mostly the same
-/// settings:
-///
-/// @code
-/// connection_options opts;
-/// opts.idle_timeout(1000).max_frame_size(10000);
-/// c1 = container.connect(url1, opts.handler(h1));
-/// c2 = container.connect(url2, opts.handler(h2));
-/// @endcode
-///
-/// Normal value semantics: copy or assign creates a separate copy of
-/// the options.
-class connection_options {
-  public:
-    /// Create an empty set of options.
-    PN_CPP_EXTERN connection_options();
-
-    /// Shorthand for connection_options().handler(h)
-    PN_CPP_EXTERN connection_options(class messaging_handler& h);
-
-    /// Copy options.
-    PN_CPP_EXTERN connection_options(const connection_options&);
-
-    PN_CPP_EXTERN ~connection_options();
-
-    /// Copy options.
-    PN_CPP_EXTERN connection_options& operator=(const connection_options&);
-
-    // XXX add C++11 move operations - Still relevant, and applies to all options
-
-    /// Set a connection handler.
-    ///
-    /// The handler must not be deleted until messaging_handler::on_transport_close() is called.
-    PN_CPP_EXTERN connection_options& handler(class messaging_handler&);
-
-    /// Set the maximum frame size.
-    PN_CPP_EXTERN connection_options& max_frame_size(uint32_t max);
-
-    /// Set the maximum number of open sessions.
-    PN_CPP_EXTERN connection_options& max_sessions(uint16_t max);
-
-    // XXX document relationship to heartbeat interval
-    /// Set the idle timeout.
-    PN_CPP_EXTERN connection_options& idle_timeout(duration);
-
-    /// Set the container ID.
-    PN_CPP_EXTERN connection_options& container_id(const std::string &id);
-
-    /// Set the virtual host name for the connection. If making a
-    /// client connection by SSL/TLS, this name is also used for
-    /// certificate verification and Server Name Indication.  For
-    /// client connections, it defaults to the host name used to set
-    /// up the connection.  It is not set by default for server
-    /// connections.
-    PN_CPP_EXTERN connection_options& virtual_host(const std::string &name);
-
-    /// Set the user name used to authenticate the connection.
-    ///
-    /// This will override any user name that is specified in the url
-    /// used for container::connect.
-    /// It will be ignored if the connection is created by container::listen as
-    /// a listening connection has no user name.
-    PN_CPP_EXTERN connection_options& user(const std::string& user);
-
-    /// Set the password used to authenticate the connection
-    PN_CPP_EXTERN connection_options& password(const std::string& pass);
-
-    /// @cond INTERNAL
-    // XXX settle questions about reconnect_timer - consider simply
-    // reconnect_options and making reconnect_timer internal
-    /// **Experimental**
-    PN_CPP_EXTERN connection_options& reconnect(const reconnect_timer &);
-    /// @endcond
-
-    /// Set SSL client options.
-    PN_CPP_EXTERN connection_options& ssl_client_options(const class ssl_client_options &);
-
-    /// Set SSL server options.
-    PN_CPP_EXTERN connection_options& ssl_server_options(const class ssl_server_options &);
-
-    /// Enable or disable SASL.
-    PN_CPP_EXTERN connection_options& sasl_enabled(bool);
-
-    /// Force the enabling of SASL mechanisms that disclose clear text
-    /// passwords over the connection.  By default, such mechanisms
-    /// are disabled.
-    PN_CPP_EXTERN connection_options& sasl_allow_insecure_mechs(bool);
-
-    /// Specify the allowed mechanisms for use on the connection.
-    PN_CPP_EXTERN connection_options& sasl_allowed_mechs(const std::string &);
-
-    /// **Experimental** - Set the SASL configuration name.
-    PN_CPP_EXTERN connection_options& sasl_config_name(const std::string &);
-
-    /// **Experimental** - Set the SASL configuration path.
-    PN_CPP_EXTERN connection_options& sasl_config_path(const std::string &);
-
-    /// Update option values from values set in other.
-    PN_CPP_EXTERN connection_options& update(const connection_options& other);
-
-  private:
-    void apply_unbound(connection&) const;
-    void apply_bound(connection&) const;
-    messaging_handler* handler() const;
-
-    class impl;
-    internal::pn_unique_ptr<impl> impl_;
-
-    /// @cond INTERNAL
-  friend class container;
-  friend class io::connection_driver;
-  friend class connection;
-    /// @endcond
-};
-
-} // proton
-
-#endif // PROTON_CONNECTION_OPTIONS_H
diff --git a/proton-c/bindings/cpp/include/proton/container.hpp b/proton-c/bindings/cpp/include/proton/container.hpp
deleted file mode 100644
index 0c40f3d..0000000
--- a/proton-c/bindings/cpp/include/proton/container.hpp
+++ /dev/null
@@ -1,234 +0,0 @@
-#ifndef PROTON_CONTAINER_HPP
-#define PROTON_CONTAINER_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./types_fwd.hpp"
-
-#include "./internal/config.hpp"
-#include "./internal/export.hpp"
-#include "./internal/pn_unique_ptr.hpp"
-
-#include <string>
-
-namespace proton {
-
-/// A top-level container of connections, sessions, senders, and
-/// receivers.
-///
-/// A container gives a unique identity to each communicating peer. It
-/// is often a process-level object.
-///
-/// It serves as an entry point to the API, allowing connections,
-/// senders, and receivers to be established. It can be supplied with
-/// an event handler in order to intercept important messaging events,
-/// such as newly received messages or newly issued credit for sending
-/// messages.
-class PN_CPP_CLASS_EXTERN container {
-  public:
-    /// Create a container.
-    PN_CPP_EXTERN container(messaging_handler& h, const std::string& id="");
-
-    /// Create a container.
-    PN_CPP_EXTERN container(const std::string& id="");
-
-    PN_CPP_EXTERN ~container();
-
-    /// Connect to `url` and send an open request to the remote peer.
-    ///
-    /// Options are applied to the connection as follows, values in later
-    /// options override earlier ones:
-    ///
-    ///  1. client_connection_options()
-    ///  2. options passed to connect()
-    ///
-    /// The handler in the composed options is used to call
-    /// proton::messaging_handler::on_connection_open() when the remote peer's
-    /// open response is received.
-    PN_CPP_EXTERN returned<connection> connect(const std::string& url, const connection_options &);
-
-    /// Connect to `url` and send an open request to the remote peer.
-    PN_CPP_EXTERN returned<connection> connect(const std::string& url);
-
-    /// @cond INTERNAL
-    /// Stop listening on url, must match the url string given to listen().
-    /// You can also use the proton::listener object returned by listen()
-    PN_CPP_EXTERN void stop_listening(const std::string& url);
-    /// @endcond
-
-    /// Start listening on url.
-    ///
-    /// Calls to the @ref listen_handler are serialized for this listener,
-    /// but handlers attached to separate listeners may be called concurrently.
-    ///
-    /// @param url identifies a listening url.
-    /// @param lh handles listening events
-    /// @return listener lets you stop listening
-    PN_CPP_EXTERN listener listen(const std::string& url, listen_handler& lh);
-
-    /// Listen with a fixed set of options for all accepted connections.
-    /// See listen(const std::string&, listen_handler&)
-    PN_CPP_EXTERN listener listen(const std::string& url, const connection_options&);
-
-    /// Start listening on URL.
-    /// New connections will use the handler from server_connection_options()
-    PN_CPP_EXTERN listener listen(const std::string& url);
-
-    /// Run the container in this thread.
-    /// Returns when the container stops.
-    /// @see auto_stop() and stop().
-    ///
-    /// With a multithreaded container, call run() in multiple threads to create a thread pool.
-    PN_CPP_EXTERN void run();
-
-    /// If true, stop the container when all active connections and listeners are closed.
-    /// If false the container will keep running till stop() is called.
-    ///
-    /// auto_stop is set by default when a new container is created.
-    PN_CPP_EXTERN void auto_stop(bool);
-
-    /// **Experimental** - Stop the container with an error_condition
-    /// err.
-    ///
-    ///  - Abort all open connections and listeners.
-    ///  - Process final handler events and injected functions
-    ///  - If `!err.empty()`, handlers will receive on_transport_error
-    ///  - run() will return in all threads.
-    PN_CPP_EXTERN void stop(const error_condition& err);
-
-    /// **Experimental** - Stop the container with an empty error
-    /// condition.
-    ///
-    /// @see stop(const error_condition&)
-    PN_CPP_EXTERN void stop();
-
-    /// Open a connection and sender for `url`.
-    PN_CPP_EXTERN returned<sender> open_sender(const std::string &url);
-
-    /// Open a connection and sender for `url`.
-    ///
-    /// Supplied sender options will override the container's
-    /// template options.
-    PN_CPP_EXTERN returned<sender> open_sender(const std::string &url,
-                                         const proton::sender_options &o);
-
-    /// Open a connection and sender for `url`.
-    ///
-    /// Supplied connection options will override the
-    /// container's template options.
-    PN_CPP_EXTERN returned<sender> open_sender(const std::string &url,
-                                         const connection_options &c);
-
-    /// Open a connection and sender for `url`.
-    ///
-    /// Supplied sender or connection options will override the
-    /// container's template options.
-    PN_CPP_EXTERN returned<sender> open_sender(const std::string &url,
-                                         const proton::sender_options &o,
-                                         const connection_options &c);
-
-    /// Open a connection and receiver for `url`.
-    PN_CPP_EXTERN returned<receiver> open_receiver(const std::string&url);
-
-
-    /// Open a connection and receiver for `url`.
-    ///
-    /// Supplied receiver options will override the container's
-    /// template options.
-    PN_CPP_EXTERN returned<receiver> open_receiver(const std::string&url,
-                                             const proton::receiver_options &o);
-
-    /// Open a connection and receiver for `url`.
-    ///
-    /// Supplied receiver or connection options will override the
-    /// container's template options.
-    PN_CPP_EXTERN returned<receiver> open_receiver(const std::string&url,
-                                             const connection_options &c);
-
-    /// Open a connection and receiver for `url`.
-    ///
-    /// Supplied receiver or connection options will override the
-    /// container's template options.
-    PN_CPP_EXTERN returned<receiver> open_receiver(const std::string&url,
-                                             const proton::receiver_options &o,
-                                             const connection_options &c);
-
-    /// A unique identifier for the container.
-    PN_CPP_EXTERN std::string id() const;
-
-    /// Connection options that will be to outgoing connections. These
-    /// are applied first and overriden by options provided in
-    /// connect() and messaging_handler::on_connection_open().
-    PN_CPP_EXTERN void client_connection_options(const connection_options &);
-
-    /// @copydoc client_connection_options
-    PN_CPP_EXTERN connection_options client_connection_options() const;
-
-    /// Connection options that will be applied to incoming
-    /// connections. These are applied first and overridden by options
-    /// provided in listen(), listen_handler::on_accept() and
-    /// messaging_handler::on_connection_open().
-    PN_CPP_EXTERN void server_connection_options(const connection_options &);
-
-    /// @copydoc server_connection_options
-    PN_CPP_EXTERN connection_options server_connection_options() const;
-
-    /// Sender options applied to senders created by this
-    /// container. They are applied before messaging_handler::on_sender_open()
-    /// and can be overridden.
-    PN_CPP_EXTERN void sender_options(const class sender_options &);
-
-    /// @copydoc sender_options
-    PN_CPP_EXTERN class sender_options sender_options() const;
-
-    /// Receiver options applied to receivers created by this
-    /// container. They are applied before messaging_handler::on_receiver_open()
-    /// and can be overridden.
-    PN_CPP_EXTERN void receiver_options(const class receiver_options &);
-
-    /// @copydoc receiver_options
-    PN_CPP_EXTERN class receiver_options receiver_options() const;
-
-    /// Schedule a function to be called after the duration.  C++03
-    /// compatible, for C++11 use schedule(duration,
-    /// std::function<void()>)
-    PN_CPP_EXTERN void schedule(duration, void_function0&);
-
-#if PN_CPP_HAS_STD_FUNCTION
-    /// Schedule a function to be called after the duration
-    PN_CPP_EXTERN void schedule(duration, std::function<void()>);
-#endif
-
-  private:
-    class impl;
-    internal::pn_unique_ptr<impl> impl_;
-
-  friend class connection_options;
-  friend class session_options;
-  friend class receiver_options;
-  friend class sender_options;
-};
-
-} // proton
-
-#endif // PROTON_CONTAINER_HPP
diff --git a/proton-c/bindings/cpp/include/proton/decimal.hpp b/proton-c/bindings/cpp/include/proton/decimal.hpp
deleted file mode 100644
index efca029..0000000
--- a/proton-c/bindings/cpp/include/proton/decimal.hpp
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef PROTON_DECIMAL_HPP
-#define PROTON_DECIMAL_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./byte_array.hpp"
-#include "./internal/export.hpp"
-#include "./internal/comparable.hpp"
-
-#include <iosfwd>
-
-namespace proton {
-
-/// @name AMQP decimal types.
-///
-/// AMQP uses the standard IEEE 754-2008 encoding for decimal types.
-///
-/// This library does not provide support for decimal arithmetic but it does
-/// provide access to the byte representation of decimal values. You can pass
-/// these values uninterpreted via AMQP, or you can use a library that supports
-/// IEEE 754-2008 and make a byte-wise copy between the real decimal values and
-/// proton::decimal values.
-///
-/// @{
-
-/// 32-bit decimal floating point.
-class decimal32 : public byte_array<4> {};
-
-/// 64-bit decimal floating point.
-class decimal64 : public byte_array<8> {};
-
-/// 128-bit decimal floating point.
-class decimal128 : public byte_array<16> {};
-/// @}
-
-/// Print decimal values
-/// @{
-PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const decimal32&);
-PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const decimal64&);
-PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const decimal128&);
-/// @}
-
-} // proton
-
-#endif // PROTON_DECIMAL_HPP
diff --git a/proton-c/bindings/cpp/include/proton/default_container.hpp b/proton-c/bindings/cpp/include/proton/default_container.hpp
deleted file mode 100644
index 0f245a0..0000000
--- a/proton-c/bindings/cpp/include/proton/default_container.hpp
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef PROTON_DEFAULT_CONTAINER_HPP
-#define PROTON_DEFAULT_CONTAINER_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-namespace proton {
-
-/// @cond INTERNAL
-typedef class container default_container;
-/// @endcond
-
-} // proton
-
-#endif // PROTON_DEFAULT_CONTAINER_HPP
diff --git a/proton-c/bindings/cpp/include/proton/delivery.hpp b/proton-c/bindings/cpp/include/proton/delivery.hpp
deleted file mode 100644
index 7c89f0c..0000000
--- a/proton-c/bindings/cpp/include/proton/delivery.hpp
+++ /dev/null
@@ -1,69 +0,0 @@
-#ifndef PROTON_DELIVERY_HPP
-#define PROTON_DELIVERY_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./internal/export.hpp"
-#include "./internal/object.hpp"
-#include "./transfer.hpp"
-
-namespace proton {
-
-/// A received message.
-/// 
-/// A delivery attempt can fail. As a result, a particular message may
-/// correspond to multiple deliveries.
-class delivery : public transfer {
-    /// @cond INTERNAL
-    delivery(pn_delivery_t* d);
-    /// @endcond
-
-  public:
-    delivery() {}
-
-    /// Return the receiver for this delivery.
-    PN_CPP_EXTERN class receiver receiver() const;
-
-    // XXX ATM the following don't reflect the differing behaviors we
-    // get from the different delivery modes. - Deferred
-    
-    /// Settle with ACCEPTED state.
-    PN_CPP_EXTERN void accept();
-
-    /// Settle with REJECTED state.
-    PN_CPP_EXTERN void reject();
-
-    /// Settle with RELEASED state.
-    PN_CPP_EXTERN void release();
-
-    /// Settle with MODIFIED state.
-    PN_CPP_EXTERN void modify();
-
-    /// @cond INTERNAL
-  friend class internal::factory<delivery>;
-    /// @endcond
-};
-
-} // proton
-
-#endif // PROTON_DELIVERY_HPP
diff --git a/proton-c/bindings/cpp/include/proton/delivery_mode.hpp b/proton-c/bindings/cpp/include/proton/delivery_mode.hpp
deleted file mode 100644
index 97b350f..0000000
--- a/proton-c/bindings/cpp/include/proton/delivery_mode.hpp
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef PROTON_DELIVERY_MODE_H
-#define PROTON_DELIVERY_MODE_H
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-namespace proton {
-
-/// The message delivery policy to establish when opening a link.
-/// This structure imitates the newer C++11 "enum class" so that
-/// The enumeration constants are in the delivery_mode namespace.
-struct delivery_mode {
-    /// Delivery modes
-    enum modes {
-        /// No set policy.  The application must settle messages
-        /// itself according to its own policy.
-        NONE = 0,
-        /// Outgoing messages are settled immediately by the link.
-        /// There are no duplicates.
-        AT_MOST_ONCE,
-        /// The receiver settles the delivery first with an
-        /// accept/reject/release disposition.  The sender waits to
-        /// settle until after the disposition notification is
-        /// received.
-        AT_LEAST_ONCE
-    };
-
-    /// @cond INTERNAL
-    
-    delivery_mode() : modes_(NONE) {}
-    delivery_mode(modes m) : modes_(m) {}
-    operator modes() { return modes_; }
-
-    /// @endcond
-
-  private:
-    modes modes_;
-};
-
-} // proton
-
-#endif // PROTON_DELIVERY_MODE_H
diff --git a/proton-c/bindings/cpp/include/proton/duration.hpp b/proton-c/bindings/cpp/include/proton/duration.hpp
deleted file mode 100644
index a190cf9..0000000
--- a/proton-c/bindings/cpp/include/proton/duration.hpp
+++ /dev/null
@@ -1,75 +0,0 @@
-#ifndef PROTON_DURATION_HPP
-#define PROTON_DURATION_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./internal/export.hpp"
-#include "./internal/comparable.hpp"
-#include "./types_fwd.hpp"
-
-#include <proton/type_compat.h>
-
-#include <iosfwd>
-
-namespace proton {
-
-/// A span of time in milliseconds.
-class duration : private internal::comparable<duration> {
-  public:
-    /// Numeric type used to store milliseconds    
-    typedef int64_t numeric_type;
-
-    /// Construct from milliseconds
-    explicit duration(numeric_type ms = 0) : ms_(ms) {}
-
-    /// Assign
-    duration& operator=(numeric_type ms) { ms_ = ms; return *this; }
-
-    /// Return milliseconds
-    numeric_type milliseconds() const { return ms_; }
-
-    PN_CPP_EXTERN static const duration FOREVER;   ///< Wait forever
-    PN_CPP_EXTERN static const duration IMMEDIATE; ///< Don't wait at all
-    PN_CPP_EXTERN static const duration SECOND;    ///< One second
-    PN_CPP_EXTERN static const duration MINUTE;    ///< One minute
-
-  private:
-    numeric_type ms_;
-};
-
-/// Print duration
-PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, duration);
-
-/// @name Comparison and arithmetic operators
-/// @{
-inline bool operator<(duration x, duration y) { return x.milliseconds() < y.milliseconds(); }
-inline bool operator==(duration x, duration y) { return x.milliseconds() == y.milliseconds(); }
-
-inline duration operator+(duration x, duration y) { return duration(x.milliseconds() + y.milliseconds()); }
-inline duration operator-(duration x, duration y) { return duration(x.milliseconds() - y.milliseconds()); }
-inline duration operator*(duration d, uint64_t n) { return duration(d.milliseconds()*n); }
-inline duration operator*(uint64_t n, duration d) { return d * n; }
-/// @}
-
-} // proton
-
-#endif // PROTON_DURATION_HPP
diff --git a/proton-c/bindings/cpp/include/proton/endpoint.hpp b/proton-c/bindings/cpp/include/proton/endpoint.hpp
deleted file mode 100644
index b041906..0000000
--- a/proton-c/bindings/cpp/include/proton/endpoint.hpp
+++ /dev/null
@@ -1,109 +0,0 @@
-#ifndef PROTON_ENDPOINT_HPP
-#define PROTON_ENDPOINT_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./internal/config.hpp"
-#include "./internal/export.hpp"
-
-namespace proton {
-
-/// The base class for session, connection, and link.
-class
-PN_CPP_CLASS_EXTERN endpoint {
-  public:
-    PN_CPP_EXTERN virtual ~endpoint();
-
-    // XXX Add the container accessor here.
-    
-    /// True if the local end is uninitialized.
-    virtual bool uninitialized() const = 0;
-    
-    /// True if the local end is active.
-    virtual bool active() const = 0;
-    
-    /// True if the local and remote ends are closed.
-    virtual bool closed() const = 0;
-
-    /// Get the error condition of the remote endpoint.
-    virtual class error_condition error() const = 0;
-
-    // XXX Add virtual open() and open(endpoint_options)
-    
-    /// Close the endpoint.
-    ///
-    /// @see endpoint_lifecycle
-    virtual void close() = 0;
-
-    /// Close the endpoint with an error condition.
-    ///
-    /// @see endpoint_lifecycle
-    virtual void close(const error_condition&) = 0;
-
-#if PN_CPP_HAS_DEFAULTED_FUNCTIONS
-    // Make everything explicit for C++11 compilers
-
-    /// @cond INTERNAL
-    endpoint() = default;
-    endpoint& operator=(const endpoint&) = default;
-    endpoint& operator=(endpoint&&) = default;
-    endpoint(const endpoint&) = default;
-    endpoint(endpoint&&) = default;
-    /// @endcond
-#endif
-};
-
-namespace internal {
-
-template <class T, class D> class iter_base {
-  public:
-    typedef T value_type;
-
-    T operator*() const { return obj_; }
-    T* operator->() const { return const_cast<T*>(&obj_); }
-    D operator++(int) { D x(*this); ++(*this); return x; }
-    bool operator==(const iter_base<T, D>& x) const { return obj_ == x.obj_; }
-    bool operator!=(const iter_base<T, D>& x) const { return obj_ != x.obj_; }
-    
-  protected:
-    explicit iter_base(T p = 0) : obj_(p) {}
-    T obj_;
-};
-
-template<class I> class iter_range {
-  public:
-    typedef I iterator;
-
-    explicit iter_range(I begin = I(), I end = I()) : begin_(begin), end_(end) {}
-    I begin() const { return begin_; }
-    I end() const { return end_; }
-    bool empty() const { return begin_ == end_; }
-    
-  private:
-    I begin_, end_;
-};
-
-} // internal
-} // proton
-
-#endif // PROTON_ENDPOINT_HPP
diff --git a/proton-c/bindings/cpp/include/proton/error.hpp b/proton-c/bindings/cpp/include/proton/error.hpp
deleted file mode 100644
index 6896620..0000000
--- a/proton-c/bindings/cpp/include/proton/error.hpp
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef PROTON_ERROR_HPP
-#define PROTON_ERROR_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./internal/config.hpp"
-#include "./internal/export.hpp"
-
-#include <stdexcept>
-#include <string>
-
-namespace proton {
-
-/// The base Proton error.
-///
-/// All exceptions thrown from functions in the proton namespace are
-/// subclasses of proton::error.
-struct
-PN_CPP_CLASS_EXTERN error : public std::runtime_error {
-    /// Construct the error with a message.
-    PN_CPP_EXTERN explicit error(const std::string&);
-};
-
-/// An operation timed out.
-struct
-PN_CPP_CLASS_EXTERN timeout_error : public error {
-    /// Construct the error with a message.
-    PN_CPP_EXTERN explicit timeout_error(const std::string&);
-};
-
-/// An error converting between AMQP and C++ data.
-struct
-PN_CPP_CLASS_EXTERN conversion_error : public error {
-    /// Construct the error with a message.
-    PN_CPP_EXTERN explicit conversion_error(const std::string&);
-};
-
-} // proton
-
-#endif // PROTON_ERROR_HPP
diff --git a/proton-c/bindings/cpp/include/proton/error_condition.hpp b/proton-c/bindings/cpp/include/proton/error_condition.hpp
deleted file mode 100644
index fb0d461..0000000
--- a/proton-c/bindings/cpp/include/proton/error_condition.hpp
+++ /dev/null
@@ -1,109 +0,0 @@
-#ifndef PROTON_ERROR_CONDITION_H
-#define PROTON_ERROR_CONDITION_H
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./internal/export.hpp"
-#include "./internal/config.hpp"
-#include "./value.hpp"
-
-#include <string>
-#include <iosfwd>
-
-struct pn_condition_t;
-
-namespace proton {
-
-/// Describes an endpoint error state.
-class error_condition {
-    /// @cond INTERNAL
-    error_condition(pn_condition_t* c);
-    /// @endcond
-
-  public:
-    /// Create an empty error condition.
-    error_condition() {}
-
-    /// Create an error condition with only a description. A default
-    /// name will be used ("proton:io:error").
-    PN_CPP_EXTERN error_condition(std::string description);
-
-    /// Create an error condition with a name and description.
-    PN_CPP_EXTERN error_condition(std::string name, std::string description);
-
-    /// **Experimental** - Create an error condition with name,
-    /// description, and informational properties.
-    PN_CPP_EXTERN error_condition(std::string name, std::string description, proton::value properties);
-
-#if PN_CPP_HAS_DEFAULTED_FUNCTIONS
-    /// @cond INTERNAL
-    error_condition(const error_condition&) = default;
-    error_condition(error_condition&&) = default;
-    error_condition& operator=(const error_condition&) = default;
-    error_condition& operator=(error_condition&&) = default;
-    /// @endcond
-#endif
-
-#if PN_CPP_HAS_EXPLICIT_CONVERSIONS
-    /// If you are using a C++11 compiler, you may use an
-    /// error_condition in boolean contexts. The expression will be
-    /// true if the error_condition is set.
-    PN_CPP_EXTERN explicit operator bool() const;
-#endif
-
-    /// No condition set.
-    PN_CPP_EXTERN bool operator!() const;
-
-    /// No condition has been set.
-    PN_CPP_EXTERN bool empty() const;
-
-    /// Condition name.
-    PN_CPP_EXTERN std::string name() const;
-
-    /// Descriptive string for condition.
-    PN_CPP_EXTERN std::string description() const;
-
-    /// Extra information for condition.
-    PN_CPP_EXTERN value properties() const;
-
-    /// Simple printable string for condition.
-    PN_CPP_EXTERN std::string what() const;
-
-  private:
-    std::string name_;
-    std::string description_;
-    proton::value properties_;
-
-    /// @cond INTERNAL
-  friend class internal::factory<error_condition>;
-    /// @endcond
-};
-
-/// @cond INTERNAL
-// XXX Document these 
-PN_CPP_EXTERN bool operator==(const error_condition& x, const error_condition& y);
-PN_CPP_EXTERN std::ostream& operator<<(std::ostream& o, const error_condition& err);
-/// @endcond
-
-} // proton
-
-#endif // PROTON_ERROR_CONDITION_H
diff --git a/proton-c/bindings/cpp/include/proton/event_loop.hpp b/proton-c/bindings/cpp/include/proton/event_loop.hpp
deleted file mode 100644
index f49d211..0000000
--- a/proton-c/bindings/cpp/include/proton/event_loop.hpp
+++ /dev/null
@@ -1,93 +0,0 @@
-#ifndef PROTON_EVENT_LOOP_HPP
-#define PROTON_EVENT_LOOP_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./internal/config.hpp"
-#include "./internal/export.hpp"
-#include "./internal/pn_unique_ptr.hpp"
-
-#include <functional>
-
-struct pn_connection_t;
-struct pn_session_t;
-struct pn_link_t;
-
-namespace proton {
-
-/// **Experimental** - A serial execution context.
-///
-/// Event handler functions associated with a single proton::connection are called in sequence.
-/// The connection's @ref event_loop allows you to "inject" extra work from any thread,
-/// and have it executed in the same sequence.
-///
-class PN_CPP_CLASS_EXTERN event_loop {
-    /// @cond internal
-    class impl;
-    event_loop& operator=(impl* i);
-    /// @endcond
-
-  public:
-    /// Create event_loop
-    PN_CPP_EXTERN event_loop();
-
-    PN_CPP_EXTERN ~event_loop();
-
-#if PN_CPP_HAS_EXPLICIT_CONVERSIONS
-    /// When using C++11 (or later) you can use event_loop in a bool context
-    /// to indicate if there is an event loop set.
-    PN_CPP_EXTERN explicit operator bool() const { return bool(impl_); }
-#endif
-
-    /// No event loop set.
-    PN_CPP_EXTERN bool operator !() const { return !impl_; }
-
-    /// Arrange to have f() called in the event_loop's sequence: possibly
-    /// deferred, possibly in another thread.
-    ///
-    /// @return true if f() has or will be called, false if the event_loop is ended
-    /// and f() cannot be injected.
-    PN_CPP_EXTERN bool inject(void_function0& f);
-
-#if PN_CPP_HAS_STD_FUNCTION
-    /// @copydoc inject(void_function0&)
-    PN_CPP_EXTERN bool inject(std::function<void()> f);
-#endif
-
-  private:
-    PN_CPP_EXTERN static event_loop& get(pn_connection_t*);
-    PN_CPP_EXTERN static event_loop& get(pn_session_t*);
-    PN_CPP_EXTERN static event_loop& get(pn_link_t*);
-
-    internal::pn_unique_ptr<impl> impl_;
-
-    /// @cond INTERNAL
-  friend class container;
-  friend class io::connection_driver;
-  template <class T> friend class thread_safe;
-    /// @endcond
-};
-
-} // proton
-
-#endif // PROTON_EVENT_LOOP_HPP
diff --git a/proton-c/bindings/cpp/include/proton/function.hpp b/proton-c/bindings/cpp/include/proton/function.hpp
deleted file mode 100644
index ac756c7..0000000
--- a/proton-c/bindings/cpp/include/proton/function.hpp
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef PROTON_FUNCTION_HPP
-#define PROTON_FUNCTION_HPP
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-namespace proton {
-
-/// A C++03 compatible void no-argument callback function object.
-///
-/// Used by container::schedule() and event_loop::inject().  In C++11
-/// you can use std::bind, std::function or a void-no-argument lambda
-/// instead.
-///
-/// void_function0 is passed by reference, so instances of sub-classes
-/// do not have to be heap allocated.  Once passed, the instance must
-/// not be deleted until its operator() is called or the container has
-/// stopped.
-class void_function0 {
-  public:
-    virtual ~void_function0() {}
-    /// Override the call operator with your code.
-    virtual void operator()() = 0;
-};
-
-}
-
-#endif // PROTON_FUNCTION_HPP
diff --git a/proton-c/bindings/cpp/include/proton/fwd.hpp b/proton-c/bindings/cpp/include/proton/fwd.hpp
deleted file mode 100644
index 3ed9283..0000000
--- a/proton-c/bindings/cpp/include/proton/fwd.hpp
+++ /dev/null
@@ -1,69 +0,0 @@
-#ifndef PROTON_FWD_HPP
-#define PROTON_FWD_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-namespace proton {
-
-class annotation_key;
-class connection;
-class connection_options;
-class container;
-class delivery;
-class error_condition;
-class event;
-class message;
-class message_id;
-class messaging_handler;
-class listen_handler;
-class listener;
-class receiver;
-class receiver_iterator;
-class receiver_options;
-class reconnect_timer;
-class sasl;
-class sender;
-class sender_iterator;
-class sender_options;
-class session;
-class session_options;
-class source_options;
-class ssl;
-class target_options;
-class tracker;
-class transport;
-class url;
-class void_function0;
-
-
-namespace io {
-
-class connection_driver;
-
-}
-
-template <class T> class returned;
-template <class T> class thread_safe;
-
-}
-
-#endif // PROTON_FWD_HPP
diff --git a/proton-c/bindings/cpp/include/proton/internal/cached_map.hpp b/proton-c/bindings/cpp/include/proton/internal/cached_map.hpp
deleted file mode 100644
index 4f388a1..0000000
--- a/proton-c/bindings/cpp/include/proton/internal/cached_map.hpp
+++ /dev/null
@@ -1,91 +0,0 @@
-#ifndef PROTON_CPP_CACHED_MAP_H
-#define PROTON_CPP_CACHED_MAP_H
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./config.hpp"
-#include "./export.hpp"
-#include "./pn_unique_ptr.hpp"
-
-#include <cstddef>
-
-namespace proton {
-
-namespace codec {
-class decoder;
-class encoder;
-}
-
-namespace internal {
-
-template <class key_type, class value_type>
-class map_type_impl;
-
-/// A convenience class to view and manage AMQP map data contained in
-/// a proton::value.  An internal cache of the map data is created as
-/// needed.
-template <class K, class V>
-class cached_map;
-
-template <class K, class V>
-PN_CPP_EXTERN proton::codec::decoder& operator>>(proton::codec::decoder& d, cached_map<K,V>& m);
-template <class K, class V>
-PN_CPP_EXTERN proton::codec::encoder& operator<<(proton::codec::encoder& e, const cached_map<K,V>& m);
-
-template <class key_type, class value_type>
-class PN_CPP_CLASS_EXTERN cached_map {
-    typedef map_type_impl<key_type, value_type> map_type;
-
-  public:
-    PN_CPP_EXTERN cached_map();
-    PN_CPP_EXTERN cached_map(const cached_map& cm);
-    PN_CPP_EXTERN cached_map& operator=(const cached_map& cm);
-#if PN_CPP_HAS_RVALUE_REFERENCES
-    PN_CPP_EXTERN cached_map(cached_map&&);
-    PN_CPP_EXTERN cached_map& operator=(cached_map&&);
-#endif
-    PN_CPP_EXTERN ~cached_map();
-
-    PN_CPP_EXTERN value_type get(const key_type& k) const;
-    PN_CPP_EXTERN void put(const key_type& k, const value_type& v);
-    PN_CPP_EXTERN size_t erase(const key_type& k);
-    PN_CPP_EXTERN bool exists(const key_type& k) const;
-    PN_CPP_EXTERN size_t size();
-    PN_CPP_EXTERN void clear();
-    PN_CPP_EXTERN bool empty();
-
-  /// @cond INTERNAL
-  private:
-    pn_unique_ptr<map_type> map_;
- 
-    void make_cached_map();
-
-  friend PN_CPP_EXTERN proton::codec::decoder& operator>> <>(proton::codec::decoder& d, cached_map<key_type, value_type>& m);
-  friend PN_CPP_EXTERN proton::codec::encoder& operator<< <>(proton::codec::encoder& e, const cached_map<key_type, value_type>& m);
-  /// @endcond
-};
-
-
-}
-}
-
-#endif // PROTON_CPP_CACHED_MAP_H
diff --git a/proton-c/bindings/cpp/include/proton/internal/comparable.hpp b/proton-c/bindings/cpp/include/proton/internal/comparable.hpp
deleted file mode 100644
index b93ec4b..0000000
--- a/proton-c/bindings/cpp/include/proton/internal/comparable.hpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef PROTON_INTERNAL_COMPARABLE_HPP
-#define PROTON_INTERNAL_COMPARABLE_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-namespace proton {
-namespace internal {
-
-/// Base class for comparable types with operator< and
-/// operator==. Provides remaining operators.
-template <class T> class comparable {
-    friend bool operator>(const T &a, const T &b) { return b < a; }
-    friend bool operator<=(const T &a, const T &b) { return !(a > b); }
-    friend bool operator>=(const T &a, const T &b) { return !(a < b); }
-    friend bool operator!=(const T &a, const T &b) { return !(a == b); }
-};
-
-} // internal
-} // proton
-
-#endif // PROTON_INTERNAL_COMPARABLE_HPP
diff --git a/proton-c/bindings/cpp/include/proton/internal/config.hpp b/proton-c/bindings/cpp/include/proton/internal/config.hpp
deleted file mode 100644
index 563a304..0000000
--- a/proton-c/bindings/cpp/include/proton/internal/config.hpp
+++ /dev/null
@@ -1,100 +0,0 @@
-#ifndef PROTON_INTERNAL_CONFIG_HPP
-#define PROTON_INTERNAL_CONFIG_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/// @cond INTERNAL
-
-/// @file
-///
-/// Configuration macros.  They can be set via -D compiler options or
-/// in code.
-///
-/// On a C++11 compliant compiler, all C++11 features are enabled by
-/// default.  Otherwise they can be enabled or disabled separately
-/// with -D on the compile line.
-
-#ifndef PN_CPP_HAS_CPP11
-#if defined(__cplusplus) && __cplusplus >= 201100
-#define PN_CPP_HAS_CPP11 1
-#else
-#define PN_CPP_HAS_CPP11 0
-#endif
-#endif
-
-#ifndef PN_CPP_HAS_SHARED_PTR
-#define PN_CPP_HAS_SHARED_PTR PN_CPP_HAS_CPP11
-#endif
-
-#ifndef PN_CPP_HAS_UNIQUE_PTR
-#define PN_CPP_HAS_UNIQUE_PTR PN_CPP_HAS_CPP11
-#endif
-
-#ifndef PN_CPP_HAS_LONG_LONG
-#define PN_CPP_HAS_LONG_LONG PN_CPP_HAS_CPP11
-#endif
-
-#ifndef PN_CPP_HAS_NULLPTR
-#define PN_CPP_HAS_NULLPTR PN_CPP_HAS_CPP11
-#endif
-
-#ifndef PN_CPP_HAS_RVALUE_REFERENCES
-#define PN_CPP_HAS_RVALUE_REFERENCES PN_CPP_HAS_CPP11
-#endif
-
-#ifndef PN_CPP_HAS_OVERRIDE
-#define PN_CPP_HAS_OVERRIDE PN_CPP_HAS_CPP11
-#endif
-
-#if PN_CPP_HAS_OVERRIDE
-#define PN_CPP_OVERRIDE override
-#else
-#define PN_CPP_OVERRIDE
-#endif
-
-#ifndef PN_CPP_HAS_EXPLICIT_CONVERSIONS
-#define PN_CPP_HAS_EXPLICIT_CONVERSIONS PN_CPP_HAS_CPP11
-#endif
-
-#ifndef PN_CPP_HAS_DEFAULTED_FUNCTIONS
-#define PN_CPP_HAS_DEFAULTED_FUNCTIONS PN_CPP_HAS_CPP11
-#endif
-
-#ifndef PN_CPP_HAS_DELETED_FUNCTIONS
-#define PN_CPP_HAS_DELETED_FUNCTIONS PN_CPP_HAS_CPP11
-#endif
-
-#ifndef PN_CPP_HAS_STD_FUNCTION
-#define PN_CPP_HAS_STD_FUNCTION PN_CPP_HAS_CPP11
-#endif
-
-#ifndef PN_CPP_HAS_STD_BIND
-#define PN_CPP_HAS_STD_BIND PN_CPP_HAS_CPP11
-#endif
-
-#ifndef PN_CPP_HAS_CHRONO
-#define PN_CPP_HAS_CHRONO PN_CPP_HAS_CPP11
-#endif
-
-#endif // PROTON_INTERNAL_CONFIG_HPP
-
-/// @endcond
diff --git a/proton-c/bindings/cpp/include/proton/internal/data.hpp b/proton-c/bindings/cpp/include/proton/internal/data.hpp
deleted file mode 100644
index bfc0e33..0000000
--- a/proton-c/bindings/cpp/include/proton/internal/data.hpp
+++ /dev/null
@@ -1,105 +0,0 @@
-#ifndef PROTON_INTERNAL_DATA_HPP
-#define PROTON_INTERNAL_DATA_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "../internal/object.hpp"
-#include "../types_fwd.hpp"
-
-struct pn_data_t;
-
-namespace proton {
-
-class value;
-
-namespace internal {
-
-/// @cond INTERNAL
-/// Wrapper for a proton data object.
-class data : public object<pn_data_t> {
-    /// Wrap an existing proton-C data object.
-    data(pn_data_t* d) : internal::object<pn_data_t>(d) {}
-
-  public:
-    /// Create an empty data.
-    data() : internal::object<pn_data_t>(0) {}
-
-    /// Create a new data object.
-    PN_CPP_EXTERN static data create();
-
-    /// Copy the contents of another data object.
-    PN_CPP_EXTERN void copy(const data&);
-
-    /// Clear the data.
-    PN_CPP_EXTERN void clear();
-
-    /// Rewind current position to the start.
-    PN_CPP_EXTERN void rewind();
-
-    /// True if there are no values.
-    PN_CPP_EXTERN bool empty() const;
-
-    /// Append the contents of another data object.
-    PN_CPP_EXTERN int append(data src);
-
-    /// Append up to limit items from data object.
-    PN_CPP_EXTERN int appendn(data src, int limit);
-
-    PN_CPP_EXTERN bool next();
-    PN_CPP_EXTERN void* point() const;
-    PN_CPP_EXTERN void restore(void* h);
-
-  protected:
-    void narrow();
-    void widen();
-
-  friend class internal::factory<data>;
-  friend struct state_guard;
-  friend PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const data&);
-};
-/// @endcond
-
-/// **Experimental** - Save and restore codec state
-///
-/// A state_guard saves the state and restores it in the destructor
-/// unless cancel() is called.
-struct state_guard {
-    /// @cond INTERNAL
-    data& data_;
-    void* point_;
-    bool cancel_;
-    /// @endcond
-
-    /// @cond INTERNAL
-    state_guard(data& d) : data_(d), point_(data_.point()), cancel_(false) {}
-    /// @endcond
-
-    ~state_guard() { if (!cancel_) data_.restore(point_); }
-
-    /// Discard the saved state.
-    void cancel() { cancel_ = true; }
-};
-
-} // internal
-} // proton
-
-#endif // PROTON_INTERNAL_DATA_HPP
diff --git a/proton-c/bindings/cpp/include/proton/internal/export.hpp b/proton-c/bindings/cpp/include/proton/internal/export.hpp
deleted file mode 100644
index 4c95956..0000000
--- a/proton-c/bindings/cpp/include/proton/internal/export.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef PROTON_INTERNAL_EXPORT_HPP
-#define PROTON_INTERNAL_EXPORT_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/// @cond INTERNAL
-
-/// import/export macros
-#if defined(WIN32) && !defined(PN_CPP_DECLARE_STATIC)
-  //
-  // Import and Export definitions for Windows:
-  //
-#  define PN_CPP_EXPORT __declspec(dllexport)
-#  define PN_CPP_IMPORT __declspec(dllimport)
-#  define PN_CPP_CLASS_EXPORT
-#  define PN_CPP_CLASS_IMPORT
-#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
-#  define PN_CPP_EXPORT __global
-#  define PN_CPP_IMPORT
-#  define PN_CPP_CLASS_EXPORT __global
-#  define PN_CPP_CLASS_IMPORT
-#else
-  //
-  // Non-Windows (Linux, etc.) definitions:
-  //
-#  define PN_CPP_EXPORT __attribute ((visibility ("default")))
-#  define PN_CPP_IMPORT
-#  define PN_CPP_CLASS_EXPORT __attribute ((visibility ("default")))
-#  define PN_CPP_CLASS_IMPORT
-#endif
-
-// For qpid-proton-cpp library symbols
-#ifdef qpid_proton_cpp_EXPORTS
-#  define PN_CPP_EXTERN PN_CPP_EXPORT
-#  define PN_CPP_CLASS_EXTERN PN_CPP_CLASS_EXPORT
-#else
-#  define PN_CPP_EXTERN PN_CPP_IMPORT
-#  define PN_CPP_CLASS_EXTERN PN_CPP_CLASS_IMPORT
-#endif
-
-/// @endcond
-
-#endif // PROTON_INTERNAL_EXPORT_HPP
diff --git a/proton-c/bindings/cpp/include/proton/internal/object.hpp b/proton-c/bindings/cpp/include/proton/internal/object.hpp
deleted file mode 100644
index d492b80..0000000
--- a/proton-c/bindings/cpp/include/proton/internal/object.hpp
+++ /dev/null
@@ -1,113 +0,0 @@
-#ifndef PROTON_INTERNAL_OBJECT_HPP
-#define PROTON_INTERNAL_OBJECT_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./config.hpp"
-#include "./export.hpp"
-#include "./comparable.hpp"
-
-#include <memory>
-#include <string>
-
-namespace proton {
-
-template <class T> class thread_safe;
-
-namespace internal {
-
-class pn_ptr_base {
-  protected:
-    PN_CPP_EXTERN static void incref(void* p);
-    PN_CPP_EXTERN static void decref(void* p);
-    PN_CPP_EXTERN static std::string inspect(void* p);
-};
-
-template <class T> class pn_ptr : private pn_ptr_base, private comparable<pn_ptr<T> > {
-  public:
-    pn_ptr() : ptr_(0) {}
-    pn_ptr(T* p) : ptr_(p) { incref(ptr_); }
-    pn_ptr(const pn_ptr& o) : ptr_(o.ptr_) { incref(ptr_); }
-
-#if PN_CPP_HAS_RVALUE_REFERENCES
-    pn_ptr(pn_ptr&& o) : ptr_(0) { std::swap(ptr_, o.ptr_); }
-#endif
-
-    ~pn_ptr() { decref(ptr_); }
-
-    pn_ptr& operator=(pn_ptr o) { std::swap(ptr_, o.ptr_); return *this; }
-
-    T* get() const { return ptr_; }
-    T* release() { T *p = ptr_; ptr_ = 0; return p; }
-
-    bool operator!() const { return !ptr_; }
-
-#if PN_CPP_HAS_EXPLICIT_CONVERSIONS
-    explicit operator bool() const { return !!ptr_; }
-#endif
-
-    std::string inspect() const { return pn_ptr_base::inspect(ptr_); }
-
-    static pn_ptr take_ownership(T* p) { return pn_ptr<T>(p, true); }
-
-  private:
-    T *ptr_;
-
-    // Note that it is the presence of the bool in the constructor signature that matters
-    // to get the "transfer ownership" constructor: The value of the bool isn't checked.
-    pn_ptr(T* p, bool) : ptr_(p) {}
-
-    friend bool operator==(const pn_ptr& a, const pn_ptr& b) { return a.ptr_ == b.ptr_; }
-    friend bool operator<(const pn_ptr& a, const pn_ptr& b) { return a.ptr_ < b.ptr_; }
-};
-
-template <class T> pn_ptr<T> take_ownership(T* p) { return pn_ptr<T>::take_ownership(p); }
-
-/// Base class for proton object types.
-template <class T> class object : private comparable<object<T> > {
-  public:
-    bool operator!() const { return !object_; }
-#if PN_CPP_HAS_EXPLICIT_CONVERSIONS
-    explicit operator bool() const { return object_; }
-#endif
-
-  protected:
-    typedef T pn_type;
-    object(pn_ptr<T> o) : object_(o) {}
-    T* pn_object() const { return object_.get(); }
-
-  private:
-    pn_ptr<T> object_;
-
-    friend bool operator==(const object& a, const object& b) { return a.object_ == b.object_; }
-    friend bool operator<(const object& a, const object& b) { return a.object_ < b.object_; }
-    friend std::ostream& operator<<(std::ostream& o, const object& a) { o << a.object_.inspect(); return o; }
-    template <class U> friend class proton::thread_safe;
-};
-
-/// Factory class used internally to make wrappers and extract proton objects
-template <class T> class factory;
-
-} // internal
-} // proton
-
-#endif // PROTON_INTERNAL_OBJECT_HPP
diff --git a/proton-c/bindings/cpp/include/proton/internal/pn_unique_ptr.hpp b/proton-c/bindings/cpp/include/proton/internal/pn_unique_ptr.hpp
deleted file mode 100644
index 323c701..0000000
--- a/proton-c/bindings/cpp/include/proton/internal/pn_unique_ptr.hpp
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef PROTON_INTERNAL_UNIQUE_PTR_HPP
-#define PROTON_INTERNAL_UNIQUE_PTR_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./config.hpp"
-
-#include <memory>
-
-namespace proton {
-namespace internal {
-
-/// A simple unique ownership pointer, used as a return value from
-/// functions that transfer ownership to the caller.
-///
-/// pn_unique_ptr return values should be converted immediately to
-/// std::unique_ptr if that is available or std::auto_ptr (by calling
-/// release()) for older C++. You should not use pn_unique_ptr in your
-/// own code.  It is a limited pointer class designed only to work
-/// around differences between C++11 and C++03.
-template <class T> class pn_unique_ptr {
-  public:
-    pn_unique_ptr(T* p=0) : ptr_(p) {}
-#if PN_CPP_HAS_RVALUE_REFERENCES
-    pn_unique_ptr(pn_unique_ptr&& x) : ptr_(0)  { std::swap(ptr_, x.ptr_); }
-#else
-    pn_unique_ptr(const pn_unique_ptr& x) : ptr_() { std::swap(ptr_, const_cast<pn_unique_ptr&>(x).ptr_); }
-#endif
-    ~pn_unique_ptr() { delete(ptr_); }
-    T& operator*() const { return *ptr_; }
-    T* operator->() const { return ptr_; }
-    T* get() const { return ptr_; }
-    void reset(T* p = 0) { pn_unique_ptr<T> tmp(p); std::swap(ptr_, tmp.ptr_); }
-    T* release() { T *p = ptr_; ptr_ = 0; return p; }
-#if PN_CPP_HAS_EXPLICIT_CONVERSIONS
-    explicit operator bool() const { return get(); }
-#endif
-    bool operator !() const { return !get(); }
-
-#if PN_CPP_HAS_UNIQUE_PTR
-    operator std::unique_ptr<T>() { T *p = ptr_; ptr_ = 0; return std::unique_ptr<T>(p); }
-#endif
-
-  private:
-    T* ptr_;
-};
-
-} // internal
-} // proton
-
-#endif // PROTON_INTERNAL_UNIQUE_PTR_HPP
diff --git a/proton-c/bindings/cpp/include/proton/internal/type_traits.hpp b/proton-c/bindings/cpp/include/proton/internal/type_traits.hpp
deleted file mode 100644
index 8abba55..0000000
--- a/proton-c/bindings/cpp/include/proton/internal/type_traits.hpp
+++ /dev/null
@@ -1,184 +0,0 @@
-#ifndef PROTON_INTERNAL_TYPE_TRAITS_HPP
-#define PROTON_INTERNAL_TYPE_TRAITS_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-// Type traits for mapping between AMQP and C++ types.
-//
-// Also provides workarounds for missing type_traits classes on older
-// C++ compilers.
-
-#include "./config.hpp"
-#include "../types_fwd.hpp"
-#include "../type_id.hpp"
-
-#include <proton/type_compat.h>
-
-#include <limits>
-
-namespace proton {
-namespace internal {
-
-class decoder;
-class encoder;
-
-template <bool, class T=void> struct enable_if {};
-template <class T> struct enable_if<true, T> { typedef T type; };
-
-struct true_type { static const bool value = true; };
-struct false_type { static const bool value = false; };
-
-template <class T> struct is_integral : public false_type {};
-template <class T> struct is_signed : public false_type {};
-
-template <> struct is_integral<char> : public true_type {};
-template <> struct is_signed<char> { static const bool value = std::numeric_limits<char>::is_signed; };
-
-template <> struct is_integral<unsigned char> : public true_type {};
-template <> struct is_integral<unsigned short> : public true_type {};
-template <> struct is_integral<unsigned int> : public true_type {};
-template <> struct is_integral<unsigned long> : public true_type {};
-
-template <> struct is_integral<signed char> : public true_type {};
-template <> struct is_integral<signed short> : public true_type {};
-template <> struct is_integral<signed int> : public true_type {};
-template <> struct is_integral<signed long> : public true_type {};
-
-template <> struct is_signed<unsigned short> : public false_type {};
-template <> struct is_signed<unsigned int> : public false_type {};
-template <> struct is_signed<unsigned long> : public false_type {};
-
-template <> struct is_signed<signed char> : public true_type {};
-template <> struct is_signed<signed short> : public true_type {};
-template <> struct is_signed<signed int> : public true_type {};
-template <> struct is_signed<signed long> : public true_type {};
-
-#if PN_CPP_HAS_LONG_LONG
-template <> struct is_integral<unsigned long long> : public true_type {};
-template <> struct is_integral<signed long long> : public true_type {};
-template <> struct is_signed<unsigned long long> : public false_type {};
-template <> struct is_signed<signed long long> : public true_type {};
-#endif
-
-template <class T, class U> struct is_same { static const bool value=false; };
-template <class T> struct is_same<T,T> { static const bool value=true; };
-
-template< class T > struct remove_const          { typedef T type; };
-template< class T > struct remove_const<const T> { typedef T type; };
-
-template <type_id ID, class T> struct type_id_constant {
-    typedef T type;
-    static const type_id value = ID;
-};
-
-/// @name Metafunction returning AMQP type for scalar C++ types.
-/// @{
-template <class T> struct type_id_of;
-template<> struct type_id_of<bool> : public type_id_constant<BOOLEAN, bool> {};
-template<> struct type_id_of<uint8_t> : public type_id_constant<UBYTE, uint8_t> {};
-template<> struct type_id_of<int8_t> : public type_id_constant<BYTE, int8_t> {};
-template<> struct type_id_of<uint16_t> : public type_id_constant<USHORT, uint16_t> {};
-template<> struct type_id_of<int16_t> : public type_id_constant<SHORT, int16_t> {};
-template<> struct type_id_of<uint32_t> : public type_id_constant<UINT, uint32_t> {};
-template<> struct type_id_of<int32_t> : public type_id_constant<INT, int32_t> {};
-template<> struct type_id_of<uint64_t> : public type_id_constant<ULONG, uint64_t> {};
-template<> struct type_id_of<int64_t> : public type_id_constant<LONG, int64_t> {};
-template<> struct type_id_of<wchar_t> : public type_id_constant<CHAR, wchar_t> {};
-template<> struct type_id_of<float> : public type_id_constant<FLOAT, float> {};
-template<> struct type_id_of<double> : public type_id_constant<DOUBLE, double> {};
-template<> struct type_id_of<timestamp> : public type_id_constant<TIMESTAMP, timestamp> {};
-template<> struct type_id_of<decimal32> : public type_id_constant<DECIMAL32, decimal32> {};
-template<> struct type_id_of<decimal64> : public type_id_constant<DECIMAL64, decimal64> {};
-template<> struct type_id_of<decimal128> : public type_id_constant<DECIMAL128, decimal128> {};
-template<> struct type_id_of<uuid> : public type_id_constant<UUID, uuid> {};
-template<> struct type_id_of<std::string> : public type_id_constant<STRING, std::string> {};
-template<> struct type_id_of<symbol> : public type_id_constant<SYMBOL, symbol> {};
-template<> struct type_id_of<binary> : public type_id_constant<BINARY, binary> {};
-/// @}
-
-/// Metafunction to test if a class has a type_id.
-template <class T, class Enable=void> struct has_type_id : public false_type {};
-template <class T> struct has_type_id<T, typename type_id_of<T>::type>  : public true_type {};
-
-// The known/unknown integer type magic is required because the C++ standard is
-// vague a about the equivalence of integral types for overloading. E.g. char is
-// sometimes equivalent to signed char, sometimes unsigned char, sometimes
-// neither. int8_t or uint8_t may or may not be equivalent to a char type.
-// int64_t may or may not be equivalent to long long etc. C++ compilers are also
-// allowed to add their own non-standard integer types like __int64, which may
-// or may not be equivalent to any of the standard integer types.
-//
-// The solution is to use a fixed, standard set of integer types that are
-// guaranteed to be distinct for overloading (see type_id_of) and to use template
-// specialization to convert other integer types to a known integer type with the
-// same sizeof and is_signed.
-
-// Map arbitrary integral types to known integral types.
-template<size_t SIZE, bool IS_SIGNED> struct integer_type;
-template<> struct integer_type<1, true> { typedef int8_t type; };
-template<> struct integer_type<2, true> { typedef int16_t type; };
-template<> struct integer_type<4, true> { typedef int32_t type; };
-template<> struct integer_type<8, true> { typedef int64_t type; };
-template<> struct integer_type<1, false> { typedef uint8_t type; };
-template<> struct integer_type<2, false> { typedef uint16_t type; };
-template<> struct integer_type<4, false> { typedef uint32_t type; };
-template<> struct integer_type<8, false> { typedef uint64_t type; };
-
-// True if T is an integer type that does not have an explicit type_id.
-template <class T> struct is_unknown_integer {
-    static const bool value = !has_type_id<T>::value && is_integral<T>::value;
-};
-
-template<class T, class = typename enable_if<is_unknown_integer<T>::value>::type>
-struct known_integer : public integer_type<sizeof(T), is_signed<T>::value> {};
-
-
-// Helper base for SFINAE templates.
-struct sfinae {
-    typedef char yes;
-    typedef double no;
-    struct any_t {
-        template < typename T > any_t(T const&);
-    };
-};
-
-template <class From, class To> struct is_convertible : public sfinae {
-    static yes test(const To&);
-    static no test(...);
-    static const From& from;
-    // Windows compilers warn about data-loss caused by legal conversions.  We
-    // can't use static_cast because that will cause a hard error instead of
-    // letting SFINAE overload resolution select the test(...) overload.
-#ifdef _WIN32
-#pragma warning( push )
-#pragma warning( disable : 4244 )
-#endif
-    static bool const value = sizeof(test(from)) == sizeof(yes);
-#ifdef _WIN32
-#pragma warning( pop )
-#endif
-};
-
-} // internal
-} // proton
-
-#endif // PROTON_INTERNAL_TYPE_TRAITS_HPP
diff --git a/proton-c/bindings/cpp/include/proton/io/connection_driver.hpp b/proton-c/bindings/cpp/include/proton/io/connection_driver.hpp
deleted file mode 100644
index 4a0efe9..0000000
--- a/proton-c/bindings/cpp/include/proton/io/connection_driver.hpp
+++ /dev/null
@@ -1,214 +0,0 @@
-#ifndef PROTON_IO_CONNECTION_DRIVER_HPP
-#define PROTON_IO_CONNECTION_DRIVER_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "../internal/config.hpp"
-#include "../connection.hpp"
-#include "../connection_options.hpp"
-#include "../error.hpp"
-#include "../error_condition.hpp"
-#include "../internal/export.hpp"
-#include "../internal/pn_unique_ptr.hpp"
-#include "../transport.hpp"
-#include "../types.hpp"
-
-#include <proton/connection_driver.h>
-
-#include <cstddef>
-#include <utility>
-#include <string>
-
-namespace proton {
-
-class event_loop;
-class proton_handler;
-
-namespace io {
-
-/// **Experimental** - Pointer to a mutable memory region with a size.
-struct mutable_buffer {
-    char* data;                 ///< Beginning of the buffered data.
-    size_t size;                ///< Number of bytes in the buffer.
-
-    /// Construct a buffer starting at data_ with size_ bytes.
-    mutable_buffer(char* data_=0, size_t size_=0) : data(data_), size(size_) {}
-};
-
-/// **Experimental** - Pointer to a const memory region with a size.
-struct const_buffer {
-    const char* data;           ///< Beginning of the buffered data.
-    size_t size;                ///< Number of bytes in the buffer.
-
-    /// Construct a buffer starting at data_ with size_ bytes.
-    const_buffer(const char* data_=0, size_t size_=0) : data(data_), size(size_) {}
-};
-
-/// **Experimental** - An AMQP driver for a single connection.
-///
-/// io::connection_driver manages a single proton::connection and dispatches
-/// events to a proton::messaging_handler. It does no IO of its own, but allows you to
-/// integrate AMQP protocol handling into any IO or concurrency framework.
-///
-/// The application is coded the same way as for the
-/// proton::container. The application implements a
-/// proton::messaging_handler to respond to transport, connection,
-/// session, link, and message events. With a little care, the same
-/// handler classes can be used for both container and
-/// connection_driver. the @ref broker.cpp example illustrates this.
-///
-/// You need to write the IO code to read AMQP data to the
-/// read_buffer(). The engine parses the AMQP frames. dispatch() calls
-/// the appropriate functions on the applications proton::messaging_handler. You
-/// write output data from the engine's write_buffer() to your IO.
-///
-/// The engine is not safe for concurrent use, but you can process
-/// different engines concurrently. A common pattern for
-/// high-performance servers is to serialize read/write activity
-/// per connection and dispatch in a fixed-size thread pool.
-///
-/// The engine is designed to work with a classic reactor (e.g.,
-/// select, poll, epoll) or an async-request driven proactor (e.g.,
-/// windows completion ports, boost.asio, libuv).
-///
-/// The engine never throws exceptions.
-class
-PN_CPP_CLASS_EXTERN connection_driver {
-  public:
-    /// An engine that is not associated with a proton::container or
-    /// proton::event_loop.
-    ///
-    /// Accessing the container or event_loop for this connection in
-    /// a proton::messaging_handler will throw a proton::error exception.
-    ///
-    PN_CPP_EXTERN connection_driver();
-
-    /// Create a connection driver associated with a proton::container and
-    /// optional event_loop. If the event_loop is not provided attempts to use
-    /// it will throw proton::error.
-    ///
-    /// Takes ownership of the event_loop. Note the proton::connection created
-    /// by this connection_driver can outlive the connection_driver itself if
-    /// the user pins it in memory using the proton::thread_safe<> template.
-    /// The event_loop is deleted when, and only when, the proton::connection is.
-    ///
-    PN_CPP_EXTERN connection_driver(proton::container&);
-#if PN_CPP_HAS_RVALUE_REFERENCES
-    PN_CPP_EXTERN connection_driver(proton::container&, event_loop&& loop);
-#endif
-
-    PN_CPP_EXTERN ~connection_driver();
-
-    /// Configure a connection by applying exactly the options in opts (including proton::messaging_handler)
-    /// Does not apply any default options, to apply container defaults use connect() or accept()
-    /// instead. If server==true, configure a server connection.
-    void configure(const connection_options& opts=connection_options(), bool server=false);
-
-    /// Call configure() with client options and call connection::open()
-    /// Options applied: container::id(), container::client_connection_options(), opts.
-    PN_CPP_EXTERN void connect(const connection_options& opts);
-
-    /// Call configure() with server options.
-    /// Options applied: container::id(), container::server_connection_options(), opts.
-    ///
-    /// Note this does not call connection::open(). If there is a messaging_handler in the
-    /// composed options it will receive messaging_handler::on_connection_open() and can
-    /// respond with connection::open() or connection::close()
-    PN_CPP_EXTERN void accept(const connection_options& opts);
-
-    /// The engine's read buffer. Read data into this buffer then call read_done() when complete.
-    /// Returns mutable_buffer(0, 0) if the engine cannot currently read data.
-    /// Calling dispatch() may open up more buffer space.
-    PN_CPP_EXTERN mutable_buffer read_buffer();
-
-    /// Indicate that the first n bytes of read_buffer() have valid data.
-    /// This changes the buffer, call read_buffer() to get the updated buffer.
-    PN_CPP_EXTERN void read_done(size_t n);
-
-    /// Indicate that the read side of the transport is closed and no more data will be read.
-    /// Note that there may still be events to dispatch() or data to write.
-    PN_CPP_EXTERN void read_close();
-
-    /// The engine's write buffer. Write data from this buffer then call write_done()
-    /// Returns const_buffer(0, 0) if the engine has nothing to write.
-    /// Calling dispatch() may generate more data in the write buffer.
-    PN_CPP_EXTERN const_buffer write_buffer();
-
-    /// Indicate that the first n bytes of write_buffer() have been written successfully.
-    /// This changes the buffer, call write_buffer() to get the updated buffer.
-    PN_CPP_EXTERN void write_done(size_t n);
-
-    /// Indicate that the write side of the transport has closed and no more data can be written.
-    /// Note that there may still be events to dispatch() or data to read.
-    PN_CPP_EXTERN void write_close();
-
-    /// Inform the engine that the transport been disconnected unexpectedly,
-    /// without completing the AMQP connection close sequence.
-    ///
-    /// This calls read_close(), write_close(), sets the transport().error() and
-    /// queues an `on_transport_error` event. You must call dispatch() one more
-    /// time to dispatch the messaging_handler::on_transport_error() call and other final
-    /// events.
-    ///
-    /// Note this does not close the connection() so that a proton::messaging_handler can
-    /// distinguish between a connection close error sent by the remote peer and
-    /// a transport failure.
-    ///
-    PN_CPP_EXTERN void disconnected(const error_condition& = error_condition());
-
-    /// Dispatch all available events and call the corresponding \ref messaging_handler methods.
-    ///
-    /// Returns true if the engine is still active, false if it is finished and
-    /// can be destroyed. The engine is finished when all events are dispatched
-    /// and one of the following is true:
-    ///
-    /// - both read_close() and write_close() have been called, no more IO is possible.
-    /// - The AMQP connection() is closed AND the write_buffer() is empty.
-    ///
-    /// May modify the read_buffer() and/or the write_buffer().
-    ///
-    PN_CPP_EXTERN bool dispatch();
-
-    /// Get the AMQP connection associated with this connection_driver.
-    /// The event_loop is availabe via proton::thread_safe<connection>(connection())
-    PN_CPP_EXTERN proton::connection connection() const;
-
-    /// Get the transport associated with this connection_driver.
-    PN_CPP_EXTERN proton::transport transport() const;
-
-    /// Get the container associated with this connection_driver, if there is one.
-    PN_CPP_EXTERN proton::container* container() const;
-
- private:
-    void init();
-    connection_driver(const connection_driver&);
-    connection_driver& operator=(const connection_driver&);
-
-    messaging_handler* handler_;
-    proton::container* container_;
-    pn_connection_driver_t driver_;
-};
-
-} // io
-} // proton
-
-#endif // PROTON_IO_CONNECTION_DRIVER_HPP
diff --git a/proton-c/bindings/cpp/include/proton/io/container_impl_base.hpp b/proton-c/bindings/cpp/include/proton/io/container_impl_base.hpp
deleted file mode 100644
index a04b4ff..0000000
--- a/proton-c/bindings/cpp/include/proton/io/container_impl_base.hpp
+++ /dev/null
@@ -1,144 +0,0 @@
-#ifndef PROTON_IO_CONTAINER_IMPL_BASE_HPP
-#define PROTON_IO_CONTAINER_IMPL_BASE_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "../container.hpp"
-
-#include <future>
-#include <mutex>
-#include <sstream>
-
-namespace proton {
-namespace io {
-
-/// **Experimental** - A base container implementation.
-///
-/// This is a thread-safe partial implementation of the
-/// proton::container interface to reduce boilerplate code in
-/// container implementations. Requires C++11.
-///
-/// You can ignore this class if you want to implement the functions
-/// in a different way.
-class container_impl_base : public standard_container {
-  public:
-    // Pull in base class functions here so that name search finds all the overloads
-    using standard_container::open_receiver;
-    using standard_container::open_sender;
-
-    /// @see proton::container::client_connection_options
-    void client_connection_options(const connection_options & opts) {
-        store(client_copts_, opts);
-    }
-    
-    /// @see proton::container::client_connection_options
-    connection_options client_connection_options() const {
-        return load(client_copts_);
-    }
-    
-    /// @see proton::container::server_connection_options
-    void server_connection_options(const connection_options & opts) {
-        store(server_copts_, opts);
-    }
-    
-    /// @see proton::container::server_connection_options
-    connection_options server_connection_options() const {
-        return load(server_copts_);
-    }
-    
-    /// @see proton::container::sender_options
-    void sender_options(const class sender_options & opts) {
-        store(sender_opts_, opts);
-    }
-    
-    /// @see proton::container::sender_options
-    class sender_options sender_options() const {
-        return load(sender_opts_);
-    }
-    
-    /// @see proton::container::receiver_options
-    void receiver_options(const class receiver_options & opts) {
-        store(receiver_opts_, opts);
-    }
-    
-    /// @see proton::container::receiver_options
-    class receiver_options receiver_options() const {
-        return load(receiver_opts_);
-    }
-
-    /// @see proton::container::open_sender
-    returned<sender> open_sender(
-        const std::string &url, const class sender_options &opts, const connection_options &copts)
-    {
-        return open_link<sender, class sender_options>(url, opts, copts, &connection::open_sender);
-    }
-
-    /// @see proton::container::open_receiver
-    returned<receiver> open_receiver(
-        const std::string &url, const class receiver_options &opts, const connection_options &copts)
-    {
-        return open_link<receiver>(url, opts, copts, &connection::open_receiver);
-    }
-
-  private:
-    template<class T, class Opts>
-    returned<T> open_link(
-        const std::string &url_str, const Opts& opts, const connection_options& copts,
-        T (connection::*open_fn)(const std::string&, const Opts&))
-    {
-        std::string addr = url(url_str).path();
-        std::shared_ptr<thread_safe<connection> > ts_connection = connect(url_str, copts);
-        std::promise<returned<T> > result_promise;
-        auto do_open = [ts_connection, addr, opts, open_fn, &result_promise]() {
-            try {
-                connection c = ts_connection->unsafe();
-                returned<T> s = make_thread_safe((c.*open_fn)(addr, opts));
-                result_promise.set_value(s);
-            } catch (...) {
-                result_promise.set_exception(std::current_exception());
-            }
-        };
-        ts_connection->event_loop()->inject(do_open);
-        std::future<returned<T> > result_future = result_promise.get_future();
-        if (!result_future.valid())
-            throw error(url_str+": connection closed");
-        return result_future.get();
-    }
-
-    mutable std::mutex lock_;
-    template <class T> T load(const T& v) const {
-        std::lock_guard<std::mutex> g(lock_);
-        return v;
-    }
-    template <class T> void store(T& v, const T& x) const {
-        std::lock_guard<std::mutex> g(lock_);
-        v = x;
-    }
-    connection_options client_copts_, server_copts_;
-    class receiver_options receiver_opts_;
-    class sender_options sender_opts_;
-};
-
-} // io
-} // proton
-
-#endif // PROTON_IO_CONTAINER_IMPL_BASE_HPP
diff --git a/proton-c/bindings/cpp/include/proton/io/link_namer.hpp b/proton-c/bindings/cpp/include/proton/io/link_namer.hpp
deleted file mode 100644
index a0eea67..0000000
--- a/proton-c/bindings/cpp/include/proton/io/link_namer.hpp
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef PROTON_IO_LINK_NAMER_HPP
-#define PROTON_IO_LINK_NAMER_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "../internal/export.hpp"
-#include <string>
-
-namespace proton {
-
-class connection;
-
-namespace io {
-
-/// **Experimental** - Generate default link names that are unique
-/// within a container.  base_container provides a default
-/// implementation.
-class link_namer {
-  public:
-    virtual ~link_namer() {}
-
-    /// Generate a unique link name.
-    virtual std::string link_name() = 0;
-};
-
-/// *Experimental* - Set the link_namer to use on a connection.
-PN_CPP_EXTERN void set_link_namer(connection&, link_namer&);
-
-} // io
-} // proton
-
-#endif // PROTON_IO_LINK_NAMER_HPP
diff --git a/proton-c/bindings/cpp/include/proton/link.hpp b/proton-c/bindings/cpp/include/proton/link.hpp
deleted file mode 100644
index 8534f21..0000000
--- a/proton-c/bindings/cpp/include/proton/link.hpp
+++ /dev/null
@@ -1,100 +0,0 @@
-#ifndef PROTON_LINK_HPP
-#define PROTON_LINK_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./internal/export.hpp"
-#include "./endpoint.hpp"
-#include "./internal/object.hpp"
-
-#include <string>
-
-struct pn_link_t;
-
-namespace proton {
-
-/// A named channel for sending or receiving messages.  It is the base
-/// class for sender and receiver.
-class
-PN_CPP_CLASS_EXTERN link : public internal::object<pn_link_t> , public endpoint {
-    /// @cond INTERNAL
-    link(pn_link_t* l) : internal::object<pn_link_t>(l) {}
-    /// @endcond
-
-  public:
-    /// Create an empty link.
-    link() : internal::object<pn_link_t>(0) {}
-
-    PN_CPP_EXTERN bool uninitialized() const;
-    PN_CPP_EXTERN bool active() const;
-    PN_CPP_EXTERN bool closed() const;
-
-    PN_CPP_EXTERN class error_condition error() const;
-
-    PN_CPP_EXTERN void close();
-    PN_CPP_EXTERN void close(const error_condition&);
-
-    /// Suspend the link without closing it.  A suspended link may be
-    /// reopened with the same or different link options if supported
-    /// by the peer. A suspended durable subscription becomes inactive
-    /// without cancelling it.
-    // XXX Should take error condition
-    PN_CPP_EXTERN void detach();
-
-    /// Credit available on the link.
-    PN_CPP_EXTERN int credit() const;
-
-    /// **Experimental** - True for a receiver if a drain cycle has
-    /// been started and the corresponding `on_receiver_drain_finish`
-    /// event is still pending.  True for a sender if the receiver has
-    /// requested a drain of credit and the sender has unused credit.
-    ///
-    /// @see @ref receiver::drain. 
-    PN_CPP_EXTERN bool draining();
-
-    /// Get the link name.
-    PN_CPP_EXTERN std::string name() const;
-
-    /// The container for this link.
-    PN_CPP_EXTERN class container &container() const;
-
-    /// The connection that owns this link.
-    PN_CPP_EXTERN class connection connection() const;
-
-    /// The session that owns this link.
-    PN_CPP_EXTERN class session session() const;
-
-  protected:
-    /// @cond INTERNAL
-    
-    // Initiate the AMQP attach frame.
-    void attach();
-
-  friend class internal::factory<link>;
-
-    /// @endcond
-};
-
-}
-
-#endif // PROTON_LINK_HPP
diff --git a/proton-c/bindings/cpp/include/proton/listen_handler.hpp b/proton-c/bindings/cpp/include/proton/listen_handler.hpp
deleted file mode 100644
index 99f7558..0000000
--- a/proton-c/bindings/cpp/include/proton/listen_handler.hpp
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef PROTON_LISTEN_HANDLER_HPP
-#define PROTON_LISTEN_HANDLER_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-
-namespace proton {
-
-// XXX Discuss more
-/// **Experimental** - A handler for incoming connections.
-///
-/// Implement this interface and pass to proton::container::listen()
-/// to be notified of new connections.
-class listen_handler {
-  public:
-    virtual ~listen_handler() {}
-
-    /// Called for each accepted connection.
-    ///
-    /// Returns connection_options to apply, including a proton::messaging_handler for
-    /// the connection.  messaging_handler::on_connection_open() will be called with
-    /// the proton::connection, it can call connection::open() to accept or
-    /// connection::close() to reject the connection.
-    virtual connection_options on_accept()= 0;
-
-    /// Called if there is a listening error, with an error message.
-    /// close() will also be called.
-    virtual void on_error(const std::string&) {}
-
-    /// Called when this listen_handler is no longer needed, and can be deleted.
-    virtual void on_close() {}
-};
-
-} // proton
-
-#endif // PROTON_LISTEN_HANDLER_HPP
diff --git a/proton-c/bindings/cpp/include/proton/listener.hpp b/proton-c/bindings/cpp/include/proton/listener.hpp
deleted file mode 100644
index 4b4ca24..0000000
--- a/proton-c/bindings/cpp/include/proton/listener.hpp
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef PROTON_LISTENER_HPP
-#define PROTON_LISTENER_HPP
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "./fwd.hpp"
-#include "./internal/export.hpp"
-
-#include <string>
-
-namespace proton {
-
-/// A listener for incoming connections.
-class PN_CPP_CLASS_EXTERN listener {
-  public:
-    /// Create an empty listener.
-    PN_CPP_EXTERN listener();
-
-    /// @cond INTERNAL
-    PN_CPP_EXTERN listener(container&, const std::string&);
-    /// @endcond
-
-    /// Stop listening on the address provided to the call to
-    /// container::listen that returned this listener.
-    PN_CPP_EXTERN void stop();
-
- private:
-    std::string url_;
-    container* container_;
-};
-
-} // proton
-
-#endif // PROTON_LISTENER_HPP
diff --git a/proton-c/bindings/cpp/include/proton/message.hpp b/proton-c/bindings/cpp/include/proton/message.hpp
deleted file mode 100644
index 85ccff6..0000000
--- a/proton-c/bindings/cpp/include/proton/message.hpp
+++ /dev/null
@@ -1,342 +0,0 @@
-#ifndef PROTON_MESSAGE_HPP
-#define PROTON_MESSAGE_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./internal/export.hpp"
-#include "./duration.hpp"
-#include "./timestamp.hpp"
-#include "./value.hpp"
-
-#include "./internal/cached_map.hpp"
-#include "./internal/pn_unique_ptr.hpp"
-
-#include <proton/type_compat.h>
-
-#include <string>
-#include <vector>
-
-struct pn_message_t;
-
-namespace proton {
-
-/// An AMQP message.
-///
-/// Value semantics: A message can be copied or assigned to make a new
-/// message.
-class message {
-  public:
-    /// **Experimental** - A map of string keys and AMQP scalar
-    /// values.
-    class property_map : public internal::cached_map<std::string, scalar> {};
-
-    /// **Experimental** - A map of AMQP annotation keys and AMQP
-    /// values.
-    class annotation_map : public internal::cached_map<annotation_key, value> {};
-
-    /// Create an empty message.
-    PN_CPP_EXTERN message();
-
-    /// Copy a message.
-    PN_CPP_EXTERN message(const message&);
-
-    /// Copy a message.
-    PN_CPP_EXTERN message& operator=(const message&);
-
-#if PN_CPP_HAS_RVALUE_REFERENCES
-    /// Move a message.
-    PN_CPP_EXTERN message(message&&);
-
-    /// Move a message.
-    PN_CPP_EXTERN message& operator=(message&&);
-#endif
-
-    /// Create a message with its body set from any value that can be
-    /// converted to a proton::value.
-    PN_CPP_EXTERN message(const value& x);
-
-    PN_CPP_EXTERN ~message();
-
-    /// @name Basic properties and methods
-    /// @{
-
-    /// Clear the message content and properties.
-    PN_CPP_EXTERN void clear();
-
-    /// Set the message ID.
-    ///
-    /// The message ID uniquely identifies a message within a
-    /// messaging system.
-    PN_CPP_EXTERN void id(const message_id& id);
-
-    /// Get the message ID.
-    PN_CPP_EXTERN message_id id() const;
-
-    /// Set the user name or ID.
-    PN_CPP_EXTERN void user(const std::string &user);
-
-    /// Get the user name or ID.
-    PN_CPP_EXTERN std::string user() const;
-
-    /// Encode entire message into a byte vector, growing it if
-    /// necessary.
-    PN_CPP_EXTERN void encode(std::vector<char> &bytes) const;
-
-    /// Return encoded message as a byte vector.
-    PN_CPP_EXTERN std::vector<char> encode() const;
-
-    /// Decode from string data into the message.
-    PN_CPP_EXTERN void decode(const std::vector<char> &bytes);
-
-    /// @}
-
-    /// @name Routing
-    /// @{
-
-    /// Set the destination address.
-    PN_CPP_EXTERN void to(const std::string &addr);
-
-    /// Get the destination address.
-    PN_CPP_EXTERN std::string to() const;
-
-    /// @cond INTERNAL
-    /// These are aliases for to()
-    PN_CPP_EXTERN void address(const std::string &addr);
-    PN_CPP_EXTERN std::string address() const;
-    /// @endcond
-
-    /// Set the address for replies.
-    PN_CPP_EXTERN void reply_to(const std::string &addr);
-
-    /// Get the address for replies.
-    PN_CPP_EXTERN std::string reply_to() const;
-
-    /// Set the ID for matching related messages.
-    PN_CPP_EXTERN void correlation_id(const message_id&);
-
-    /// Get the ID for matching related messages.
-    PN_CPP_EXTERN message_id correlation_id() const;
-
-    /// @}
-
-    /// @name Content
-    /// @{
-
-    /// Set the body.  Equivalent to `body() = x`.
-    PN_CPP_EXTERN void body(const value& x);
-
-    /// Get the body.
-    PN_CPP_EXTERN const value& body() const;
-
-    /// Get a reference to the body that can be modified in place.
-    PN_CPP_EXTERN value& body();
-
-    /// Set the subject.
-    PN_CPP_EXTERN void subject(const std::string &s);
-
-    /// Get the subject.
-    PN_CPP_EXTERN std::string subject() const;
-
-    /// Set the content type of the body.
-    PN_CPP_EXTERN void content_type(const std::string &s);
-
-    /// Get the content type of the body.
-    PN_CPP_EXTERN std::string content_type() const;
-
-    /// Set the content encoding of the body.
-    PN_CPP_EXTERN void content_encoding(const std::string &s);
-
-    /// Get the content encoding of the body.
-    PN_CPP_EXTERN std::string content_encoding() const;
-
-    /// Set the expiration time.
-    PN_CPP_EXTERN void expiry_time(timestamp t);
-
-    /// Get the expiration time.
-    PN_CPP_EXTERN timestamp expiry_time() const;
-
-    /// Set the creation time.
-    PN_CPP_EXTERN void creation_time(timestamp t);
-
-    /// Get the creation time.
-    PN_CPP_EXTERN timestamp creation_time() const;
-
-    /// Get the inferred flag.
-    ///
-    /// The inferred flag for a message indicates how the message
-    /// content is encoded into AMQP sections. If the inferred is true
-    /// then binary and list values in the body of the message will be
-    /// encoded as AMQP DATA and AMQP SEQUENCE sections,
-    /// respectively. If inferred is false, then all values in the
-    /// body of the message will be encoded as AMQP VALUE sections
-    /// regardless of their type.
-    PN_CPP_EXTERN bool inferred() const;
-
-    /// Set the inferred flag.
-    PN_CPP_EXTERN void inferred(bool);
-
-    /// @}
-
-    /// @name Transfer headers
-    /// @{
-
-    /// Get the durable flag.
-    ///
-    /// The durable flag indicates that any parties taking
-    /// responsibility for the message must durably store the content.
-    PN_CPP_EXTERN bool durable() const;
-
-    /// Set the durable flag.
-    PN_CPP_EXTERN void durable(bool);
-
-    /// Get the TTL.
-    ///
-    /// The TTL (time to live) for a message determines how long a
-    /// message is considered live. When a message is held for
-    /// retransmit, the TTL is decremented. Once the TTL reaches zero,
-    /// the message is considered dead. Once a message is considered
-    /// dead, it may be dropped.
-    PN_CPP_EXTERN duration ttl() const;
-
-    /// Set the TTL.
-    PN_CPP_EXTERN void ttl(duration);
-
-    /// Get the priority.
-    ///
-    /// The priority of a message impacts ordering guarantees. Within
-    /// a given ordered context, higher priority messages may jump
-    /// ahead of lower priority messages.
-    ///
-    /// The default value set on newly constructed messages is message::default_priority.
-    PN_CPP_EXTERN uint8_t priority() const;
-
-    /// Set the priority.
-    PN_CPP_EXTERN void priority(uint8_t);
-
-    /// Get the first acquirer flag.
-    ///
-    /// When set to true, the first acquirer flag for a message
-    /// indicates that the recipient of the message is the first
-    /// recipient to acquire the message, i.e. there have been no
-    /// failed delivery attempts to other acquirers.  Note that this
-    /// does not mean the message has not been delivered to, but not
-    /// acquired, by other recipients.
-
-    // XXX The triple-not in the last sentence above is confusing.
-    
-    PN_CPP_EXTERN bool first_acquirer() const;
-
-    /// Set the first acquirer flag.
-    PN_CPP_EXTERN void first_acquirer(bool);
-
-    /// Get the delivery count.
-    ///
-    /// The delivery count field tracks how many attempts have been
-    /// made to deliver a message.
-    PN_CPP_EXTERN uint32_t delivery_count() const;
-
-    /// Get the delivery count.
-    PN_CPP_EXTERN void delivery_count(uint32_t);
-
-    /// @}
-
-    /// @name Message groups
-    /// @{
-
-    /// Set the message group ID.
-    PN_CPP_EXTERN void group_id(const std::string &s);
-
-    /// Get the message group ID.
-    PN_CPP_EXTERN std::string group_id() const;
-
-    /// Set the reply-to group ID.
-    PN_CPP_EXTERN void reply_to_group_id(const std::string &s);
-
-    /// Get the reply-to group ID.
-    PN_CPP_EXTERN std::string reply_to_group_id() const;
-
-    /// Get the group sequence.
-    ///
-    /// The group sequence of a message identifies the relative
-    /// ordering of messages within a group. The default value for the
-    /// group sequence of a message is zero.
-    PN_CPP_EXTERN int32_t group_sequence() const;
-
-    /// Set the group sequence for a message.
-    PN_CPP_EXTERN void group_sequence(int32_t);
-
-    /// @}
-
-    /// @name Extended attributes
-    /// @{
-
-    /// **Experimental** - Get the application properties map.  It can
-    /// be modified in place.
-    PN_CPP_EXTERN property_map& properties();
-
-    /// **Experimental** - Get the application properties map.  It can
-    /// be modified in place.
-    PN_CPP_EXTERN const property_map& properties() const;
-
-    /// **Experimental** - Get the message annotations map.  It can be
-    /// modified in place.
-    PN_CPP_EXTERN annotation_map& message_annotations();
-
-    /// **Experimental** - Get the message annotations map.  It can be
-    /// modified in place.
-    PN_CPP_EXTERN const annotation_map& message_annotations() const;
-
-    /// **Experimental** - Get the delivery annotations map.  It can
-    /// be modified in place.
-    PN_CPP_EXTERN annotation_map& delivery_annotations();
-
-    /// **Experimental** - Get the delivery annotations map.  It can
-    /// be modified in place.
-    PN_CPP_EXTERN const annotation_map& delivery_annotations() const;
-
-    /// @}
-
-    /// Default priority assigned to new messages.
-    PN_CPP_EXTERN static const uint8_t default_priority;
-
-    /// @cond INTERNAL
-  private:
-    pn_message_t *pn_msg() const;
-
-    mutable pn_message_t *pn_msg_;
-    mutable internal::value_ref body_;
-    mutable property_map application_properties_;
-    mutable annotation_map message_annotations_;
-    mutable annotation_map delivery_annotations_;
-
-    /// Decode the message corresponding to a delivery from a link.
-    void decode(proton::delivery);
-
-  PN_CPP_EXTERN friend void swap(message&, message&);
-  friend class messaging_adapter;
-    /// @endcond
-};
-
-} // proton
-
-#endif // PROTON_MESSAGE_HPP
diff --git a/proton-c/bindings/cpp/include/proton/message_id.hpp b/proton-c/bindings/cpp/include/proton/message_id.hpp
deleted file mode 100644
index ee12a17..0000000
--- a/proton-c/bindings/cpp/include/proton/message_id.hpp
+++ /dev/null
@@ -1,92 +0,0 @@
-#ifndef PROTON_MESSAGE_ID_HPP
-#define PROTON_MESSAGE_ID_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./binary.hpp"
-#include "./scalar_base.hpp"
-#include "./uuid.hpp"
-
-#include <proton/type_compat.h>
-
-#include <string>
-
-namespace proton {
-
-/// An AMQP message ID.
-///
-/// It can contain one of the following types:
-///
-///  - uint64_t
-///  - std::string
-///  - proton::uuid
-///  - proton::binary
-///
-class message_id : public scalar_base {
-  public:
-    /// An empty message_id.
-    message_id() {}
-
-    /// Construct from any type that can be assigned.
-    template <class T> message_id(const T& x) { *this = x; }
-
-    /// @name Assignment operators
-    /// Assign a C++ value, deduce the AMQP type()
-    ///
-    /// @{
-    message_id& operator=(uint64_t x) { put_(x); return *this; }
-    message_id& operator=(const uuid& x) { put_(x); return *this; }
-    message_id& operator=(const binary& x) { put_(x); return *this; }
-    message_id& operator=(const std::string& x) { put_(x); return *this; }
-    message_id& operator=(const char* x) { put_(x); return *this; } ///< Treated as amqp::STRING
-    /// @}
-
-  private:
-    message_id(const pn_atom_t& a): scalar_base(a) {}
-
-    ///@cond INTERNAL
-  friend class message;
-  friend class codec::decoder;
-    ///@endcond
-};
-
-/// @cond INTERNAL
-/// Base template for get(message_id), specialized for legal message_id types.
-template <class T> T get(const message_id& x);
-/// @endcond
-
-/// Get the uint64_t value or throw conversion_error. @related message_id
-template<> inline uint64_t get<uint64_t>(const message_id& x) { return internal::get<uint64_t>(x); }
-/// Get the @ref uuid value or throw conversion_error. @related message_id
-template<> inline uuid get<uuid>(const message_id& x) { return internal::get<uuid>(x); }
-/// Get the @ref binary value or throw conversion_error. @related message_id
-template<> inline binary get<binary>(const message_id& x) { return internal::get<binary>(x); }
-/// Get the std::string value or throw conversion_error. @related message_id
-template<> inline std::string get<std::string>(const message_id& x) { return internal::get<std::string>(x); }
-
-/// @copydoc scalar::coerce
-/// @related message_id
-template<class T> T coerce(const message_id& x) { return internal::coerce<T>(x); }
-
-} // proton
-
-#endif // PROTON_MESSAGE_ID_HPP
diff --git a/proton-c/bindings/cpp/include/proton/messaging_handler.hpp b/proton-c/bindings/cpp/include/proton/messaging_handler.hpp
deleted file mode 100644
index 6653c43..0000000
--- a/proton-c/bindings/cpp/include/proton/messaging_handler.hpp
+++ /dev/null
@@ -1,160 +0,0 @@
-#ifndef PROTON_MESSAGING_HANDLER_HPP
-#define PROTON_MESSAGING_HANDLER_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./internal/export.hpp"
-
-namespace proton {
-
-
-/// A handler for Proton messaging events.
-///
-/// Subclass and override the event-handling member functions.
-///
-/// #### Close and error handling
-///
-/// There are several objects that have `on_X_close` and `on_X_error`
-/// functions.  They are called as follows:
-///
-/// - If `X` is closed cleanly, with no error status, then `on_X_close`
-///   is called.
-/// - If `X` is closed with an error, then `on_X_error` is called,
-///   followed by `on_X_close`. The error condition is also available
-///   in `on_X_close` from `X::condition()`.
-///
-/// By default, if you do not implement `on_X_error`, it will call
-/// `on_error`.  If you do not implement `on_error` it will throw a
-/// @ref proton::error exception, which may not be what you want but
-/// does help to identify forgotten error handling quickly.
-///
-/// #### Resource cleanup
-///
-/// Every `on_X_open` event is paired with an `on_X_close` event which
-/// can clean up any resources created by the open handler.  In
-/// particular this is still true if an error is reported with an
-/// `on_X_error` event.  The error-handling logic doesn't have to
-/// manage resource clean up.  It can assume that the close event will
-/// be along to handle it.
-class
-PN_CPP_CLASS_EXTERN messaging_handler {
-  public:
-    PN_CPP_EXTERN messaging_handler();
-    PN_CPP_EXTERN virtual ~messaging_handler();
-
-    /// The container event loop is starting.
-    /// This is the first event received after calling container::run
-    PN_CPP_EXTERN virtual void on_container_start(container &c);
-
-    /// The container event loop is stopping.
-    /// This is the last event received before the container event loop stops.
-    PN_CPP_EXTERN virtual void on_container_stop(container &c);
-
-    /// A message is received.
-    PN_CPP_EXTERN virtual void on_message(delivery &d, message &m);
-
-    /// A message can be sent.
-    PN_CPP_EXTERN virtual void on_sendable(sender &s);
-
-    /// The underlying network transport is open
-    PN_CPP_EXTERN virtual void on_transport_open(transport &t);
-    
-    /// The underlying network transport has closed.
-    PN_CPP_EXTERN virtual void on_transport_close(transport &t);
-
-    /// The underlying network transport has closed with an error
-    /// condition.
-    PN_CPP_EXTERN virtual void on_transport_error(transport &t);
-
-    /// The remote peer opened the connection.
-    PN_CPP_EXTERN virtual void on_connection_open(connection &c);
-
-    /// The remote peer closed the connection.
-    PN_CPP_EXTERN virtual void on_connection_close(connection &c);
-
-    /// The remote peer closed the connection with an error condition.
-    PN_CPP_EXTERN virtual void on_connection_error(connection &c);
-
-    /// The remote peer opened the session.
-    PN_CPP_EXTERN virtual void on_session_open(session &s);
-
-    /// The remote peer closed the session.
-    PN_CPP_EXTERN virtual void on_session_close(session &s);
-
-    /// The remote peer closed the session with an error condition.
-    PN_CPP_EXTERN virtual void on_session_error(session &s);
-
-    /// The remote peer opened the link.
-    PN_CPP_EXTERN virtual void on_receiver_open(receiver& l);
-
-    /// The remote peer detached the link.
-    PN_CPP_EXTERN virtual void on_receiver_detach(receiver& l);
-
-    /// The remote peer closed the link.
-    PN_CPP_EXTERN virtual void on_receiver_close(receiver& l);
-
-    /// The remote peer closed the link with an error condition.
-    PN_CPP_EXTERN virtual void on_receiver_error(receiver& l);
-
-    /// The remote peer opened the link.
-    PN_CPP_EXTERN virtual void on_sender_open(sender& l);
-
-    /// The remote peer detached the link.
-    PN_CPP_EXTERN virtual void on_sender_detach(sender& l);
-
-    /// The remote peer closed the link.
-    PN_CPP_EXTERN virtual void on_sender_close(sender& l);
-
-    /// The remote peer closed the link with an error condition.
-    PN_CPP_EXTERN virtual void on_sender_error(sender& l);
-
-    /// The receiving peer accepted a transfer.
-    PN_CPP_EXTERN virtual void on_tracker_accept(tracker &d);
-
-    /// The receiving peer rejected a transfer.
-    PN_CPP_EXTERN virtual void on_tracker_reject(tracker &d);
-
-    /// The receiving peer released a transfer.
-    PN_CPP_EXTERN virtual void on_tracker_release(tracker &d);
-
-    /// The receiving peer settled a transfer.
-    PN_CPP_EXTERN virtual void on_tracker_settle(tracker &d);
-
-    /// The sending peer settled a transfer.
-    PN_CPP_EXTERN virtual void on_delivery_settle(delivery &d);
-
-    /// **Experimental** - The receiving peer has requested a drain of
-    /// remaining credit.
-    PN_CPP_EXTERN virtual void on_sender_drain_start(sender &s);
-    
-    /// **Experimental** - The credit outstanding at the time of the
-    /// call to receiver::drain has been consumed or returned.
-    PN_CPP_EXTERN virtual void on_receiver_drain_finish(receiver &r);
-
-    /// Fallback error handling.
-    PN_CPP_EXTERN virtual void on_error(const error_condition &c);
-};
-
-} // proton
-
-#endif // PROTON_MESSAGING_HANDLER_HPP
diff --git a/proton-c/bindings/cpp/include/proton/namespaces.hpp b/proton-c/bindings/cpp/include/proton/namespaces.hpp
deleted file mode 100644
index 62b4913..0000000
--- a/proton-c/bindings/cpp/include/proton/namespaces.hpp
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef PROTON_NAMESPACES_HPP
-#define PROTON_NAMESPACES_HPP
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/// The main Proton namespace.
-namespace proton {
-
-/// **Experimental** - AMQP data encoding and decoding.
-///
-/// You can use these classes on an experimental basis to create your
-/// own AMQP encodings for C++ types, but they may change in the
-/// future. For examples of use see the built-in encodings, for
-/// example in proton/vector.hpp or proton/map.hpp
-namespace codec {
-}
-
-/// **Experimental** - An SPI for multithreaded network IO.
-namespace io {
-}
-
-namespace internal {
-}
-
-} // proton
-
-#endif // PROTON_NAMESPACES_HPP
diff --git a/proton-c/bindings/cpp/include/proton/receiver.hpp b/proton-c/bindings/cpp/include/proton/receiver.hpp
deleted file mode 100644
index f92ac96..0000000
--- a/proton-c/bindings/cpp/include/proton/receiver.hpp
+++ /dev/null
@@ -1,112 +0,0 @@
-#ifndef PROTON_RECEIVER_HPP
-#define PROTON_RECEIVER_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./internal/export.hpp"
-#include "./link.hpp"
-
-#include <proton/type_compat.h>
-
-struct pn_link_t;
-struct pn_session_t;
-
-namespace proton {
-
-/// A channel for receiving messages.
-class
-PN_CPP_CLASS_EXTERN receiver : public link {
-    /// @cond INTERNAL
-    PN_CPP_EXTERN receiver(pn_link_t* r);
-    /// @endcond
-
-  public:
-    /// Create an empty receiver.
-    receiver() {}
-
-    /// Open the receiver.
-    ///
-    /// @see endpoint_lifecycle
-    PN_CPP_EXTERN void open();
-
-    /// @copydoc open
-    PN_CPP_EXTERN void open(const receiver_options &opts);
-
-    /// Get the source node.
-    PN_CPP_EXTERN class source source() const;
-
-    /// Get the target node.
-    PN_CPP_EXTERN class target target() const;
-
-    /// Increment the credit available to the sender.  Credit granted
-    /// during a drain cycle is not communicated to the receiver until
-    /// the drain completes.
-    PN_CPP_EXTERN void add_credit(uint32_t);
-
-    /// **Experimental** - Commence a drain cycle.  If there is
-    /// positive credit, a request is sent to the sender to
-    /// immediately use up all of the existing credit balance by
-    /// sending messages that are immediately available and releasing
-    /// any unused credit (see sender::return_credit).  Throws
-    /// proton::error if a drain cycle is already in progress.  An
-    /// on_receiver_drain_finish event will be generated when the
-    /// outstanding drained credit reaches zero.
-    PN_CPP_EXTERN void drain();
-
-    /// @cond INTERNAL
-  friend class internal::factory<receiver>;
-  friend class receiver_iterator;
-  friend class thread_safe<receiver>;
-    /// @endcond
-};
-
-/// @cond INTERNAL
-    
-/// An iterator of receivers.
-class receiver_iterator : public internal::iter_base<receiver, receiver_iterator> {
-    explicit receiver_iterator(receiver r, pn_session_t* s = 0) :
-        internal::iter_base<receiver, receiver_iterator>(r), session_(s) {}
-
-  public:
-    /// Create an iterator of receivers.
-    explicit receiver_iterator() :
-        internal::iter_base<receiver, receiver_iterator>(0), session_(0) {}
-
-    /// Advance to the next receiver.
-    PN_CPP_EXTERN receiver_iterator operator++();
-
-  private:
-    pn_session_t* session_;
-
-  friend class connection;
-  friend class session;
-};
-
-/// A range of receivers.
-typedef internal::iter_range<receiver_iterator> receiver_range;
-
-/// @endcond
-
-} // proton
-
-#endif // PROTON_RECEIVER_HPP
diff --git a/proton-c/bindings/cpp/include/proton/receiver_options.hpp b/proton-c/bindings/cpp/include/proton/receiver_options.hpp
deleted file mode 100644
index 413e4d4..0000000
--- a/proton-c/bindings/cpp/include/proton/receiver_options.hpp
+++ /dev/null
@@ -1,106 +0,0 @@
-#ifndef PROTON_RECEIVER_OPTIONS_HPP
-#define PROTON_RECEIVER_OPTIONS_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./internal/export.hpp"
-#include "./internal/pn_unique_ptr.hpp"
-#include "./delivery_mode.hpp"
-
-namespace proton {
-
-/// Options for creating a receiver.
-///
-/// Options can be "chained" like this:
-///
-/// @code
-/// l = container.create_receiver(url, receiver_options().handler(h).auto_settle(true));
-/// @endcode
-///
-/// You can also create an options object with common settings and use
-/// it as a base for different connections that have mostly the same
-/// settings:
-///
-/// @code
-/// receiver_options opts;
-/// opts.auto_settle(true);
-/// c2 = container.open_receiver(url2, opts.handler(h2));
-/// @endcode
-///
-/// Normal value semantics: copy or assign creates a separate copy of
-/// the options.
-class receiver_options {
-  public:
-    /// Create an empty set of options.
-    PN_CPP_EXTERN receiver_options();
-
-    /// Copy options.
-    PN_CPP_EXTERN receiver_options(const receiver_options&);
-
-    PN_CPP_EXTERN ~receiver_options();
-
-    /// Copy options.
-    PN_CPP_EXTERN receiver_options& operator=(const receiver_options&);
-
-    /// Merge with another option set
-    PN_CPP_EXTERN void update(const receiver_options& other);
-
-    /// Set a messaging_handler for receiver events only.
-    /// The handler is no longer in use when messaging_handler::on_receiver_close() is called.
-    PN_CPP_EXTERN receiver_options& handler(class messaging_handler&);
-
-    /// Set the delivery mode on the receiver.
-    PN_CPP_EXTERN receiver_options& delivery_mode(delivery_mode);
-
-    /// Automatically accept inbound messages that aren't otherwise
-    /// released, rejected, or modified (default is true).
-    PN_CPP_EXTERN receiver_options& auto_accept(bool);
-
-    /// Automatically settle messages (default is true).
-    PN_CPP_EXTERN receiver_options& auto_settle(bool);
-
-    /// Options for the source node of the receiver.
-    PN_CPP_EXTERN receiver_options& source(source_options &);
-
-    /// Options for the target node of the receiver.
-    PN_CPP_EXTERN receiver_options& target(target_options &);
-
-    /// Set automated flow control to pre-fetch this many messages
-    /// (default is 10).  Set to zero to disable automatic credit
-    /// replenishing.
-    PN_CPP_EXTERN receiver_options& credit_window(int);
-
-    /// @cond INTERNAL
-  private:
-    void apply(receiver &) const;
-
-    class impl;
-    internal::pn_unique_ptr<impl> impl_;
-
-    friend class receiver;
-    /// @endcond
-};
-
-} // proton
-
-#endif // PROTON_RECEIVER_OPTIONS_HPP
diff --git a/proton-c/bindings/cpp/include/proton/reconnect_timer.hpp b/proton-c/bindings/cpp/include/proton/reconnect_timer.hpp
deleted file mode 100644
index 766feb7..0000000
--- a/proton-c/bindings/cpp/include/proton/reconnect_timer.hpp
+++ /dev/null
@@ -1,71 +0,0 @@
-#ifndef PROTON_RECONNECT_TIMER_HPP
-#define PROTON_RECONNECT_TIMER_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/// @cond INTERNAL
-/// XXX Needs more discussion
-
-#include "./internal/export.hpp"
-#include "./duration.hpp"
-#include "./timestamp.hpp"
-
-#include <proton/type_compat.h>
-
-namespace proton {
-
-/// **Experimental** - A class that generates a series of delays to
-/// coordinate reconnection attempts.  They may be open ended or
-/// limited in time.  They may be evenly spaced or doubling at an
-/// exponential rate.
-class reconnect_timer {
-  public:
-    PN_CPP_EXTERN reconnect_timer(uint32_t first = 0, int32_t max = -1, uint32_t increment = 100,
-                                  bool doubling = true, int32_t max_retries = -1, int32_t timeout = -1);
-
-    /// Indicate a successful connection, resetting the internal timer
-    /// values.
-    PN_CPP_EXTERN void reset();
-
-    /// Obtain the timer's computed time to delay before attempting a
-    /// reconnection attempt (in milliseconds).  -1 means that the
-    /// retry limit or timeout has been exceeded and reconnection
-    /// attempts should cease.
-    PN_CPP_EXTERN int next_delay(timestamp now);
-
-  private:
-    duration first_delay_;
-    duration max_delay_;
-    duration increment_;
-    bool doubling_;
-    int32_t max_retries_;
-    duration timeout_;
-    int32_t retries_;
-    duration next_delay_;
-    timestamp timeout_deadline_;
-};
-
-} // proton
-
-/// @endcond
-
-#endif // PROTON_RECONNECT_TIMER_HPP
diff --git a/proton-c/bindings/cpp/include/proton/sasl.hpp b/proton-c/bindings/cpp/include/proton/sasl.hpp
deleted file mode 100644
index 3857f06..0000000
--- a/proton-c/bindings/cpp/include/proton/sasl.hpp
+++ /dev/null
@@ -1,83 +0,0 @@
-#ifndef PROTON_SASL_HPP
-#define PROTON_SASL_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./internal/export.hpp"
-#include "./internal/config.hpp"
-#include "./internal/object.hpp"
-
-#include <proton/sasl.h>
-
-#include <string>
-
-namespace proton {
-
-/// SASL information.
-class sasl {
-    /// @cond INTERNAL
-    sasl(pn_sasl_t* s) : object_(s) {}
-    /// @endcond
-
-  public:
-#if PN_CPP_HAS_DELETED_FUNCTIONS
-    sasl() = delete;
-    sasl(const sasl&) = delete;
-    sasl& operator=(const sasl&) = delete;
-    sasl& operator=(sasl&&) = delete;
-#endif
-#if PN_CPP_HAS_DEFAULTED_FUNCTIONS
-    /// @cond INTERNAL
-    sasl(sasl&&) = default;
-    /// @endcond
-#endif
-
-    /// The result of the SASL negotiation.
-    enum outcome {
-        NONE = PN_SASL_NONE,   ///< Negotiation not completed
-        OK = PN_SASL_OK,       ///< Authentication succeeded
-        AUTH = PN_SASL_AUTH,   ///< Failed due to bad credentials
-        SYS = PN_SASL_SYS,     ///< Failed due to a system error
-        PERM = PN_SASL_PERM,   ///< Failed due to unrecoverable error
-        TEMP = PN_SASL_TEMP    ///< Failed due to transient error
-    };
-
-    /// Get the outcome.
-    PN_CPP_EXTERN enum outcome outcome() const;
-
-    /// Get the user name.
-    PN_CPP_EXTERN std::string user() const;
-
-    /// Get the mechanism.
-    PN_CPP_EXTERN std::string mech() const;
-
-    /// @cond INTERNAL
-  private:
-    pn_sasl_t* const object_;
-
-    friend class internal::factory<sasl>;
-    /// @endcond
-};
-
-} // proton
-
-#endif // PROTON_SASL_HPP
diff --git a/proton-c/bindings/cpp/include/proton/scalar.hpp b/proton-c/bindings/cpp/include/proton/scalar.hpp
deleted file mode 100644
index 0559dd9..0000000
--- a/proton-c/bindings/cpp/include/proton/scalar.hpp
+++ /dev/null
@@ -1,84 +0,0 @@
-#ifndef PROTON_SCALAR_HPP
-#define PROTON_SCALAR_HPP
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "./scalar_base.hpp"
-
-#include <proton/type_compat.h>
-
-namespace proton {
-
-/// A holder for an instance of any scalar AMQP type.
-///
-/// @see @ref types_page
-class scalar : public scalar_base {
-  public:
-    /// Create an empty scalar.
-    PN_CPP_EXTERN scalar() {}
-
-    /// Construct from any scalar type.
-    template <class T> scalar(const T& x) { *this = x; }
-
-    /// Assign from any scalar type.
-    template <class T> scalar& operator=(const T& x) { put(x); return *this; }
-
-    /// Clear the scalar, making it empty().
-    void clear() { *this = null(); }
-};
-
-/// Get a contained value of type T. For example:
-///
-///      uint64_t i = get<uint64_t>(x)
-///
-/// This will succeed if and only if x contains a uint64_t value.
-///
-/// @throw conversion_error if contained value is not of type T.
-/// @related scalar
-template<class T> T get(const scalar& s) { return internal::get<T>(s); }
-
-/// Coerce the contained value to type T. For example:
-///
-///      uint64_t i = get<uint64_t>(x)
-///
-/// This will succeed if x contains any numeric value, but may lose
-/// precision if it contains a float or double value.
-///
-/// @throw conversion_error if the value cannot be converted to T
-/// according to `std::is_convertible`
-/// @related scalar
-template<class T> T coerce(const scalar& x) { return internal::coerce<T>(x); }
-
-
-/// Coerce the contained value to type T. For example:
-///
-///      uint64_t i = get<uint64_t>(x)
-///
-/// This will succeed if x contains any numeric value, but may lose
-/// precision if it contains a float or double value.
-///
-/// @throw conversion_error if the value cannot be converted to T
-/// according to `std::is_convertible`
-/// @related scalar
-template<class T> T coerce(scalar& x) { return internal::coerce<T>(x); }
-
-} // proton
-
-#endif // PROTON_SCALAR_HPP
diff --git a/proton-c/bindings/cpp/include/proton/scalar_base.hpp b/proton-c/bindings/cpp/include/proton/scalar_base.hpp
deleted file mode 100644
index ca3161a..0000000
--- a/proton-c/bindings/cpp/include/proton/scalar_base.hpp
+++ /dev/null
@@ -1,215 +0,0 @@
-#ifndef PROTON_SCALAR_BASE_HPP
-#define PROTON_SCALAR_BASE_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./binary.hpp"
-#include "./decimal.hpp"
-#include "./error.hpp"
-#include "./internal/comparable.hpp"
-#include "./internal/export.hpp"
-#include "./internal/type_traits.hpp"
-#include "./symbol.hpp"
-#include "./timestamp.hpp"
-#include "./type_id.hpp"
-#include "./types_fwd.hpp"
-#include "./uuid.hpp"
-
-#include <proton/type_compat.h>
-
-#include <iosfwd>
-#include <string>
-#include <typeinfo>
-
-namespace proton {
-
-class scalar_base;
-
-namespace codec {
-class decoder;
-class encoder;
-}
-
-namespace internal {
-template<class T> T get(const scalar_base& s);
-}
-
-/// Base class for scalar types.
-class scalar_base : private internal::comparable<scalar_base> {
-  public:
-    /// AMQP type of data stored in the scalar
-    PN_CPP_EXTERN type_id type() const;
-
-    /// True if there is no value, i.e. type() == NULL_TYPE.
-    PN_CPP_EXTERN bool empty() const;
-
-    /// Compare
-  friend PN_CPP_EXTERN bool operator<(const scalar_base& x, const scalar_base& y);
-    /// Compare
-  friend PN_CPP_EXTERN bool operator==(const scalar_base& x, const scalar_base& y);
-    /// Print the contained value
-  friend PN_CPP_EXTERN std::ostream& operator<<(std::ostream& o, const scalar_base& x);
-
-  protected:
-    PN_CPP_EXTERN scalar_base(const pn_atom_t& a);
-    PN_CPP_EXTERN scalar_base();
-    PN_CPP_EXTERN scalar_base(const scalar_base&);
-    PN_CPP_EXTERN scalar_base& operator=(const scalar_base&);
-
-    PN_CPP_EXTERN void put_(bool);
-    PN_CPP_EXTERN void put_(uint8_t);
-    PN_CPP_EXTERN void put_(int8_t);
-    PN_CPP_EXTERN void put_(uint16_t);
-    PN_CPP_EXTERN void put_(int16_t);
-    PN_CPP_EXTERN void put_(uint32_t);
-    PN_CPP_EXTERN void put_(int32_t);
-    PN_CPP_EXTERN void put_(uint64_t);
-    PN_CPP_EXTERN void put_(int64_t);
-    PN_CPP_EXTERN void put_(wchar_t);
-    PN_CPP_EXTERN void put_(float);
-    PN_CPP_EXTERN void put_(double);
-    PN_CPP_EXTERN void put_(timestamp);
-    PN_CPP_EXTERN void put_(const decimal32&);
-    PN_CPP_EXTERN void put_(const decimal64&);
-    PN_CPP_EXTERN void put_(const decimal128&);
-    PN_CPP_EXTERN void put_(const uuid&);
-    PN_CPP_EXTERN void put_(const std::string&);
-    PN_CPP_EXTERN void put_(const symbol&);
-    PN_CPP_EXTERN void put_(const binary&);
-    PN_CPP_EXTERN void put_(const char* s); ///< Treated as an AMQP string
-    PN_CPP_EXTERN void put_(const null&);
-
-    template<class T> void put(const T& x) { putter<T>::put(*this, x); }
-
-  private:
-    PN_CPP_EXTERN void get_(bool&) const;
-    PN_CPP_EXTERN void get_(uint8_t&) const;
-    PN_CPP_EXTERN void get_(int8_t&) const;
-    PN_CPP_EXTERN void get_(uint16_t&) const;
-    PN_CPP_EXTERN void get_(int16_t&) const;
-    PN_CPP_EXTERN void get_(uint32_t&) const;
-    PN_CPP_EXTERN void get_(int32_t&) const;
-    PN_CPP_EXTERN void get_(uint64_t&) const;
-    PN_CPP_EXTERN void get_(int64_t&) const;
-    PN_CPP_EXTERN void get_(wchar_t&) const;
-    PN_CPP_EXTERN void get_(float&) const;
-    PN_CPP_EXTERN void get_(double&) const;
-    PN_CPP_EXTERN void get_(timestamp&) const;
-    PN_CPP_EXTERN void get_(decimal32&) const;
-    PN_CPP_EXTERN void get_(decimal64&) const;
-    PN_CPP_EXTERN void get_(decimal128&) const;
-    PN_CPP_EXTERN void get_(uuid&) const;
-    PN_CPP_EXTERN void get_(std::string&) const;
-    PN_CPP_EXTERN void get_(symbol&) const;
-    PN_CPP_EXTERN void get_(binary&) const;
-    PN_CPP_EXTERN void get_(null&) const;
-
-    // use template structs, functions cannot be  partially specialized.
-    template <class T, class Enable=void> struct putter {
-        static void put(scalar_base& s, const T& x) { s.put_(x); }
-    };
-    template <class T>
-    struct putter<T, typename internal::enable_if<internal::is_unknown_integer<T>::value>::type> {
-        static void put(scalar_base& s, const T& x) {
-            s.put_(static_cast<typename internal::known_integer<T>::type>(x));
-        }
-    };
-    template <class T, class Enable=void>
-    struct getter {
-        static T get(const scalar_base& s) { T x; s.get_(x); return x; }
-    };
-    template <class T>
-    struct getter<T, typename internal::enable_if<internal::is_unknown_integer<T>::value>::type> {
-        static T get(const scalar_base& s) {
-            typename internal::known_integer<T>::type x; s.get_(x); return x;
-        }
-    };
-
-    void ok(pn_type_t) const;
-    void set(const pn_atom_t&);
-    void set(const binary& x, pn_type_t t);
-
-    pn_atom_t atom_;
-    binary bytes_; // Hold binary data.
-
-    /// @cond INTERNAL
-  friend class message;
-  friend class codec::encoder;
-  friend class codec::decoder;
-  template<class T> friend T internal::get(const scalar_base& s);
-    /// @endcond
-};
-
-namespace internal {
-
-template<class T> T get(const scalar_base& s) {
-      return scalar_base::getter<T>::get(s);
-}
-
-template <class R, class F> R visit(const scalar_base& s, F f) {
-    switch(s.type()) {
-      case BOOLEAN: return f(internal::get<bool>(s));
-      case UBYTE: return f(internal::get<uint8_t>(s));
-      case BYTE: return f(internal::get<int8_t>(s));
-      case USHORT: return f(internal::get<uint16_t>(s));
-      case SHORT: return f(internal::get<int16_t>(s));
-      case UINT: return f(internal::get<uint32_t>(s));
-      case INT: return f(internal::get<int32_t>(s));
-      case CHAR: return f(internal::get<wchar_t>(s));
-      case ULONG: return f(internal::get<uint64_t>(s));
-      case LONG: return f(internal::get<int64_t>(s));
-      case TIMESTAMP: return f(internal::get<timestamp>(s));
-      case FLOAT: return f(internal::get<float>(s));
-      case DOUBLE: return f(internal::get<double>(s));
-      case DECIMAL32: return f(internal::get<decimal32>(s));
-      case DECIMAL64: return f(internal::get<decimal64>(s));
-      case DECIMAL128: return f(internal::get<decimal128>(s));
-      case UUID: return f(internal::get<uuid>(s));
-      case BINARY: return f(internal::get<binary>(s));
-      case STRING: return f(internal::get<std::string>(s));
-      case SYMBOL: return f(internal::get<symbol>(s));
-      default: throw conversion_error("invalid scalar type "+type_name(s.type()));
-    }
-}
-
-PN_CPP_EXTERN conversion_error make_coercion_error(const char* cpp_type, type_id amqp_type);
-
-template<class T> struct coerce_op {
-    template <class U>
-    typename enable_if<is_convertible<U, T>::value, T>::type operator()(const U& x) {
-        return static_cast<T>(x);
-    }
-    template <class U>
-    typename enable_if<!is_convertible<U, T>::value, T>::type operator()(const U&) {
-        throw make_coercion_error(typeid(T).name(), type_id_of<U>::value);
-    }
-};
-
-template <class T> T coerce(const scalar_base& s) { return visit<T>(s, coerce_op<T>()); }
-} // namespace internal
-
-/// Return a readable string representation of x for display purposes.
-PN_CPP_EXTERN std::string to_string(const scalar_base& x);
-
-} // proton
-
-#endif // PROTON_SCALAR_BASE_HPP
diff --git a/proton-c/bindings/cpp/include/proton/sender.hpp b/proton-c/bindings/cpp/include/proton/sender.hpp
deleted file mode 100644
index 8979bb4..0000000
--- a/proton-c/bindings/cpp/include/proton/sender.hpp
+++ /dev/null
@@ -1,105 +0,0 @@
-#ifndef PROTON_SENDER_HPP
-#define PROTON_SENDER_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./internal/export.hpp"
-#include "./link.hpp"
-
-struct pn_link_t;
-struct pn_session_t;
-
-namespace proton {
-
-/// A channel for sending messages.
-class
-PN_CPP_CLASS_EXTERN sender : public link {
-    /// @cond INTERNAL
-    PN_CPP_EXTERN sender(pn_link_t* s);
-    /// @endcond
-
-  public:
-    /// Create an empty sender.
-    sender() {}
-
-    /// Open the sender.
-    ///
-    /// @see endpoint_lifecycle
-    PN_CPP_EXTERN void open();
-
-    /// @copydoc open
-    PN_CPP_EXTERN void open(const sender_options &opts);
-
-    /// Send a message on the sender.
-    PN_CPP_EXTERN tracker send(const message &m);
-
-    /// Get the source node.
-    PN_CPP_EXTERN class source source() const;
-
-    /// Get the target node.
-    PN_CPP_EXTERN class target target() const;
-
-    /// **Experimental** - Return all unused credit to the receiver in
-    /// response to a drain request.  Has no effect unless there has
-    /// been a drain request and there is remaining credit to use or
-    /// return.
-    ///
-    /// @see receiver::drain
-    PN_CPP_EXTERN void return_credit();
-
-    /// @cond INTERNAL
-  friend class internal::factory<sender>;
-  friend class sender_iterator;
-  friend class thread_safe<sender>;
-    /// @endcond
-};
-
-/// @cond INTERNAL
-
-/// An iterator of senders.
-class sender_iterator : public internal::iter_base<sender, sender_iterator> {
-    sender_iterator(sender snd, pn_session_t* s = 0) :
-        internal::iter_base<sender, sender_iterator>(snd), session_(s) {}
-
-  public:
-    /// Create an iterator of senders.
-    sender_iterator() :
-        internal::iter_base<sender, sender_iterator>(0), session_(0) {}
-    /// Advance to the next sender.
-    PN_CPP_EXTERN sender_iterator operator++();
-
-  private:
-    pn_session_t* session_;
-
-  friend class connection;
-  friend class session;
-};
-
-/// A range of senders.
-typedef internal::iter_range<sender_iterator> sender_range;
-
-/// @endcond
-
-}
-
-#endif // PROTON_SENDER_HPP
diff --git a/proton-c/bindings/cpp/include/proton/sender_options.hpp b/proton-c/bindings/cpp/include/proton/sender_options.hpp
deleted file mode 100644
index 9d7bb42..0000000
--- a/proton-c/bindings/cpp/include/proton/sender_options.hpp
+++ /dev/null
@@ -1,101 +0,0 @@
-#ifndef PROTON_SENDER_OPTIONS_HPP
-#define PROTON_SENDER_OPTIONS_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./internal/export.hpp"
-#include "./internal/pn_unique_ptr.hpp"
-#include "./delivery_mode.hpp"
-
-namespace proton {
-
-/// Options for creating a sender.
-///
-/// Options can be "chained" like this:
-///
-/// @code
-/// l = container.create_sender(url, sender_options().handler(h).auto_settle(false));
-/// @endcode
-///
-/// You can also create an options object with common settings and use
-/// it as a base for different connections that have mostly the same
-/// settings:
-///
-/// @code
-/// sender_options opts;
-/// opts.browsing(true);
-/// l1 = container.open_sender(url1, opts.handler(h1));
-/// c2 = container.open_receiver(url2, opts.handler(h2));
-/// @endcode
-///
-/// Normal value semantics: copy or assign creates a separate copy of
-/// the options.
-// XXX opts.browsing is not a good example here
-class sender_options {
-  public:
-    /// Create an empty set of options.
-    PN_CPP_EXTERN sender_options();
-
-    /// Copy options.
-    PN_CPP_EXTERN sender_options(const sender_options&);
-
-    PN_CPP_EXTERN ~sender_options();
-
-    /// Copy options.
-    PN_CPP_EXTERN sender_options& operator=(const sender_options&);
-
-    /// Merge with another option set
-    PN_CPP_EXTERN void update(const sender_options& other);
-
-    /// Set a messaging_handler for sender events only.
-    /// The handler is no longer in use when messaging_handler::on_sender_close() is called.
-    /// messaging_handler::on_sender_close() may not be called if a connection is aborted,
-    /// in that case it should be cleaned up in its connection's messaging_handler::on_transport_close()
-    PN_CPP_EXTERN sender_options& handler(class messaging_handler&);
-
-    /// Set the delivery mode on the sender.
-    PN_CPP_EXTERN sender_options& delivery_mode(delivery_mode);
-
-    /// Automatically settle messages (default is true).
-    PN_CPP_EXTERN sender_options& auto_settle(bool);
-
-    /// Options for the source node of the sender.
-    PN_CPP_EXTERN sender_options& source(const source_options &);
-
-    /// Options for the receiver node of the receiver.
-    PN_CPP_EXTERN sender_options& target(const target_options &);
-
-    /// @cond INTERNAL
-  private:
-    void apply(sender&) const;
-
-    class impl;
-    internal::pn_unique_ptr<impl> impl_;
-
-    friend class sender;
-    /// @endcond
-};
-
-} // proton
-
-#endif // PROTON_SENDER_OPTIONS_HPP
diff --git a/proton-c/bindings/cpp/include/proton/session.hpp b/proton-c/bindings/cpp/include/proton/session.hpp
deleted file mode 100644
index cbdf1b9..0000000
--- a/proton-c/bindings/cpp/include/proton/session.hpp
+++ /dev/null
@@ -1,121 +0,0 @@
-#ifndef PROTON_SESSION_HPP
-#define PROTON_SESSION_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./internal/export.hpp"
-#include "./endpoint.hpp"
-#include "./receiver.hpp"
-#include "./sender.hpp"
-
-#include <string>
-
-struct pn_session_t;
-
-namespace proton {
-
-/// A container of senders and receivers.
-class
-PN_CPP_CLASS_EXTERN session : public internal::object<pn_session_t>, public endpoint {
-  public:
-    /// @cond INTERNAL
-    PN_CPP_EXTERN session(pn_session_t* s) : internal::object<pn_session_t>(s) {}
-    /// @endcond
-
-  public:
-    /// Create an empty session.
-    session() : internal::object<pn_session_t>(0) {}
-
-    PN_CPP_EXTERN bool uninitialized() const;
-    PN_CPP_EXTERN bool active() const;
-    PN_CPP_EXTERN bool closed() const;
-
-    PN_CPP_EXTERN class error_condition error() const;
-
-    /// Open the session.
-    ///
-    /// @see endpoint_lifecycle
-    PN_CPP_EXTERN void open();
-
-    /// @copydoc open
-    PN_CPP_EXTERN void open(const session_options &opts);
-
-    PN_CPP_EXTERN void close();
-    PN_CPP_EXTERN void close(const error_condition&);
-
-    /// Get the container for this session.
-    PN_CPP_EXTERN class container &container() const;
-
-    /// Get the connection this session belongs to.
-    PN_CPP_EXTERN class connection connection() const;
-
-    /// Open a sender for `addr`.
-    PN_CPP_EXTERN sender open_sender(const std::string &addr);
-
-    /// @copydoc open_sender
-    PN_CPP_EXTERN sender open_sender(const std::string &addr, const sender_options &opts);
-
-    /// Open a receiver for `addr`.
-    PN_CPP_EXTERN receiver open_receiver(const std::string &addr);
-
-    /// @copydoc open_receiver
-    PN_CPP_EXTERN receiver open_receiver(const std::string &addr, const receiver_options &opts);
-
-    /// The number of incoming bytes currently buffered.
-    PN_CPP_EXTERN size_t incoming_bytes() const;
-
-    /// The number of outgoing bytes currently buffered.
-    PN_CPP_EXTERN size_t outgoing_bytes() const;
-
-    /// Return the senders on this session.
-    PN_CPP_EXTERN sender_range senders() const;
-
-    /// Return the receivers on this session.
-    PN_CPP_EXTERN receiver_range receivers() const;
-
-    /// @cond INTERNAL
-  friend class internal::factory<session>;
-  friend class session_iterator;
-  friend class thread_safe<session>;
-    /// @endcond
-};
-
-/// @cond INTERNAL
-    
-/// An iterator of sessions.
-class session_iterator : public internal::iter_base<session, session_iterator> {
- public:
-    explicit session_iterator(session s = 0) : internal::iter_base<session, session_iterator>(s) {}
-
-    /// Advance to the next session.
-    PN_CPP_EXTERN session_iterator operator++();
-};
-
-/// A range of sessions.
-typedef internal::iter_range<session_iterator> session_range;
-
-/// @endcond
-    
-} // proton
-
-#endif // PROTON_SESSION_HPP
diff --git a/proton-c/bindings/cpp/include/proton/session_options.hpp b/proton-c/bindings/cpp/include/proton/session_options.hpp
deleted file mode 100644
index eb47a89..0000000
--- a/proton-c/bindings/cpp/include/proton/session_options.hpp
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef PROTON_SESSION_OPTIONS_HPP
-#define PROTON_SESSION_OPTIONS_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./internal/export.hpp"
-#include "./internal/pn_unique_ptr.hpp"
-
-namespace proton {
-
-/// Options for creating a session.
-///
-/// Options can be "chained" (see proton::connection_options).
-///
-/// Normal value semantics: copy or assign creates a separate copy of
-/// the options.
-// XXX Does this need the CLASS_EXTERN stuff? - Add just for consistency
-class session_options {
-  public:
-    /// Create an empty set of options.
-    PN_CPP_EXTERN session_options();
-
-    /// Copy options.
-    PN_CPP_EXTERN session_options(const session_options&);
-
-    PN_CPP_EXTERN ~session_options();
-
-    /// Copy options.
-    PN_CPP_EXTERN session_options& operator=(const session_options&);
-
-    /// Set a messaging_handler for the session.
-    PN_CPP_EXTERN session_options& handler(class messaging_handler &);
-
-    /// @cond INTERNAL
-    // Other useful session configuration TBD.
-  private:
-    void apply(session&) const;
-
-    class impl;
-    internal::pn_unique_ptr<impl> impl_;
-
-    friend class session;
-    /// @endcond
-};
-
-} // proton
-
-#endif // PROTON_SESSION_OPTIONS_HPP
diff --git a/proton-c/bindings/cpp/include/proton/source.hpp b/proton-c/bindings/cpp/include/proton/source.hpp
deleted file mode 100644
index 321af9a..0000000
--- a/proton-c/bindings/cpp/include/proton/source.hpp
+++ /dev/null
@@ -1,88 +0,0 @@
-#ifndef PROTON_SOURCE_HPP
-#define PROTON_SOURCE_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./internal/export.hpp"
-#include "./internal/cached_map.hpp"
-#include "./symbol.hpp"
-#include "./terminus.hpp"
-#include "./value.hpp"
-
-#include <string>
-
-struct pn_terminus_t;
-
-namespace proton {
-
-/// A point of origin for messages.
-///
-/// @see proton::sender, proton::receiver, proton::target
-class source : public terminus {
-  public:
-    /// **Experimental** - A map of AMQP symbol keys and filter
-    /// specifiers.
-    class filter_map : public internal::cached_map<symbol, value> {};
-
-    /// Create an empty source.
-    source() : terminus() {}
-
-    /// The policy for distributing messages.
-    enum distribution_mode {
-        // XXX Why is unspecified needed?  The protocol doesn't have
-        // it.
-        /// Unspecified
-        UNSPECIFIED = PN_DIST_MODE_UNSPECIFIED,
-        /// Once transferred, the message remains available to other links
-        COPY = PN_DIST_MODE_COPY,
-        /// Once transferred, the message is unavailable to other links
-        MOVE = PN_DIST_MODE_MOVE
-    };
-
-    using terminus::durability_mode;
-    using terminus::expiry_policy;
-
-    /// The address of the source.
-    PN_CPP_EXTERN std::string address() const;
-
-    /// Get the distribution mode.
-    PN_CPP_EXTERN enum distribution_mode distribution_mode() const;
-
-    /// **Experimental** - Obtain the set of message filters.
-    PN_CPP_EXTERN filter_map filters() const;
-
-  private:
-    source(pn_terminus_t* t);
-    source(const sender&);
-    source(const receiver&);
-
-    /// @cond INTERNAL
-  friend class proton::internal::factory<source>;
-  friend class sender;
-  friend class receiver;
-    /// @endcond
-};
-
-} // proton
-
-#endif // PROTON_SOURCE_HPP
diff --git a/proton-c/bindings/cpp/include/proton/source_options.hpp b/proton-c/bindings/cpp/include/proton/source_options.hpp
deleted file mode 100644
index f7dde48..0000000
--- a/proton-c/bindings/cpp/include/proton/source_options.hpp
+++ /dev/null
@@ -1,93 +0,0 @@
-#ifndef PROTON_SOURCE_OPTIONS_HPP
-#define PROTON_SOURCE_OPTIONS_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./internal/export.hpp"
-#include "./internal/pn_unique_ptr.hpp"
-#include "./duration.hpp"
-#include "./source.hpp"
-
-#include <string>
-
-namespace proton {
-
-/// Options for creating a source node for a sender or receiver.
-///
-/// Options can be "chained" (@see proton::connection_options).
-///
-/// Normal value semantics: copy or assign creates a separate copy of
-/// the options.
-class source_options {
-  public:
-
-    /// Create an empty set of options.
-    PN_CPP_EXTERN source_options();
-
-    /// Copy options.
-    PN_CPP_EXTERN source_options(const source_options&);
-
-    PN_CPP_EXTERN ~source_options();
-
-    /// Copy options.
-    PN_CPP_EXTERN source_options& operator=(const source_options&);
-
-    /// Set the address for the source.  Ignored if dynamic is true.
-    PN_CPP_EXTERN source_options& address(const std::string&);
-
-    /// Request a dynamically created node to be created by the remote peer.
-    /// Any specified source address is ignored.
-    PN_CPP_EXTERN source_options& dynamic(bool);
-
-    /// Control whether messsages are browsed or consumed.
-    PN_CPP_EXTERN source_options& distribution_mode(enum source::distribution_mode);
-
-    /// Control the persistence of source state.
-    PN_CPP_EXTERN source_options& durability_mode(enum source::durability_mode);
-
-    /// The expiry period after which the source is discarded.
-    PN_CPP_EXTERN source_options& timeout(duration);
-
-    /// Control when the clock for expiration begins.
-    PN_CPP_EXTERN source_options& expiry_policy(enum source::expiry_policy);
-
-    /// **Experimental** - Specify a filter mechanism on the source
-    /// that restricts message flow to a subset of the available
-    /// messages.
-    PN_CPP_EXTERN source_options& filters(const source::filter_map&);
-
-  private:
-    void apply(source&) const;
-
-    class impl;
-    internal::pn_unique_ptr<impl> impl_;
-
-    /// @cond INTERNAL
-  friend class source;
-  friend class sender_options;
-  friend class receiver_options;
-    /// @endcond
-};
-
-} // proton
-
-#endif // PROTON_SOURCE_OPTIONS_HPP
diff --git a/proton-c/bindings/cpp/include/proton/ssl.hpp b/proton-c/bindings/cpp/include/proton/ssl.hpp
deleted file mode 100644
index c6c4c93..0000000
--- a/proton-c/bindings/cpp/include/proton/ssl.hpp
+++ /dev/null
@@ -1,198 +0,0 @@
-#ifndef PROTON_SSL_HPP
-#define PROTON_SSL_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./internal/export.hpp"
-
-#include <proton/ssl.h>
-
-#include <string>
-
-namespace proton {
-
-namespace internal {
-template <class T> class factory;
-}
-
-/// SSL information.
-class ssl {
-    /// @cond INTERNAL
-    ssl(pn_ssl_t* s) : object_(s) {}
-    /// @endcond
-
-  public:
-    /// Create an empty ssl object.
-    ssl() : object_(0) {}
-
-    /// Determines the level of peer validation.
-    enum verify_mode {
-        /// Require peer to provide a valid identifying certificate
-        VERIFY_PEER = PN_SSL_VERIFY_PEER,
-        /// Do not require a certificate or cipher authorization
-        ANONYMOUS_PEER = PN_SSL_ANONYMOUS_PEER,
-        /// Require valid certificate and matching name
-        VERIFY_PEER_NAME = PN_SSL_VERIFY_PEER_NAME
-    };
-
-    /// Outcome specifier for an attempted session resume.
-    enum resume_status {
-        UNKNOWN = PN_SSL_RESUME_UNKNOWN, ///< Session resume state unknown or not supported
-        NEW = PN_SSL_RESUME_NEW,         ///< Session renegotiated, not resumed
-        REUSED = PN_SSL_RESUME_REUSED    ///< Session resumed from previous session
-    };
-
-    /// @cond INTERNAL
-
-    /// XXX C API uses cipher_name
-    /// Get the cipher name.
-    PN_CPP_EXTERN std::string cipher() const;
-
-    /// XXX C API uses protocol_name
-    /// Get the protocol name.
-    PN_CPP_EXTERN std::string protocol() const;
-
-    /// Get the security strength factor.
-    PN_CPP_EXTERN int ssf() const;
-
-    /// XXX discuss, what's the meaning of "remote" here?
-    PN_CPP_EXTERN std::string remote_subject() const;
-
-    /// XXX setters? versus connection options
-    PN_CPP_EXTERN void resume_session_id(const std::string& session_id);
-
-    PN_CPP_EXTERN enum resume_status resume_status() const;
-
-    /// @endcond
-
-  private:
-    pn_ssl_t* object_;
-
-    /// @cond INTERNAL
-  friend class internal::factory<ssl>;
-    /// @endcond
-};
-
-/// **Experimental** - An SSL certificate.
-class ssl_certificate {
-  public:
-    /// Create an SSL certificate.
-    PN_CPP_EXTERN ssl_certificate(const std::string &certdb_main);
-
-    // XXX Document the following constructors
-
-    /// @copydoc ssl_certificate
-    PN_CPP_EXTERN ssl_certificate(const std::string &certdb_main, const std::string &certdb_extra);
-
-    /// @copydoc ssl_certificate
-    PN_CPP_EXTERN ssl_certificate(const std::string &certdb_main, const std::string &certdb_extra, const std::string &passwd);
-    /// @endcond
-
-  private:
-    std::string certdb_main_;
-    std::string certdb_extra_;
-    std::string passwd_;
-    bool pw_set_;
-
-    /// @cond INTERNAL
-  friend class ssl_client_options;
-  friend class ssl_server_options;
-    /// @endcond
-};
-
-class ssl_domain_impl;
-
-namespace internal {
-
-// Base class for SSL configuration
-class ssl_domain {
-  public:
-    PN_CPP_EXTERN ssl_domain(const ssl_domain&);
-    PN_CPP_EXTERN ssl_domain& operator=(const ssl_domain&);
-    PN_CPP_EXTERN ~ssl_domain();
-
-  protected:
-    ssl_domain(bool is_server);
-    pn_ssl_domain_t *pn_domain();
-
-  private:
-    ssl_domain_impl *impl_;
-    bool server_type_;
-};
-
-}
-
-/// **Experimental** - SSL configuration for inbound connections.
-class ssl_server_options : private internal::ssl_domain {
-  public:
-    /// Server SSL options based on the supplied X.509 certificate
-    /// specifier.
-    PN_CPP_EXTERN ssl_server_options(ssl_certificate &cert);
-
-    /// Server SSL options requiring connecting clients to provide a
-    /// client certificate.
-    PN_CPP_EXTERN ssl_server_options(ssl_certificate &cert, const std::string &trust_db,
-                                     const std::string &advertise_db = std::string(),
-                                     enum ssl::verify_mode mode = ssl::VERIFY_PEER);
-
-    /// Server SSL options restricted to available anonymous cipher
-    /// suites on the platform.
-    PN_CPP_EXTERN ssl_server_options();
-
-  private:
-    // Bring pn_domain into scope and allow connection_options to use
-    // it.
-    using internal::ssl_domain::pn_domain;
-
-    /// @cond INTERNAL
-  friend class connection_options;
-    /// @endcond
-};
-
-/// **Experimental** - SSL configuration for outbound connections.
-class ssl_client_options : private internal::ssl_domain {
-  public:
-    /// Create SSL client options (no client certificate).
-    PN_CPP_EXTERN ssl_client_options(const std::string &trust_db,
-                                     enum ssl::verify_mode = ssl::VERIFY_PEER_NAME);
-
-    /// Create SSL client options with a client certificate.
-    PN_CPP_EXTERN ssl_client_options(ssl_certificate&, const std::string &trust_db,
-                                     enum ssl::verify_mode = ssl::VERIFY_PEER_NAME);
-
-    /// SSL connections restricted to available anonymous cipher
-    /// suites on the platform.
-    PN_CPP_EXTERN ssl_client_options();
-
-  private:
-    // Bring pn_domain into scope and allow connection_options to use
-    // it.
-    using internal::ssl_domain::pn_domain;
-
-    /// @cond INTERNAL
-  friend class connection_options;
-    /// @endcond
-};
-
-} // proton
-
-#endif // PROTON_SSL_HPP
diff --git a/proton-c/bindings/cpp/include/proton/symbol.hpp b/proton-c/bindings/cpp/include/proton/symbol.hpp
deleted file mode 100644
index 303f350..0000000
--- a/proton-c/bindings/cpp/include/proton/symbol.hpp
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef PROTON_SYMBOL_HPP
-#define PROTON_SYMBOL_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <string>
-
-namespace proton {
-
-/// A std::string that represents the AMQP symbol type.
-///
-/// A symbol can only contain 7-bit ASCII characters.
-class symbol : public std::string {
-  public:
-    /// Construct from a std::string.
-    symbol(const std::string& s=std::string()) : std::string(s) {}
-
-    /// Construct from a C string.
-    symbol(const char* s) : std::string(s) {}
-
-    /// Construct from any sequence of char.
-    template<class Iter> symbol(Iter start, Iter finish) : std::string(start, finish) {}
-};
-
-} // proton
-
-#endif // PROTON_SYMBOL_HPP
diff --git a/proton-c/bindings/cpp/include/proton/target.hpp b/proton-c/bindings/cpp/include/proton/target.hpp
deleted file mode 100644
index 746133a..0000000
--- a/proton-c/bindings/cpp/include/proton/target.hpp
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef PROTON_TARGET_HPP
-#define PROTON_TARGET_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./internal/export.hpp"
-#include "./terminus.hpp"
-
-#include <string>
-
-struct pn_terminus_t;
-
-namespace proton {
-
-namespace internal {
-template <class T> class factory;
-}
-
-/// A destination for messages.
-///
-/// @see proton::sender, proton::receiver, proton::target
-class target : public terminus {
-  public:
-    /// Create an empty target.
-    target() : terminus() {}
-
-    using terminus::durability_mode;
-    using terminus::expiry_policy;
-
-    /// The address of the target.
-    PN_CPP_EXTERN std::string address() const;
-
-  private:
-    target(pn_terminus_t* t);
-    target(const sender&);
-    target(const receiver&);
-
-    /// @cond INTERNAL
-  friend class internal::factory<target>;
-  friend class sender;
-  friend class receiver;
-    /// @endcond
-};
-
-} // proton
-
-#endif // PROTON_TARGET_HPP
diff --git a/proton-c/bindings/cpp/include/proton/target_options.hpp b/proton-c/bindings/cpp/include/proton/target_options.hpp
deleted file mode 100644
index 547dbbe..0000000
--- a/proton-c/bindings/cpp/include/proton/target_options.hpp
+++ /dev/null
@@ -1,84 +0,0 @@
-#ifndef PROTON_TARGET_OPTIONS_HPP
-#define PROTON_TARGET_OPTIONS_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./internal/export.hpp"
-#include "./internal/pn_unique_ptr.hpp"
-#include "./duration.hpp"
-#include "./target.hpp"
-
-#include <string>
-
-namespace proton {
-
-/// Options for creating a target node for a sender or receiver.
-///
-/// Options can be "chained" (see proton::connection_options).
-///
-/// Normal value semantics: copy or assign creates a separate copy of
-/// the options.
-class target_options {
-  public:
-    /// Create an empty set of options.
-    PN_CPP_EXTERN target_options();
-
-    /// Copy options.
-    PN_CPP_EXTERN target_options(const target_options&);
-
-    PN_CPP_EXTERN ~target_options();
-
-    /// Copy options.
-    PN_CPP_EXTERN target_options& operator=(const target_options&);
-
-    /// Set the address for the target.  Ignored if dynamic is true.
-    PN_CPP_EXTERN target_options& address(const std::string& addr);
-
-    /// Request a dynamically created node to be created by the peer.
-    /// Any specified target address is ignored.
-    PN_CPP_EXTERN target_options& dynamic(bool);
-
-    /// Control the persistence of target state.
-    PN_CPP_EXTERN target_options& durability_mode(enum target::durability_mode);
-
-    /// The expiry period after which the target is discarded.
-    PN_CPP_EXTERN target_options& timeout(duration);
-
-    /// Control when the clock for expiration begins.
-    PN_CPP_EXTERN target_options& expiry_policy(enum target::expiry_policy);
-
-  private:
-    void apply(target&) const;
-
-    class impl;
-    internal::pn_unique_ptr<impl> impl_;
-
-    /// @cond INTERNAL
-  friend class target;
-  friend class sender_options;
-  friend class receiver_options;
-    /// @endcond
-};
-
-} // proton
-
-#endif // PROTON_TARGET_OPTIONS_HPP
diff --git a/proton-c/bindings/cpp/include/proton/terminus.hpp b/proton-c/bindings/cpp/include/proton/terminus.hpp
deleted file mode 100644
index b63a8ad..0000000
--- a/proton-c/bindings/cpp/include/proton/terminus.hpp
+++ /dev/null
@@ -1,111 +0,0 @@
-#ifndef PROTON_TERMINUS_HPP
-#define PROTON_TERMINUS_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./types_fwd.hpp"
-#include "./internal/export.hpp"
-
-#include <proton/terminus.h>
-
-#include <string>
-
-struct pn_link_t;
-struct pn_terminus_t;
-
-namespace proton {
-
-namespace internal {
-template <class T> class factory;
-}
-
-/// One end of a link, either a source or a target.
-///
-/// The source terminus is where messages originate; the target
-/// terminus is where they go.
-///
-/// @see proton::link
-class terminus {
-    /// @cond INTERNAL
-    terminus(pn_terminus_t* t);
-    /// @endcond
-
-  public:
-    terminus() : object_(0), parent_(0) {}
-
-    /// The persistence mode of the source or target.
-    enum durability_mode {
-        /// No persistence.
-        NONDURABLE = PN_NONDURABLE,
-        /// Only configuration is persisted.
-        CONFIGURATION = PN_CONFIGURATION,
-        /// Configuration and unsettled state are persisted.
-        UNSETTLED_STATE = PN_DELIVERIES
-    };
-
-    /// When expiration of the source or target begins.
-    enum expiry_policy {
-        /// When the link is closed.
-        LINK_CLOSE = PN_EXPIRE_WITH_LINK,
-        /// When the containing session is closed.
-        SESSION_CLOSE = PN_EXPIRE_WITH_SESSION,
-        /// When the containing connection is closed.
-        CONNECTION_CLOSE = PN_EXPIRE_WITH_CONNECTION,
-        /// The terminus never expires.
-        NEVER = PN_EXPIRE_NEVER
-    };
-
-    // XXX This should have address?
-
-    /// Get the policy for when expiration begins.
-    PN_CPP_EXTERN enum expiry_policy expiry_policy() const;
-
-    /// The period after which the source is discarded on expiry. The
-    /// duration is rounded to the nearest second.
-    PN_CPP_EXTERN duration timeout() const;
-
-    /// Get the durability flag.
-    PN_CPP_EXTERN enum durability_mode durability_mode();
-
-    /// True if the remote node is created dynamically.
-    PN_CPP_EXTERN bool dynamic() const;
-
-    /// Obtain a reference to the AMQP dynamic node properties for the
-    /// terminus.  See also lifetime_policy.
-    PN_CPP_EXTERN value node_properties() const;
-
-  protected:
-    pn_terminus_t *pn_object() { return object_; }
-  private:
-    pn_terminus_t* object_;
-    pn_link_t* parent_;
-
-    /// @cond INTERNAL
-  friend class internal::factory<terminus>;
-  friend class source;
-  friend class target;
-    /// @endcond
-};
-
-} // proton
-
-#endif // PROTON_TERMINUS_HPP
diff --git a/proton-c/bindings/cpp/include/proton/thread_safe.hpp b/proton-c/bindings/cpp/include/proton/thread_safe.hpp
deleted file mode 100644
index 608a1ca..0000000
--- a/proton-c/bindings/cpp/include/proton/thread_safe.hpp
+++ /dev/null
@@ -1,178 +0,0 @@
-#ifndef PROTON_THREAD_SAFE_HPP
-#define PROTON_THREAD_SAFE_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./internal/config.hpp"
-#include "./connection.hpp"
-#include "./event_loop.hpp"
-#include "./function.hpp"
-#include "./internal/object.hpp"
-#include "./internal/type_traits.hpp"
-
-#include <functional>
-
-namespace proton {
-
-namespace internal {
-template <class T> struct endpoint_traits;
-template<> struct endpoint_traits<connection> {};
-template<> struct endpoint_traits<session> {};
-template<> struct endpoint_traits<link> {};
-template<> struct endpoint_traits<sender> {};
-template<> struct endpoint_traits<receiver> {};
-}
-
-/// **Experimental** - A thread-safe object wrapper.
-///
-/// The proton::object subclasses (proton::connection, proton::sender etc.) are
-/// reference-counted wrappers for C structs. They are not safe for concurrent use,
-/// not even to copy or assign.
-///
-/// A pointer to thread_safe<> can be used from any thread to get the
-/// proton::event_loop for the object's connection. The object will not be
-/// destroyed until the thread_safe<> is deleted. You can use std::shared_ptr,
-/// std::unique_ptr or any other memory management technique to manage the
-/// thread_safe<>.
-///
-/// Use make_thread_safe(), make_shared_thread_safe(), make_unique_thread_safe() to
-/// create a thread_safe<>
-///
-/// @see @ref mt_page
-template <class T>
-class thread_safe : private internal::pn_ptr_base, private internal::endpoint_traits<T> {
-    typedef typename T::pn_type pn_type;
-
-    struct inject_decref : public void_function0 {
-        pn_type* ptr_;
-        inject_decref(pn_type* p) : ptr_(p) {}
-        void operator()() PN_CPP_OVERRIDE { decref(ptr_); delete this; }
-    };
-
-  public:
-    /// @cond INTERNAL
-    static void operator delete(void*) {}
-    /// @endcond
-
-    ~thread_safe() {
-        if (ptr()) {
-            if (!!event_loop()) {
-#if PN_CPP_HAS_STD_BIND
-                event_loop().inject(std::bind(&decref, ptr()));
-#else
-                event_loop().inject(*new inject_decref(ptr()));
-#endif
-            } else {
-                decref(ptr());
-            }
-        }
-    }
-
-    /// Get the event loop for this object.
-    class event_loop& event_loop() { return event_loop::get(ptr()); }
-
-    /// Get the thread-unsafe proton object wrapped by this thread_safe<T>
-    T unsafe() { return T(ptr()); }
-
-  private:
-    static thread_safe* create(const T& obj) { return new (obj.pn_object()) thread_safe(); }
-    static void* operator new(size_t, pn_type* p) { return p; }
-    static void operator delete(void*, pn_type*) {}
-    thread_safe() { incref(ptr()); }
-    pn_type* ptr() { return reinterpret_cast<pn_type*>(this); }
-
-
-    // Non-copyable.
-    thread_safe(const thread_safe&);
-    thread_safe& operator=(const thread_safe&);
-
-    /// @cond INTERNAL
-  friend class returned<T>;
-    /// @endcond
-};
-
-// A return value for functions returning a thread_safe<> object.
-//
-// Temporary return value only, you should release() to get a plain pointer or
-// assign to a smart pointer type.
-template <class T>
-class returned : private internal::endpoint_traits<T>
-{
-  public:
-    /// Take ownership
-    explicit returned(thread_safe<T>* p) : ptr_(p) {}
-    /// Create an owned thread_safe<T>
-    explicit returned(const T& obj) : ptr_(thread_safe<T>::create(obj)) {}
-    /// Transfer ownership.
-    /// Use the same "cheat" as std::auto_ptr, calls x.release() even though x is const.
-    returned(const returned& x) : ptr_(const_cast<returned&>(x).release()) {}
-    /// Delete if still owned.
-    ~returned() { if (ptr_) delete ptr_; }
-
-    /// Release ownership.
-    thread_safe<T>* release() const { thread_safe<T>* p = ptr_; ptr_ = 0; return p; }
-
-    /// Get the raw pointer, caller must not delete.
-    thread_safe<T>* get() const { return ptr_; }
-
-    /// Implicit conversion to target, usable only in a safe context.
-    operator T() { return ptr_->unsafe(); }
-
-#if PN_CPP_HAS_SHARED_PTR
-    /// Release to a std::shared_ptr
-    operator std::shared_ptr<thread_safe<T> >() {
-        return std::shared_ptr<thread_safe<T> >(release());
-    }
-#endif
-#if PN_CPP_HAS_UNIQUE_PTR
-    /// Release to a std::unique_ptr
-    operator std::unique_ptr<thread_safe<T> >() {
-        return std::unique_ptr<thread_safe<T> >(release());
-    }
-#endif
-
-  private:
-    void operator=(const returned&);
-    mutable thread_safe<T>* ptr_;
-};
-
-/// Make a thread-safe wrapper for `obj`.
-template <class T> returned<T> make_thread_safe(const T& obj) { return returned<T>(obj); }
-
-#if PN_CPP_HAS_SHARED_PTR
-/// Create a thread-safe shared_ptr to `obj`.
-template <class T> std::shared_ptr<thread_safe<T> > make_shared_thread_safe(const T& obj) {
-    return make_thread_safe(obj);
-}
-#endif
-#if PN_CPP_HAS_UNIQUE_PTR
-/// Create a thread-safe unique_ptr to `obj`.
-template <class T> std::unique_ptr<thread_safe<T> > make_unique_thread_safe(const T& obj) {
-    return make_thread_safe(obj);
-}
-
-#endif
-
-} // proton
-
-#endif // PROTON_THREAD_SAFE_HPP
diff --git a/proton-c/bindings/cpp/include/proton/timestamp.hpp b/proton-c/bindings/cpp/include/proton/timestamp.hpp
deleted file mode 100644
index 6e4281b..0000000
--- a/proton-c/bindings/cpp/include/proton/timestamp.hpp
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef PROTON_TIMESTAMP_HPP
-#define PROTON_TIMESTAMP_HPP
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "./duration.hpp"
-
-#include <proton/type_compat.h>
-
-namespace proton {
-
-/// A 64-bit timestamp in milliseconds since the Unix epoch.
-///    
-/// The dawn of the Unix epoch was 00:00:00 (UTC), 1 January 1970.
-class timestamp : private internal::comparable<timestamp> {
-  public:
-    /// A numeric type holding a milliseconds value.
-    typedef int64_t numeric_type;
-
-    /// The current wall-clock time.
-    PN_CPP_EXTERN static timestamp now();
-
-    /// Construct from milliseconds.
-    explicit timestamp(numeric_type ms = 0) : ms_(ms) {}
-
-    /// Assign from milliseconds.
-    timestamp& operator=(numeric_type ms) { ms_ = ms; return *this; }
-
-    /// Get milliseconds.
-    numeric_type milliseconds() const { return ms_; }
-
-  private:
-    numeric_type ms_;
-};
-
-/// @name Comparison and arithmetic operators
-/// @{
-inline bool operator==(timestamp x, timestamp y) { return x.milliseconds() == y.milliseconds(); }
-inline bool operator<(timestamp x, timestamp y) { return x.milliseconds() < y.milliseconds(); }
-
-inline timestamp operator+(timestamp ts, duration d) { return timestamp(ts.milliseconds() + d.milliseconds()); }
-inline duration operator-(timestamp t0, timestamp t1) { return duration(t0.milliseconds() - t1.milliseconds()); }
-inline timestamp operator+(duration d, timestamp ts) { return ts + d; }
-/// @}
-
-/// Printable format.
-PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, timestamp);
-
-} // proton
-
-#endif // PROTON_TIMESTAMP_HPP
diff --git a/proton-c/bindings/cpp/include/proton/tracker.hpp b/proton-c/bindings/cpp/include/proton/tracker.hpp
deleted file mode 100644
index 408b04d..0000000
--- a/proton-c/bindings/cpp/include/proton/tracker.hpp
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef PROTON_TRACKER_HPP
-#define PROTON_TRACKER_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./internal/export.hpp"
-#include "./transfer.hpp"
-
-struct pn_delivery_t;
-
-namespace proton {
-
-/// A tracker for a sent message. Every tracker exists within the
-/// context of a sender.
-///
-/// A delivery attempt can fail. As a result, a particular message may
-/// correspond to multiple trackers.
-class tracker : public transfer {
-    /// @cond INTERNAL
-    tracker(pn_delivery_t* d);
-    /// @endcond
-
-  public:
-    /// Create an empty tracker.
-    tracker() {}
-
-    /// Get the sender for this tracker.
-    PN_CPP_EXTERN class sender sender() const;
-
-    // @cond INTERNAL
-  friend class internal::factory<tracker>;
-    // @endcond
-};
-
-} // proton
-
-#endif // PROTON_TRACKER_HPP
diff --git a/proton-c/bindings/cpp/include/proton/transfer.hpp b/proton-c/bindings/cpp/include/proton/transfer.hpp
deleted file mode 100644
index ea073f6..0000000
--- a/proton-c/bindings/cpp/include/proton/transfer.hpp
+++ /dev/null
@@ -1,80 +0,0 @@
-#ifndef PROTON_TRANSFER_HPP
-#define PROTON_TRANSFER_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./internal/export.hpp"
-#include "./internal/object.hpp"
-
-#include <proton/disposition.h>
-
-struct pn_delivery_t;
-
-namespace proton {
-
-/// The base class for delivery and tracker.
-class transfer : public internal::object<pn_delivery_t> {
-    /// @cond INTERNAL
-    transfer(pn_delivery_t* d) : internal::object<pn_delivery_t>(d) {}
-    /// @endcond
-
-  public:
-    /// Create an empty transfer.
-    transfer() : internal::object<pn_delivery_t>(0) {}
-
-    /// Delivery state values.
-    enum state {
-        NONE = 0,               ///< Unknown state
-        RECEIVED = PN_RECEIVED, ///< Received but not yet settled
-        ACCEPTED = PN_ACCEPTED, ///< Settled as accepted
-        REJECTED = PN_REJECTED, ///< Settled as rejected
-        RELEASED = PN_RELEASED, ///< Settled as released
-        MODIFIED = PN_MODIFIED  ///< Settled as modified
-    }; // AMQP spec 3.4 delivery State
-
-    /// Get the remote state for a delivery.
-    PN_CPP_EXTERN enum state state() const;
-
-    /// Return the session for this transfer.
-    PN_CPP_EXTERN class session session() const;
-
-    /// Return the connection for this transfer.
-    PN_CPP_EXTERN class connection connection() const;
-
-    /// Return the container for this transfer.
-    PN_CPP_EXTERN class container &container() const;
-
-    /// Settle the delivery; informs the remote end.
-    PN_CPP_EXTERN void settle();
-
-    /// Return true if the transfer has been settled.
-    PN_CPP_EXTERN bool settled() const;
-
-    /// @cond INTERNAL
-  friend class internal::factory<transfer>;
-    /// @endcond
-};
-
-} // proton
-
-#endif // PROTON_TRANSFER_HPP
diff --git a/proton-c/bindings/cpp/include/proton/transport.hpp b/proton-c/bindings/cpp/include/proton/transport.hpp
deleted file mode 100644
index 614eff2..0000000
--- a/proton-c/bindings/cpp/include/proton/transport.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef PROTON_TRANSPORT_HPP
-#define PROTON_TRANSPORT_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./fwd.hpp"
-#include "./internal/export.hpp"
-#include "./internal/object.hpp"
-
-struct pn_transport_t;
-
-namespace proton {
-
-/// A network channel supporting an AMQP connection.
-class transport : public internal::object<pn_transport_t> {
-    /// @cond INTERNAL
-    transport(pn_transport_t* t) : internal::object<pn_transport_t>(t) {}
-    /// @endcond 
-
-  public:
-    /// Create an empty transport.
-    transport() : internal::object<pn_transport_t>(0) {}
-
-    /// Get the connection associated with this transport.
-    PN_CPP_EXTERN class connection connection() const;
-
-    /// Get SSL information.
-    PN_CPP_EXTERN class ssl ssl() const;
-
-    /// Get SASL information.
-    PN_CPP_EXTERN class sasl sasl() const;
-
-    /// Get the error condition.
-    PN_CPP_EXTERN class error_condition error() const;
-
-    /// @cond INTERNAL
-    friend class internal::factory<transport>;
-    /// @endcond
-};
-
-} // proton
-
-#endif // PROTON_TRANSPORT_HPP
diff --git a/proton-c/bindings/cpp/include/proton/type_id.hpp b/proton-c/bindings/cpp/include/proton/type_id.hpp
deleted file mode 100644
index 4460eb6..0000000
--- a/proton-c/bindings/cpp/include/proton/type_id.hpp
+++ /dev/null
@@ -1,92 +0,0 @@
-#ifndef PROTON_TYPE_ID_HPP
-#define PROTON_TYPE_ID_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/// @file
-///
-/// Type-identifiers for AMQP types.
-
-#include "./internal/export.hpp"
-
-#include <proton/codec.h>
-
-#include <string>
-
-namespace proton {
-
-/// An identifier for AMQP types.
-enum type_id {
-    NULL_TYPE = PN_NULL,          ///< The null type, contains no data.
-    BOOLEAN = PN_BOOL,            ///< Boolean true or false.
-    UBYTE = PN_UBYTE,             ///< Unsigned 8-bit integer.
-    BYTE = PN_BYTE,               ///< Signed 8-bit integer.
-    USHORT = PN_USHORT,           ///< Unsigned 16-bit integer.
-    SHORT = PN_SHORT,             ///< Signed 16-bit integer.
-    UINT = PN_UINT,               ///< Unsigned 32-bit integer.
-    INT = PN_INT,                 ///< Signed 32-bit integer.
-    CHAR = PN_CHAR,               ///< 32-bit unicode character.
-    ULONG = PN_ULONG,             ///< Unsigned 64-bit integer.
-    LONG = PN_LONG,               ///< Signed 64-bit integer.
-    TIMESTAMP = PN_TIMESTAMP,     ///< Signed 64-bit milliseconds since the epoch.
-    FLOAT = PN_FLOAT,             ///< 32-bit binary floating point.
-    DOUBLE = PN_DOUBLE,           ///< 64-bit binary floating point.
-    DECIMAL32 = PN_DECIMAL32,     ///< 32-bit decimal floating point.
-    DECIMAL64 = PN_DECIMAL64,     ///< 64-bit decimal floating point.
-    DECIMAL128 = PN_DECIMAL128,   ///< 128-bit decimal floating point.
-    UUID = PN_UUID,               ///< 16-byte UUID.
-    BINARY = PN_BINARY,           ///< Variable-length sequence of bytes.
-    STRING = PN_STRING,           ///< Variable-length utf8-encoded string.
-    SYMBOL = PN_SYMBOL,           ///< Variable-length encoded string.
-    DESCRIBED = PN_DESCRIBED,     ///< A descriptor and a value.
-    ARRAY = PN_ARRAY,             ///< A sequence of values of the same type.
-    LIST = PN_LIST,               ///< A sequence of values of mixed types.
-    MAP = PN_MAP                  ///< A sequence of key-value pairs.
-};
-
-/// Get the name of the AMQP type.
-PN_CPP_EXTERN std::string type_name(type_id);
-
-/// Print the type name.
-PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, type_id);
-
-/// Throw a conversion_error if want != got with a message including
-/// the names of the types.
-PN_CPP_EXTERN void assert_type_equal(type_id want, type_id got);
-
-/// @name Test the properties of a type_id.
-/// @{
-inline bool type_id_is_signed_int(type_id t) { return t == BYTE || t == SHORT || t == INT || t == LONG; }
-inline bool type_id_is_unsigned_int(type_id t) { return t == UBYTE || t == USHORT || t == UINT || t == ULONG; }
-inline bool type_id_is_integral(type_id t) { return t == BOOLEAN || t == CHAR || t == TIMESTAMP || type_id_is_unsigned_int(t) || type_id_is_signed_int(t); }
-inline bool type_id_is_floating_point(type_id t) { return t == FLOAT || t == DOUBLE; }
-inline bool type_id_is_decimal(type_id t) { return t == DECIMAL32 || t == DECIMAL64 || t == DECIMAL128; }
-inline bool type_id_is_signed(type_id t) { return type_id_is_signed_int(t) || type_id_is_floating_point(t) || type_id_is_decimal(t); }
-inline bool type_id_is_string_like(type_id t) { return t == BINARY || t == STRING || t == SYMBOL; }
-inline bool type_id_is_container(type_id t) { return t == LIST || t == MAP || t == ARRAY || t == DESCRIBED; }
-inline bool type_id_is_scalar(type_id t) { return type_id_is_integral(t) || type_id_is_floating_point(t) || type_id_is_decimal(t) || type_id_is_string_like(t) || t == TIMESTAMP || t == UUID; }
-inline bool type_id_is_null(type_id t) { return t == NULL_TYPE; }
-/// }
-
-} // proton
-
-#endif // PROTON_TYPE_ID_HPP
diff --git a/proton-c/bindings/cpp/include/proton/types.hpp b/proton-c/bindings/cpp/include/proton/types.hpp
deleted file mode 100644
index d21cb8f..0000000
--- a/proton-c/bindings/cpp/include/proton/types.hpp
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef PROTON_TYPES_HPP
-#define PROTON_TYPES_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/// @file
-///
-/// Include the definitions of all proton types used to represent AMQP
-/// types.
-
-// TODO aconway 2016-03-15: described types, described arrays.
-
-#include "./internal/config.hpp"
-
-#include "./annotation_key.hpp"
-#include "./binary.hpp"
-#include "./codec/deque.hpp"
-#include "./codec/list.hpp"
-#include "./codec/map.hpp"
-#include "./codec/vector.hpp"
-#include "./decimal.hpp"
-#include "./duration.hpp"
-#include "./message_id.hpp"
-#include "./scalar.hpp"
-#include "./symbol.hpp"
-#include "./timestamp.hpp"
-#include "./types_fwd.hpp"
-#include "./uuid.hpp"
-#include "./value.hpp"
-
-#if PN_CPP_HAS_CPP11
-#include "./codec/forward_list.hpp"
-#include "./codec/unordered_map.hpp"
-#endif
-
-#endif // PROTON_TYPES_HPP
diff --git a/proton-c/bindings/cpp/include/proton/types_fwd.hpp b/proton-c/bindings/cpp/include/proton/types_fwd.hpp
deleted file mode 100644
index ff53b0c..0000000
--- a/proton-c/bindings/cpp/include/proton/types_fwd.hpp
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef PROTON_TYPES_FWD_HPP
-#define PROTON_TYPES_FWD_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/// @file
-///
-/// Forward declarations for all the C++ types used by Proton to
-/// represent AMQP types.
-
-#include "./internal/config.hpp"
-
-#if PN_CPP_HAS_NULLPTR
-#include <cstddef>
-#endif
-
-namespace proton {
-
-class binary;
-class decimal128;
-class decimal32;
-class decimal64;
-class scalar;
-class symbol;
-class timestamp;
-class duration;
-class uuid;
-class value;
-
-struct null {
-    null() {}
-#if PN_CPP_HAS_NULLPTR
-    null(std::nullptr_t) {}
-#endif
-};
-
-} // proton
-
-#endif // PROTON_TYPES_FWD_HPP
diff --git a/proton-c/bindings/cpp/include/proton/url.hpp b/proton-c/bindings/cpp/include/proton/url.hpp
deleted file mode 100644
index b94b24d..0000000
--- a/proton-c/bindings/cpp/include/proton/url.hpp
+++ /dev/null
@@ -1,147 +0,0 @@
-#ifndef PROTON_URL_HPP
-#define PROTON_URL_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./internal/pn_unique_ptr.hpp"
-#include "./error.hpp"
-
-#include <proton/type_compat.h>
-
-#include <iosfwd>
-#include <string>
-
-namespace proton {
-
-/// An error encountered during URL parsing.
-struct
-PN_CPP_CLASS_EXTERN url_error : public error {
-    /// @cond INTERNAL
-    /// Construct a URL error with a message.
-    PN_CPP_EXTERN explicit url_error(const std::string&);
-    /// @endcond
-};
-
-/// A URL parser.
-///
-///  Proton URLs take the form
-/// `<scheme>://<username>:<password>@<host>:<port>/<path>`.
-///
-/// - Scheme can be `amqp` or `amqps`.  Host is a DNS name or IP
-///   address (v4 or v6).
-///
-/// - Port can be a number or a symbolic service name such as `amqp`.
-///
-/// - Path is normally used as a link source or target address.  On a
-///   broker it typically corresponds to a queue or topic name.
-class url {
-  public:
-    static const std::string AMQP;     ///< "amqp" prefix
-    static const std::string AMQPS;    ///< "amqps" prefix
-
-    // XXX No constructor for an empty URL?
-    // XXX What is the default 'defaults' behavior?
-
-    /// Parse `url_str` as an AMQP URL.
-    ///
-    /// @note Converts automatically from string.
-    /// @throw url_error if URL is invalid.
-    PN_CPP_EXTERN url(const std::string& url_str);
-
-    /// @cond INTERNAL
-    /// XXX I want to understand why this is important to keep.
-    ///
-    /// **Experimental** - Parse `url_str` as an AMQP URL. If
-    /// `defaults` is true, fill in defaults for missing values.
-    /// Otherwise, return an empty string for missing values.
-    ///
-    /// @note Converts automatically from string.
-    /// @throw url_error if URL is invalid.
-    PN_CPP_EXTERN url(const std::string& url_str, bool defaults);
-    /// @endcond
-
-    /// Copy a URL.
-    PN_CPP_EXTERN url(const url&);
-
-    PN_CPP_EXTERN ~url();
-
-    /// Copy a URL.
-    PN_CPP_EXTERN url& operator=(const url&);
-
-    /// True if the URL is empty.
-    PN_CPP_EXTERN bool empty() const;
-
-    /// Returns the URL as a string
-    PN_CPP_EXTERN operator std::string() const;
-
-    /// @name URL fields
-    ///
-    /// @{
-
-    /// `amqp` or `amqps`.
-    PN_CPP_EXTERN std::string scheme() const;
-    /// The user name for authentication.
-    PN_CPP_EXTERN std::string user() const;
-    // XXX Passwords in URLs are dumb.
-    /// The password.
-    PN_CPP_EXTERN std::string password() const;
-    /// The host name or IP address.
-    PN_CPP_EXTERN std::string host() const;
-    /// `port` can be a number or a symbolic name such as "amqp".
-    PN_CPP_EXTERN std::string port() const;
-    /// `port_int` is the numeric value of the port.
-    PN_CPP_EXTERN uint16_t port_int() const;
-    /// host_port returns just the `host:port` part of the URL
-    PN_CPP_EXTERN std::string host_port() const;
-
-    // XXX is this not confusing (or incorrect)?  The path starts with
-    // the first / after //.
-    /// `path` is everything after the final "/".
-    PN_CPP_EXTERN std::string path() const;
-
-    /// @}
-
-    /// Return URL as a string.
-    friend PN_CPP_EXTERN std::string to_string(const url&);
-
-  private:
-    struct impl;
-    internal::pn_unique_ptr<impl> impl_;
-
-    /// @cond INTERNAL
-
-  friend PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const url&);
-
-    // XXX Why is it important to have this?
-    /// Parse `url` from istream.  This automatically fills in
-    /// defaults for missing values.
-    ///
-    /// @note An invalid url is indicated by setting
-    /// std::stream::fail(), NOT by throwing url_error.
-  friend PN_CPP_EXTERN std::istream& operator>>(std::istream&, url&);
-
-    /// @endcond
-};
-
-} // proton
-
-#endif // PROTON_URL_HPP
diff --git a/proton-c/bindings/cpp/include/proton/uuid.hpp b/proton-c/bindings/cpp/include/proton/uuid.hpp
deleted file mode 100644
index a60c944..0000000
--- a/proton-c/bindings/cpp/include/proton/uuid.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef PROTON_UUID_HPP
-#define PROTON_UUID_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./internal/export.hpp"
-#include "./byte_array.hpp"
-
-#include <string>
-#include <iosfwd>
-
-namespace proton {
-
-/// A 16-byte universally unique identifier.
-class uuid : public byte_array<16> {
-  public:
-    /// Make a copy.
-    PN_CPP_EXTERN static uuid copy();
-
-    /// Return a uuid copied from bytes.  Bytes must point to at least
-    /// 16 bytes.  If `bytes == 0` the UUID is zero-initialized.
-    PN_CPP_EXTERN static uuid copy(const char* bytes);
-
-    /// Return a simple randomly-generated UUID.  This is used by the
-    /// Proton library to generate default UUIDs.
-    ///
-    /// For specific security, performance, or uniqueness
-    /// requirements, you may want to use a better UUID generator or
-    /// some other form of identifier entirely.
-    PN_CPP_EXTERN static uuid random();
-
-    /// UUID standard string format: 8-4-4-4-12 (36 chars, 32
-    /// alphanumeric chars and 4 hypens).
-    PN_CPP_EXTERN std::string str()  const;
-};
-
-/// UUID standard format: 8-4-4-4-12 (36 chars, 32 alphanumeric chars
-/// and 4 hypens).
-PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const uuid&);
-
-} // proton
-
-#endif // PROTON_UUID_HPP
diff --git a/proton-c/bindings/cpp/include/proton/value.hpp b/proton-c/bindings/cpp/include/proton/value.hpp
deleted file mode 100644
index 3ac1763..0000000
--- a/proton-c/bindings/cpp/include/proton/value.hpp
+++ /dev/null
@@ -1,207 +0,0 @@
-#ifndef PROTON_VALUE_HPP
-#define PROTON_VALUE_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "./codec/encoder.hpp"
-#include "./codec/decoder.hpp"
-#include "./internal/type_traits.hpp"
-#include "./scalar.hpp"
-#include "./types_fwd.hpp"
-
-#include <proton/type_compat.h>
-
-#include <iosfwd>
-
-namespace proton {
-
-namespace internal {
-
-// Separate value data from implicit conversion constructors to avoid template recursion.
-class value_base {
-  protected:
-    internal::data& data();
-    internal::data data_;
-
-  friend class value_ref;
-  friend class codec::encoder;
-  friend class codec::decoder;
-};
-
-} // internal
-
-/// A holder for any AMQP value, simple or complex.
-///
-/// @see @ref types_page
-class value : public internal::value_base, private internal::comparable<value> {
-  private:
-    // Enabler for encodable types excluding proton::value.
-    template<class T, class U=void> struct assignable :
-        public internal::enable_if<codec::is_encodable<T>::value, U> {};
-    template<class U> struct assignable<value, U> {};
-
-  public:
-    /// Create a null value
-    PN_CPP_EXTERN value();
-
-    /// @name Copy a value
-    /// @{
-    PN_CPP_EXTERN value(const value&);
-    PN_CPP_EXTERN value& operator=(const value&);
-#if PN_CPP_HAS_RVALUE_REFERENCES
-    PN_CPP_EXTERN value(value&&);
-    PN_CPP_EXTERN value& operator=(value&&);
-#endif
-    /// @}
-
-    /// Construct from any allowed type T.
-    template <class T> value(const T& x, typename assignable<T>::type* = 0) { *this = x; }
-
-    /// Assign from any allowed type T.
-    template <class T> typename assignable<T, value&>::type operator=(const T& x) {
-        codec::encoder e(*this);
-        e << x;
-        return *this;
-    }
-
-    /// Get the type ID for the current value.
-    PN_CPP_EXTERN type_id type() const;
-
-    /// True if the value is null
-    PN_CPP_EXTERN bool empty() const;
-
-
-    /// Reset the value to null/empty
-    PN_CPP_EXTERN void clear();
-
-    /// @cond INTERNAL (deprecated)
-    template<class T> void get(T &t) const;
-    template<class T> T get() const;
-    PN_CPP_EXTERN int64_t as_int() const;
-    PN_CPP_EXTERN uint64_t as_uint() const;
-    PN_CPP_EXTERN double as_double() const;
-    PN_CPP_EXTERN std::string as_string() const;
-    /// @endcond
-
-    /// swap values
-  friend PN_CPP_EXTERN void swap(value&, value&);
-
-    /// @name Comparison operators
-    /// @{
-  friend PN_CPP_EXTERN bool operator==(const value& x, const value& y);
-  friend PN_CPP_EXTERN bool operator<(const value& x, const value& y);
-    ///@}
-
-    /// If contained value is a scalar type T, print using operator<<(T)
-    ///
-    /// Complex types are printed in a non-standard human-readable format but
-    /// that may change in future so should not be parsed.
-  friend PN_CPP_EXTERN std::ostream& operator<<(std::ostream&, const value&);
-};
-
-namespace internal {
-
-// value_ref is a `pn_data_t* p` that can be returned as a value& and used to modify
-// the underlying value in-place.
-//
-// Classes with a value_ref member can return it as a value& in accessor functions.
-// It can also be used to copy a pn_data_t* p to a proton::value via: value(value_ref(p));
-// None of the constructors make copies, they just refer to the same value.
-//
-class value_ref : public value {
-  public:
-    value_ref(pn_data_t* = 0);
-    value_ref(const internal::data&);
-    value_ref(const value_base&);
-
-    // Use refer() not operator= to avoid confusion with value op=
-    void refer(pn_data_t*);
-    void refer(const internal::data&);
-    void refer(const value_base&);
-
-    // Reset to refer to nothing, release existing references. Equivalent to refer(0).
-    void reset();
-
-    // Assignments to value_ref means assigning to the value.
-    template <class T> value_ref& operator=(const T& x) {
-        static_cast<value&>(*this) = x;
-        return *this;
-    }
-};
-
-}
-
-
-/// @copydoc scalar::get
-/// @related proton::value
-template<class T> T get(const value& v) { T x; get(v, x); return x; }
-
-/// Like get(const value&) but assigns the value to a reference
-/// instead of returning it.  May be more efficient for complex values
-/// (arrays, maps, etc.)
-///
-/// @related proton::value
-template<class T> void get(const value& v, T& x) { codec::decoder d(v, true); d >> x; }
-
-/// @related proton::value
-template<class T, class U> inline void get(const U& u, T& x) { const value v(u); get(v, x); }
-
-/// @copydoc scalar::coerce
-/// @related proton::value
-template<class T> T coerce(const value& v) { T x; coerce(v, x); return x; }
-
-/// Like coerce(const value&) but assigns the value to a reference
-/// instead of returning it.  May be more efficient for complex values
-/// (arrays, maps, etc.)
-///
-/// @related proton::value
-template<class T> void coerce(const value& v, T& x) {
-    codec::decoder d(v, false);
-    if (type_id_is_scalar(v.type())) {
-        scalar s;
-        d >> s;
-        x = internal::coerce<T>(s);
-    } else {
-        d >> x;
-    }
-}
-
-/// Special case for get<null>(), just checks that value contains NULL.
-template<> inline void get<null>(const value& v, null&) {
-    assert_type_equal(NULL_TYPE, v.type());
-}
-
-/// Return a readable string representation of x for display purposes.
-PN_CPP_EXTERN std::string to_string(const value& x);
-
-/// @cond INTERNAL
-template<class T> void value::get(T &x) const { x = proton::get<T>(*this); }
-template<class T> T value::get() const { return proton::get<T>(*this); }
-inline int64_t value::as_int() const { return proton::coerce<int64_t>(*this); }
-inline uint64_t value::as_uint() const { return proton::coerce<uint64_t>(*this); }
-inline double value::as_double() const { return proton::coerce<double>(*this); }
-inline std::string value::as_string() const { return proton::coerce<std::string>(*this); }
-/// @endcond
-
-} // proton
-
-#endif // PROTON_VALUE_HPP
diff --git a/proton-c/bindings/cpp/libqpid-proton-cpp.pc.in b/proton-c/bindings/cpp/libqpid-proton-cpp.pc.in
deleted file mode 100644
index 4b556f4..0000000
--- a/proton-c/bindings/cpp/libqpid-proton-cpp.pc.in
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-prefix=@PREFIX@
-exec_prefix=@EXEC_PREFIX@
-libdir=@LIBDIR@
-includedir=@INCLUDEDIR@
-
-Name: Proton C++
-Description: Qpid Proton C++ library
-Version: @PN_VERSION@
-URL: http://qpid.apache.org/proton/
-Libs: -L${libdir} -lqpid-proton-cpp
-Cflags: -I${includedir}
diff --git a/proton-c/bindings/cpp/src/binary.cpp b/proton-c/bindings/cpp/src/binary.cpp
deleted file mode 100644
index fb366f0..0000000
--- a/proton-c/bindings/cpp/src/binary.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "types_internal.hpp"
-
-#include "proton/binary.hpp"
-
-#include <ostream>
-#include <iomanip>
-
-#include <ctype.h>
-
-namespace proton {
-
-std::ostream& operator<<(std::ostream& o, const binary& x) {
-    ios_guard restore_flags(o);
-    o << std::hex << std::setfill('0') << "b\"";
-    for (binary::const_iterator i = x.begin(); i != x.end(); ++i) {
-        if (!isprint(*i) && !isspace(*i)) { // Non-printables in hex.
-            o << "\\x" << std::setw(2) << printable_byte(*i);
-        } else {
-            o << char(*i);
-        }
-    }
-    return o << '"';
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/byte_array.cpp b/proton-c/bindings/cpp/src/byte_array.cpp
deleted file mode 100644
index cd6bb1b..0000000
--- a/proton-c/bindings/cpp/src/byte_array.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-#include "types_internal.hpp"
-
-#include "proton/byte_array.hpp"
-
-#include <ostream>
-#include <iomanip>
-
-namespace proton {
-namespace internal {
-
-void print_hex(std::ostream& o, const uint8_t* p, size_t n) {
-    ios_guard restore_flags(o);
-    o << "0x" << std::hex << std::setfill('0');
-    for (size_t i = 0; i < n; ++i) {
-        o << std::setw(2) << printable_byte(p[i]);
-    }
-}
-
-}}
diff --git a/proton-c/bindings/cpp/src/cached_map.cpp b/proton-c/bindings/cpp/src/cached_map.cpp
deleted file mode 100644
index 5411aa1..0000000
--- a/proton-c/bindings/cpp/src/cached_map.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/internal/cached_map.hpp"
-
-#include "proton/annotation_key.hpp"
-#include "proton/scalar.hpp"
-#include "proton/value.hpp"
-#include "proton/codec/decoder.hpp"
-#include "proton/codec/encoder.hpp"
-#include "proton/codec/map.hpp"
-
-#include <map>
-#include <string>
-
-namespace proton {
-namespace internal {
-
- // use std::map as the actual cached_map implementation type
-template <class K, class V>
-class map_type_impl : public std::map<K, V> {};
-
-template <class K, class V>
-cached_map<K,V>::cached_map() {}
-template <class K, class V>
-cached_map<K,V>::cached_map(const cached_map& cm) { if ( !cm.map_ ) return;  map_.reset(new map_type(*cm.map_)); }
-template <class K, class V>
-cached_map<K,V>& cached_map<K,V>::operator=(const cached_map& cm) {
-    if (&cm != this) {
-        cached_map<K,V> t;
-        map_type *m = !cm.map_ ? 0 : new map_type(*cm.map_);
-        t.map_.reset(map_.release());
-        map_.reset(m);
-    }
-    return *this;
-}
-
-template <class K, class V>
-#if PN_CPP_HAS_RVALUE_REFERENCES
-cached_map<K,V>::cached_map(cached_map&& cm) : map_(std::move(cm.map_)) {}
-template <class K, class V>
-cached_map<K,V>& cached_map<K,V>::operator=(cached_map&& cm) { map_.reset(cm.map_.release()); return *this; }
-template <class K, class V>
-#endif
-cached_map<K,V>::~cached_map() {}
-
-template <class K, class V>
-V cached_map<K,V>::get(const K& k) const {
-  if ( !map_ ) return V();
-  typename map_type::const_iterator i = map_->find(k);
-  if ( i==map_->end() ) return V();
-  return i->second;
-}
-template <class K, class V>
-void cached_map<K,V>::put(const K& k, const V& v) {
-  if ( !map_ ) make_cached_map();
-  (*map_)[k] = v;
-}
-template <class K, class V>
-size_t cached_map<K,V>::erase(const K& k) {
-  if ( !map_ ) return 0;
-  return map_->erase(k);
-}
-template <class K, class V>
-bool cached_map<K,V>::exists(const K& k) const {
-  if ( !map_ ) return false;
-  return map_->count(k) > 0;
-}
-
-template <class K, class V>
-size_t cached_map<K,V>::size() {
-  if ( !map_ ) return 0;
-  return map_->size();
-}
-template <class K, class V>
-void cached_map<K,V>::clear() {
-  map_.reset();
-}
-template <class K, class V>
-bool cached_map<K,V>::empty() {
-  if ( !map_ ) return true;
-  return map_->empty();
-}
-
-template <class K, class V>
-void cached_map<K,V>::make_cached_map() { map_.reset(new map_type); }
-
-template <class K, class V>
-PN_CPP_EXTERN proton::codec::decoder& operator>>(proton::codec::decoder& d, cached_map<K,V>& m) {
-  if ( !m.map_ ) m.make_cached_map();
-  return d >> *(m.map_);
-}
-template <class K, class V>
-PN_CPP_EXTERN proton::codec::encoder& operator<<(proton::codec::encoder& e, const cached_map<K,V>& m) {
-  if ( !m.map_ ) return e;
-  return e << *(m.map_);
-}
-
-// Force the necessary template instantiations so that the library exports the correct symbols
-template class PN_CPP_CLASS_EXTERN cached_map<std::string, scalar>;
-template class PN_CPP_CLASS_EXTERN cached_map<annotation_key, value>;
-template class PN_CPP_CLASS_EXTERN cached_map<symbol, value>;
-
-template proton::codec::decoder& operator>> <>(proton::codec::decoder& d, cached_map<std::string, scalar>& m);
-template proton::codec::encoder& operator<< <>(proton::codec::encoder& e, const cached_map<std::string, scalar>& m);
-template proton::codec::decoder& operator>> <>(proton::codec::decoder& d, cached_map<annotation_key, value>& m);
-template proton::codec::encoder& operator<< <>(proton::codec::encoder& e, const cached_map<annotation_key, value>& m);
-template proton::codec::decoder& operator>> <>(proton::codec::decoder& d, cached_map<symbol, value>& m);
-template proton::codec::encoder& operator<< <>(proton::codec::encoder& e, const cached_map<symbol, value>& m);
-
-}
-}
diff --git a/proton-c/bindings/cpp/src/codec_test.cpp b/proton-c/bindings/cpp/src/codec_test.cpp
deleted file mode 100644
index 7791749..0000000
--- a/proton-c/bindings/cpp/src/codec_test.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "test_bits.hpp"
-
-#include "proton/internal/data.hpp"
-#include "proton/internal/config.hpp"
-#include "proton/types.hpp"
-
-namespace {
-
-using namespace proton;
-
-template <class T> void  simple_type_test(const T& x) {
-    ASSERT(codec::is_encodable<T>::value);
-    value v;
-    codec::encoder e(v);
-    e << x;
-    T y;
-    codec::decoder d(v);
-    d >> y;
-    ASSERT_EQUAL(x, y);
-}
-
-template <class T> T make_fill(const char c) {
-    T x; std::fill(x.begin(), x.end(), c);
-    return x;
-}
-
-template <class T> void  uncodable_type_test() {
-    ASSERT(!codec::is_encodable<T>::value);
-}
-
-}
-
-int main(int, char**) {
-    int failed = 0;
-
-    // Basic AMQP types
-    RUN_TEST(failed, simple_type_test(false));
-    RUN_TEST(failed, simple_type_test(uint8_t(42)));
-    RUN_TEST(failed, simple_type_test(int8_t(-42)));
-    RUN_TEST(failed, simple_type_test(uint16_t(4242)));
-    RUN_TEST(failed, simple_type_test(int16_t(-4242)));
-    RUN_TEST(failed, simple_type_test(uint32_t(4242)));
-    RUN_TEST(failed, simple_type_test(int32_t(-4242)));
-    RUN_TEST(failed, simple_type_test(uint64_t(4242)));
-    RUN_TEST(failed, simple_type_test(int64_t(-4242)));
-    RUN_TEST(failed, simple_type_test(wchar_t('X')));
-    RUN_TEST(failed, simple_type_test(float(1.234)));
-    RUN_TEST(failed, simple_type_test(double(11.2233)));
-    RUN_TEST(failed, simple_type_test(timestamp(1234)));
-    RUN_TEST(failed, simple_type_test(make_fill<decimal32>(0)));
-    RUN_TEST(failed, simple_type_test(make_fill<decimal64>(0)));
-    RUN_TEST(failed, simple_type_test(make_fill<decimal128>(0)));
-    RUN_TEST(failed, simple_type_test(uuid::copy("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff")));
-    RUN_TEST(failed, simple_type_test(std::string("xxx")));
-    RUN_TEST(failed, simple_type_test(symbol("aaa")));
-    RUN_TEST(failed, simple_type_test(binary("aaa")));
-
-    // Native int type that may map differently per platform to uint types.
-    RUN_TEST(failed, simple_type_test(char(42)));
-    RUN_TEST(failed, simple_type_test(short(42)));
-    RUN_TEST(failed, simple_type_test(int(42)));
-    RUN_TEST(failed, simple_type_test(long(42)));
-
-    RUN_TEST(failed, simple_type_test(static_cast<signed char>(42)));
-    RUN_TEST(failed, simple_type_test(static_cast<signed short>(42)));
-    RUN_TEST(failed, simple_type_test(static_cast<signed int>(42)));
-    RUN_TEST(failed, simple_type_test(static_cast<signed long>(42)));
-
-    RUN_TEST(failed, simple_type_test(static_cast<unsigned char>(42)));
-    RUN_TEST(failed, simple_type_test(static_cast<unsigned short>(42)));
-    RUN_TEST(failed, simple_type_test(static_cast<unsigned int>(42)));
-    RUN_TEST(failed, simple_type_test(static_cast<unsigned long>(42)));
-
-#if PN_CPP_HAS_LONG_LONG
-    RUN_TEST(failed, simple_type_test(static_cast<long>(42)));
-    RUN_TEST(failed, simple_type_test(static_cast<signed long>(42)));
-    RUN_TEST(failed, simple_type_test(static_cast<unsigned long>(42)));
-#endif
-
-    // value and scalar types, more tests in value_test and scalar_test.
-    RUN_TEST(failed, simple_type_test(value("foo")));
-    RUN_TEST(failed, value v(23); simple_type_test(v));
-    RUN_TEST(failed, simple_type_test(scalar(23)));
-    RUN_TEST(failed, simple_type_test(annotation_key(42)));
-    RUN_TEST(failed, simple_type_test(message_id(42)));
-
-    // Make sure we reject uncodable types
-    RUN_TEST(failed, (uncodable_type_test<std::pair<int, float> >()));
-    RUN_TEST(failed, (uncodable_type_test<std::pair<scalar, value> >()));
-    RUN_TEST(failed, (uncodable_type_test<std::basic_string<wchar_t> >()));
-    RUN_TEST(failed, (uncodable_type_test<internal::data>()));
-    RUN_TEST(failed, (uncodable_type_test<pn_data_t*>()));
-
-    return failed;
-}
-
diff --git a/proton-c/bindings/cpp/src/connection.cpp b/proton-c/bindings/cpp/src/connection.cpp
deleted file mode 100644
index 113932c..0000000
--- a/proton-c/bindings/cpp/src/connection.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton_bits.hpp"
-
-#include "proton/connection.hpp"
-#include "proton/container.hpp"
-#include "proton/error.hpp"
-#include "proton/event_loop.hpp"
-#include "proton/receiver_options.hpp"
-#include "proton/sender_options.hpp"
-#include "proton/session.hpp"
-#include "proton/session_options.hpp"
-#include "proton/transport.hpp"
-
-#include "connector.hpp"
-#include "contexts.hpp"
-#include "msg.hpp"
-#include "proton_bits.hpp"
-
-#include <proton/connection.h>
-#include <proton/session.h>
-#include <proton/transport.h>
-#include <proton/reactor.h>
-#include <proton/object.h>
-
-namespace proton {
-
-transport connection::transport() const {
-    return make_wrapper(pn_connection_transport(pn_object()));
-}
-
-void connection::open() {
-    open(connection_options());
-}
-
-void connection::open(const connection_options &opts) {
-    opts.apply_unbound(*this);
-    pn_connection_open(pn_object());
-}
-
-void connection::close() { pn_connection_close(pn_object()); }
-
-std::string connection::virtual_host() const {
-    return str(pn_connection_remote_hostname(pn_object()));
-}
-
-std::string connection::container_id() const {
-    return str(pn_connection_get_container(pn_object()));
-}
-
-std::string connection::user() const {
-    return str(pn_transport_get_user(pn_connection_transport(pn_object())));
-}
-
-container& connection::container() const {
-    class container* c = connection_context::get(pn_object()).container;
-    if (!c) {
-        pn_reactor_t *r = pn_object_reactor(pn_object());
-        if (r)
-            c = &container_context::get(r);
-    }
-    if (!c)
-        throw proton::error("connection does not have a container");
-    return *c;
-}
-
-session_range connection::sessions() const {
-    return session_range(session_iterator(make_wrapper(pn_session_head(pn_object(), 0))));
-}
-
-receiver_range connection::receivers() const {
-  pn_link_t *lnk = pn_link_head(pn_object(), 0);
-  while (lnk) {
-    if (pn_link_is_receiver(lnk))
-      break;
-    lnk = pn_link_next(lnk, 0);
-  }
-  return receiver_range(receiver_iterator(make_wrapper<receiver>(lnk)));
-}
-
-sender_range connection::senders() const {
-  pn_link_t *lnk = pn_link_head(pn_object(), 0);
-  while (lnk) {
-    if (pn_link_is_sender(lnk))
-      break;
-    lnk = pn_link_next(lnk, 0);
-  }
-  return sender_range(sender_iterator(make_wrapper<sender>(lnk)));
-}
-
-session connection::open_session() {
-    return open_session(session_options());
-}
-
-session connection::open_session(const session_options &opts) {
-    session s(make_wrapper<session>(pn_session(pn_object())));
-    // TODO: error check, too many sessions, no mem...
-    if (!!s) s.open(opts);
-    return s;
-}
-
-session connection::default_session() {
-    connection_context& ctx = connection_context::get(pn_object());
-    if (!ctx.default_session) {
-        // Note we can't use a proton::session here because we don't want to own
-        // a session reference. The connection owns the session, owning it here as well
-        // would create a circular ownership.
-        ctx.default_session = pn_session(pn_object());
-        pn_session_open(ctx.default_session);
-    }
-    return make_wrapper(ctx.default_session);
-}
-
-sender connection::open_sender(const std::string &addr) {
-    return open_sender(addr, sender_options());
-}
-
-sender connection::open_sender(const std::string &addr, const sender_options &opts) {
-    return default_session().open_sender(addr, opts);
-}
-
-receiver connection::open_receiver(const std::string &addr) {
-    return open_receiver(addr, receiver_options());
-}
-
-receiver connection::open_receiver(const std::string &addr, const receiver_options &opts)
-{
-    return default_session().open_receiver(addr, opts);
-}
-
-error_condition connection::error() const {
-    return make_wrapper(pn_connection_remote_condition(pn_object()));
-}
-
-uint32_t connection::max_frame_size() const {
-    return pn_transport_get_remote_max_frame(pn_connection_transport(pn_object()));
-}
-
-uint16_t connection::max_sessions() const {
-    return pn_transport_remote_channel_max(pn_connection_transport(pn_object()));
-}
-
-uint32_t connection::idle_timeout() const {
-    return pn_transport_get_remote_idle_timeout(pn_connection_transport(pn_object()));
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/connection_options.cpp b/proton-c/bindings/cpp/src/connection_options.cpp
deleted file mode 100644
index c30b98d..0000000
--- a/proton-c/bindings/cpp/src/connection_options.cpp
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include "proton/connection_options.hpp"
-#include "proton/messaging_handler.hpp"
-#include "proton/reconnect_timer.hpp"
-#include "proton/transport.hpp"
-#include "proton/ssl.hpp"
-#include "proton/sasl.hpp"
-
-#include "acceptor.hpp"
-#include "contexts.hpp"
-#include "connector.hpp"
-#include "messaging_adapter.hpp"
-#include "msg.hpp"
-#include "proton_bits.hpp"
-
-#include <proton/connection.h>
-#include <proton/transport.h>
-
-namespace proton {
-
-template <class T> struct option {
-    T value;
-    bool set;
-
-    option() : value(), set(false) {}
-    option& operator=(const T& x) { value = x;  set = true; return *this; }
-    void update(const option<T>& x) { if (x.set) *this = x.value; }
-};
-
-class connection_options::impl {
-  public:
-    option<messaging_handler*> handler;
-    option<uint32_t> max_frame_size;
-    option<uint16_t> max_sessions;
-    option<duration> idle_timeout;
-    option<std::string> container_id;
-    option<std::string> virtual_host;
-    option<std::string> user;
-    option<std::string> password;
-    option<reconnect_timer> reconnect;
-    option<class ssl_client_options> ssl_client_options;
-    option<class ssl_server_options> ssl_server_options;
-    option<bool> sasl_enabled;
-    option<std::string> sasl_allowed_mechs;
-    option<bool> sasl_allow_insecure_mechs;
-    option<std::string> sasl_config_name;
-    option<std::string> sasl_config_path;
-
-    /*
-     * There are three types of connection options: the handler
-     * (required at creation, so too late to apply here), open frame
-     * options (that never change after the original open), and
-     * transport options (set once per transport over the life of the
-     * connection).
-     */
-    void apply_unbound(connection& c) {
-        pn_connection_t *pnc = unwrap(c);
-        container::impl::connector *outbound = dynamic_cast<container::impl::connector*>(
-            connection_context::get(c).handler.get());
-
-        // Only apply connection options if uninit.
-        bool uninit = c.uninitialized();
-        if (!uninit) return;
-
-        if (reconnect.set && outbound)
-            outbound->reconnect_timer(reconnect.value);
-        if (container_id.set)
-            pn_connection_set_container(pnc, container_id.value.c_str());
-        if (virtual_host.set)
-            pn_connection_set_hostname(pnc, virtual_host.value.c_str());
-        if (user.set)
-            pn_connection_set_user(pnc, user.value.c_str());
-        if (password.set)
-            pn_connection_set_password(pnc, password.value.c_str());
-    }
-
-    void apply_bound(connection& c) {
-        // Transport options.  pnt is NULL between reconnect attempts
-        // and if there is a pipelined open frame.
-        pn_connection_t *pnc = unwrap(c);
-        container::impl::connector *outbound = dynamic_cast<container::impl::connector*>(
-            connection_context::get(c).handler.get());
-
-        pn_transport_t *pnt = pn_connection_transport(pnc);
-        if (!pnt) return;
-
-        // SSL
-        if (outbound && outbound->address().scheme() == url::AMQPS) {
-            // A side effect of pn_ssl() is to set the ssl peer
-            // hostname to the connection hostname, which has
-            // already been adjusted for the virtual_host option.
-            pn_ssl_t *ssl = pn_ssl(pnt);
-            if (pn_ssl_init(ssl, ssl_client_options.value.pn_domain(), NULL))
-                throw error(MSG("client SSL/TLS initialization error"));
-        } else if (!outbound) {
-            // TODO aconway 2016-05-13: reactor only
-            pn_acceptor_t *pnp = pn_connection_acceptor(pnc);
-            if (pnp) {
-                listener_context &lc(listener_context::get(pnp));
-                if (lc.ssl) {
-                    pn_ssl_t *ssl = pn_ssl(pnt);
-                    if (pn_ssl_init(ssl, ssl_server_options.value.pn_domain(), NULL))
-                        throw error(MSG("server SSL/TLS initialization error"));
-                }
-            }
-        }
-
-        // SASL
-        if (!sasl_enabled.set || sasl_enabled.value) {
-            if (sasl_enabled.set)  // Explicitly set, not just default behaviour.
-                pn_sasl(pnt);          // Force a sasl instance.  Lazily create one otherwise.
-            if (sasl_allow_insecure_mechs.set)
-                pn_sasl_set_allow_insecure_mechs(pn_sasl(pnt), sasl_allow_insecure_mechs.value);
-            if (sasl_allowed_mechs.set)
-                pn_sasl_allowed_mechs(pn_sasl(pnt), sasl_allowed_mechs.value.c_str());
-            if (sasl_config_name.set)
-                pn_sasl_config_name(pn_sasl(pnt), sasl_config_name.value.c_str());
-            if (sasl_config_path.set)
-                pn_sasl_config_path(pn_sasl(pnt), sasl_config_path.value.c_str());
-        }
-
-        if (max_frame_size.set)
-            pn_transport_set_max_frame(pnt, max_frame_size.value);
-        if (max_sessions.set)
-            pn_transport_set_channel_max(pnt, max_sessions.value);
-        if (idle_timeout.set)
-            pn_transport_set_idle_timeout(pnt, idle_timeout.value.milliseconds());
-    }
-
-    void update(const impl& x) {
-        handler.update(x.handler);
-        max_frame_size.update(x.max_frame_size);
-        max_sessions.update(x.max_sessions);
-        idle_timeout.update(x.idle_timeout);
-        container_id.update(x.container_id);
-        virtual_host.update(x.virtual_host);
-        user.update(x.user);
-        password.update(x.password);
-        reconnect.update(x.reconnect);
-        ssl_client_options.update(x.ssl_client_options);
-        ssl_server_options.update(x.ssl_server_options);
-        sasl_enabled.update(x.sasl_enabled);
-        sasl_allow_insecure_mechs.update(x.sasl_allow_insecure_mechs);
-        sasl_allowed_mechs.update(x.sasl_allowed_mechs);
-        sasl_config_name.update(x.sasl_config_name);
-        sasl_config_path.update(x.sasl_config_path);
-    }
-
-};
-
-connection_options::connection_options() : impl_(new impl()) {}
-
-connection_options::connection_options(class messaging_handler& h) : impl_(new impl()) { handler(h); }
-
-connection_options::connection_options(const connection_options& x) : impl_(new impl()) {
-    *this = x;
-}
-
-connection_options::~connection_options() {}
-
-connection_options& connection_options::operator=(const connection_options& x) {
-    *impl_ = *x.impl_;
-    return *this;
-}
-
-connection_options& connection_options::update(const connection_options& x) {
-    impl_->update(*x.impl_);
-    return *this;
-}
-
-connection_options& connection_options::handler(class messaging_handler &h) { impl_->handler = &h; return *this; }
-connection_options& connection_options::max_frame_size(uint32_t n) { impl_->max_frame_size = n; return *this; }
-connection_options& connection_options::max_sessions(uint16_t n) { impl_->max_sessions = n; return *this; }
-connection_options& connection_options::idle_timeout(duration t) { impl_->idle_timeout = t; return *this; }
-connection_options& connection_options::container_id(const std::string &id) { impl_->container_id = id; return *this; }
-connection_options& connection_options::virtual_host(const std::string &id) { impl_->virtual_host = id; return *this; }
-connection_options& connection_options::user(const std::string &user) { impl_->user = user; return *this; }
-connection_options& connection_options::password(const std::string &password) { impl_->password = password; return *this; }
-connection_options& connection_options::reconnect(const reconnect_timer &rc) { impl_->reconnect = rc; return *this; }
-connection_options& connection_options::ssl_client_options(const class ssl_client_options &c) { impl_->ssl_client_options = c; return *this; }
-connection_options& connection_options::ssl_server_options(const class ssl_server_options &c) { impl_->ssl_server_options = c; return *this; }
-connection_options& connection_options::sasl_enabled(bool b) { impl_->sasl_enabled = b; return *this; }
-connection_options& connection_options::sasl_allow_insecure_mechs(bool b) { impl_->sasl_allow_insecure_mechs = b; return *this; }
-connection_options& connection_options::sasl_allowed_mechs(const std::string &s) { impl_->sasl_allowed_mechs = s; return *this; }
-connection_options& connection_options::sasl_config_name(const std::string &n) { impl_->sasl_config_name = n; return *this; }
-connection_options& connection_options::sasl_config_path(const std::string &p) { impl_->sasl_config_path = p; return *this; }
-
-void connection_options::apply_unbound(connection& c) const { impl_->apply_unbound(c); }
-void connection_options::apply_bound(connection& c) const { impl_->apply_bound(c); }
-messaging_handler* connection_options::handler() const { return impl_->handler.value; }
-} // namespace proton
diff --git a/proton-c/bindings/cpp/src/connector.cpp b/proton-c/bindings/cpp/src/connector.cpp
deleted file mode 100644
index 0467d60..0000000
--- a/proton-c/bindings/cpp/src/connector.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "connector.hpp"
-
-#include "proton/connection.hpp"
-#include "proton/transport.hpp"
-#include "proton/container.hpp"
-#include "proton/reconnect_timer.hpp"
-#include "proton/sasl.hpp"
-#include "proton/url.hpp"
-
-#include "container_impl.hpp"
-#include "proton_bits.hpp"
-#include "proton_event.hpp"
-
-#include <proton/connection.h>
-#include <proton/transport.h>
-
-namespace proton {
-
-container::impl::connector::connector(connection&c, const connection_options& options, const url& a) :
-    connection_(c), options_(options), address_(a), reconnect_timer_(0)
-{}
-
-container::impl::connector::~connector() { delete reconnect_timer_; }
-
-void container::impl::connector::reconnect_timer(const class reconnect_timer &rt) {
-    delete reconnect_timer_;
-    reconnect_timer_ = new class reconnect_timer(rt);
-}
-
-void container::impl::connector::connect() {
-    pn_transport_t *pnt = pn_transport();
-    transport t(make_wrapper(pnt));
-    pn_transport_bind(pnt, unwrap(connection_));
-    pn_decref(pnt);
-    // Apply options to the new transport.
-    options_.apply_bound(connection_);
-}
-
-void container::impl::connector::on_connection_local_open(proton_event &) {
-    connect();
-}
-
-void container::impl::connector::on_connection_remote_open(proton_event &) {
-    if (reconnect_timer_) {
-        reconnect_timer_->reset();
-    }
-}
-
-void container::impl::connector::on_connection_init(proton_event &) {
-}
-
-void container::impl::connector::on_transport_tail_closed(proton_event &e) {
-    on_transport_closed(e);
-}
-
-void container::impl::connector::on_transport_closed(proton_event &) {
-    if (!connection_) return;
-    if (connection_.active()) {
-        if (reconnect_timer_) {
-            pn_transport_unbind(unwrap(connection_.transport()));
-            int delay = reconnect_timer_->next_delay(timestamp::now());
-            if (delay >= 0) {
-                if (delay == 0) {
-                    // log "Disconnected, reconnecting..."
-                    connect();
-                    return;
-                }
-                else {
-                    // log "Disconnected, reconnecting in " <<  delay << " milliseconds"
-                    container::impl::schedule(connection_.container(), delay, this);
-                    return;
-                }
-            }
-        }
-    }
-    pn_connection_release(unwrap(connection_));
-    connection_  = 0;
-}
-
-void container::impl::connector::on_timer_task(proton_event &) {
-    connect();
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/container.cpp b/proton-c/bindings/cpp/src/container.cpp
deleted file mode 100644
index 3daa925..0000000
--- a/proton-c/bindings/cpp/src/container.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/container.hpp"
-#include "proton/error_condition.hpp"
-
-#include "proton/error_condition.hpp"
-#include "proton/listen_handler.hpp"
-#include "proton/listener.hpp"
-#include "proton/thread_safe.hpp"
-
-#include "container_impl.hpp"
-
-namespace proton {
-
-container::container(messaging_handler& h, const std::string& id) :
-    impl_(new impl(*this, id, &h)) {}
-container::container(const std::string& id) :
-    impl_(new impl(*this, id)) {}
-container::~container() {}
-
-returned<connection> container::connect(const std::string &url) {
-    return connect(url, connection_options());
-}
-
-returned<sender> container::open_sender(const std::string &url) {
-    return open_sender(url, proton::sender_options(), connection_options());
-}
-
-returned<sender> container::open_sender(const std::string &url, const proton::sender_options &lo) {
-    return open_sender(url, lo, connection_options());
-}
-
-returned<sender> container::open_sender(const std::string &url, const proton::connection_options &co) {
-    return open_sender(url, sender_options(), co);
-}
-
-returned<receiver> container::open_receiver(const std::string &url) {
-    return open_receiver(url, proton::receiver_options(), connection_options());
-}
-
-returned<receiver> container::open_receiver(const std::string &url, const proton::receiver_options &lo) {
-    return open_receiver(url, lo, connection_options());
-}
-
-returned<receiver> container::open_receiver(const std::string &url, const proton::connection_options &co) {
-    return open_receiver(url, receiver_options(), co);
-}
-
-namespace{
-    struct listen_opts : public listen_handler {
-        connection_options  opts;
-        listen_opts(const connection_options& o) : opts(o) {}
-        connection_options on_accept() { return opts; }
-        void on_close() { delete this; }
-    };
-}
-
-listener container::listen(const std::string& url, const connection_options& opts) {
-    // Note: listen_opts::on_close() calls delete(this) so this is not a leak.
-    // The container will always call on_closed() even if there are errors or exceptions.
-    listen_opts* lh = new listen_opts(opts);
-    return listen(url, *lh);
-}
-
-listener container::listen(const std::string &url) {
-    return listen(url, connection_options());
-}
-
-void container::stop() { stop(error_condition()); }
-
-returned<connection> container::connect(const std::string& url, const connection_options& opts) {
-    return impl_->connect(url, opts);
-}
-
-listener container::listen(const std::string& url, listen_handler& l) { return impl_->listen(url, l); }
-
-void container::stop_listening(const std::string& url) { impl_->stop_listening(url); }
-
-void container::run() { impl_->run(); }
-
-void container::auto_stop(bool set) { impl_->auto_stop(set); }
-
-void container::stop(const error_condition& err) { impl_->stop(err); }
-
-returned<sender> container::open_sender(
-    const std::string &url,
-    const class sender_options &o,
-    const connection_options &c) {
-    return impl_->open_sender(url, o, c);
-}
-
-returned<receiver> container::open_receiver(
-    const std::string&url,
-    const class receiver_options &o,
-    const connection_options &c) {
-    return impl_->open_receiver(url, o, c);
-}
-
-std::string container::id() const { return impl_->id(); }
-
-void container::schedule(duration d, void_function0& f) { return impl_->schedule(d, f); }
-
-#if PN_CPP_HAS_STD_FUNCTION
-void container::schedule(duration d, std::function<void()> f) { return impl_->schedule(d, f); }
-#endif
-
-void container::client_connection_options(const connection_options& c) { impl_->client_connection_options(c); }
-connection_options container::client_connection_options() const { return impl_->client_connection_options(); }
-
-void container::server_connection_options(const connection_options &o) { impl_->server_connection_options(o); }
-connection_options container::server_connection_options() const { return impl_->server_connection_options(); }
-
-void container::sender_options(const class sender_options &o) { impl_->sender_options(o); }
-class sender_options container::sender_options() const { return impl_->sender_options(); }
-
-void container::receiver_options(const class receiver_options & o) { impl_->receiver_options(o); }
-class receiver_options container::receiver_options() const { return impl_->receiver_options(); }
-
-} // namespace proton
diff --git a/proton-c/bindings/cpp/src/container_impl.cpp b/proton-c/bindings/cpp/src/container_impl.cpp
deleted file mode 100644
index 9cec831..0000000
--- a/proton-c/bindings/cpp/src/container_impl.cpp
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/connection_options.hpp"
-#include "proton/connection.hpp"
-#include "proton/error.hpp"
-#include "proton/event_loop.hpp"
-#include "proton/listener.hpp"
-#include "proton/receiver.hpp"
-#include "proton/sender.hpp"
-#include "proton/session.hpp"
-#include "proton/ssl.hpp"
-#include "proton/sasl.hpp"
-#include "proton/thread_safe.hpp"
-#include "proton/transport.hpp"
-#include "proton/url.hpp"
-#include "proton/uuid.hpp"
-
-#include "acceptor.hpp"
-#include "connector.hpp"
-#include "container_impl.hpp"
-#include "contexts.hpp"
-#include "event_loop_impl.hpp"
-#include "messaging_adapter.hpp"
-#include "msg.hpp"
-#include "proton_bits.hpp"
-#include "proton_event.hpp"
-
-#include <proton/connection.h>
-#include <proton/handlers.h>
-#include <proton/reactor.h>
-#include <proton/session.h>
-
-namespace proton {
-
-class container::impl::handler_context {
-  public:
-    static handler_context& get(pn_handler_t* h) {
-        return *reinterpret_cast<handler_context*>(pn_handler_mem(h));
-    }
-    static void cleanup(pn_handler_t*) {}
-
-    /*
-     * NOTE: this call, at the transition from C to C++ is possibly
-     * the biggest performance bottleneck.  "Average" clients ignore
-     * 90% of these events.  Current strategy is to create the
-     * messaging_event on the stack.  For success, the messaging_event
-     * should be small and free of indirect malloc/free/new/delete.
-     */
-
-    static void dispatch(pn_handler_t *c_handler, pn_event_t *c_event, pn_event_type_t)
-    {
-        handler_context& hc(handler_context::get(c_handler));
-        proton_event pevent(c_event, hc.container_);
-        pevent.dispatch(*hc.handler_);
-        return;
-    }
-
-    container *container_;
-    proton_handler *handler_;
-};
-
-// Used to sniff for connector events before the reactor's global handler sees them.
-class container::impl::override_handler : public proton_handler
-{
-  public:
-    internal::pn_ptr<pn_handler_t> base_handler;
-    container::impl &container_impl_;
-
-    override_handler(pn_handler_t *h, container::impl &c) : base_handler(h), container_impl_(c) {}
-
-    virtual void on_unhandled(proton_event &pe) {
-        proton_event::event_type type = pe.type();
-        if (type==proton_event::EVENT_NONE) return;  // Also not from the reactor
-
-        pn_event_t *cevent = pe.pn_event();
-        pn_connection_t *conn = pn_event_connection(cevent);
-        if (conn) {
-            proton_handler *oh = connection_context::get(conn).handler.get();
-            if (oh && type != proton_event::CONNECTION_INIT) {
-                // Send event to connector
-                pe.dispatch(*oh);
-            }
-            else if (!oh && type == proton_event::CONNECTION_INIT) {
-                // Newly accepted connection from lister socket
-                connection c(make_wrapper(conn));
-                container_impl_.configure_server_connection(c);
-            }
-        }
-        pn_handler_dispatch(base_handler.get(), cevent, pn_event_type_t(type));
-    }
-};
-
-internal::pn_ptr<pn_handler_t> container::impl::cpp_handler(proton_handler *h) {
-    pn_handler_t *handler = h ? pn_handler_new(&handler_context::dispatch,
-                                               sizeof(class handler_context),
-                                               &handler_context::cleanup) : 0;
-    if (handler) {
-        handler_context &hc = handler_context::get(handler);
-        hc.container_ = &container_;
-        hc.handler_ = h;
-    }
-    return internal::take_ownership(handler);
-}
-
-container::impl::impl(container& c, const std::string& id, messaging_handler *mh) :
-    container_(c),
-    reactor_(reactor::create()),
-    id_(id.empty() ? uuid::random().str() : id),
-    auto_stop_(true)
-{
-    container_context::set(reactor_, container_);
-
-    // Set our own global handler that "subclasses" the existing one
-    pn_handler_t *global_handler = reactor_.pn_global_handler();
-    proton_handler* oh = new override_handler(global_handler, *this);
-    handlers_.push_back(oh);
-    reactor_.pn_global_handler(cpp_handler(oh).get());
-    if (mh) {
-        proton_handler* h = new messaging_adapter(*mh);
-        handlers_.push_back(h);
-        reactor_.pn_handler(cpp_handler(h).get());
-    }
-
-    // Note: we have just set up the following handlers that see
-    // events in this order: messaging_adapter, connector override,
-    // the reactor's default globalhandler (pn_iohandler)
-}
-
-namespace {
-void close_acceptor(acceptor a) {
-    listen_handler*& lh = listener_context::get(unwrap(a)).listen_handler_;
-    if (lh) {
-        lh->on_close();
-        lh = 0;
-    }
-    a.close();
-}
-}
-
-container::impl::~impl() {
-    for (acceptors::iterator i = acceptors_.begin(); i != acceptors_.end(); ++i)
-        close_acceptor(i->second);
-}
-
-// FIXME aconway 2016-06-07: this is not thread safe. It is sufficient for using
-// default_container::schedule() inside a handler but not for inject() from
-// another thread.
-bool event_loop::impl::inject(void_function0& f) {
-    try { f(); } catch(...) {}
-    return true;
-}
-
-#if PN_CPP_HAS_STD_FUNCTION
-bool event_loop::impl::inject(std::function<void()> f) {
-    try { f(); } catch(...) {}
-    return true;
-}
-#endif
-
-returned<connection> container::impl::connect(const std::string &urlstr, const connection_options &user_opts) {
-    connection_options opts = client_connection_options(); // Defaults
-    opts.update(user_opts);
-    messaging_handler* mh = opts.handler();
-    internal::pn_ptr<pn_handler_t> chandler;
-    if (mh) {
-        proton_handler* h = new messaging_adapter(*mh);
-        handlers_.push_back(h);
-        chandler = cpp_handler(h);
-    }
-
-    proton::url  url(urlstr);
-    connection conn(reactor_.connection_to_host(url.host(), url.port(), chandler.get()));
-    internal::pn_unique_ptr<connector> ctor(new connector(conn, opts, url));
-    connection_context& cc(connection_context::get(conn));
-    cc.handler.reset(ctor.release());
-    cc.event_loop_ = new event_loop::impl;
-
-    pn_connection_t *pnc = unwrap(conn);
-    pn_connection_set_container(pnc, id_.c_str());
-    pn_connection_set_hostname(pnc, url.host().c_str());
-    if (!url.user().empty())
-        pn_connection_set_user(pnc, url.user().c_str());
-    if (!url.password().empty())
-        pn_connection_set_password(pnc, url.password().c_str());
-
-    conn.open(opts);
-    return make_thread_safe(conn);
-}
-
-returned<sender> container::impl::open_sender(const std::string &url, const proton::sender_options &o1, const connection_options &o2) {
-    proton::sender_options lopts(sender_options_);
-    lopts.update(o1);
-    connection_options copts(client_connection_options_);
-    copts.update(o2);
-    connection conn = connect(url, copts);
-    return make_thread_safe(conn.default_session().open_sender(proton::url(url).path(), lopts));
-}
-
-returned<receiver> container::impl::open_receiver(const std::string &url, const proton::receiver_options &o1, const connection_options &o2) {
-    proton::receiver_options lopts(receiver_options_);
-    lopts.update(o1);
-    connection_options copts(client_connection_options_);
-    copts.update(o2);
-    connection conn = connect(url, copts);
-    return make_thread_safe(
-        conn.default_session().open_receiver(proton::url(url).path(), lopts));
-}
-
-listener container::impl::listen(const std::string& url, listen_handler& lh) {
-    if (acceptors_.find(url) != acceptors_.end())
-        throw error("already listening on " + url);
-    connection_options opts = server_connection_options(); // Defaults
-
-    messaging_handler* mh = opts.handler();
-    internal::pn_ptr<pn_handler_t> chandler;
-    if (mh) {
-        proton_handler* h = new messaging_adapter(*mh);
-        handlers_.push_back(h);
-        chandler = cpp_handler(h);
-    }
-
-    proton::url u(url);
-    pn_acceptor_t *acptr = pn_reactor_acceptor(
-        unwrap(reactor_), u.host().c_str(), u.port().c_str(), chandler.get());
-    if (!acptr) {
-        std::string err(pn_error_text(pn_reactor_error(unwrap(reactor_))));
-        lh.on_error(err);
-        lh.on_close();
-        throw error(err);
-    }
-    // Do not use pn_acceptor_set_ssl_domain().  Manage the incoming connections ourselves for
-    // more flexibility (i.e. ability to change the server cert for a long running listener).
-    listener_context& lc(listener_context::get(acptr));
-    lc.listen_handler_ = &lh;
-    lc.ssl = u.scheme() == url::AMQPS;
-    listener_context::get(acptr).listen_handler_ = &lh;
-    acceptors_[url] = make_wrapper(acptr);
-    return listener(container_, url);
-}
-
-void container::impl::stop_listening(const std::string& url) {
-    acceptors::iterator i = acceptors_.find(url);
-    if (i != acceptors_.end())
-        close_acceptor(i->second);
-}
-
-void container::impl::schedule(impl& ci, int delay, proton_handler *h) {
-    internal::pn_ptr<pn_handler_t> task_handler;
-    if (h)
-        task_handler = ci.cpp_handler(h);
-    ci.reactor_.schedule(delay, task_handler.get());
-}
-
-void container::impl::schedule(container& c, int delay, proton_handler *h) {
-    schedule(*c.impl_.get(), delay, h);
-}
-
-namespace {
-// Abstract base for timer_handler_std and timer_handler_03
-struct timer_handler : public proton_handler, public void_function0 {
-    void on_timer_task(proton_event& ) PN_CPP_OVERRIDE {
-        (*this)();
-        delete this;
-    }
-    void on_reactor_final(proton_event&) PN_CPP_OVERRIDE {
-        delete this;
-    }
-};
-
-struct timer_handler_03 : public timer_handler {
-    void_function0& func;
-    timer_handler_03(void_function0& f): func(f) {}
-    void operator()() PN_CPP_OVERRIDE { func(); }
-};
-}
-
-void container::impl::schedule(duration delay, void_function0& f) {
-    schedule(*this, delay.milliseconds(), new timer_handler_03(f));
-}
-
-#if PN_CPP_HAS_STD_FUNCTION
-namespace {
-struct timer_handler_std : public timer_handler {
-    std::function<void()> func;
-    timer_handler_std(std::function<void()> f): func(f) {}
-    void operator()() PN_CPP_OVERRIDE { func(); }
-};
-}
-
-void container::impl::schedule(duration delay, std::function<void()> f) {
-    schedule(*this, delay.milliseconds(), new timer_handler_std(f));
-}
-#endif
-
-void container::impl::client_connection_options(const connection_options &opts) {
-    client_connection_options_ = opts;
-}
-
-void container::impl::server_connection_options(const connection_options &opts) {
-    server_connection_options_ = opts;
-}
-
-void container::impl::sender_options(const proton::sender_options &opts) {
-    sender_options_ = opts;
-}
-
-void container::impl::receiver_options(const proton::receiver_options &opts) {
-    receiver_options_ = opts;
-}
-
-void container::impl::configure_server_connection(connection &c) {
-    pn_acceptor_t *pnp = pn_connection_acceptor(unwrap(c));
-    listener_context &lc(listener_context::get(pnp));
-    pn_connection_set_container(unwrap(c), id_.c_str());
-    connection_options opts = server_connection_options_;
-    opts.update(lc.get_options());
-    // Unbound options don't apply to server connection
-    opts.apply_bound(c);
-    // Handler applied separately
-    messaging_handler* mh = opts.handler();
-    if (mh) {
-        proton_handler* h = new messaging_adapter(*mh);
-        handlers_.push_back(h);
-        internal::pn_ptr<pn_handler_t> chandler = cpp_handler(h);
-        pn_record_t *record = pn_connection_attachments(unwrap(c));
-        pn_record_set_handler(record, chandler.get());
-    }
-    connection_context::get(c).event_loop_ = new event_loop::impl;
-}
-
-void container::impl::run() {
-    do {
-        reactor_.run();
-    } while (!auto_stop_);
-}
-
-void container::impl::stop(const error_condition&) {
-    reactor_.stop();
-    auto_stop_ = true;
-}
-
-void container::impl::auto_stop(bool set) {
-    auto_stop_ = set;
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/container_test.cpp b/proton-c/bindings/cpp/src/container_test.cpp
deleted file mode 100644
index 564a4ba..0000000
--- a/proton-c/bindings/cpp/src/container_test.cpp
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-#include "test_bits.hpp"
-#include "proton/connection.hpp"
-#include "proton/connection_options.hpp"
-#include "proton/container.hpp"
-#include "proton/default_container.hpp"
-#include "proton/messaging_handler.hpp"
-#include "proton/listener.hpp"
-#include "proton/listen_handler.hpp"
-#include "proton/thread_safe.hpp"
-
-#include <cstdlib>
-#include <ctime>
-#include <string>
-#include <cstdio>
-#include <sstream>
-
-namespace {
-
-static std::string int2string(int n) {
-    std::ostringstream strm;
-    strm << n;
-    return strm.str();
-}
-
-int listen_on_random_port(proton::container& c, proton::listener& l) {
-    int port;
-    // I'm going to hell for this:
-    std::srand((unsigned int)time(0));
-    while (true) {
-        port = 20000 + (std::rand() % 30000);
-        try {
-            l = c.listen("0.0.0.0:" + int2string(port));
-            break;
-        } catch (...) {
-            // keep trying
-        }
-    }
-    return port;
-}
-
-class test_handler : public proton::messaging_handler {
-  public:
-    const std::string host;
-    proton::connection_options opts;
-    bool closing;
-    bool done;
-
-    std::string peer_vhost;
-    proton::listener listener;
-
-    test_handler(const std::string h, const proton::connection_options& c_opts)
-        : host(h), opts(c_opts), closing(false), done(false)
-    {}
-
-    void on_container_start(proton::container &c) PN_CPP_OVERRIDE {
-        int port = listen_on_random_port(c, listener);
-        proton::connection conn = c.connect(host + ":" + int2string(port), opts);
-    }
-
-    void on_connection_open(proton::connection &c) PN_CPP_OVERRIDE {
-        if (peer_vhost.empty() && !c.virtual_host().empty())
-            peer_vhost = c.virtual_host();
-        if (!closing) c.close();
-        closing = true;
-    }
-
-    void on_connection_close(proton::connection &) PN_CPP_OVERRIDE {
-        if (!done) listener.stop();
-        done = true;
-    }
-};
-
-int test_container_vhost() {
-    proton::connection_options opts;
-    opts.virtual_host(std::string("a.b.c"));
-    test_handler th(std::string("127.0.0.1"), opts);
-    proton::default_container(th).run();
-    ASSERT_EQUAL(th.peer_vhost, std::string("a.b.c"));
-    return 0;
-}
-
-int test_container_default_vhost() {
-    proton::connection_options opts;
-    test_handler th(std::string("127.0.0.1"), opts);
-    proton::default_container(th).run();
-    ASSERT_EQUAL(th.peer_vhost, std::string("127.0.0.1"));
-    return 0;
-}
-
-int test_container_no_vhost() {
-    // explicitly setting an empty virtual-host will cause the Open
-    // performative to be sent without a hostname field present.
-    // Sadly whether or not a 'hostname' field was received cannot be
-    // determined from here, so just exercise the code
-    proton::connection_options opts;
-    opts.virtual_host(std::string(""));
-    test_handler th(std::string("127.0.0.1"), opts);
-    proton::default_container(th).run();
-    ASSERT_EQUAL(th.peer_vhost, std::string(""));
-    return 0;
-}
-
-struct test_listener : public proton::listen_handler {
-    bool on_accept_, on_close_;
-    std::string on_error_;
-    test_listener() : on_accept_(false), on_close_(false) {}
-    proton::connection_options on_accept() PN_CPP_OVERRIDE {
-        on_accept_ = true;
-        return proton::connection_options();
-    }
-    void on_close() PN_CPP_OVERRIDE { on_close_ = true; }
-    void on_error(const std::string& e) PN_CPP_OVERRIDE { on_error_ = e; }
-};
-
-int test_container_bad_address() {
-    // Listen on a bad address, check for leaks
-    // Regression test for https://issues.apache.org/jira/browse/PROTON-1217
-
-    proton::default_container c;
-    // Default fixed-option listener. Valgrind for leaks.
-    try { c.listen("999.666.999.666:0"); } catch (const proton::error&) {}
-    // Dummy listener.
-    test_listener l;
-    test_handler h2(std::string("999.999.999.666"), proton::connection_options());
-    try { c.listen("999.666.999.666:0", l); } catch (const proton::error&) {}
-    ASSERT(!l.on_accept_);
-    ASSERT(l.on_close_);
-    ASSERT(!l.on_error_.empty());
-    return 0;
-}
-
-class stop_tester : public proton::messaging_handler {
-    proton::listener listener;
-
-    // Set up a listener which would block forever
-    void on_container_start(proton::container& c) PN_CPP_OVERRIDE {
-        ASSERT(state==0);
-        int port = listen_on_random_port(c, listener);
-        c.connect("127.0.0.1:" + int2string(port));
-        c.auto_stop(false);
-        state = 1;
-    }
-
-    // Get here twice - once for listener, once for connector
-    void on_connection_open(proton::connection &c) PN_CPP_OVERRIDE {
-        c.close();
-        state++;
-    }
-
-    void on_connection_close(proton::connection &c) PN_CPP_OVERRIDE {
-        ASSERT(state==3);
-        c.container().stop();
-        state = 4;
-    }
-    void on_container_stop(proton::container & ) PN_CPP_OVERRIDE {
-        ASSERT(state==4);
-        state = 5;
-    }
-
-public:
-    stop_tester(): state(0) {}
-
-    int state;
-};
-
-int test_container_stop() {
-    stop_tester t;
-    proton::default_container(t).run();
-    ASSERT(t.state==5);
-    return 0;
-}
-
-}
-
-int main(int, char**) {
-    int failed = 0;
-    RUN_TEST(failed, test_container_vhost());
-    RUN_TEST(failed, test_container_default_vhost());
-    RUN_TEST(failed, test_container_no_vhost());
-    RUN_TEST(failed, test_container_bad_address());
-    RUN_TEST(failed, test_container_stop());
-    return failed;
-}
-
diff --git a/proton-c/bindings/cpp/src/contexts.cpp b/proton-c/bindings/cpp/src/contexts.cpp
deleted file mode 100644
index 231506f..0000000
--- a/proton-c/bindings/cpp/src/contexts.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "contexts.hpp"
-#include "msg.hpp"
-#include "reactor.hpp"
-#include "proton_bits.hpp"
-
-#include "proton/error.hpp"
-
-#include <proton/connection.h>
-#include <proton/object.h>
-#include <proton/link.h>
-#include <proton/message.h>
-#include <proton/reactor.h>
-#include <proton/session.h>
-
-#include <typeinfo>
-
-namespace proton {
-
-namespace {
-void cpp_context_finalize(void* v) { reinterpret_cast<context*>(v)->~context(); }
-#define CID_cpp_context CID_pn_object
-#define cpp_context_initialize NULL
-#define cpp_context_finalize cpp_context_finalize
-#define cpp_context_hashcode NULL
-#define cpp_context_compare NULL
-#define cpp_context_inspect NULL
-pn_class_t cpp_context_class = PN_CLASS(cpp_context);
-
-// Handles
-PN_HANDLE(CONNECTION_CONTEXT)
-PN_HANDLE(CONTAINER_CONTEXT)
-PN_HANDLE(LISTENER_CONTEXT)
-PN_HANDLE(LINK_CONTEXT)
-
-void set_context(pn_record_t* record, pn_handle_t handle, const pn_class_t *clazz, void* value)
-{
-    pn_record_def(record, handle, clazz);
-    pn_record_set(record, handle, value);
-}
-
-template <class T>
-T* get_context(pn_record_t* record, pn_handle_t handle) {
-    return reinterpret_cast<T*>(pn_record_get(record, handle));
-}
-
-}
-
-context::~context() {}
-
-void *context::alloc(size_t n) { return pn_object_new(&cpp_context_class, n); }
-
-pn_class_t* context::pn_class() { return &cpp_context_class; }
-
-
-context::id connection_context::id(pn_connection_t* c) {
-    return context::id(pn_connection_attachments(c), CONNECTION_CONTEXT);
-}
-
-context::id connection_context::id(const connection& c) {
-    return id(unwrap(c));
-}
-
-void container_context::set(const reactor& r, container& c) {
-    set_context(pn_reactor_attachments(unwrap(r)), CONTAINER_CONTEXT, PN_VOID, &c);
-}
-
-container &container_context::get(pn_reactor_t *pn_reactor) {
-    container *ctx = get_context<container>(pn_reactor_attachments(pn_reactor), CONTAINER_CONTEXT);
-    if (!ctx) throw error(MSG("Reactor has no C++ container context"));
-    return *ctx;
-}
-
-listener_context& listener_context::get(pn_acceptor_t* a) {
-    // TODO aconway 2016-05-13: reactor only
-    // A Proton C pn_acceptor_t is really just a selectable
-    pn_selectable_t *sel = reinterpret_cast<pn_selectable_t*>(a);
-
-    listener_context* ctx =
-        get_context<listener_context>(pn_selectable_attachments(sel), LISTENER_CONTEXT);
-    if (!ctx) {
-        ctx =  context::create<listener_context>();
-        set_context(pn_selectable_attachments(sel), LISTENER_CONTEXT, context::pn_class(), ctx);
-        pn_decref(ctx);
-    }
-    return *ctx;
-}
-
-link_context& link_context::get(pn_link_t* l) {
-    link_context* ctx =
-        get_context<link_context>(pn_link_attachments(l), LINK_CONTEXT);
-    if (!ctx) {
-        ctx =  context::create<link_context>();
-        set_context(pn_link_attachments(l), LINK_CONTEXT, context::pn_class(), ctx);
-        pn_decref(ctx);
-    }
-    return *ctx;
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/data.cpp b/proton-c/bindings/cpp/src/data.cpp
deleted file mode 100644
index 0f6e7f5..0000000
--- a/proton-c/bindings/cpp/src/data.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "proton/internal/data.hpp"
-
-#include "proton/binary.hpp"
-#include "proton/codec/encoder.hpp"
-#include "proton/decimal.hpp"
-#include "proton/message_id.hpp"
-#include "proton/symbol.hpp"
-#include "proton/timestamp.hpp"
-#include "proton/value.hpp"
-
-#include <proton/codec.h>
-
-#include <ostream>
-
-#include "proton_bits.hpp"
-
-namespace proton {
-namespace internal {
-
-data data::create() { return internal::take_ownership(pn_data(0)).get(); }
-
-void data::copy(const data& x) { ::pn_data_copy(pn_object(), x.pn_object()); }
-
-void data::clear() { ::pn_data_clear(pn_object()); }
-
-void data::rewind() { ::pn_data_rewind(pn_object()); }
-
-bool data::empty() const { return ::pn_data_size(pn_object()) == 0; }
-
-void* data::point() const { return pn_data_point(pn_object()); }
-
-void data::restore(void* h) { pn_data_restore(pn_object(), pn_handle_t(h)); }
-
-void data::narrow() { pn_data_narrow(pn_object()); }
-
-void data::widen() { pn_data_widen(pn_object()); }
-
-int data::append(data src) { return pn_data_append(pn_object(), src.pn_object());}
-
-int data::appendn(data src, int limit) { return pn_data_appendn(pn_object(), src.pn_object(), limit);}
-
-bool data::next() { return pn_data_next(pn_object()); }
-
-std::ostream& operator<<(std::ostream& o, const data& d) {
-    state_guard sg(const_cast<data&>(d));
-    const_cast<data&>(d).rewind();
-    return o << inspectable(d.pn_object());
-}
-
-} // internal
-} // proton
diff --git a/proton-c/bindings/cpp/src/decimal.cpp b/proton-c/bindings/cpp/src/decimal.cpp
deleted file mode 100644
index 0cadb19..0000000
--- a/proton-c/bindings/cpp/src/decimal.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "proton/decimal.hpp"
-#include <iostream>
-
-namespace proton {
-
-std::ostream& operator<<(std::ostream& o, const decimal32& d) {
-    return o << "decimal32(" <<static_cast<byte_array<sizeof(d)> >(d)<< ")";
-}
-
-std::ostream& operator<<(std::ostream& o, const decimal64& d) {
-    return o << "decimal64(" <<static_cast<byte_array<sizeof(d)> >(d)<< ")";
-}
-
-std::ostream& operator<<(std::ostream& o, const decimal128& d) {
-    return o << "decimal128(" <<static_cast<byte_array<sizeof(d)> >(d)<< ")";
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/decoder.cpp b/proton-c/bindings/cpp/src/decoder.cpp
deleted file mode 100644
index 9c941c8..0000000
--- a/proton-c/bindings/cpp/src/decoder.cpp
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "proton/codec/decoder.hpp"
-
-#include "proton/annotation_key.hpp"
-#include "proton/binary.hpp"
-#include "proton/decimal.hpp"
-#include "proton/message_id.hpp"
-#include "proton/scalar.hpp"
-#include "proton/symbol.hpp"
-#include "proton/timestamp.hpp"
-#include "proton/value.hpp"
-
-#include "proton_bits.hpp"
-#include "types_internal.hpp"
-#include "msg.hpp"
-
-#include <proton/codec.h>
-
-namespace proton {
-namespace codec {
-
-/**@file
- *
- * Note the pn_data_t "current" node is always pointing *before* the next value
- * to be returned by the decoder.
- */
-decoder::decoder(const internal::value_base& v, bool exact)
-    : data(const_cast<internal::value_base&>(v).data()), exact_(exact)
-{
-    rewind();
-}
-
-namespace {
-template <class T> T check(T result) {
-    if (result < 0)
-        throw conversion_error(error_str(result));
-    return result;
-}
-}
-
-void decoder::decode(const char* i, size_t size) {
-    internal::state_guard sg(*this);
-    const char* end = i + size;
-    while (i < end)
-        i += check(pn_data_decode(pn_object(), i, size_t(end - i)));
-}
-
-void decoder::decode(const std::string& s) { decode(s.data(), s.size()); }
-
-bool decoder::more() {
-    internal::state_guard sg(*this);
-    return next();
-}
-
-type_id decoder::pre_get() {
-    if (!next()) throw conversion_error("no more data");
-    type_id t = type_id(pn_data_type(pn_object()));
-    if (t < 0) throw conversion_error("invalid data");
-    return t;
-}
-
-namespace {
-
-template <class T, class U> void assign(T& x, const U& y) { x = y; }
-void assign(uuid& x, const pn_uuid_t y) { byte_copy(x, y); }
-void assign(decimal32& x, const pn_decimal32_t y) { byte_copy(x, y); }
-void assign(decimal64& x, const pn_decimal64_t y)  { byte_copy(x, y); }
-void assign(decimal128& x, const pn_decimal128_t y) { byte_copy(x, y); }
-void assign(symbol& x, const pn_bytes_t y) { x = str(y); }
-void assign(binary& x, const pn_bytes_t y) { x = bin(y); }
-
-} // namespace
-
-
-// Simple extract with no type conversion.
-template <class T, class U> decoder& decoder::extract(T& x, U (*get)(pn_data_t*)) {
-    internal::state_guard sg(*this);
-    assert_type_equal(internal::type_id_of<T>::value, pre_get());
-    assign(x, get(pn_object()));
-    sg.cancel();                // No error, cancel the reset.
-    return *this;
-}
-
-type_id decoder::next_type() {
-    internal::state_guard sg(*this);
-    return pre_get();
-}
-
-decoder& decoder::operator>>(start& s) {
-    internal::state_guard sg(*this);
-    s.type = pre_get();
-    switch (s.type) {
-      case ARRAY:
-        s.size = pn_data_get_array(pn_object());
-        s.element = type_id(pn_data_get_array_type(pn_object())); s.is_described = pn_data_is_array_described(pn_object());
-        break;
-      case LIST:
-        s.size = pn_data_get_list(pn_object());
-        break;
-      case MAP:
-        s.size = pn_data_get_map(pn_object());
-        break;
-      case DESCRIBED:
-        s.is_described = true;
-        s.size = 1;
-        break;
-      default:
-        throw conversion_error(MSG("" << s.type << " is not a container type"));
-    }
-    pn_data_enter(pn_object());
-    sg.cancel();
-    return *this;
-}
-
-decoder& decoder::operator>>(const finish&) {
-    pn_data_exit(pn_object());
-    return *this;
-}
-
-decoder& decoder::operator>>(null&) {
-    internal::state_guard sg(*this);
-    assert_type_equal(NULL_TYPE, pre_get());
-    return *this;
-}
-
-decoder& decoder::operator>>(internal::value_base& x) {
-    if (*this == x.data_)
-        throw conversion_error("extract into self");
-    data d = x.data();
-    d.clear();
-    narrow();
-    try {
-        check(d.appendn(*this, 1));
-        widen();
-    } catch(...) {
-        widen();
-        throw;
-    }
-    next();
-    return *this;
-}
-
-decoder& decoder::operator>>(message_id& x) {
-    internal::state_guard sg(*this);
-    type_id got = pre_get();
-    if (got != ULONG && got != UUID && got != BINARY && got != STRING)
-        throw conversion_error(
-            msg() << "expected one of ulong, uuid, binary or string but found " << got);
-    x.set(pn_data_get_atom(pn_object()));
-    sg.cancel();
-    return *this;
-}
-
-decoder& decoder::operator>>(annotation_key& x) {
-    internal::state_guard sg(*this);
-    type_id got = pre_get();
-    if (got != ULONG && got != SYMBOL)
-        throw conversion_error(msg() << "expected one of ulong or symbol but found " << got);
-    x.set(pn_data_get_atom(pn_object()));
-    sg.cancel();
-    return *this;
-}
-
-decoder& decoder::operator>>(scalar& x) {
-    internal::state_guard sg(*this);
-    type_id got = pre_get();
-    if (!type_id_is_scalar(got))
-        throw conversion_error("expected scalar, found "+type_name(got));
-    x.set(pn_data_get_atom(pn_object()));
-    sg.cancel();                // No error, no rewind
-    return *this;
-}
-
-decoder& decoder::operator>>(bool &x) { return extract(x, pn_data_get_bool); }
-
-decoder& decoder::operator>>(uint8_t &x)  { return extract(x, pn_data_get_ubyte); }
-
-decoder& decoder::operator>>(int8_t &x) { return extract(x, pn_data_get_byte); }
-
-decoder& decoder::operator>>(uint16_t &x) {
-    internal::state_guard sg(*this);
-    type_id tid = pre_get();
-    if (exact_) assert_type_equal(USHORT, tid);
-    switch (tid) {
-      case UBYTE: x = pn_data_get_ubyte(pn_object()); break;
-      case USHORT: x = pn_data_get_ushort(pn_object()); break;
-      default: assert_type_equal(USHORT, tid);
-    }
-    sg.cancel();
-    return *this;
-}
-
-decoder& decoder::operator>>(int16_t &x) {
-    internal::state_guard sg(*this);
-    type_id tid = pre_get();
-    if (exact_) assert_type_equal(SHORT, tid);
-    switch (tid) {
-      case BYTE: x = pn_data_get_byte(pn_object()); break;
-      case SHORT: x = pn_data_get_short(pn_object()); break;
-      default: assert_type_equal(SHORT, tid);
-    }
-    sg.cancel();
-    return *this;
-}
-
-decoder& decoder::operator>>(uint32_t &x) {
-    internal::state_guard sg(*this);
-    type_id tid = pre_get();
-    if (exact_) assert_type_equal(UINT, tid);
-    switch (tid) {
-      case UBYTE: x = pn_data_get_ubyte(pn_object()); break;
-      case USHORT: x = pn_data_get_ushort(pn_object()); break;
-      case UINT: x = pn_data_get_uint(pn_object()); break;
-      default: assert_type_equal(UINT, tid);
-    }
-    sg.cancel();
-    return *this;
-}
-
-decoder& decoder::operator>>(int32_t &x) {
-    internal::state_guard sg(*this);
-    type_id tid = pre_get();
-    if (exact_) assert_type_equal(INT, tid);
-    switch (tid) {
-      case BYTE: x = pn_data_get_byte(pn_object()); break;
-      case SHORT: x = pn_data_get_short(pn_object()); break;
-      case INT: x = pn_data_get_int(pn_object()); break;
-      default: assert_type_equal(INT, tid);
-    }
-    sg.cancel();
-    return *this;
-}
-
-decoder& decoder::operator>>(uint64_t &x) {
-    internal::state_guard sg(*this);
-    type_id tid = pre_get();
-    if (exact_) assert_type_equal(ULONG, tid);
-    switch (tid) {
-      case UBYTE: x = pn_data_get_ubyte(pn_object()); break;
-      case USHORT: x = pn_data_get_ushort(pn_object()); break;
-      case UINT: x = pn_data_get_uint(pn_object()); break;
-      case ULONG: x = pn_data_get_ulong(pn_object()); break;
-      default: assert_type_equal(ULONG, tid);
-    }
-    sg.cancel();
-    return *this;
-}
-
-decoder& decoder::operator>>(int64_t &x) {
-    internal::state_guard sg(*this);
-    type_id tid = pre_get();
-    if (exact_) assert_type_equal(LONG, tid);
-    switch (tid) {
-      case BYTE: x = pn_data_get_byte(pn_object()); break;
-      case SHORT: x = pn_data_get_short(pn_object()); break;
-      case INT: x = pn_data_get_int(pn_object()); break;
-      case LONG: x = pn_data_get_long(pn_object()); break;
-      default: assert_type_equal(LONG, tid);
-    }
-    sg.cancel();
-    return *this;
-}
-
-decoder& decoder::operator>>(wchar_t &x) { return extract(x, pn_data_get_char); }
-
-decoder& decoder::operator>>(timestamp &x) { return extract(x, pn_data_get_timestamp); }
-
-decoder& decoder::operator>>(float &x) {
-    internal::state_guard sg(*this);
-    type_id tid = pre_get();
-    if (exact_) assert_type_equal(FLOAT, tid);
-    switch (tid) {
-      case FLOAT: x = pn_data_get_float(pn_object()); break;
-      case DOUBLE: x = float(pn_data_get_double(pn_object())); break;
-      default: assert_type_equal(FLOAT, tid);
-    }
-    sg.cancel();
-    return *this;
-}
-
-decoder& decoder::operator>>(double &x) {
-    internal::state_guard sg(*this);
-    type_id tid = pre_get();
-    if (exact_) assert_type_equal(DOUBLE, tid);
-    switch (tid) {
-      case FLOAT: x = static_cast<double>(pn_data_get_float(pn_object())); break;
-      case DOUBLE: x = pn_data_get_double(pn_object()); break;
-      default: assert_type_equal(DOUBLE, tid);
-    }
-    sg.cancel();
-    return *this;
-}
-
-decoder& decoder::operator>>(decimal32 &x) { return extract(x, pn_data_get_decimal32); }
-decoder& decoder::operator>>(decimal64 &x) { return extract(x, pn_data_get_decimal64); }
-decoder& decoder::operator>>(decimal128 &x)  { return extract(x, pn_data_get_decimal128); }
-
-decoder& decoder::operator>>(uuid &x)  { return extract(x, pn_data_get_uuid); }
-decoder& decoder::operator>>(binary &x)  { return extract(x, pn_data_get_binary); }
-decoder& decoder::operator>>(symbol &x)  { return extract(x, pn_data_get_symbol); }
-
-decoder& decoder::operator>>(std::string &x)  {
-    internal::state_guard sg(*this);
-    type_id tid = pre_get();
-    if (exact_) assert_type_equal(STRING, tid);
-    switch (tid) {
-      case STRING: x = str(pn_data_get_string(pn_object())); break;
-      case SYMBOL: x = str(pn_data_get_symbol(pn_object())); break;
-      default: assert_type_equal(STRING, tid);
-    }
-    sg.cancel();
-    return *this;
-}
-
-} // codec
-} // proton
diff --git a/proton-c/bindings/cpp/src/delivery.cpp b/proton-c/bindings/cpp/src/delivery.cpp
deleted file mode 100644
index 0562304..0000000
--- a/proton-c/bindings/cpp/src/delivery.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/delivery.hpp"
-
-#include "proton/receiver.hpp"
-
-#include "proton_bits.hpp"
-
-#include <proton/delivery.h>
-
-namespace {
-
-void settle_delivery(pn_delivery_t* o, uint64_t state) {
-    pn_delivery_update(o, state);
-    pn_delivery_settle(o);
-}
-
-}
-
-namespace proton {
-
-delivery::delivery(pn_delivery_t* d): transfer(make_wrapper(d)) {}
-receiver delivery::receiver() const { return make_wrapper<class receiver>(pn_delivery_link(pn_object())); }
-void delivery::accept() { settle_delivery(pn_object(), ACCEPTED); }
-void delivery::reject() { settle_delivery(pn_object(), REJECTED); }
-void delivery::release() { settle_delivery(pn_object(), RELEASED); }
-void delivery::modify() { settle_delivery(pn_object(), MODIFIED); }
-
-}
diff --git a/proton-c/bindings/cpp/src/duration.cpp b/proton-c/bindings/cpp/src/duration.cpp
deleted file mode 100644
index 9918da1..0000000
--- a/proton-c/bindings/cpp/src/duration.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include "proton/duration.hpp"
-#include "proton/timestamp.hpp"
-
-#include <limits>
-#include <iostream>
-
-namespace proton {
-
-const duration duration::FOREVER(std::numeric_limits<duration::numeric_type>::max());
-const duration duration::IMMEDIATE(0);
-const duration duration::SECOND(1000);
-const duration duration::MINUTE(SECOND * 60);
-
-std::ostream& operator<<(std::ostream& o, duration d) { return o << d.milliseconds(); }
-
-}
diff --git a/proton-c/bindings/cpp/src/encoder.cpp b/proton-c/bindings/cpp/src/encoder.cpp
deleted file mode 100644
index 89ac8c4..0000000
--- a/proton-c/bindings/cpp/src/encoder.cpp
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "proton/codec/encoder.hpp"
-
-#include "proton_bits.hpp"
-#include "types_internal.hpp"
-#include "msg.hpp"
-
-#include "proton/annotation_key.hpp"
-#include "proton/binary.hpp"
-#include "proton/decimal.hpp"
-#include "proton/message_id.hpp"
-#include "proton/scalar_base.hpp"
-#include "proton/symbol.hpp"
-#include "proton/timestamp.hpp"
-#include "proton/value.hpp"
-
-#include <proton/codec.h>
-
-#include <algorithm>
-#include <assert.h>
-
-namespace proton {
-namespace codec {
-
-void encoder::check(long result) {
-    if (result < 0)
-        throw conversion_error(error_str(pn_data_error(pn_object()), result));
-}
-
-
-encoder::encoder(internal::value_base& v) : data(v.data()) {
-    clear();
-}
-
-bool encoder::encode(char* buffer, size_t& size) {
-    internal::state_guard sg(*this); // In case of error
-    ssize_t result = pn_data_encode(pn_object(), buffer, size);
-    if (result == PN_OVERFLOW) {
-        result = pn_data_encoded_size(pn_object());
-        if (result >= 0) {
-            size = size_t(result);
-            return false;
-        }
-    }
-    check(result);
-    size = size_t(result);
-    sg.cancel();                // Don't restore state, all is well.
-    pn_data_clear(pn_object());
-    return true;
-}
-
-void encoder::encode(std::string& s) {
-    s.resize(std::max(s.capacity(), size_t(1))); // Use full capacity, ensure not empty
-    size_t size = s.size();
-    assert(!s.empty());
-    if (!encode(&s[0], size)) {
-        s.resize(size);
-        assert(!s.empty());
-        encode(&s[0], size);
-    }
-}
-
-std::string encoder::encode() {
-    std::string s;
-    encode(s);
-    return s;
-}
-
-encoder& encoder::operator<<(const start& s) {
-    switch (s.type) {
-      case ARRAY: pn_data_put_array(pn_object(), s.is_described, pn_type_t(s.element)); break;
-      case MAP: pn_data_put_map(pn_object()); break;
-      case LIST: pn_data_put_list(pn_object()); break;
-      case DESCRIBED: pn_data_put_described(pn_object()); break;
-      default:
-        throw conversion_error(MSG("" << s.type << " is not a container type"));
-    }
-    pn_data_enter(pn_object());
-    return *this;
-}
-
-encoder& encoder::operator<<(const finish&) {
-    pn_data_exit(pn_object());
-    return *this;
-}
-
-namespace {
-
-template <class T, class U> T coerce(const U &x) { return x; }
-template <> pn_uuid_t coerce(const uuid& x) { pn_uuid_t y; byte_copy(y, x); return  y; }
-template <> pn_decimal32_t coerce(const decimal32 &x) { pn_decimal32_t y; byte_copy(y, x); return  y; }
-template <> pn_decimal64_t coerce(const decimal64 &x) { pn_decimal64_t y; byte_copy(y, x); return  y; }
-template <> pn_decimal128_t coerce(const decimal128 &x) { pn_decimal128_t y; byte_copy(y, x); return  y; }
-
-int pn_data_put_amqp_string(pn_data_t *d, const std::string& x) { return pn_data_put_string(d, pn_bytes(x)); }
-int pn_data_put_amqp_binary(pn_data_t *d, const binary& x) { return pn_data_put_binary(d, pn_bytes(x)); }
-int pn_data_put_amqp_symbol(pn_data_t *d, const symbol& x) { return pn_data_put_symbol(d, pn_bytes(x)); }
-} // namespace
-
-template <class T, class U>
-encoder& encoder::insert(const T& x, int (*put)(pn_data_t*, U)) {
-    internal::state_guard sg(*this);         // Save state in case of error.
-    check(put(pn_object(), coerce<U>(x)));
-    sg.cancel();                // Don't restore state, all is good.
-    return *this;
-}
-
-encoder& encoder::operator<<(bool x) { return insert(x, pn_data_put_bool); }
-encoder& encoder::operator<<(uint8_t x) { return insert(x, pn_data_put_ubyte); }
-encoder& encoder::operator<<(int8_t x) { return insert(x, pn_data_put_byte); }
-encoder& encoder::operator<<(uint16_t x) { return insert(x, pn_data_put_ushort); }
-encoder& encoder::operator<<(int16_t x) { return insert(x, pn_data_put_short); }
-encoder& encoder::operator<<(uint32_t x) { return insert(x, pn_data_put_uint); }
-encoder& encoder::operator<<(int32_t x) { return insert(x, pn_data_put_int); }
-encoder& encoder::operator<<(wchar_t x) { return insert(x, pn_data_put_char); }
-encoder& encoder::operator<<(uint64_t x) { return insert(x, pn_data_put_ulong); }
-encoder& encoder::operator<<(int64_t x) { return insert(x, pn_data_put_long); }
-encoder& encoder::operator<<(timestamp x) { return insert(x.milliseconds(), pn_data_put_timestamp); }
-encoder& encoder::operator<<(float x) { return insert(x, pn_data_put_float); }
-encoder& encoder::operator<<(double x) { return insert(x, pn_data_put_double); }
-encoder& encoder::operator<<(decimal32 x) { return insert(x, pn_data_put_decimal32); }
-encoder& encoder::operator<<(decimal64 x) { return insert(x, pn_data_put_decimal64); }
-encoder& encoder::operator<<(decimal128 x) { return insert(x, pn_data_put_decimal128); }
-encoder& encoder::operator<<(const uuid& x) { return insert(x, pn_data_put_uuid); }
-encoder& encoder::operator<<(const std::string& x) { return insert(x, pn_data_put_amqp_string); }
-encoder& encoder::operator<<(const symbol& x) { return insert(x, pn_data_put_amqp_symbol); }
-encoder& encoder::operator<<(const binary& x) { return insert(x, pn_data_put_amqp_binary); }
-encoder& encoder::operator<<(const null&) { pn_data_put_null(pn_object()); return *this; }
-
-encoder& encoder::operator<<(const scalar_base& x) { return insert(x.atom_, pn_data_put_atom); }
-
-encoder& encoder::operator<<(const internal::value_base& x) {
-    data d = x.data_;
-    if (*this == d)
-        throw conversion_error("cannot insert into self");
-    if (!d || d.empty())
-        return *this << null();
-    d.rewind();
-    check(append(d));
-    return *this;
-}
-
-} // codec
-} // proton
diff --git a/proton-c/bindings/cpp/src/endpoint.cpp b/proton-c/bindings/cpp/src/endpoint.cpp
deleted file mode 100644
index b99ab46..0000000
--- a/proton-c/bindings/cpp/src/endpoint.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include "proton_bits.hpp"
-
-#include "proton/connection.hpp"
-#include "proton/endpoint.hpp"
-#include "proton/error_condition.hpp"
-#include "proton/link.hpp"
-#include "proton/session.hpp"
-
-#include <proton/connection.h>
-#include <proton/session.h>
-#include <proton/link.h>
-
-namespace {
-
-inline bool uninitialized(int state) { return state & PN_LOCAL_UNINIT; }
-inline bool active(int state) { return state & PN_LOCAL_ACTIVE; }
-inline bool closed(int state) { return (state & PN_LOCAL_CLOSED) && (state & PN_REMOTE_CLOSED); }
-}
-
-namespace proton {
-
-bool connection::uninitialized() const { return ::uninitialized(pn_connection_state(pn_object())); }
-bool connection::active() const { return ::active(pn_connection_state(pn_object())); }
-bool connection::closed() const { return ::closed(pn_connection_state(pn_object())); }
-
-void connection::close(const error_condition& condition) {
-    set_error_condition(condition, pn_connection_condition(pn_object()));
-    close();
-}
-
-bool session::uninitialized() const { return ::uninitialized(pn_session_state(pn_object())); }
-bool session::active() const { return ::active(pn_session_state(pn_object())); }
-bool session::closed() const { return ::closed(pn_session_state(pn_object())); }
-
-void session::close(const error_condition& condition) {
-    set_error_condition(condition, pn_session_condition(pn_object()));
-    close();
-}
-
-bool link::uninitialized() const { return ::uninitialized(pn_link_state(pn_object())); }
-bool link::active() const { return ::active(pn_link_state(pn_object())); }
-bool link::closed() const { return ::closed(pn_link_state(pn_object())); }
-
-void link::close(const error_condition& condition) {
-    set_error_condition(condition, pn_link_condition(pn_object()));
-    close();
-}
-
-endpoint::~endpoint() {}
-
-}
diff --git a/proton-c/bindings/cpp/src/engine_test.cpp b/proton-c/bindings/cpp/src/engine_test.cpp
deleted file mode 100644
index 991836d..0000000
--- a/proton-c/bindings/cpp/src/engine_test.cpp
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-#include "test_bits.hpp"
-#include "test_dummy_container.hpp"
-#include "proton_bits.hpp"
-
-#include "proton/container.hpp"
-#include "proton/uuid.hpp"
-#include "proton/io/connection_driver.hpp"
-#include "proton/io/link_namer.hpp"
-#include "proton/messaging_handler.hpp"
-#include "proton/types_fwd.hpp"
-#include "proton/link.hpp"
-#include <deque>
-#include <algorithm>
-
-namespace {
-
-using namespace std;
-using namespace proton;
-
-using proton::io::connection_driver;
-using proton::io::const_buffer;
-using proton::io::mutable_buffer;
-
-using test::dummy_container;
-
-typedef std::deque<char> byte_stream;
-
-/// In memory connection_driver that reads and writes from byte_streams
-struct in_memory_engine : public connection_driver {
-
-    byte_stream& reads;
-    byte_stream& writes;
-
-    in_memory_engine(byte_stream& rd, byte_stream& wr, class container& cont) :
-        connection_driver(cont), reads(rd), writes(wr) {}
-
-    void do_read() {
-        mutable_buffer rbuf = read_buffer();
-        size_t size = std::min(reads.size(), rbuf.size);
-        if (size) {
-            copy(reads.begin(), reads.begin()+size, static_cast<char*>(rbuf.data));
-            read_done(size);
-            reads.erase(reads.begin(), reads.begin()+size);
-        }
-    }
-
-    void do_write() {
-        const_buffer wbuf = write_buffer();
-        if (wbuf.size) {
-            writes.insert(writes.begin(),
-                          static_cast<const char*>(wbuf.data),
-                          static_cast<const char*>(wbuf.data) + wbuf.size);
-            write_done(wbuf.size);
-        }
-    }
-
-    void process() {
-        if (!dispatch())
-            throw std::runtime_error("unexpected close: "+connection().error().what());
-        do_read();
-        do_write();
-        dispatch();
-    }
-};
-
-/// A pair of engines that talk to each other in-memory, simulating a connection.
-struct engine_pair {
-    dummy_container conta, contb;
-    byte_stream ab, ba;
-    in_memory_engine a, b;
-
-    engine_pair(const connection_options& oa, const connection_options& ob,
-                const std::string& name=""
-    ) :
-        conta(name+"a"), contb(name+"b"), a(ba, ab, conta), b(ab, ba, contb)
-    {
-        a.connect(oa);
-        b.accept(ob);
-    }
-
-    void process() { a.process(); b.process(); }
-};
-
-template <class S> typename S::value_type quick_pop(S& s) {
-    ASSERT(!s.empty());
-    typename S::value_type x = s.front();
-    s.pop_front();
-    return x;
-}
-
-/// A handler that records incoming endpoints, errors etc.
-struct record_handler : public messaging_handler {
-    std::deque<proton::receiver> receivers;
-    std::deque<proton::sender> senders;
-    std::deque<proton::session> sessions;
-    std::deque<std::string> unhandled_errors, transport_errors, connection_errors;
-
-    void on_receiver_open(receiver &l) PN_CPP_OVERRIDE {
-        receivers.push_back(l);
-    }
-
-    void on_sender_open(sender &l) PN_CPP_OVERRIDE {
-        senders.push_back(l);
-    }
-
-    void on_session_open(session &s) PN_CPP_OVERRIDE {
-        sessions.push_back(s);
-    }
-
-    void on_transport_error(transport& t) PN_CPP_OVERRIDE {
-        transport_errors.push_back(t.error().what());
-    }
-
-    void on_connection_error(connection& c) PN_CPP_OVERRIDE {
-        connection_errors.push_back(c.error().what());
-    }
-
-    void on_error(const proton::error_condition& c) PN_CPP_OVERRIDE {
-        unhandled_errors.push_back(c.what());
-    }
-};
-
-struct namer : public io::link_namer {
-    char name;
-    namer(char c) : name(c) {}
-    std::string link_name() { return std::string(1, name++); }
-};
-
-void test_engine_container_link_id() {
-    record_handler ha, hb;
-    engine_pair e(ha, hb, "ids-");
-    e.a.connect(ha);
-    e.b.accept(hb);
-
-    namer na('x');
-    namer nb('b');
-    connection ca = e.a.connection();
-    connection cb = e.b.connection();
-    set_link_namer(ca, na);
-    set_link_namer(cb, nb);
-
-    ASSERT_EQUAL("ids-a", e.a.connection().container_id());
-    e.b.connection().open();
-    ASSERT_EQUAL("ids-b", e.b.connection().container_id());
-
-    e.a.connection().open_sender("foo");
-    while (ha.senders.empty() || hb.receivers.empty()) e.process();
-    sender s = quick_pop(ha.senders);
-    ASSERT_EQUAL("x", s.name());
-
-    ASSERT_EQUAL("x", quick_pop(hb.receivers).name());
-
-    e.a.connection().open_receiver("bar");
-    while (ha.receivers.empty() || hb.senders.empty()) e.process();
-    ASSERT_EQUAL("y", quick_pop(ha.receivers).name());
-    ASSERT_EQUAL("y", quick_pop(hb.senders).name());
-
-    e.b.connection().open_receiver("");
-    while (ha.senders.empty() || hb.receivers.empty()) e.process();
-    ASSERT_EQUAL("b", quick_pop(ha.senders).name());
-    ASSERT_EQUAL("b", quick_pop(hb.receivers).name());
-}
-
-void test_endpoint_close() {
-    record_handler ha, hb;
-    engine_pair e(ha, hb);
-    e.a.connection().open_sender("x");
-    e.a.connection().open_receiver("y");
-    while (ha.senders.size()+ha.receivers.size() < 2 ||
-           hb.senders.size()+hb.receivers.size() < 2) e.process();
-    proton::link ax = quick_pop(ha.senders), ay = quick_pop(ha.receivers);
-    proton::link bx = quick_pop(hb.receivers), by = quick_pop(hb.senders);
-
-    // Close a link
-    ax.close(proton::error_condition("err", "foo bar"));
-    while (!bx.closed()) e.process();
-    proton::error_condition c = bx.error();
-    ASSERT_EQUAL("err", c.name());
-    ASSERT_EQUAL("foo bar", c.description());
-    ASSERT_EQUAL("err: foo bar", c.what());
-
-    // Close a link with an empty condition
-    ay.close(proton::error_condition());
-    while (!by.closed()) e.process();
-    ASSERT(by.error().empty());
-
-    // Close a connection
-    connection ca = e.a.connection(), cb = e.b.connection();
-    ca.close(proton::error_condition("conn", "bad connection"));
-    while (!cb.closed()) e.process();
-    ASSERT_EQUAL("conn: bad connection", cb.error().what());
-    ASSERT_EQUAL(1u, hb.connection_errors.size());
-    ASSERT_EQUAL("conn: bad connection", hb.connection_errors.front());
-}
-
-void test_engine_disconnected() {
-    // engine.disconnected() aborts the connection and calls the local on_transport_error()
-    record_handler ha, hb;
-    engine_pair e(ha, hb, "disconnected");
-    e.a.connect(ha);
-    e.b.accept(hb);
-    while (!e.a.connection().active() || !e.b.connection().active())
-        e.process();
-
-    // Close a with an error condition. The AMQP connection is still open.
-    e.a.disconnected(proton::error_condition("oops", "engine failure"));
-    ASSERT(!e.a.dispatch());
-    ASSERT(!e.a.connection().closed());
-    ASSERT(e.a.connection().error().empty());
-    ASSERT_EQUAL(0u, ha.connection_errors.size());
-    ASSERT_EQUAL("oops: engine failure", e.a.transport().error().what());
-    ASSERT_EQUAL(1u, ha.transport_errors.size());
-    ASSERT_EQUAL("oops: engine failure", ha.transport_errors.front());
-
-    // In a real app the IO code would detect the abort and do this:
-    e.b.disconnected(proton::error_condition("broken", "it broke"));
-    ASSERT(!e.b.dispatch());
-    ASSERT(!e.b.connection().closed());
-    ASSERT(e.b.connection().error().empty());
-    ASSERT_EQUAL(0u, hb.connection_errors.size());
-    // Proton-C adds (connection aborted) if transport closes too early,
-    // and provides a default message if there is no user message.
-    ASSERT_EQUAL("broken: it broke (connection aborted)", e.b.transport().error().what());
-    ASSERT_EQUAL(1u, hb.transport_errors.size());
-    ASSERT_EQUAL("broken: it broke (connection aborted)", hb.transport_errors.front());
-}
-
-void test_no_container() {
-    // An engine with no container should throw, not crash.
-    connection_driver e;
-    try {
-        e.connection().container();
-        FAIL("expected error");
-    } catch (proton::error) {}
-    ASSERT(make_thread_safe<connection>(e.connection()).get());
-    ASSERT(!make_thread_safe<connection>(e.connection()).get()->event_loop());
-}
-
-}
-
-int main(int, char**) {
-    int failed = 0;
-    RUN_TEST(failed, test_engine_container_link_id());
-    RUN_TEST(failed, test_endpoint_close());
-    RUN_TEST(failed, test_engine_disconnected());
-    RUN_TEST(failed, test_no_container());
-    return failed;
-}
diff --git a/proton-c/bindings/cpp/src/error.cpp b/proton-c/bindings/cpp/src/error.cpp
deleted file mode 100644
index 28fd9f5..0000000
--- a/proton-c/bindings/cpp/src/error.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "proton/error.hpp"
-
-namespace proton {
-
-error::error(const std::string& msg) : std::runtime_error(msg) {}
-
-timeout_error::timeout_error(const std::string& msg) : error(msg) {}
-
-conversion_error::conversion_error(const std::string& msg) : error(msg) {}
-
-}
diff --git a/proton-c/bindings/cpp/src/error_condition.cpp b/proton-c/bindings/cpp/src/error_condition.cpp
deleted file mode 100644
index ead1cff..0000000
--- a/proton-c/bindings/cpp/src/error_condition.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include "proton/error_condition.hpp"
-
-#include <proton/condition.h>
-
-#include "proton_bits.hpp"
-
-#include <ostream>
-
-namespace proton {
-
-error_condition::error_condition(pn_condition_t* c) :
-    name_(str(pn_condition_get_name(c))),
-    description_(str(pn_condition_get_description(c))),
-    properties_(internal::value_ref(pn_condition_info(c)))
-{}
-
-
-error_condition::error_condition(std::string description) :
-    name_("proton:io:error"),
-    description_(description)
-{}
-
-error_condition::error_condition(std::string name, std::string description) :
-    name_(name),
-    description_(description)
-{}
-
-error_condition::error_condition(std::string name, std::string description, value properties) :
-    name_(name),
-    description_(description),
-    properties_(properties)
-{}
-
-#if PN_CPP_HAS_EXPLICIT_CONVERSIONS
-error_condition::operator bool() const {
-  return !name_.empty();
-}
-#endif
-
-bool error_condition::operator!() const {
-    return name_.empty();
-}
-
-bool error_condition::empty() const {
-    return name_.empty();
-}
-
-std::string error_condition::name() const {
-    return name_;
-}
-
-std::string error_condition::description() const {
-    return description_;
-}
-
-value error_condition::properties() const {
-    return properties_;
-}
-
-std::string error_condition::what() const {
-    if (!*this) {
-        return "No error condition";
-    } else {
-      std::string s(name_);
-      if (!description_.empty()) {
-          s += ": ";
-          s += description_;
-      }
-      return s;
-    }
-}
-
-bool operator==(const error_condition& x, const error_condition& y) {
-    return x.name() == y.name() && x.description() == y.description()
-        && x.properties() == y.properties();
-}
-
-std::ostream& operator<<(std::ostream& o, const error_condition& err) {
-    return o << err.what();
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/event_loop.cpp b/proton-c/bindings/cpp/src/event_loop.cpp
deleted file mode 100644
index ea4ee71..0000000
--- a/proton-c/bindings/cpp/src/event_loop.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "proton/event_loop.hpp"
-
-#include "contexts.hpp"
-#include "event_loop_impl.hpp"
-
-#include <proton/session.h>
-#include <proton/link.h>
-
-namespace proton {
-
-event_loop::event_loop() {}
-event_loop::~event_loop() {}
-
-event_loop& event_loop::operator=(impl* i) { impl_.reset(i); return *this; }
-
-bool event_loop::inject(void_function0& f) {
-    return impl_->inject(f);
-}
-
-#if PN_CPP_HAS_STD_FUNCTION
-bool event_loop::inject(std::function<void()> f) {
-    return impl_->inject(f);
-}
-#endif
-
-event_loop& event_loop::get(pn_connection_t* c) {
-    return connection_context::get(c).event_loop_;
-}
-
-event_loop& event_loop::get(pn_session_t* s) {
-    return get(pn_session_connection(s));
-}
-
-event_loop& event_loop::get(pn_link_t* l) {
-    return get(pn_link_session(l));
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/handler.cpp b/proton-c/bindings/cpp/src/handler.cpp
deleted file mode 100644
index 5cf6208..0000000
--- a/proton-c/bindings/cpp/src/handler.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include "proton/messaging_handler.hpp"
-
-#include "proton/connection.hpp"
-#include "proton/error_condition.hpp"
-#include "proton/receiver.hpp"
-#include "proton/sender.hpp"
-#include "proton/session.hpp"
-#include "proton/transport.hpp"
-
-#include "proton_event.hpp"
-#include "messaging_adapter.hpp"
-
-#include <proton/handlers.h>
-
-#include <algorithm>
-
-namespace proton {
-
-messaging_handler::messaging_handler(){}
-
-messaging_handler::~messaging_handler(){}
-
-void messaging_handler::on_container_start(container &) {}
-void messaging_handler::on_container_stop(container &) {}
-void messaging_handler::on_message(delivery &, message &) {}
-void messaging_handler::on_sendable(sender &) {}
-void messaging_handler::on_transport_close(transport &) {}
-void messaging_handler::on_transport_error(transport &t) { on_error(t.error()); }
-void messaging_handler::on_transport_open(transport &) {}
-void messaging_handler::on_connection_close(connection &) {}
-void messaging_handler::on_connection_error(connection &c) { on_error(c.error()); }
-void messaging_handler::on_connection_open(connection &) {}
-void messaging_handler::on_session_close(session &) {}
-void messaging_handler::on_session_error(session &s) { on_error(s.error()); }
-void messaging_handler::on_session_open(session &) {}
-void messaging_handler::on_receiver_close(receiver &) {}
-void messaging_handler::on_receiver_error(receiver &l) { on_error(l.error()); }
-void messaging_handler::on_receiver_open(receiver &) {}
-void messaging_handler::on_receiver_detach(receiver &) {}
-void messaging_handler::on_sender_close(sender &) {}
-void messaging_handler::on_sender_error(sender &l) { on_error(l.error()); }
-void messaging_handler::on_sender_open(sender &) {}
-void messaging_handler::on_sender_detach(sender &) {}
-void messaging_handler::on_tracker_accept(tracker &) {}
-void messaging_handler::on_tracker_reject(tracker &) {}
-void messaging_handler::on_tracker_release(tracker &) {}
-void messaging_handler::on_tracker_settle(tracker &) {}
-void messaging_handler::on_delivery_settle(delivery &) {}
-void messaging_handler::on_sender_drain_start(sender &) {}
-void messaging_handler::on_receiver_drain_finish(receiver &) {}
-
-void messaging_handler::on_error(const error_condition& c) { throw proton::error(c.what()); }
-
-}
diff --git a/proton-c/bindings/cpp/src/include/acceptor.hpp b/proton-c/bindings/cpp/src/include/acceptor.hpp
deleted file mode 100644
index 9a25592..0000000
--- a/proton-c/bindings/cpp/src/include/acceptor.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef PROTON_ACCEPTOR_HPP
-#define PROTON_ACCEPTOR_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/internal/export.hpp"
-#include "proton/internal/object.hpp"
-
-#include <proton/reactor.h>
-
-struct pn_acceptor_t;
-
-namespace proton {
-
-/// A context for accepting inbound connections.
-///
-/// @see container::listen
-class acceptor : public internal::object<pn_acceptor_t> {
-    /// @cond INTERNAL
-    acceptor(pn_acceptor_t* a) : internal::object<pn_acceptor_t>(a) {}
-    /// @endcond
-
-  public:
-    acceptor() : internal::object<pn_acceptor_t>(0) {}
-
-    /// Close the acceptor.
-    PN_CPP_EXTERN void close();
-
-    /// Return the current set of connection options applied to
-    /// inbound connectons by the acceptor.
-    ///
-    /// Note that changes made to the connection options only affect
-    /// connections accepted after this call returns.
-    PN_CPP_EXTERN class connection_options &connection_options();
-
-    /// @cond INTERNAL
-  friend class internal::factory<acceptor>;
-    /// @endcond
-};
-
-} // proton
-
-#endif // PROTON_ACCEPTOR_HPP
diff --git a/proton-c/bindings/cpp/src/include/connector.hpp b/proton-c/bindings/cpp/src/include/connector.hpp
deleted file mode 100644
index 6bcd0db..0000000
--- a/proton-c/bindings/cpp/src/include/connector.hpp
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef PROTON_CPP_CONNECTOR_HANDLER_H
-#define PROTON_CPP_CONNECTOR_HANDLER_H
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/connection.hpp"
-#include "proton/connection_options.hpp"
-#include <proton/event.h>
-#include <proton/reactor.h>
-#include "proton/url.hpp"
-
-#include "container_impl.hpp"
-#include "proton_handler.hpp"
-
-#include <string>
-
-
-namespace proton {
-
-class reconnect_timer;
-
-class container::impl::connector : public proton_handler
-{
-  public:
-    connector(connection &c, const connection_options &options, const url&);
-    ~connector();
-    const url &address() const { return address_; }
-    void connect();
-    void reconnect_timer(const class reconnect_timer &);
-    virtual void on_connection_local_open(proton_event &e);
-    virtual void on_connection_remote_open(proton_event &e);
-    virtual void on_connection_init(proton_event &e);
-    virtual void on_transport_closed(proton_event &e);
-    virtual void on_transport_tail_closed(proton_event &e);
-    virtual void on_timer_task(proton_event &e);
-
-  private:
-    connection connection_;
-    const connection_options options_;
-    const url address_;
-    class reconnect_timer *reconnect_timer_;
-};
-
-
-}
-
-#endif  /*!PROTON_CPP_CONNECTOR_HANDLER_H*/
diff --git a/proton-c/bindings/cpp/src/include/container_impl.hpp b/proton-c/bindings/cpp/src/include/container_impl.hpp
deleted file mode 100644
index 7443150..0000000
--- a/proton-c/bindings/cpp/src/include/container_impl.hpp
+++ /dev/null
@@ -1,119 +0,0 @@
-#ifndef PROTON_CPP_CONTAINERIMPL_H
-#define PROTON_CPP_CONTAINERIMPL_H
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/fwd.hpp"
-#include "proton/container.hpp"
-#include "proton/connection.hpp"
-#include "proton/connection_options.hpp"
-#include "proton/duration.hpp"
-#include "proton/sender.hpp"
-#include "proton/sender_options.hpp"
-#include "proton/receiver.hpp"
-#include "proton/receiver_options.hpp"
-
-#include "messaging_adapter.hpp"
-#include "reactor.hpp"
-#include "proton_bits.hpp"
-#include "proton_handler.hpp"
-
-#include <list>
-#include <map>
-#include <string>
-
-namespace proton {
-
-class dispatch_helper;
-class connector;
-class acceptor;
-class url;
-class listen_handler;
-
-class container::impl {
-  public:
-    impl(container& c, const std::string& id, messaging_handler* = 0);
-    ~impl();
-    std::string id() const { return id_; }
-    returned<connection> connect(const std::string&, const connection_options&);
-    returned<sender> open_sender(
-        const std::string&, const proton::sender_options &, const connection_options &);
-    returned<receiver> open_receiver(
-        const std::string&, const proton::receiver_options &, const connection_options &);
-    listener listen(const std::string&, listen_handler& lh);
-    void stop_listening(const std::string&);
-    void client_connection_options(const connection_options &);
-    connection_options client_connection_options() const { return client_connection_options_; }
-    void server_connection_options(const connection_options &);
-    connection_options server_connection_options() const { return server_connection_options_; }
-    void sender_options(const proton::sender_options&);
-    class sender_options sender_options() const { return sender_options_; }
-    void receiver_options(const proton::receiver_options&);
-    class receiver_options receiver_options() const { return receiver_options_; }
-    void run();
-    void stop(const error_condition& err);
-    void auto_stop(bool set);
-    void schedule(duration, void_function0&);
-#if PN_CPP_HAS_STD_FUNCTION
-    void schedule(duration, std::function<void()>);
-#endif
-
-    // non-interface functionality
-    class connector;
-
-    void configure_server_connection(connection &c);
-    static void schedule(impl& ci, int delay, proton_handler *h);
-    static void schedule(container& c, int delay, proton_handler *h);
-    template <class T> static void set_handler(T s, messaging_handler* h);
-
-  private:
-    class handler_context;
-    class override_handler;
-
-    internal::pn_ptr<pn_handler_t> cpp_handler(proton_handler *h);
-
-    container& container_;
-    reactor reactor_;
-    // Keep a list of all the handlers used by the container so they last as long as the container
-    std::list<internal::pn_unique_ptr<proton_handler> > handlers_;
-    std::string id_;
-    connection_options client_connection_options_;
-    connection_options server_connection_options_;
-    proton::sender_options sender_options_;
-    proton::receiver_options receiver_options_;
-    typedef std::map<std::string, acceptor> acceptors;
-    acceptors acceptors_;
-    bool auto_stop_;
-};
-
-template <class T>
-void container::impl::set_handler(T s, messaging_handler* mh) {
-    pn_record_t *record = internal::get_attachments(unwrap(s));
-    proton_handler* h = new messaging_adapter(*mh);
-    impl* ci = s.container().impl_.get();
-    ci->handlers_.push_back(h);
-    pn_record_set_handler(record, ci->cpp_handler(h).get());
-}
-
-}
-
-#endif  /*!PROTON_CPP_CONTAINERIMPL_H*/
diff --git a/proton-c/bindings/cpp/src/include/contexts.hpp b/proton-c/bindings/cpp/src/include/contexts.hpp
deleted file mode 100644
index e80c434..0000000
--- a/proton-c/bindings/cpp/src/include/contexts.hpp
+++ /dev/null
@@ -1,136 +0,0 @@
-#ifndef PROTON_CPP_CONTEXTS_H
-#define PROTON_CPP_CONTEXTS_H
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/connection.hpp"
-#include "proton/container.hpp"
-#include "proton/io/connection_driver.hpp"
-#include "proton/event_loop.hpp"
-#include "proton/listen_handler.hpp"
-#include "proton/message.hpp"
-#include "proton/internal/pn_unique_ptr.hpp"
-
-#include "proton/io/link_namer.hpp"
-
-#include "proton_handler.hpp"
-
-struct pn_session_t;
-struct pn_event_t;
-struct pn_reactor_t;
-struct pn_record_t;
-struct pn_acceptor_t;
-
-namespace proton {
-
-class proton_handler;
-class reactor;
-
-// Base class for C++ classes that are used as proton contexts.
-// Contexts are pn_objects managed by pn reference counts, the C++ value is allocated in-place.
-class context {
-  public:
-    // identifies a context, contains a record pointer and a handle.
-    typedef std::pair<pn_record_t*, pn_handle_t> id;
-
-    virtual ~context();
-
-    // Allocate a default-constructed T as a proton object.
-    // T must be a subclass of context.
-    template <class T> static T *create() { return new(alloc(sizeof(T))) T(); }
-
-    // The pn_class for a context
-    static pn_class_t* pn_class();
-
-    // Get the context identified by id as a C++ T*, return null pointer if not present.
-    template <class T> static T* ptr(id id_) {
-        return reinterpret_cast<T*>(pn_record_get(id_.first, id_.second));
-    }
-
-    // If the context is not present, create it with value x.
-    template <class T> static T& ref(id id_) {
-        T* ctx = context::ptr<T>(id_);
-        if (!ctx) {
-            ctx = create<T>();
-            pn_record_def(id_.first, id_.second, pn_class());
-            pn_record_set(id_.first, id_.second, ctx);
-            pn_decref(ctx);
-        }
-        return *ctx;
-    }
-
-  private:
-    static void *alloc(size_t n);
-};
-
-// Connection context used by all connections.
-class connection_context : public context {
-  public:
-    connection_context() : container(0), default_session(0), link_gen(0) {}
-
-    class container* container;
-    pn_session_t *default_session; // Owned by connection.
-    message event_message;      // re-used by messaging_adapter for performance.
-    io::link_namer* link_gen;      // Link name generator.
-
-    internal::pn_unique_ptr<proton_handler> handler;
-    event_loop event_loop_;
-
-    static connection_context& get(pn_connection_t *c) { return ref<connection_context>(id(c)); }
-    static connection_context& get(const connection& c) { return ref<connection_context>(id(c)); }
-
-  protected:
-    static context::id id(pn_connection_t*);
-    static context::id id(const connection& c);
-};
-
-void container_context(const reactor&, container&);
-
-class container_context {
-  public:
-    static void set(const reactor& r, container& c);
-    static container& get(pn_reactor_t*);
-};
-
-class listener_context : public context {
-  public:
-    static listener_context& get(pn_acceptor_t* c);
-    listener_context() : listen_handler_(0), ssl(false) {}
-    connection_options  get_options() { return listen_handler_->on_accept(); }
-    class listen_handler* listen_handler_;
-    bool ssl;
-};
-
-class link_context : public context {
-  public:
-    static link_context& get(pn_link_t* l);
-    link_context() : credit_window(10), auto_accept(true), auto_settle(true), draining(false), pending_credit(0) {}
-    int credit_window;
-    bool auto_accept;
-    bool auto_settle;
-    bool draining;
-    uint32_t pending_credit;
-};
-
-}
-
-#endif  /*!PROTON_CPP_CONTEXTS_H*/
diff --git a/proton-c/bindings/cpp/src/include/event_loop_impl.hpp b/proton-c/bindings/cpp/src/include/event_loop_impl.hpp
deleted file mode 100644
index b34a981..0000000
--- a/proton-c/bindings/cpp/src/include/event_loop_impl.hpp
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef PROTON_CPP_EVENT_LOOP_IMPL_HPP
-#define PROTON_CPP_EVENT_LOOP_IMPL_HPP
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/fwd.hpp"
-
-namespace proton {
-
-class event_loop::impl {
-  public:
-    bool inject(void_function0& f);
-#if PN_CPP_HAS_CPP11
-    bool inject(std::function<void()> f);
-#endif
-};
-
-}
-
-#endif // PROTON_CPP_EVENT_LOOP_IMPL_HPP
diff --git a/proton-c/bindings/cpp/src/include/messaging_adapter.hpp b/proton-c/bindings/cpp/src/include/messaging_adapter.hpp
deleted file mode 100644
index 5371eec..0000000
--- a/proton-c/bindings/cpp/src/include/messaging_adapter.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef PROTON_CPP_MESSAGING_ADAPTER_H
-#define PROTON_CPP_MESSAGING_ADAPTER_H
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/messaging_handler.hpp"
-
-#include "proton_handler.hpp"
-
-#include <proton/event.h>
-#include <proton/reactor.h>
-
-///@cond INTERNAL
-
-namespace proton {
-
-/// Convert the low level proton-c events to the higher level proton::messaging_handler calls
-class messaging_adapter : public proton_handler
-{
-  public:
-    messaging_adapter(messaging_handler &delegate) : delegate_(delegate) {}
-
-    void on_reactor_init(proton_event &e);
-    void on_reactor_final(proton_event & e);
-    void on_link_flow(proton_event &e);
-    void on_delivery(proton_event &e);
-    void on_connection_remote_open(proton_event &e);
-    void on_connection_remote_close(proton_event &e);
-    void on_session_remote_open(proton_event &e);
-    void on_session_remote_close(proton_event &e);
-    void on_link_local_open(proton_event &e);
-    void on_link_remote_open(proton_event &e);
-    void on_link_remote_detach(proton_event & e);
-    void on_link_remote_close(proton_event &e);
-    void on_transport_closed(proton_event &e);
-
-  private:
-    messaging_handler &delegate_;  // The handler for generated messaging_event's
-};
-
-}
-///@endcond INTERNAL
-#endif  /*!PROTON_CPP_MESSAGING_ADAPTER_H*/
diff --git a/proton-c/bindings/cpp/src/include/msg.hpp b/proton-c/bindings/cpp/src/include/msg.hpp
deleted file mode 100644
index b24b25c..0000000
--- a/proton-c/bindings/cpp/src/include/msg.hpp
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef PROTON_MSG_H
-#define PROTON_MSG_H
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <sstream>
-#include <iostream>
-
-namespace proton {
-
-/** A simple facade for std::ostringstream that allows
- * in place construction of a message and automatic conversion
- * to string.
- * E.g.
- *@code
- * void foo(const std::string&);
- * foo(msg() << "hello " << 32);
- *@endcode
- * Will construct the string "hello 32" and pass it to foo()
- */
-struct msg {
-    std::ostringstream os;
-    msg() {}
-    msg(const msg& m) : os(m.str()) {}
-    std::string str() const { return os.str(); }
-    operator std::string() const { return str(); }
-    template <class T> msg& operator<<(const T& t) { os << t; return *this; }
-};
-
-inline std::ostream& operator<<(std::ostream& o, const msg& m) { return o << m.str(); }
-
-/** Construct a message using operator << and append (file:line) */
-#define QUOTe_(x) #x
-#define QUOTE(x) QUOTe_(x)
-#define MSG(message) (::proton::msg() << message)
-
-}
-
-#endif  /*!PROTON_MSG_H*/
diff --git a/proton-c/bindings/cpp/src/include/proton_bits.hpp b/proton-c/bindings/cpp/src/include/proton_bits.hpp
deleted file mode 100644
index 97d4bee..0000000
--- a/proton-c/bindings/cpp/src/include/proton_bits.hpp
+++ /dev/null
@@ -1,149 +0,0 @@
-#ifndef PROTON_BITS_HPP
-#define PROTON_BITS_HPP
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-#include <proton/link.h>
-#include <proton/session.h>
-
-#include <string>
-#include <iosfwd>
-
-/**@file
- *
- * Assorted internal proton utilities.
- */
-
-struct pn_error_t;
-
-struct pn_data_t;
-struct pn_transport_t;
-struct pn_sasl_t;
-struct pn_ssl_t;
-struct pn_connection_t;
-struct pn_session_t;
-struct pn_link_t;
-struct pn_delivery_t;
-struct pn_condition_t;
-struct pn_acceptor_t;
-struct pn_terminus_t;
-struct pn_reactor_t;
-struct pn_record_t;
-
-namespace proton {
-
-namespace internal { class data; }
-class transport;
-class sasl;
-class ssl;
-class connection;
-class session;
-class link;
-class sender;
-class receiver;
-class transfer;
-class tracker;
-class delivery;
-class error_condition;
-class acceptor;
-class terminus;
-class source;
-class target;
-class reactor;
-
-std::string error_str(long code);
-
-/** Print the error string from pn_error_t, or from code if pn_error_t has no error. */
-std::string error_str(pn_error_t*, long code=0);
-
-/** Make a void* inspectable via operator <<. */
-struct inspectable { void* value; inspectable(void* o) : value(o) {} };
-
-/** Stream a proton object via pn_inspect. */
-std::ostream& operator<<(std::ostream& o, const inspectable& object);
-
-void set_error_condition(const error_condition&, pn_condition_t*);
-
-/// Convert a const char* to std::string, convert NULL to the empty string.
-inline std::string str(const char* s) { return s ? s : std::string(); }
-
-namespace internal {
-
-// These traits relate the wrapped and wrapper classes for the templated factories below
-template <class T> struct wrapped {};
-template <> struct wrapped<internal::data> { typedef pn_data_t type; };
-template <> struct wrapped<transport> { typedef pn_transport_t type; };
-template <> struct wrapped<sasl> { typedef pn_sasl_t type; };
-template <> struct wrapped<ssl> { typedef pn_ssl_t type; };
-template <> struct wrapped<connection> { typedef pn_connection_t type; };
-template <> struct wrapped<session> { typedef pn_session_t type; };
-template <> struct wrapped<link> { typedef pn_link_t type; };
-template <> struct wrapped<sender> { typedef pn_link_t type; };
-template <> struct wrapped<receiver> { typedef pn_link_t type; };
-template <> struct wrapped<transfer> { typedef pn_delivery_t type; };
-template <> struct wrapped<tracker> { typedef pn_delivery_t type; };
-template <> struct wrapped<delivery> { typedef pn_delivery_t type; };
-template <> struct wrapped<error_condition> { typedef pn_condition_t type; };
-template <> struct wrapped<acceptor> { typedef pn_acceptor_t type; }; // TODO aconway 2016-05-13: reactor only
-template <> struct wrapped<terminus> { typedef pn_terminus_t type; };
-template <> struct wrapped<source> { typedef pn_terminus_t type; };
-template <> struct wrapped<target> { typedef pn_terminus_t type; };
-template <> struct wrapped<reactor> { typedef pn_reactor_t type; };
-
-template <class T> struct wrapper {};
-template <> struct wrapper<pn_data_t> { typedef internal::data type; };
-template <> struct wrapper<pn_transport_t> { typedef transport type; };
-template <> struct wrapper<pn_sasl_t> { typedef sasl type; };
-template <> struct wrapper<pn_ssl_t> { typedef ssl type; };
-template <> struct wrapper<pn_connection_t> { typedef connection type; };
-template <> struct wrapper<pn_session_t> { typedef session type; };
-template <> struct wrapper<pn_link_t> { typedef link type; };
-template <> struct wrapper<pn_delivery_t> { typedef transfer type; };
-template <> struct wrapper<pn_condition_t> { typedef error_condition type; };
-template <> struct wrapper<pn_acceptor_t> { typedef acceptor type; };
-template <> struct wrapper<pn_terminus_t> { typedef terminus type; };
-template <> struct wrapper<pn_reactor_t> { typedef reactor type; };
-
-// Factory for wrapper types
-template <class T>
-class factory {
-public:
-    static T wrap(typename wrapped<T>::type* t) { return t; }
-    static typename wrapped<T>::type* unwrap(T t) { return t.pn_object(); }
-};
-
-// Get attachments for various proton-c types
-template <class T>
-inline pn_record_t* get_attachments(T*);
-
-template <> inline pn_record_t* get_attachments(pn_session_t* s) { return pn_session_attachments(s); }
-template <> inline pn_record_t* get_attachments(pn_link_t* l) { return pn_link_attachments(l); }
-}
-
-template <class T>
-typename internal::wrapper<T>::type make_wrapper(T* t) { return internal::factory<typename internal::wrapper<T>::type>::wrap(t); }
-
-template <class U>
-U make_wrapper(typename internal::wrapped<U>::type* t) { return internal::factory<U>::wrap(t); }
-
-template <class T>
-typename internal::wrapped<T>::type* unwrap(T t) {return internal::factory<T>::unwrap(t); }
-
-}
-
-#endif // PROTON_BITS_HPP
diff --git a/proton-c/bindings/cpp/src/include/proton_event.hpp b/proton-c/bindings/cpp/src/include/proton_event.hpp
deleted file mode 100644
index 00fdadf..0000000
--- a/proton-c/bindings/cpp/src/include/proton_event.hpp
+++ /dev/null
@@ -1,293 +0,0 @@
-#ifndef PROTON_CPP_PROTONEVENT_H
-#define PROTON_CPP_PROTONEVENT_H
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/fwd.hpp"
-#include "proton/error.hpp"
-
-#include <proton/event.h>
-
-namespace proton {
-
-class proton_handler;
-
-/** Event information for a proton::proton_handler */
-class proton_event
-{
-  public:
-    /// The type of an event
-    enum event_type {
-    ///@name Event types
-    ///@{
-
-      /**
-      * Defined as a programming convenience. No event of this type will
-      * ever be generated.
-      */
-      EVENT_NONE=PN_EVENT_NONE,
-
-      /**
-      * A reactor has been started. Events of this type point to the reactor.
-      */
-      REACTOR_INIT=PN_REACTOR_INIT,
-
-      /**
-      * A reactor has no more events to process. Events of this type
-      * point to the reactor.
-      */
-      REACTOR_QUIESCED=PN_REACTOR_QUIESCED,
-
-      /**
-      * A reactor has been stopped. Events of this type point to the reactor.
-      */
-      REACTOR_FINAL=PN_REACTOR_FINAL,
-
-      /**
-      * A timer event has occurred.
-      */
-      TIMER_TASK=PN_TIMER_TASK,
-
-      /**
-      * The connection has been created. This is the first event that
-      * will ever be issued for a connection. Events of this type point
-      * to the relevant connection.
-      */
-      CONNECTION_INIT=PN_CONNECTION_INIT,
-
-      /**
-      * The connection has been bound to a transport. This event is
-      * issued when the transport::bind() is called.
-      */
-      CONNECTION_BOUND=PN_CONNECTION_BOUND,
-
-      /**
-      * The connection has been unbound from its transport. This event is
-      * issued when transport::unbind() is called.
-      */
-      CONNECTION_UNBOUND=PN_CONNECTION_UNBOUND,
-
-      /**
-      * The local connection endpoint has been closed. Events of this
-      * type point to the relevant connection.
-      */
-      CONNECTION_LOCAL_OPEN=PN_CONNECTION_LOCAL_OPEN,
-
-      /**
-      * The remote endpoint has opened the connection. Events of this
-      * type point to the relevant connection.
-      */
-      CONNECTION_REMOTE_OPEN=PN_CONNECTION_REMOTE_OPEN,
-
-      /**
-      * The local connection endpoint has been closed. Events of this
-      * type point to the relevant connection.
-      */
-      CONNECTION_LOCAL_CLOSE=PN_CONNECTION_LOCAL_CLOSE,
-
-      /**
-      *  The remote endpoint has closed the connection. Events of this
-      *  type point to the relevant connection.
-      */
-      CONNECTION_REMOTE_CLOSE=PN_CONNECTION_REMOTE_CLOSE,
-
-      /**
-      * The connection has been freed and any outstanding processing has
-      * been completed. This is the final event that will ever be issued
-      * for a connection.
-      */
-      CONNECTION_FINAL=PN_CONNECTION_FINAL,
-
-      /**
-      * The session has been created. This is the first event that will
-      * ever be issued for a session.
-      */
-      SESSION_INIT=PN_SESSION_INIT,
-
-      /**
-      * The local session endpoint has been opened. Events of this type
-      * point to the relevant session.
-      */
-      SESSION_LOCAL_OPEN=PN_SESSION_LOCAL_OPEN,
-
-      /**
-      * The remote endpoint has opened the session. Events of this type
-      * point to the relevant session.
-      */
-      SESSION_REMOTE_OPEN=PN_SESSION_REMOTE_OPEN,
-
-      /**
-      * The local session endpoint has been closed. Events of this type
-      * point ot the relevant session.
-      */
-      SESSION_LOCAL_CLOSE=PN_SESSION_LOCAL_CLOSE,
-
-      /**
-      * The remote endpoint has closed the session. Events of this type
-      * point to the relevant session.
-      */
-      SESSION_REMOTE_CLOSE=PN_SESSION_REMOTE_CLOSE,
-
-      /**
-      * The session has been freed and any outstanding processing has
-      * been completed. This is the final event that will ever be issued
-      * for a session.
-      */
-      SESSION_FINAL=PN_SESSION_FINAL,
-
-      /**
-      * The link has been created. This is the first event that will ever
-      * be issued for a link.
-      */
-      LINK_INIT=PN_LINK_INIT,
-
-      /**
-      * The local link endpoint has been opened. Events of this type
-      * point ot the relevant link.
-      */
-      LINK_LOCAL_OPEN=PN_LINK_LOCAL_OPEN,
-
-      /**
-      * The remote endpoint has opened the link. Events of this type
-      * point to the relevant link.
-      */
-      LINK_REMOTE_OPEN=PN_LINK_REMOTE_OPEN,
-
-      /**
-      * The local link endpoint has been closed. Events of this type
-      * point ot the relevant link.
-      */
-      LINK_LOCAL_CLOSE=PN_LINK_LOCAL_CLOSE,
-
-      /**
-      * The remote endpoint has closed the link. Events of this type
-      * point to the relevant link.
-      */
-      LINK_REMOTE_CLOSE=PN_LINK_REMOTE_CLOSE,
-
-      /**
-      * The local link endpoint has been detached. Events of this type
-      * point to the relevant link.
-      */
-      LINK_LOCAL_DETACH=PN_LINK_LOCAL_DETACH,
-
-      /**
-      * The remote endpoint has detached the link. Events of this type
-      * point to the relevant link.
-      */
-      LINK_REMOTE_DETACH=PN_LINK_REMOTE_DETACH,
-
-      /**
-      * The flow control state for a link has changed. Events of this
-      * type point to the relevant link.
-      */
-      LINK_FLOW=PN_LINK_FLOW,
-
-      /**
-      * The link has been freed and any outstanding processing has been
-      * completed. This is the final event that will ever be issued for a
-      * link. Events of this type point to the relevant link.
-      */
-      LINK_FINAL=PN_LINK_FINAL,
-
-      /**
-      * A delivery has been created or updated. Events of this type point
-      * to the relevant delivery.
-      */
-      DELIVERY=PN_DELIVERY,
-
-      /**
-      * The transport has new data to read and/or write. Events of this
-      * type point to the relevant transport.
-      */
-      TRANSPORT=PN_TRANSPORT,
-
-      /**
-      * The transport has authenticated, if this is received by a server
-      * the associated transport has authenticated an incoming connection
-      * and transport::user() can be used to obtain the authenticated
-      * user.
-      */
-      TRANSPORT_AUTHENTICATED=PN_TRANSPORT_AUTHENTICATED,
-
-      /**
-      * Indicates that a transport error has occurred. Use
-      * transport::condition() to access the details of the error
-      * from the associated transport.
-      */
-      TRANSPORT_ERROR=PN_TRANSPORT_ERROR,
-
-      /**
-      * Indicates that the head of the transport has been closed. This
-      * means the transport will never produce more bytes for output to
-      * the network. Events of this type point to the relevant transport.
-      */
-      TRANSPORT_HEAD_CLOSED=PN_TRANSPORT_HEAD_CLOSED,
-
-      /**
-      * Indicates that the tail of the transport has been closed. This
-      * means the transport will never be able to process more bytes from
-      * the network. Events of this type point to the relevant transport.
-      */
-      TRANSPORT_TAIL_CLOSED=PN_TRANSPORT_TAIL_CLOSED,
-
-      /**
-      * Indicates that the both the head and tail of the transport are
-      * closed. Events of this type point to the relevant transport.
-      */
-      TRANSPORT_CLOSED=PN_TRANSPORT_CLOSED,
-
-      SELECTABLE_INIT=PN_SELECTABLE_INIT,
-      SELECTABLE_UPDATED=PN_SELECTABLE_UPDATED,
-      SELECTABLE_READABLE=PN_SELECTABLE_READABLE,
-      SELECTABLE_WRITABLE=PN_SELECTABLE_WRITABLE,
-      SELECTABLE_ERROR=PN_SELECTABLE_ERROR,
-      SELECTABLE_EXPIRED=PN_SELECTABLE_EXPIRED,
-      SELECTABLE_FINAL=PN_SELECTABLE_FINAL
-    };
-    ///@}
-
-    proton_event(pn_event_t *ce, class container* cont) :
-      pn_event_(ce),
-      container_(cont)
-    {}
-
-    pn_event_t* pn_event() const { return pn_event_; }
-    class container& container() const {
-        if (!container_)
-            throw proton::error("event does not have a container");
-        return *container_;
-    }
-
-    /// Get type of event
-    event_type type() const { return event_type(pn_event_type(pn_event_)); }
-
-    void dispatch(proton_handler& h);
-
-  private:
-    pn_event_t *pn_event_;
-    class container* container_;
-};
-
-}
-
-#endif  /*!PROTON_CPP_PROTONEVENT_H*/
diff --git a/proton-c/bindings/cpp/src/include/proton_handler.hpp b/proton-c/bindings/cpp/src/include/proton_handler.hpp
deleted file mode 100644
index 9941396..0000000
--- a/proton-c/bindings/cpp/src/include/proton_handler.hpp
+++ /dev/null
@@ -1,92 +0,0 @@
-#ifndef PROTON_CPP_PROTONHANDLER_H
-#define PROTON_CPP_PROTONHANDLER_H
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/internal/object.hpp"
-
-#include <vector>
-
-struct pn_handler_t;
-
-namespace proton {
-
-class event;
-class proton_event;
-
-/// Handler base class, subclass and over-ride event handling member functions.
-/// @see proton::proton_event for meaning of events.
-class proton_handler
-{
-  public:
-    proton_handler();
-    virtual ~proton_handler();
-
-    ///@name Over-ride these member functions to handle events
-    ///@{
-    virtual void on_reactor_init(proton_event &e);
-    virtual void on_reactor_quiesced(proton_event &e);
-    virtual void on_reactor_final(proton_event &e);
-    virtual void on_timer_task(proton_event &e);
-    virtual void on_connection_init(proton_event &e);
-    virtual void on_connection_bound(proton_event &e);
-    virtual void on_connection_unbound(proton_event &e);
-    virtual void on_connection_local_open(proton_event &e);
-    virtual void on_connection_local_close(proton_event &e);
-    virtual void on_connection_remote_open(proton_event &e);
-    virtual void on_connection_remote_close(proton_event &e);
-    virtual void on_connection_final(proton_event &e);
-    virtual void on_session_init(proton_event &e);
-    virtual void on_session_local_open(proton_event &e);
-    virtual void on_session_local_close(proton_event &e);
-    virtual void on_session_remote_open(proton_event &e);
-    virtual void on_session_remote_close(proton_event &e);
-    virtual void on_session_final(proton_event &e);
-    virtual void on_link_init(proton_event &e);
-    virtual void on_link_local_open(proton_event &e);
-    virtual void on_link_local_close(proton_event &e);
-    virtual void on_link_local_detach(proton_event &e);
-    virtual void on_link_remote_open(proton_event &e);
-    virtual void on_link_remote_close(proton_event &e);
-    virtual void on_link_remote_detach(proton_event &e);
-    virtual void on_link_flow(proton_event &e);
-    virtual void on_link_final(proton_event &e);
-    virtual void on_delivery(proton_event &e);
-    virtual void on_transport(proton_event &e);
-    virtual void on_transport_error(proton_event &e);
-    virtual void on_transport_head_closed(proton_event &e);
-    virtual void on_transport_tail_closed(proton_event &e);
-    virtual void on_transport_closed(proton_event &e);
-    virtual void on_selectable_init(proton_event &e);
-    virtual void on_selectable_updated(proton_event &e);
-    virtual void on_selectable_readable(proton_event &e);
-    virtual void on_selectable_writable(proton_event &e);
-    virtual void on_selectable_expired(proton_event &e);
-    virtual void on_selectable_error(proton_event &e);
-    virtual void on_selectable_final(proton_event &e);
-    virtual void on_unhandled(proton_event &e);
-    ///@}
-};
-
-}
-
-#endif  /*!PROTON_CPP_PROTONHANDLER_H*/
diff --git a/proton-c/bindings/cpp/src/include/reactor.hpp b/proton-c/bindings/cpp/src/include/reactor.hpp
deleted file mode 100644
index 07678e4..0000000
--- a/proton-c/bindings/cpp/src/include/reactor.hpp
+++ /dev/null
@@ -1,100 +0,0 @@
-#ifndef REACTOR_HPP
-#define REACTOR_HPP
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/// @cond INTERNAL
-/// XXX remove
-
-#include "proton/fwd.hpp"
-#include "proton/internal/object.hpp"
-#include "proton/duration.hpp"
-#include "proton/timestamp.hpp"
-
-struct pn_reactor_t;
-struct pn_handler_t;
-struct pn_io_t;
-
-namespace proton {
-
-class acceptor;
-
-class reactor : public internal::object<pn_reactor_t> {
-  public:
-    reactor(pn_reactor_t* r = 0) : internal::object<pn_reactor_t>(r) {}
-
-    /** Create a new reactor. */
-    static reactor create();
-
-    /** Open a connection to url and create a receiver with source=url.path() */
-    acceptor listen(const proton::url &);
-
-    /** Run the event loop, return when all connections and acceptors are closed. */
-    void run();
-
-    /** Start the reactor, you must call process() to process events */
-    void start();
-
-    /** Process events, return true if there are more events to process. */
-    bool process();
-
-    /** Stop the reactor, causes run() to return and process() to return false. */
-    void stop();
-
-    /// Identifier for the container
-    std::string id() const;
-
-    /// Get timeout, process() will return if there is no activity within the timeout.
-    duration timeout();
-
-    /// Set timeout, process() will return if there is no activity within the timeout.
-    void timeout(duration timeout);
-
-    timestamp mark();
-    timestamp now();
-
-    void schedule(int, pn_handler_t*);
-
-    class connection connection(pn_handler_t*) const;
-
-    class connection connection_to_host(const std::string &host, const std::string &port, pn_handler_t*) const;
-
-    pn_handler_t* pn_handler() const;
-
-    void pn_handler(pn_handler_t* );
-
-    pn_handler_t* pn_global_handler() const;
-
-    void pn_global_handler(pn_handler_t* );
-
-    pn_io_t* pn_io() const;
-
-    void wakeup();
-    bool quiesced();
-    void yield();
-
-  friend class internal::factory<reactor>;
-};
-
-}
-
-/// @endcond
-
-#endif // REACTOR_HPP
diff --git a/proton-c/bindings/cpp/src/include/scalar_test.hpp b/proton-c/bindings/cpp/src/include/scalar_test.hpp
deleted file mode 100644
index b075c98..0000000
--- a/proton-c/bindings/cpp/src/include/scalar_test.hpp
+++ /dev/null
@@ -1,209 +0,0 @@
-#ifndef SCALAR_TEST_HPP
-#define SCALAR_TEST_HPP
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-// Template tests used by both scalar_test.cpp and value_test.hpp to test conversion
-// of scalar values via a proton::scalar or a proton::value.
-
-#include "test_bits.hpp"
-
-#include "proton/types.hpp"
-#include "proton/error.hpp"
-
-#include <sstream>
-
-
-namespace test {
-
-using namespace proton;
-
-// Inserting and extracting simple C++ values using same-type get<T> and coerce<T>
-template <class V, class T> void simple_type_test(T x, type_id tid, const std::string& s, T y) {
-    V vx(x);                    // Construct from C++ value
-    ASSERT_EQUAL(tid, vx.type());
-    ASSERT(!vx.empty());
-    ASSERT_EQUAL(x, get<T>(vx));
-    ASSERT_EQUAL(x, coerce<T>(vx));
-
-    V vxa = x;                  // Assign from C++ value
-    ASSERT_EQUAL(tid, vxa.type());
-    ASSERT(!vx.empty());
-    ASSERT_EQUAL(vx, vxa);
-    ASSERT_EQUAL(x, get<T>(vxa));
-    ASSERT_EQUAL(x, coerce<T>(vxa));
-
-    V v2;                       // Default construct
-    ASSERT(v2.type() == NULL_TYPE);
-    ASSERT(v2.empty());
-    v2 = x;                     // Assign from C++ value
-    ASSERT_EQUAL(tid, v2.type());
-    ASSERT_EQUAL(vx, v2);
-    ASSERT_EQUAL(x, get<T>(v2));
-    ASSERT_EQUAL(x, coerce<T>(v2));
-
-    V v3(vx);                   // Copy construct
-    ASSERT_EQUAL(tid, v3.type());
-    ASSERT_EQUAL(vx, v3);
-    ASSERT_EQUAL(x, get<T>(v3));
-    ASSERT_EQUAL(x, coerce<T>(v3));
-
-    V v4 = vx;                  // Copy assign
-    ASSERT_EQUAL(tid, v4.type());
-    ASSERT_EQUAL(x, get<T>(v4));
-    ASSERT_EQUAL(x, coerce<T>(v4));
-
-    ASSERT_EQUAL(s, to_string(vx));   // Stringify
-    V vy(y);
-    ASSERT(vx != vy);           // Compare
-    ASSERT(vx < vy);
-    ASSERT(vy > vx);
-}
-
-// Test native C/C++ integer types via their mapped integer type ([u]int_x_t)
-template <class V, class T> void simple_integral_test() {
-    typedef typename internal::integer_type<sizeof(T), internal::is_signed<T>::value>::type int_type;
-    simple_type_test<V>(T(3), internal::type_id_of<int_type>::value, "3", T(4));
-}
-
-// Test invalid gets, valid same-type get<T> is tested by simple_type_test
-// Templated to test both scalar and value.
-template<class V>  void bad_get_test() {
-    try { get<bool>(V(int8_t(1))); FAIL("byte as bool"); } catch (conversion_error) {}
-    try { get<uint8_t>(V(true)); FAIL("bool as uint8_t"); } catch (conversion_error) {}
-    try { get<uint8_t>(V(int8_t(1))); FAIL("int8 as uint8"); } catch (conversion_error) {}
-    try { get<int16_t>(V(uint16_t(1))); FAIL("uint16 as int16"); } catch (conversion_error) {}
-    try { get<int16_t>(V(int32_t(1))); FAIL("int32 as int16"); } catch (conversion_error) {}
-    try { get<symbol>(V(std::string())); FAIL("string as symbol"); } catch (conversion_error) {}
-    try { get<std::string>(V(binary())); FAIL("binary as string"); } catch (conversion_error) {}
-    try { get<binary>(V(symbol())); FAIL("symbol as binary"); } catch (conversion_error) {}
-    try { get<binary>(V(timestamp())); FAIL("timestamp as binary"); } catch (conversion_error) {}
-    try { get<int>(V(timestamp())); FAIL("timestamp as int"); } catch (conversion_error) {}
-    try { get<timestamp>(V(0)); FAIL("int as timestamp"); } catch (conversion_error) {}
-    try { get<timestamp>(V(std::string())); FAIL("string as timestamp"); } catch (conversion_error) {}
-}
-
-// Test some valid coercions and some bad ones with mixed types.
-// Templated to test both scalar and value.
-template<class V> void coerce_test() {
-    // Valid C++ conversions should work with coerce.
-    ASSERT_EQUAL(false, coerce<bool>(V(0)));
-    ASSERT_EQUAL(true, coerce<bool>(V(-1)));
-    ASSERT_EQUAL(true, coerce<bool>(V(int64_t(0xFFFF0000))));
-
-    ASSERT_EQUAL(1, coerce<uint8_t>(V(uint64_t(1)))); // In range.
-    ASSERT_EQUAL(1, coerce<uint8_t>(V(uint32_t(0xFF01)))); // int truncate.
-    ASSERT_EQUAL(0xFFFF, coerce<uint16_t>(V(int8_t(-1)))); // Sign extend.
-    ASSERT_EQUAL(-1, coerce<int32_t>(V(uint64_t(0xFFFFFFFFul)))); // 2s complement
-
-    ASSERT_EQUALISH(1.2f, coerce<float>(V(double(1.2))), 0.001f);
-    ASSERT_EQUALISH(3.4, coerce<double>(V(float(3.4))), 0.001);
-    ASSERT_EQUALISH(23.0, coerce<double>(V(uint64_t(23))), 0.001); // int to double.
-    ASSERT_EQUAL(-1945, coerce<int>(V(float(-1945.123))));    // round to int.
-
-    // String-like conversions.
-    ASSERT_EQUAL(std::string("foo"), coerce<std::string>(V(symbol("foo"))));
-    ASSERT_EQUAL(std::string("foo"), coerce<std::string>(V(binary("foo"))));
-
-    // Bad coercions, types are not `is_convertible`
-    V s("foo");
-    try { coerce<bool>(s); FAIL("string as bool"); } catch (conversion_error) {}
-    try { coerce<int>(s); FAIL("string as int"); } catch (conversion_error) {}
-    try { coerce<double>(s); FAIL("string as double"); } catch (conversion_error) {}
-
-    try { coerce<std::string>(V(0)); FAIL("int as string"); } catch (conversion_error) {}
-    try { coerce<symbol>(V(true)); FAIL("bool as symbol"); } catch (conversion_error) {}
-    try { coerce<binary>(V(0.0)); FAIL("double as binary"); } catch (conversion_error) {}
-    try { coerce<symbol>(V(binary())); FAIL("binary as symbol"); } catch (conversion_error) {}
-    try { coerce<binary>(V(symbol())); FAIL("symbol as binary"); } catch (conversion_error) {}
-    try { coerce<binary>(s); } catch (conversion_error) {}
-    try { coerce<symbol>(s); } catch (conversion_error) {}
-}
-
-template <class V> void null_test() {
-    V v;
-    ASSERT(v.empty());
-    ASSERT_EQUAL(NULL_TYPE, v.type());
-    get<null>(v);
-    null n;
-    get(v, n);
-    V v2(n);
-    ASSERT(v.empty());
-    ASSERT_EQUAL(NULL_TYPE, v.type());
-    v = "foo";
-    ASSERT_EQUAL(STRING, v.type());
-    try { get<null>(v); FAIL("Expected conversion_error"); } catch (conversion_error) {}
-    v = null();
-    get<null>(v);
-}
-
-// Nasty hack for uninterpreted decimal<> types.
-template <class T> T make(const char c) { T x; std::fill(x.begin(), x.end(), c); return x; }
-
-template <class V> void scalar_test_group(int& failed) {
-    // Direct AMQP-mapped types.
-    RUN_TEST(failed, simple_type_test<V>(false, BOOLEAN, "false", true));
-    RUN_TEST(failed, simple_type_test<V>(uint8_t(42), UBYTE, "42", uint8_t(50)));
-    RUN_TEST(failed, simple_type_test<V>(int8_t(-42), BYTE, "-42", int8_t(-40)));
-    RUN_TEST(failed, simple_type_test<V>(uint16_t(4242), USHORT, "4242", uint16_t(5252)));
-    RUN_TEST(failed, simple_type_test<V>(int16_t(-4242), SHORT, "-4242", int16_t(3)));
-    RUN_TEST(failed, simple_type_test<V>(uint32_t(4242), UINT, "4242", uint32_t(5252)));
-    RUN_TEST(failed, simple_type_test<V>(int32_t(-4242), INT, "-4242", int32_t(3)));
-    RUN_TEST(failed, simple_type_test<V>(uint64_t(4242), ULONG, "4242", uint64_t(5252)));
-    RUN_TEST(failed, simple_type_test<V>(int64_t(-4242), LONG, "-4242", int64_t(3)));
-    RUN_TEST(failed, simple_type_test<V>(wchar_t('X'), CHAR, "88", wchar_t('Y')));
-    RUN_TEST(failed, simple_type_test<V>(float(1.234), FLOAT, "1.234", float(2.345)));
-    RUN_TEST(failed, simple_type_test<V>(double(11.2233), DOUBLE, "11.2233", double(12)));
-    RUN_TEST(failed, simple_type_test<V>(timestamp(1234), TIMESTAMP, "1234", timestamp(12345)));
-    RUN_TEST(failed, simple_type_test<V>(make<decimal32>(1), DECIMAL32, "decimal32(0x01010101)", make<decimal32>(2)));
-    RUN_TEST(failed, simple_type_test<V>(make<decimal64>(3), DECIMAL64, "decimal64(0x0303030303030303)", make<decimal64>(4)));
-    RUN_TEST(failed, simple_type_test<V>(make<decimal128>(5), DECIMAL128, "decimal128(0x05050505050505050505050505050505)", make<decimal128>(6)));
-    RUN_TEST(failed, simple_type_test<V>(
-                 uuid::copy("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff"),
-                 UUID, "00112233-4455-6677-8899-aabbccddeeff",
-                 uuid::copy("\xff\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff")));
-    RUN_TEST(failed, simple_type_test<V>(std::string("xxx"), STRING, "xxx", std::string("yyy")));
-    RUN_TEST(failed, simple_type_test<V>(symbol("aaa"), SYMBOL, "aaa", symbol("aaaa")));
-    RUN_TEST(failed, simple_type_test<V>(binary("\010aaa"), BINARY, "b\"\\x08aaa\"", binary("aaaa")));
-
-    // Test native C++ integral types.
-    RUN_TEST(failed, (simple_integral_test<V, char>()));
-    RUN_TEST(failed, (simple_integral_test<V, signed char>()));
-    RUN_TEST(failed, (simple_integral_test<V, unsigned char>()));
-    RUN_TEST(failed, (simple_integral_test<V, short>()));
-    RUN_TEST(failed, (simple_integral_test<V, int>()));
-    RUN_TEST(failed, (simple_integral_test<V, long>()));
-    RUN_TEST(failed, (simple_integral_test<V, unsigned short>()));
-    RUN_TEST(failed, (simple_integral_test<V, unsigned int>()));
-    RUN_TEST(failed, (simple_integral_test<V, unsigned long>()));
-#if PN_CPP_HAS_LONG_LONG
-    RUN_TEST(failed, (simple_integral_test<V, long long>()));
-    RUN_TEST(failed, (simple_integral_test<V, unsigned long long>()));
-#endif
-
-
-    RUN_TEST(failed, (coerce_test<V>()));
-    RUN_TEST(failed, (null_test<V>()));
-    RUN_TEST(failed, (bad_get_test<V>()));
-}
-
-}
-
-#endif // SCALAR_TEST_HPP
diff --git a/proton-c/bindings/cpp/src/include/test_bits.hpp b/proton-c/bindings/cpp/src/include/test_bits.hpp
deleted file mode 100644
index 0cfbe1f..0000000
--- a/proton-c/bindings/cpp/src/include/test_bits.hpp
+++ /dev/null
@@ -1,136 +0,0 @@
-#ifndef TEST_BITS_HPP
-#define TEST_BITS_HPP
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "msg.hpp"
-#include "proton/types.hpp"
-
-#include <stdexcept>
-#include <iostream>
-#include <iterator>
-#include <sstream>
-#include <math.h>
-
-namespace test {
-
-struct fail : public std::logic_error {
-    fail(const std::string& what) : logic_error(what) {}
-};
-
-template <class T, class U>
-void assert_equal(const T& want, const U& got, const std::string& what) {
-    if (!(want == got))
-        throw fail(MSG(what << " " << want << " != " << got));
-}
-
-template <class T>
-inline void assert_equalish(T want, T got, T delta, const std::string& what)
-{
-    if (!(fabs(want-got) <= delta))
-        throw fail(MSG(what << " " << want << " !=~ " << got));
-}
-
-#define FAIL_MSG(WHAT) (MSG(__FILE__ << ":" << __LINE__ << ": " << WHAT).str())
-#define FAIL(WHAT) throw test::fail(FAIL_MSG(WHAT))
-#define ASSERT(TEST) do { if (!(TEST)) FAIL("failed ASSERT(" #TEST ")"); } while(false)
-#define ASSERT_EQUAL(WANT, GOT) \
-    test::assert_equal((WANT), (GOT), FAIL_MSG("failed ASSERT_EQUAL(" #WANT ", " #GOT ")"))
-#define ASSERT_EQUALISH(WANT, GOT, DELTA) \
-    test::assert_equalish((WANT), (GOT), (DELTA), FAIL_MSG("failed ASSERT_EQUALISH(" #WANT ", " #GOT ")"))
-
-#define RUN_TEST(BAD_COUNT, TEST)                                       \
-    do {                                                                \
-        try {                                                           \
-            TEST;                                                       \
-            break;                                                      \
-        } catch(const test::fail& e) {                                        \
-            std::cout << "FAIL " << #TEST << std::endl << e.what() << std::endl; \
-        } catch(const std::exception& e) {                              \
-            std::cout << "ERROR " << #TEST << std::endl << __FILE__ << ":" << __LINE__ << ": " << e.what() << std::endl; \
-        }                                                               \
-            ++BAD_COUNT;                                                \
-    } while(0)
-
-template<class T> std::string str(const T& x) {
-    std::ostringstream s; s << std::boolalpha << x; return s.str();
-}
-
-// A way to easily create literal collections that can be compared to std:: collections
-// and to print std collections
-// e.g.
-//     std::vector<string> v = ...;
-//     ASSERT_EQUAL(many<string>() + "a" + "b" + "c", v);
-template <class T> struct many : public std::vector<T> {
-    many() {}
-    template<class S> explicit many(const S& s) : std::vector<T>(s.begin(), s.end()) {}
-    many& operator+=(const T& t) { this->push_back(t); return *this; }
-    many& operator<<(const T& t) { return *this += t; }
-    many operator+(const T& t) { many<T> l(*this); return l += t; }
-};
-
-template <class T, class S> bool operator==(const many<T>& m, const S& s) {
-    return m.size() == s.size() && S(m.begin(), m.end()) == s;
-}
-
-template <class T, class S> bool operator==(const S& s, const many<T>& m) {
-    return m.size() == s.size() && S(m.begin(), m.end()) == s;
-}
-
-template <class T> std::ostream& operator<<(std::ostream& o, const many<T>& m) {
-    std::ostream_iterator<T> oi(o, " ");
-    std::copy(m.begin(), m.end(), oi);
-    return o;
-}
-
-}
-
-namespace std {
-template <class T> std::ostream& operator<<(std::ostream& o, const std::vector<T>& s) {
-    return o << test::many<T>(s);
-}
-
-template <class T> std::ostream& operator<<(std::ostream& o, const std::deque<T>& s) {
-    return o << test::many<T>(s);
-}
-
-template <class T> std::ostream& operator<<(std::ostream& o, const std::list<T>& s) {
-    return o << test::many<T>(s);
-}
-
-template <class K, class T> std::ostream& operator<<(std::ostream& o, const std::map<K, T>& x) {
-    return o << test::many<std::pair<K, T> >(x);
-}
-
-template <class U, class V> std::ostream& operator<<(std::ostream& o, const std::pair<U, V>& p) {
-    return o << "( " << p.first << " , " << p.second << " )";
-}
-
-#if PN_CPP_HAS_CPP11
-template <class K, class T> std::ostream& operator<<(std::ostream& o, const std::unordered_map<K, T>& x) {
-    return o << test::many<std::pair<const K, T> >(x);
-}
-
-template <class T> std::ostream& operator<<(std::ostream& o, const std::forward_list<T>& s) {
-    return o << test::many<T>(s);
-}
-#endif
-}
-
-#endif // TEST_BITS_HPP
diff --git a/proton-c/bindings/cpp/src/include/test_dummy_container.hpp b/proton-c/bindings/cpp/src/include/test_dummy_container.hpp
deleted file mode 100644
index 4af432a..0000000
--- a/proton-c/bindings/cpp/src/include/test_dummy_container.hpp
+++ /dev/null
@@ -1,83 +0,0 @@
-#ifndef TEST_DUMMY_CONTAINER_HPP
-#define TEST_DUMMY_CONTAINER_HPP
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "proton/container.hpp"
-#include "proton/event_loop.hpp"
-#include "proton/thread_safe.hpp"
-
-namespace test {
-
-using namespace proton;
-
-
-class dummy_container : public standard_container {
-  public:
-    dummy_container(const std::string cid="") :
-        id_(cid), fail("not implemented for dummy_container") {}
-
-    // Pull in base class functions here so that name search finds all the overloads
-    using standard_container::stop;
-    using standard_container::connect;
-    using standard_container::listen;
-    using standard_container::open_receiver;
-    using standard_container::open_sender;
-
-    returned<connection> connect(const std::string&, const connection_options&) { throw fail; }
-    listener listen(const std::string& , listen_handler& ) { throw fail; }
-    void stop_listening(const std::string&) { throw fail; }
-    void run() { throw fail; }
-    void auto_stop(bool) { throw fail; }
-    void stop(const proton::error_condition& ) { throw fail; }
-    returned<sender> open_sender(const std::string &, const proton::sender_options &, const connection_options&) { throw fail; }
-    returned<receiver> open_receiver( const std::string &, const proton::receiver_options &, const connection_options &) { throw fail; }
-    std::string id() const { return id_; }
-    void client_connection_options(const connection_options &o) { ccopts_ = o; }
-    connection_options client_connection_options() const { return ccopts_; }
-    void server_connection_options(const connection_options &o) { scopts_ = o; }
-    connection_options server_connection_options() const { return scopts_; }
-    void sender_options(const class sender_options &o) { sopts_ = o; }
-    class sender_options sender_options() const { return sopts_; }
-    void receiver_options(const class receiver_options &o) { ropts_ = o; }
-    class receiver_options receiver_options() const { return ropts_; }
-#if PN_CPP_HAS_STD_FUNCTION
-    void schedule(duration, std::function<void()>) { throw fail; }
-#endif
-    void schedule(duration, void_function0&) { throw fail; }
-
-  private:
-    std::string id_;
-    connection_options ccopts_, scopts_;
-    class sender_options sopts_;
-    class receiver_options ropts_;
-    std::runtime_error fail;
-};
-
-class dummy_event_loop : public event_loop {
-#if PN_CPP_HAS_CPP11
-    bool inject(std::function<void()> f) PN_CPP_OVERRIDE { f(); return true; }
-#endif
-    bool inject(proton::void_function0& h) PN_CPP_OVERRIDE { h(); return true; }
-};
-
-}
-
-#endif // TEST_DUMMY_CONTAINER_HPP
diff --git a/proton-c/bindings/cpp/src/include/types_internal.hpp b/proton-c/bindings/cpp/src/include/types_internal.hpp
deleted file mode 100644
index bff93a0..0000000
--- a/proton-c/bindings/cpp/src/include/types_internal.hpp
+++ /dev/null
@@ -1,74 +0,0 @@
-#ifndef TYPES_INTERNAL_HPP
-#define TYPES_INTERNAL_HPP
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "proton/internal/type_traits.hpp"
-#include "proton/error.hpp"
-#include "proton/binary.hpp"
-#include <sstream>
-
-///@file
-/// Inline helpers for encode/decode/type conversion/ostream operators.
-
-namespace proton {
-
-/// Byte copy between two objects, only enabled if their sizes are equal.
-template <class T, class U>
-typename internal::enable_if<sizeof(T) == sizeof(U)>::type byte_copy(T &to, const U &from) {
-    const char *p = reinterpret_cast<const char*>(&from);
-    std::copy(p, p + sizeof(T), reinterpret_cast<char*>(&to));
-}
-
-inline conversion_error
-make_conversion_error(type_id want, type_id got, const std::string& msg=std::string()) {
-    std::ostringstream s;
-    s << "unexpected type, want: " << want << " got: " << got;
-    if (!msg.empty()) s << ": " << msg;
-    return conversion_error(s.str());
-}
-
-/// Convert std::string to pn_bytes_t
-inline pn_bytes_t pn_bytes(const std::string& s) {
-    pn_bytes_t b = { s.size(), s.empty() ? 0 : const_cast<char*>(&s[0]) };
-    return b;
-}
-
-inline pn_bytes_t pn_bytes(const binary& s) {
-    pn_bytes_t b = { s.size(), s.empty() ? 0 : reinterpret_cast<const char*>(&s[0]) };
-    return b;
-}
-
-inline std::string str(const pn_bytes_t& b) { return std::string(b.start, b.size); }
-inline binary bin(const pn_bytes_t& b) { return binary(b.start, b.start+b.size); }
-
-// Save all stream format state, restore in destructor.
-struct ios_guard {
-    std::ios &guarded;
-    std::ios old;
-    ios_guard(std::ios& x) : guarded(x), old(0) { old.copyfmt(guarded); }
-    ~ios_guard() { guarded.copyfmt(old); }
-};
-
-// Convert a char (signed or unsigned) into an unsigned 1 byte integer that will ostream
-// as a numeric byte value, not a character and will not get sign-extended.
-inline unsigned int printable_byte(uint8_t byte) { return byte; }
-
-}
-#endif // TYPES_INTERNAL_HPP
diff --git a/proton-c/bindings/cpp/src/interop_test.cpp b/proton-c/bindings/cpp/src/interop_test.cpp
deleted file mode 100644
index de6ae63..0000000
--- a/proton-c/bindings/cpp/src/interop_test.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "proton/codec/decoder.hpp"
-#include "proton/codec/encoder.hpp"
-#include "proton/error.hpp"
-#include "proton/value.hpp"
-#include "test_bits.hpp"
-#include <string>
-#include <sstream>
-#include <fstream>
-#include <streambuf>
-#include <iosfwd>
-
-namespace {
-
-using namespace std;
-using namespace proton;
-
-using proton::codec::encoder;
-using proton::codec::decoder;
-
-using proton::internal::data;
-
-using test::str;
-
-std::string tests_dir;
-
-string read(string filename) {
-    filename = tests_dir+string("/interop/")+filename+string(".amqp");
-    ifstream ifs(filename.c_str());
-    if (!ifs.good()) FAIL("Can't open " << filename);
-    return string(istreambuf_iterator<char>(ifs), istreambuf_iterator<char>());
-}
-
-// Test data ostream operator
-void test_data_ostream() {
-    data dt(data::create());
-    decoder d(dt);
-    d.decode(read("primitives"));
-    ASSERT_EQUAL("true, false, 42, 42, -42, 12345, -12345, 12345, -12345, 0.125, 0.125", str(dt));
-}
-
-// Test extracting to exact AMQP types works corectly, extrating to invalid types fails.
-void test_decoder_primitves_exact() {
-    value dv;
-    decoder d(dv);
-    d.decode(read("primitives"));
-    ASSERT(d.more());
-    try { get< ::int8_t>(d); FAIL("got bool as byte"); } catch(conversion_error){}
-    ASSERT_EQUAL(true, get<bool>(d));
-    ASSERT_EQUAL(false, get<bool>(d));
-    try { get< ::int8_t>(d); FAIL("got ubyte as byte"); } catch(conversion_error){}
-    ASSERT_EQUAL(42, get< ::uint8_t>(d));
-    try { get< ::int32_t>(d); FAIL("got uint as ushort"); } catch(conversion_error){}
-    ASSERT_EQUAL(42, get< ::uint16_t>(d));
-    try { get< ::uint16_t>(d); FAIL("got short as ushort"); } catch(conversion_error){}
-    ASSERT_EQUAL(-42, get< ::int16_t>(d));
-    ASSERT_EQUAL(12345u, get< ::uint32_t>(d));
-    ASSERT_EQUAL(-12345, get< ::int32_t>(d));
-    ASSERT_EQUAL(12345u, get< ::uint64_t>(d));
-    ASSERT_EQUAL(-12345, get< ::int64_t>(d));
-    try { get<double>(d); FAIL("got float as double"); } catch(conversion_error){}
-    ASSERT_EQUAL(0.125f, get<float>(d));
-    try { get<float>(d); FAIL("got double as float"); } catch(conversion_error){}
-    ASSERT_EQUAL(0.125, get<double>(d));
-    ASSERT(!d.more());
-}
-
-// Test inserting primitive sand encoding as AMQP.
-void test_encoder_primitives() {
-    value dv;
-    encoder e(dv);
-    e << true << false;
-    e << ::uint8_t(42);
-    e << ::uint16_t(42) << ::int16_t(-42);
-    e << ::uint32_t(12345) << ::int32_t(-12345);
-    e << ::uint64_t(12345) << ::int64_t(-12345);
-    e << float(0.125) << double(0.125);
-    ASSERT_EQUAL("true, false, 42, 42, -42, 12345, -12345, 12345, -12345, 0.125, 0.125", str(e));
-    std::string data = e.encode();
-    ASSERT_EQUAL(read("primitives"), data);
-}
-
-}
-
-int main(int argc, char** argv) {
-    int failed = 0;
-    if (argc != 2) {
-        cerr << "Usage: " << argv[0] << " tests-dir" << endl;
-        return 1;
-    }
-    tests_dir = argv[1];
-
-    RUN_TEST(failed, test_data_ostream());
-    RUN_TEST(failed, test_decoder_primitves_exact());
-    RUN_TEST(failed, test_encoder_primitives());
-    return failed;
-}
diff --git a/proton-c/bindings/cpp/src/io/connection_driver.cpp b/proton-c/bindings/cpp/src/io/connection_driver.cpp
deleted file mode 100644
index 148a00b..0000000
--- a/proton-c/bindings/cpp/src/io/connection_driver.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "proton/io/connection_driver.hpp"
-
-#include "proton/event_loop.hpp"
-#include "proton/error.hpp"
-#include "proton/messaging_handler.hpp"
-#include "proton/uuid.hpp"
-
-#include "contexts.hpp"
-#include "messaging_adapter.hpp"
-#include "msg.hpp"
-#include "proton_bits.hpp"
-#include "proton_event.hpp"
-
-#include <proton/connection.h>
-#include <proton/transport.h>
-#include <proton/event.h>
-
-#include <algorithm>
-
-
-namespace proton {
-namespace io {
-
-void connection_driver::init() {
-    if (pn_connection_driver_init(&driver_, pn_connection(), pn_transport()) != 0) {
-        this->~connection_driver(); // Dtor won't be called on throw from ctor.
-        throw proton::error(std::string("connection_driver allocation failed"));
-    }
-}
-
-connection_driver::connection_driver() : handler_(0), container_(0) { init(); }
-
-connection_driver::connection_driver(class container& cont) : handler_(0), container_(&cont) {
-    init();
-    connection_context& ctx = connection_context::get(connection());
-    ctx.container = container_;
-}
-
-#if PN_CPP_HAS_RVALUE_REFERENCES
-connection_driver::connection_driver(class container& cont, event_loop&& loop) : handler_(0), container_(&cont) {
-    init();
-    connection_context& ctx = connection_context::get(connection());
-    ctx.container = container_;
-    ctx.event_loop_ = loop.impl_.get();
-}
-#endif
-
-connection_driver::~connection_driver() {
-    pn_connection_driver_destroy(&driver_);
-}
-
-// FIXME aconway 2016-11-16: rename _engine > _driver
-void connection_driver::configure(const connection_options& opts, bool server) {
-    proton::connection c(connection());
-    opts.apply_unbound(c);
-    if (server) pn_transport_set_server(driver_.transport);
-    pn_connection_driver_bind(&driver_);
-    opts.apply_bound(c);
-    handler_ =  opts.handler();
-}
-
-void connection_driver::connect(const connection_options& opts) {
-    connection_options all;
-    if (container_) {
-        all.container_id(container_->id());
-        all.update(container_->client_connection_options());
-    }
-    all.update(opts);
-    configure(all, false);
-    connection().open();
-}
-
-void connection_driver::accept(const connection_options& opts) {
-    connection_options all;
-    if (container_) {
-        all.container_id(container_->id());
-        all.update(container_->server_connection_options());
-    }
-    all.update(opts);
-    configure(all, true);
-}
-
-bool connection_driver::dispatch() {
-    pn_event_t* c_event;
-    while ((c_event = pn_connection_driver_next_event(&driver_)) != NULL) {
-        proton_event cpp_event(c_event, container_);
-        try {
-            if (handler_ != 0) {
-                messaging_adapter adapter(*handler_);
-                cpp_event.dispatch(adapter);
-            }
-        } catch (const std::exception& e) {
-            pn_condition_t *cond = pn_transport_condition(driver_.transport);
-            if (!pn_condition_is_set(cond)) {
-                pn_condition_format(cond, "exception", "%s", e.what());
-            }
-        }
-    }
-    return !pn_connection_driver_finished(&driver_);
-}
-
-mutable_buffer connection_driver::read_buffer() {
-    pn_rwbytes_t buffer = pn_connection_driver_read_buffer(&driver_);
-    return mutable_buffer(buffer.start, buffer.size);
-}
-
-void connection_driver::read_done(size_t n) {
-    return pn_connection_driver_read_done(&driver_, n);
-}
-
-void connection_driver::read_close() {
-    pn_connection_driver_read_close(&driver_);
-}
-
-const_buffer connection_driver::write_buffer() {
-    pn_bytes_t buffer = pn_connection_driver_write_buffer(&driver_);
-    return const_buffer(buffer.start, buffer.size);
-}
-
-void connection_driver::write_done(size_t n) {
-    return pn_connection_driver_write_done(&driver_, n);
-}
-
-void connection_driver::write_close() {
-    pn_connection_driver_write_close(&driver_);
-}
-
-void connection_driver::disconnected(const proton::error_condition& err) {
-    pn_condition_t* condition = pn_transport_condition(driver_.transport);
-    if (!pn_condition_is_set(condition))  {
-        set_error_condition(err, condition);
-    }
-    pn_connection_driver_close(&driver_);
-}
-
-proton::connection connection_driver::connection() const {
-    return make_wrapper(driver_.connection);
-}
-
-proton::transport connection_driver::transport() const {
-    return make_wrapper(driver_.transport);
-}
-
-proton::container* connection_driver::container() const {
-    return container_;
-}
-
-}}
diff --git a/proton-c/bindings/cpp/src/io/link_namer.cpp b/proton-c/bindings/cpp/src/io/link_namer.cpp
deleted file mode 100644
index 307c423..0000000
--- a/proton-c/bindings/cpp/src/io/link_namer.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "proton/io/link_namer.hpp"
-#include "contexts.hpp"
-
-namespace proton {
-namespace io {
-
-void set_link_namer(connection& c, link_namer& l) {
-    connection_context::get(c).link_gen = &l;
-}
-
-}}
diff --git a/proton-c/bindings/cpp/src/link.cpp b/proton-c/bindings/cpp/src/link.cpp
deleted file mode 100644
index eb4ccb1..0000000
--- a/proton-c/bindings/cpp/src/link.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton_bits.hpp"
-
-#include "proton/link.hpp"
-#include "proton/error.hpp"
-#include "proton/connection.hpp"
-
-#include <proton/connection.h>
-#include <proton/session.h>
-#include <proton/link.h>
-
-#include "contexts.hpp"
-#include "msg.hpp"
-#include "proton_bits.hpp"
-
-namespace proton {
-
-void link::attach() {
-    pn_link_open(pn_object());
-}
-
-void link::close() {
-    pn_link_close(pn_object());
-}
-
-void link::detach() {
-    pn_link_detach(pn_object());
-}
-
-int link::credit() const {
-    pn_link_t *lnk = pn_object();
-    if (pn_link_is_sender(lnk))
-        return pn_link_credit(lnk);
-    link_context& lctx = link_context::get(lnk);
-    return pn_link_credit(lnk) + lctx.pending_credit;
-}
-
-bool link::draining() {
-    pn_link_t *lnk = pn_object();
-    link_context& lctx = link_context::get(lnk);
-    if (pn_link_is_sender(lnk))
-        return pn_link_credit(lnk) > 0 && lctx.draining;
-    else
-        return lctx.draining;
-}
-
-std::string link::name() const { return str(pn_link_name(pn_object()));}
-
-container& link::container() const {
-    return connection().container();
-}
-
-class connection link::connection() const {
-    return make_wrapper(pn_session_connection(pn_link_session(pn_object())));
-}
-
-class session link::session() const {
-    return make_wrapper(pn_link_session(pn_object()));
-}
-
-error_condition link::error() const {
-    return make_wrapper(pn_link_remote_condition(pn_object()));
-}
-}
diff --git a/proton-c/bindings/cpp/src/listener.cpp b/proton-c/bindings/cpp/src/listener.cpp
deleted file mode 100644
index 2639f5e..0000000
--- a/proton-c/bindings/cpp/src/listener.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "proton/listener.hpp"
-#include "proton/container.hpp"
-
-namespace proton {
-
-listener::listener() : container_(0) {}
-listener::listener(container& c, const std::string& u) : url_(u), container_(&c) {}
-void listener::stop() { if (container_) container_->stop_listening(url_); }
-
-}
diff --git a/proton-c/bindings/cpp/src/message.cpp b/proton-c/bindings/cpp/src/message.cpp
deleted file mode 100644
index eecfa3b..0000000
--- a/proton-c/bindings/cpp/src/message.cpp
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/delivery.hpp"
-#include "proton/error.hpp"
-#include "proton/link.hpp"
-#include "proton/message.hpp"
-#include "proton/message_id.hpp"
-#include "proton/receiver.hpp"
-#include "proton/sender.hpp"
-#include "proton/timestamp.hpp"
-
-#include "msg.hpp"
-#include "proton_bits.hpp"
-#include "types_internal.hpp"
-
-#include <proton/delivery.h>
-#include <proton/message.h>
-
-#include <string>
-#include <algorithm>
-#include <assert.h>
-
-namespace proton {
-
-message::message() : pn_msg_(0) {}
-message::message(const message &m) : pn_msg_(0) { *this = m; }
-
-#if PN_CPP_HAS_RVALUE_REFERENCES
-message::message(message &&m) : pn_msg_(0) { swap(*this, m); }
-message& message::operator=(message&& m) {
-  swap(*this, m);
-  return *this;
-}
-#endif
-
-message::message(const value& x) : pn_msg_(0) { body() = x; }
-
-message::~message() {
-    // Workaround proton bug: Must release all refs to body before calling pn_message_free()
-    body_.reset();
-    pn_message_free(pn_msg_);
-}
-
-void swap(message& x, message& y) {
-    using std::swap;
-    swap(x.pn_msg_, y.pn_msg_);
-    swap(x.body_, y.body_);
-    swap(x.application_properties_, y.application_properties_);
-    swap(x.message_annotations_, y.message_annotations_);
-    swap(x.delivery_annotations_, y.delivery_annotations_);
-}
-
-pn_message_t *message::pn_msg() const {
-    if (!pn_msg_) pn_msg_ = pn_message();
-    body_.refer(pn_message_body(pn_msg_));
-    return pn_msg_;
-}
-
-message& message::operator=(const message& m) {
-    if (&m != this) {
-        // TODO aconway 2015-08-10: more efficient pn_message_copy function
-        std::vector<char> data;
-        m.encode(data);
-        decode(data);
-    }
-    return *this;
-}
-
-void message::clear() { if (pn_msg_) pn_message_clear(pn_msg_); }
-
-namespace {
-void check(int err) {
-    if (err) throw error(error_str(err));
-}
-} // namespace
-
-void message::id(const message_id& id) { pn_message_set_id(pn_msg(), id.atom_); }
-
-message_id message::id() const {
-    return pn_message_get_id(pn_msg());
-}
-
-void message::user(const std::string &id) {
-    check(pn_message_set_user_id(pn_msg(), pn_bytes(id)));
-}
-
-std::string message::user() const {
-    return str(pn_message_get_user_id(pn_msg()));
-}
-
-void message::to(const std::string &addr) {
-    check(pn_message_set_address(pn_msg(), addr.c_str()));
-}
-
-std::string message::to() const {
-    const char* addr = pn_message_get_address(pn_msg());
-    return addr ? std::string(addr) : std::string();
-}
-
-void message::address(const std::string &addr) {
-  check(pn_message_set_address(pn_msg(), addr.c_str()));
-}
-
-std::string message::address() const {
-  const char* addr = pn_message_get_address(pn_msg());
-  return addr ? std::string(addr) : std::string();
-}
-
-void message::subject(const std::string &s) {
-    check(pn_message_set_subject(pn_msg(), s.c_str()));
-}
-
-std::string message::subject() const {
-    const char* s = pn_message_get_subject(pn_msg());
-    return s ? std::string(s) : std::string();
-}
-
-void message::reply_to(const std::string &s) {
-    check(pn_message_set_reply_to(pn_msg(), s.c_str()));
-}
-
-std::string message::reply_to() const {
-    const char* s = pn_message_get_reply_to(pn_msg());
-    return s ? std::string(s) : std::string();
-}
-
-void message::correlation_id(const message_id& id) {
-    internal::value_ref(pn_message_correlation_id(pn_msg())) = id;
-}
-
-message_id message::correlation_id() const {
-    return pn_message_get_correlation_id(pn_msg());
-}
-
-void message::content_type(const std::string &s) {
-    check(pn_message_set_content_type(pn_msg(), s.c_str()));
-}
-
-std::string message::content_type() const {
-    const char* s = pn_message_get_content_type(pn_msg());
-    return s ? std::string(s) : std::string();
-}
-
-void message::content_encoding(const std::string &s) {
-    check(pn_message_set_content_encoding(pn_msg(), s.c_str()));
-}
-
-std::string message::content_encoding() const {
-    const char* s = pn_message_get_content_encoding(pn_msg());
-    return s ? std::string(s) : std::string();
-}
-
-void message::expiry_time(timestamp t) {
-    pn_message_set_expiry_time(pn_msg(), t.milliseconds());
-}
-timestamp message::expiry_time() const {
-    return timestamp(pn_message_get_expiry_time(pn_msg()));
-}
-
-void message::creation_time(timestamp t) {
-    pn_message_set_creation_time(pn_msg(), t.milliseconds());
-}
-timestamp message::creation_time() const {
-    return timestamp(pn_message_get_creation_time(pn_msg()));
-}
-
-void message::group_id(const std::string &s) {
-    check(pn_message_set_group_id(pn_msg(), s.c_str()));
-}
-
-std::string message::group_id() const {
-    const char* s = pn_message_get_group_id(pn_msg());
-    return s ? std::string(s) : std::string();
-}
-
-void message::reply_to_group_id(const std::string &s) {
-    check(pn_message_set_reply_to_group_id(pn_msg(), s.c_str()));
-}
-
-std::string message::reply_to_group_id() const {
-    const char* s = pn_message_get_reply_to_group_id(pn_msg());
-    return s ? std::string(s) : std::string();
-}
-
-bool message::inferred() const { return pn_message_is_inferred(pn_msg()); }
-
-void message::inferred(bool b) { pn_message_set_inferred(pn_msg(), b); }
-
-void message::body(const value& x) { body() = x; }
-
-const value& message::body() const { pn_msg(); return body_; }
-value& message::body() { pn_msg(); return body_; }
-
-// MAP CACHING: the properties and annotations maps can either be encoded in the
-// pn_message pn_data_t structures OR decoded as C++ map members of the message
-// but not both. At least one of the pn_data_t or the map member is always
-// empty, the non-empty one is the authority.
-
-// Decode a map on demand
-template<class M, class F> M& get_map(pn_message_t* msg, F get, M& map) {
-    codec::decoder d(make_wrapper(get(msg)));
-    if (map.empty() && !d.empty()) {
-        d.rewind();
-        d >> map;
-        d.clear();              // The map member is now the authority.
-    }
-    return map;
-}
-
-// Encode a map if necessary.
-template<class M, class F> M& put_map(pn_message_t* msg, F get, M& map) {
-    codec::encoder e(make_wrapper(get(msg)));
-    if (e.empty() && !map.empty()) {
-        e << map;
-        map.clear();            // The encoded pn_data_t  is now the authority.
-    }
-    return map;
-}
-
-message::property_map& message::properties() {
-    return get_map(pn_msg(), pn_message_properties, application_properties_);
-}
-
-const message::property_map& message::properties() const {
-    return get_map(pn_msg(), pn_message_properties, application_properties_);
-}
-
-
-message::annotation_map& message::message_annotations() {
-    return get_map(pn_msg(), pn_message_annotations, message_annotations_);
-}
-
-const message::annotation_map& message::message_annotations() const {
-    return get_map(pn_msg(), pn_message_annotations, message_annotations_);
-}
-
-
-message::annotation_map& message::delivery_annotations() {
-    return get_map(pn_msg(), pn_message_instructions, delivery_annotations_);
-}
-
-const message::annotation_map& message::delivery_annotations() const {
-    return get_map(pn_msg(), pn_message_instructions, delivery_annotations_);
-}
-
-void message::encode(std::vector<char> &s) const {
-    put_map(pn_msg(), pn_message_properties, application_properties_);
-    put_map(pn_msg(), pn_message_annotations, message_annotations_);
-    put_map(pn_msg(), pn_message_instructions, delivery_annotations_);
-    size_t sz = std::max(s.capacity(), size_t(512));
-    while (true) {
-        s.resize(sz);
-        assert(!s.empty());
-        int err = pn_message_encode(pn_msg(), const_cast<char*>(&s[0]), &sz);
-        if (err) {
-            if (err != PN_OVERFLOW)
-                check(err);
-        } else {
-            s.resize(sz);
-            return;
-        }
-        sz *= 2;
-    }
-}
-
-std::vector<char> message::encode() const {
-    std::vector<char> data;
-    encode(data);
-    return data;
-}
-
-void message::decode(const std::vector<char> &s) {
-    if (s.empty())
-        throw error("message decode: no data");
-    application_properties_.clear();
-    message_annotations_.clear();
-    delivery_annotations_.clear();
-    assert(!s.empty());
-    check(pn_message_decode(pn_msg(), &s[0], s.size()));
-}
-
-void message::decode(proton::delivery delivery) {
-    std::vector<char> buf;
-    buf.resize(pn_delivery_pending(unwrap(delivery)));
-    if (buf.empty())
-        throw error("message decode: no delivery pending on link");
-    proton::receiver link = delivery.receiver();
-    assert(!buf.empty());
-    ssize_t n = pn_link_recv(unwrap(link), const_cast<char *>(&buf[0]), buf.size());
-    if (n != ssize_t(buf.size())) throw error(MSG("receiver read failure"));
-    clear();
-    decode(buf);
-    pn_link_advance(unwrap(link));
-}
-
-bool message::durable() const { return pn_message_is_durable(pn_msg()); }
-void message::durable(bool b) { pn_message_set_durable(pn_msg(), b); }
-
-duration message::ttl() const { return duration(pn_message_get_ttl(pn_msg())); }
-void message::ttl(duration d) { pn_message_set_ttl(pn_msg(), d.milliseconds()); }
-
-uint8_t message::priority() const { return pn_message_get_priority(pn_msg()); }
-void message::priority(uint8_t d) { pn_message_set_priority(pn_msg(), d); }
-
-bool message::first_acquirer() const { return pn_message_is_first_acquirer(pn_msg()); }
-void message::first_acquirer(bool b) { pn_message_set_first_acquirer(pn_msg(), b); }
-
-uint32_t message::delivery_count() const { return pn_message_get_delivery_count(pn_msg()); }
-void message::delivery_count(uint32_t d) { pn_message_set_delivery_count(pn_msg(), d); }
-
-int32_t message::group_sequence() const { return pn_message_get_group_sequence(pn_msg()); }
-void message::group_sequence(int32_t d) { pn_message_set_group_sequence(pn_msg(), d); }
-
-const uint8_t message::default_priority = PN_DEFAULT_PRIORITY;
-
-}
diff --git a/proton-c/bindings/cpp/src/message_test.cpp b/proton-c/bindings/cpp/src/message_test.cpp
deleted file mode 100644
index 4d4e239..0000000
--- a/proton-c/bindings/cpp/src/message_test.cpp
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "proton/message.hpp"
-#include "proton/scalar.hpp"
-#include "test_bits.hpp"
-#include <string>
-#include <fstream>
-#include <streambuf>
-#include <iosfwd>
-
-namespace {
-
-using namespace std;
-using namespace proton;
-
-#define CHECK_STR(ATTR) \
-    m.ATTR(#ATTR); \
-    ASSERT_EQUAL(std::string(#ATTR), m.ATTR())
-
-#define CHECK_MESSAGE_ID(ATTR) \
-    m.ATTR(#ATTR); \
-    ASSERT_EQUAL(scalar(#ATTR), m.ATTR())
-
-void test_message_defaults() {
-    message m;
-    ASSERT(m.body().empty());
-    ASSERT(m.id().empty());
-    ASSERT(m.user().empty());
-    ASSERT(m.to().empty());
-    ASSERT(m.subject().empty());
-    ASSERT(m.reply_to().empty());
-    ASSERT(m.correlation_id().empty());
-    ASSERT(m.content_type().empty());
-    ASSERT(m.content_encoding().empty());
-    ASSERT(m.group_id().empty());
-    ASSERT(m.reply_to_group_id().empty());
-    ASSERT_EQUAL(0, m.expiry_time().milliseconds());
-    ASSERT_EQUAL(0, m.creation_time().milliseconds());
-
-    ASSERT_EQUAL(false, m.inferred());
-    ASSERT_EQUAL(false, m.durable());
-    ASSERT_EQUAL(0, m.ttl().milliseconds());
-    ASSERT_EQUAL(message::default_priority, m.priority());
-    ASSERT_EQUAL(false, m.first_acquirer());
-    ASSERT_EQUAL(0u, m.delivery_count());
-}
-
-void test_message_properties() {
-    message m("hello");
-    std::string s = get<std::string>(m.body());
-    ASSERT_EQUAL("hello", s);
-
-    CHECK_MESSAGE_ID(id);
-    CHECK_STR(user);
-    CHECK_STR(to);
-    CHECK_STR(subject);
-    CHECK_STR(reply_to);
-    CHECK_MESSAGE_ID(correlation_id);
-    CHECK_STR(content_type);
-    CHECK_STR(content_encoding);
-    CHECK_STR(group_id);
-    CHECK_STR(reply_to_group_id);
-    m.expiry_time(timestamp(42));
-    ASSERT_EQUAL(m.expiry_time().milliseconds(), 42);
-    m.creation_time(timestamp(4242));
-    ASSERT_EQUAL(m.creation_time().milliseconds(), 4242);
-    m.ttl(duration(30));
-    ASSERT_EQUAL(m.ttl().milliseconds(), 30);
-    m.priority(3);
-    ASSERT_EQUAL(m.priority(), 3);
-
-    message m2(m);
-    ASSERT_EQUAL("hello", get<std::string>(m2.body()));
-    ASSERT_EQUAL(message_id("id"), m2.id());
-    ASSERT_EQUAL("user", m2.user());
-    ASSERT_EQUAL("to", m2.to());
-    ASSERT_EQUAL("subject", m2.subject());
-    ASSERT_EQUAL("reply_to", m2.reply_to());
-    ASSERT_EQUAL(message_id("correlation_id"), m2.correlation_id());
-    ASSERT_EQUAL("content_type", m2.content_type());
-    ASSERT_EQUAL("content_encoding", m2.content_encoding());
-    ASSERT_EQUAL("group_id", m2.group_id());
-    ASSERT_EQUAL("reply_to_group_id", m2.reply_to_group_id());
-    ASSERT_EQUAL(42, m2.expiry_time().milliseconds());
-    ASSERT_EQUAL(4242, m.creation_time().milliseconds());
-
-    m2 = m;
-    ASSERT_EQUAL("hello", get<std::string>(m2.body()));
-    ASSERT_EQUAL(message_id("id"), m2.id());
-    ASSERT_EQUAL("user", m2.user());
-    ASSERT_EQUAL("to", m2.to());
-    ASSERT_EQUAL("subject", m2.subject());
-    ASSERT_EQUAL("reply_to", m2.reply_to());
-    ASSERT_EQUAL(message_id("correlation_id"), m2.correlation_id());
-    ASSERT_EQUAL("content_type", m2.content_type());
-    ASSERT_EQUAL("content_encoding", m2.content_encoding());
-    ASSERT_EQUAL("group_id", m2.group_id());
-    ASSERT_EQUAL("reply_to_group_id", m2.reply_to_group_id());
-    ASSERT_EQUAL(42, m2.expiry_time().milliseconds());
-    ASSERT_EQUAL(4242, m.creation_time().milliseconds());
-}
-
-void test_message_body() {
-    std::string s("hello");
-    message m1(s.c_str());
-    ASSERT_EQUAL(s, get<std::string>(m1.body()));
-    message m2(s);
-    ASSERT_EQUAL(s, coerce<std::string>(m2.body()));
-    message m3;
-    m3.body(s);
-    ASSERT_EQUAL(s, coerce<std::string>(m3.body()));
-    ASSERT_EQUAL(5, coerce<int64_t>(message(5).body()));
-    ASSERT_EQUAL(3.1, coerce<double>(message(3.1).body()));
-}
-
-void test_message_maps() {
-    message m;
-
-    ASSERT(m.properties().empty());
-    ASSERT(m.message_annotations().empty());
-    ASSERT(m.delivery_annotations().empty());
-
-    m.properties().put("foo", 12);
-    m.delivery_annotations().put("bar", "xyz");
-
-    m.message_annotations().put(23, "23");
-    ASSERT_EQUAL(m.properties().get("foo"), scalar(12));
-    ASSERT_EQUAL(m.delivery_annotations().get("bar"), scalar("xyz"));
-    ASSERT_EQUAL(m.message_annotations().get(23), scalar("23"));
-
-    message m2(m);
-
-    ASSERT_EQUAL(m2.properties().get("foo"), scalar(12));
-    ASSERT_EQUAL(m2.delivery_annotations().get("bar"), scalar("xyz"));
-    ASSERT_EQUAL(m2.message_annotations().get(23), scalar("23"));
-
-    m.properties().put("foo","newfoo");
-    m.delivery_annotations().put(24, 1000);
-    m.message_annotations().erase(23);
-
-    m2 = m;
-    ASSERT_EQUAL(1u, m2.properties().size());
-    ASSERT_EQUAL(m2.properties().get("foo"), scalar("newfoo"));
-    ASSERT_EQUAL(2u, m2.delivery_annotations().size());
-    ASSERT_EQUAL(m2.delivery_annotations().get("bar"), scalar("xyz"));
-    ASSERT_EQUAL(m2.delivery_annotations().get(24), scalar(1000));
-    ASSERT(m2.message_annotations().empty());
-}
-
-}
-
-int main(int, char**) {
-    int failed = 0;
-    RUN_TEST(failed, test_message_properties());
-    RUN_TEST(failed, test_message_defaults());
-    RUN_TEST(failed, test_message_body());
-    RUN_TEST(failed, test_message_maps());
-    return failed;
-}
diff --git a/proton-c/bindings/cpp/src/messaging_adapter.cpp b/proton-c/bindings/cpp/src/messaging_adapter.cpp
deleted file mode 100644
index 17c84cd..0000000
--- a/proton-c/bindings/cpp/src/messaging_adapter.cpp
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "messaging_adapter.hpp"
-
-#include "proton/delivery.hpp"
-#include "proton/error.hpp"
-#include "proton/receiver_options.hpp"
-#include "proton/sender.hpp"
-#include "proton/sender_options.hpp"
-#include "proton/tracker.hpp"
-#include "proton/transport.hpp"
-
-#include "contexts.hpp"
-#include "msg.hpp"
-#include "proton_bits.hpp"
-#include "proton_event.hpp"
-
-#include <proton/connection.h>
-#include <proton/delivery.h>
-#include <proton/handlers.h>
-#include <proton/link.h>
-#include <proton/message.h>
-#include <proton/session.h>
-#include <proton/transport.h>
-
-namespace proton {
-
-namespace {
-void credit_topup(pn_link_t *link) {
-    if (link && pn_link_is_receiver(link)) {
-        int window = link_context::get(link).credit_window;
-        if (window) {
-            int delta = window - pn_link_credit(link);
-            pn_link_flow(link, delta);
-        }
-    }
-}
-}
-
-void messaging_adapter::on_reactor_init(proton_event &pe) {
-    delegate_.on_container_start(pe.container());
-}
-
-void messaging_adapter::on_reactor_final(proton_event &pe) {
-    delegate_.on_container_stop(pe.container());
-}
-
-void messaging_adapter::on_link_flow(proton_event &pe) {
-    pn_event_t *pne = pe.pn_event();
-    pn_link_t *lnk = pn_event_link(pne);
-    // TODO: process session flow data, if no link-specific data, just return.
-    if (!lnk) return;
-    link_context& lctx = link_context::get(lnk);
-    int state = pn_link_state(lnk);
-    if ((state&PN_LOCAL_ACTIVE) && (state&PN_REMOTE_ACTIVE)) {
-        if (pn_link_is_sender(lnk)) {
-            if (pn_link_credit(lnk) > 0) {
-                sender s(make_wrapper<sender>(lnk));
-                if (pn_link_get_drain(lnk)) {
-                    if (!lctx.draining) {
-                        lctx.draining = true;
-                        delegate_.on_sender_drain_start(s);
-                    }
-                }
-                else {
-                    lctx.draining = false;
-                }
-                // create on_message extended event
-                delegate_.on_sendable(s);
-            }
-        }
-        else {
-            // receiver
-            if (!pn_link_credit(lnk) && lctx.draining) {
-                lctx.draining = false;
-                receiver r(make_wrapper<receiver>(lnk));
-                delegate_.on_receiver_drain_finish(r);
-            }
-        }
-    }
-    credit_topup(lnk);
-}
-
-void messaging_adapter::on_delivery(proton_event &pe) {
-    pn_event_t *cevent = pe.pn_event();
-    pn_link_t *lnk = pn_event_link(cevent);
-    pn_delivery_t *dlv = pn_event_delivery(cevent);
-    link_context& lctx = link_context::get(lnk);
-
-    if (pn_link_is_receiver(lnk)) {
-        delivery d(make_wrapper<delivery>(dlv));
-        if (!pn_delivery_partial(dlv) && pn_delivery_readable(dlv)) {
-            // generate on_message
-            pn_connection_t *pnc = pn_session_connection(pn_link_session(lnk));
-            connection_context& ctx = connection_context::get(pnc);
-            // Reusable per-connection message.
-            // Avoid expensive heap malloc/free overhead.
-            // See PROTON-998
-            class message &msg(ctx.event_message);
-            msg.decode(d);
-            if (pn_link_state(lnk) & PN_LOCAL_CLOSED) {
-                if (lctx.auto_accept)
-                    d.release();
-            } else {
-                delegate_.on_message(d, msg);
-                if (lctx.auto_accept && !d.settled())
-                    d.accept();
-                if (lctx.draining && !pn_link_credit(lnk)) {
-                    lctx.draining = false;
-                    receiver r(make_wrapper<receiver>(lnk));
-                    delegate_.on_receiver_drain_finish(r);
-                }
-            }
-        }
-        else if (pn_delivery_updated(dlv) && d.settled()) {
-            delegate_.on_delivery_settle(d);
-        }
-        if (lctx.draining && pn_link_credit(lnk) == 0) {
-            lctx.draining = false;
-            pn_link_set_drain(lnk, false);
-            receiver r(make_wrapper<receiver>(lnk));
-            delegate_.on_receiver_drain_finish(r);
-            if (lctx.pending_credit) {
-                pn_link_flow(lnk, lctx.pending_credit);
-                lctx.pending_credit = 0;
-            }
-        }
-        credit_topup(lnk);
-    } else {
-        tracker t(make_wrapper<tracker>(dlv));
-        // sender
-        if (pn_delivery_updated(dlv)) {
-            uint64_t rstate = pn_delivery_remote_state(dlv);
-            if (rstate == PN_ACCEPTED) {
-                delegate_.on_tracker_accept(t);
-            }
-            else if (rstate == PN_REJECTED) {
-                delegate_.on_tracker_reject(t);
-            }
-            else if (rstate == PN_RELEASED || rstate == PN_MODIFIED) {
-                delegate_.on_tracker_release(t);
-            }
-
-            if (t.settled()) {
-                delegate_.on_tracker_settle(t);
-            }
-            if (lctx.auto_settle)
-                t.settle();
-        }
-    }
-}
-
-namespace {
-
-bool is_local_open(pn_state_t state) {
-    return state & PN_LOCAL_ACTIVE;
-}
-
-bool is_local_unititialised(pn_state_t state) {
-    return state & PN_LOCAL_UNINIT;
-}
-
-bool is_remote_unititialised(pn_state_t state) {
-    return state & PN_REMOTE_UNINIT;
-}
-
-} // namespace
-
-void messaging_adapter::on_link_remote_detach(proton_event & pe) {
-    pn_event_t *cevent = pe.pn_event();
-    pn_link_t *lnk = pn_event_link(cevent);
-    if (pn_link_is_receiver(lnk)) {
-        receiver r(make_wrapper<receiver>(lnk));
-        delegate_.on_receiver_detach(r);
-    } else {
-        sender s(make_wrapper<sender>(lnk));
-        delegate_.on_sender_detach(s);
-    }
-    pn_link_detach(lnk);
-}
-
-void messaging_adapter::on_link_remote_close(proton_event &pe) {
-    pn_event_t *cevent = pe.pn_event();
-    pn_link_t *lnk = pn_event_link(cevent);
-    if (pn_link_is_receiver(lnk)) {
-        receiver r(make_wrapper<receiver>(lnk));
-        if (pn_condition_is_set(pn_link_remote_condition(lnk))) {
-            delegate_.on_receiver_error(r);
-        }
-        delegate_.on_receiver_close(r);
-    } else {
-        sender s(make_wrapper<sender>(lnk));
-        if (pn_condition_is_set(pn_link_remote_condition(lnk))) {
-            delegate_.on_sender_error(s);
-        }
-        delegate_.on_sender_close(s);
-    }
-    pn_link_close(lnk);
-}
-
-void messaging_adapter::on_session_remote_close(proton_event &pe) {
-    pn_event_t *cevent = pe.pn_event();
-    pn_session_t *session = pn_event_session(cevent);
-    class session s(make_wrapper(session));
-    if (pn_condition_is_set(pn_session_remote_condition(session))) {
-        delegate_.on_session_error(s);
-    }
-    delegate_.on_session_close(s);
-    pn_session_close(session);
-}
-
-void messaging_adapter::on_connection_remote_close(proton_event &pe) {
-    pn_event_t *cevent = pe.pn_event();
-    pn_connection_t *conn = pn_event_connection(cevent);
-    connection c(make_wrapper(conn));
-    if (pn_condition_is_set(pn_connection_remote_condition(conn))) {
-        delegate_.on_connection_error(c);
-    }
-    delegate_.on_connection_close(c);
-    pn_connection_close(conn);
-}
-
-void messaging_adapter::on_connection_remote_open(proton_event &pe) {
-    // Generate on_transport_open event here until we find a better place
-    transport t(make_wrapper(pn_event_transport(pe.pn_event())));
-    delegate_.on_transport_open(t);
-
-    pn_connection_t *conn = pn_event_connection(pe.pn_event());
-    connection c(make_wrapper(conn));
-    delegate_.on_connection_open(c);
-    if (!is_local_open(pn_connection_state(conn)) && is_local_unititialised(pn_connection_state(conn))) {
-        pn_connection_open(conn);
-    }
-}
-
-void messaging_adapter::on_session_remote_open(proton_event &pe) {
-    pn_session_t *session = pn_event_session(pe.pn_event());
-    class session s(make_wrapper(session));
-    delegate_.on_session_open(s);
-    if (!is_local_open(pn_session_state(session)) && is_local_unititialised(pn_session_state(session))) {
-        pn_session_open(session);
-    }
-}
-
-void messaging_adapter::on_link_local_open(proton_event &pe) {
-    credit_topup(pn_event_link(pe.pn_event()));
-}
-
-void messaging_adapter::on_link_remote_open(proton_event &pe) {
-    pn_link_t *lnk = pn_event_link(pe.pn_event());
-    container& c = pe.container();
-    if (pn_link_is_receiver(lnk)) {
-      receiver r(make_wrapper<receiver>(lnk));
-      delegate_.on_receiver_open(r);
-      if (is_local_unititialised(pn_link_state(lnk))) {
-          r.open(c.receiver_options());
-      }
-    } else {
-      sender s(make_wrapper<sender>(lnk));
-      delegate_.on_sender_open(s);
-      if (is_local_unititialised(pn_link_state(lnk))) {
-          s.open(c.sender_options());
-      }
-    }
-    credit_topup(lnk);
-}
-
-void messaging_adapter::on_transport_closed(proton_event &pe) {
-    pn_transport_t *tspt = pn_event_transport(pe.pn_event());
-    transport t(make_wrapper(tspt));
-
-    // If the connection isn't open generate on_transport_open event
-    // because we didn't generate it yet and the events won't match.
-    pn_connection_t *conn = pn_event_connection(pe.pn_event());
-    if (!conn || is_remote_unititialised(pn_connection_state(conn))) {
-        delegate_.on_transport_open(t);
-    }
-
-    if (pn_condition_is_set(pn_transport_condition(tspt))) {
-        delegate_.on_transport_error(t);
-    }
-    delegate_.on_transport_close(t);
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/node_options.cpp b/proton-c/bindings/cpp/src/node_options.cpp
deleted file mode 100644
index 5bb2f8e..0000000
--- a/proton-c/bindings/cpp/src/node_options.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/source_options.hpp"
-#include "proton/source.hpp"
-#include "proton/target_options.hpp"
-#include "proton/target.hpp"
-
-#include "proton_bits.hpp"
-
-#include <limits>
-
-namespace proton {
-
-template <class T> struct option {
-    T value;
-    bool set;
-
-    option() : value(), set(false) {}
-    option& operator=(const T& x) { value = x;  set = true; return *this; }
-    void update(const option<T>& x) { if (x.set) *this = x.value; }
-};
-
-namespace {
-
-    void timeout(terminus &t, duration d) {
-      uint32_t seconds = 0;
-      if (d == duration::FOREVER)
-        seconds = std::numeric_limits<uint32_t>::max();
-      else if (d != duration::IMMEDIATE) {
-        uint64_t x = d.milliseconds();
-        if ((std::numeric_limits<uint64_t>::max() - x) <= 500)
-          seconds = std::numeric_limits<uint32_t>::max();
-        else {
-          x = (x + 500) / 1000;
-          seconds = x < std::numeric_limits<uint32_t>::max() ? x : std::numeric_limits<uint32_t>::max();
-        }
-      }
-      pn_terminus_set_timeout(unwrap(t), seconds);
-    }
-}
-
-namespace {
-
-// Options common to sources and targets
-
-void node_address(terminus &t, option<std::string> &addr, option<bool> &dynamic) {
-    if (dynamic.set && dynamic.value) {
-        pn_terminus_set_dynamic(unwrap(t), true);
-        // Ignore any addr value for dynamic.
-        return;
-    }
-    if (addr.set) {
-        pn_terminus_set_address(unwrap(t), addr.value.c_str());
-    }
-}
-
-void node_durability(terminus &t, option<enum terminus::durability_mode> &mode) {
-    if (mode.set) pn_terminus_set_durability(unwrap(t), pn_durability_t(mode.value));
-}
-
-void node_expiry(terminus &t, option<enum terminus::expiry_policy> &policy, option<duration> &d) {
-    if (policy.set) pn_terminus_set_expiry_policy(unwrap(t), pn_expiry_policy_t(policy.value));
-    if (d.set) timeout(t, d.value);
-}
-
-}
-
-
-class source_options::impl {
-  public:
-    option<std::string> address;
-    option<bool> dynamic;
-    option<enum source::durability_mode> durability_mode;
-    option<duration> timeout;
-    option<enum source::expiry_policy> expiry_policy;
-    option<enum source::distribution_mode> distribution_mode;
-    option<source::filter_map> filters;
-
-    void apply(source& s) {
-        node_address(s, address, dynamic);
-        node_durability(s, durability_mode);
-        node_expiry(s, expiry_policy, timeout);
-        if (distribution_mode.set)
-          pn_terminus_set_distribution_mode(unwrap(s), pn_distribution_mode_t(distribution_mode.value));
-        if (filters.set && !filters.value.empty()) {
-            // Applied at most once via source_option.  No need to clear.
-            codec::encoder e(make_wrapper(pn_terminus_filter(unwrap(s))));
-            e << filters.value;
-        }
-    }
-};
-
-source_options::source_options() : impl_(new impl()) {}
-source_options::source_options(const source_options& x) : impl_(new impl()) {
-    *this = x;
-}
-source_options::~source_options() {}
-
-source_options& source_options::operator=(const source_options& x) {
-    *impl_ = *x.impl_;
-    return *this;
-}
-
-source_options& source_options::address(const std::string &addr) { impl_->address = addr; return *this; }
-source_options& source_options::dynamic(bool b) { impl_->dynamic = b; return *this; }
-source_options& source_options::durability_mode(enum source::durability_mode m) { impl_->durability_mode = m; return *this; }
-source_options& source_options::timeout(duration d) { impl_->timeout = d; return *this; }
-source_options& source_options::expiry_policy(enum source::expiry_policy m) { impl_->expiry_policy = m; return *this; }
-source_options& source_options::distribution_mode(enum source::distribution_mode m) { impl_->distribution_mode = m; return *this; }
-source_options& source_options::filters(const source::filter_map &map) { impl_->filters = map; return *this; }
-
-void source_options::apply(source& s) const { impl_->apply(s); }
-
-// TARGET
-
-class target_options::impl {
-  public:
-    option<std::string> address;
-    option<bool> dynamic;
-    option<enum target::durability_mode> durability_mode;
-    option<duration> timeout;
-    option<enum target::expiry_policy> expiry_policy;
-
-    void apply(target& t) {
-        node_address(t, address, dynamic);
-        node_durability(t, durability_mode);
-        node_expiry(t, expiry_policy, timeout);
-    }
-};
-
-target_options::target_options() : impl_(new impl()) {}
-target_options::target_options(const target_options& x) : impl_(new impl()) {
-    *this = x;
-}
-target_options::~target_options() {}
-
-target_options& target_options::operator=(const target_options& x) {
-    *impl_ = *x.impl_;
-    return *this;
-}
-
-target_options& target_options::address(const std::string &addr) { impl_->address = addr; return *this; }
-target_options& target_options::dynamic(bool b) { impl_->dynamic = b; return *this; }
-target_options& target_options::durability_mode(enum target::durability_mode m) { impl_->durability_mode = m; return *this; }
-target_options& target_options::timeout(duration d) { impl_->timeout = d; return *this; }
-target_options& target_options::expiry_policy(enum target::expiry_policy m) { impl_->expiry_policy = m; return *this; }
-
-void target_options::apply(target& s) const { impl_->apply(s); }
-
-
-
-} // namespace proton
diff --git a/proton-c/bindings/cpp/src/object.cpp b/proton-c/bindings/cpp/src/object.cpp
deleted file mode 100644
index 2f3a348..0000000
--- a/proton-c/bindings/cpp/src/object.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "proton/internal/object.hpp"
-#include <proton/object.h>
-
-namespace proton {
-namespace internal {
-
-void pn_ptr_base::incref(void *p) {
-    if (p) ::pn_incref(const_cast<void*>(p));
-}
-
-void pn_ptr_base::decref(void *p) {
-    if (p) ::pn_decref(const_cast<void*>(p));
-}
-
-std::string pn_ptr_base::inspect(void* p) {
-    if (!p) return std::string();
-    ::pn_string_t* s = ::pn_string(NULL);
-    (void) ::pn_inspect(p, s);
-    return std::string(pn_string_get(s));
-}
-}}
diff --git a/proton-c/bindings/cpp/src/proton_bits.cpp b/proton-c/bindings/cpp/src/proton_bits.cpp
deleted file mode 100644
index 18fc589..0000000
--- a/proton-c/bindings/cpp/src/proton_bits.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "proton_bits.hpp"
-#include "proton/error_condition.hpp"
-
-#include <string>
-#include <ostream>
-
-#include <proton/condition.h>
-#include <proton/error.h>
-#include <proton/object.h>
-
-namespace proton {
-
-std::string error_str(long code) {
-  switch (code)
-  {
-  case 0: return "ok";
-  case PN_EOS: return "end of data stream";
-  case PN_ERR: return "error";
-  case PN_OVERFLOW: return "overflow";
-  case PN_UNDERFLOW: return "underflow";
-  case PN_STATE_ERR: return "invalid state";
-  case PN_ARG_ERR: return "invalid argument";
-  case PN_TIMEOUT: return "timeout";
-  case PN_INTR: return "interrupt";
-  default: return "unknown error code";
-  }
-}
-
-std::string error_str(pn_error_t* err, long code) {
-    if (err && pn_error_code(err)) {
-        const char* text = pn_error_text(err);
-        return text ? std::string(text) : error_str(pn_error_code(err));
-    }
-    return error_str(code);
-}
-
-std::ostream& operator<<(std::ostream& o, const inspectable& object) {
-    pn_string_t* str = pn_string("");
-    pn_inspect(object.value, str);
-    o << pn_string_get(str);
-    pn_free(str);
-    return o;
-}
-
-void set_error_condition(const error_condition& e, pn_condition_t *c) {
-    pn_condition_clear(c);
-
-    if (!e.name().empty()) {
-        pn_condition_set_name(c, e.name().c_str());
-    }
-    if (!e.description().empty()) {
-        pn_condition_set_description(c, e.description().c_str());
-    }
-    internal::value_ref(pn_condition_info(c)) = e.properties();
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/proton_event.cpp b/proton-c/bindings/cpp/src/proton_event.cpp
deleted file mode 100644
index 9a1ffea..0000000
--- a/proton-c/bindings/cpp/src/proton_event.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton_event.hpp"
-
-#include "proton/error.hpp"
-
-#include "msg.hpp"
-#include "proton_handler.hpp"
-#include "types_internal.hpp"
-
-namespace proton {
-
-void proton_event::dispatch(proton_handler &handler) {
-    pn_event_type_t type = pn_event_type(pn_event_);
-    switch(type) {
-
-      case PN_REACTOR_INIT: handler.on_reactor_init(*this); break;
-      case PN_REACTOR_QUIESCED: handler.on_reactor_quiesced(*this); break;
-      case PN_REACTOR_FINAL: handler.on_reactor_final(*this); break;
-
-      case PN_TIMER_TASK: handler.on_timer_task(*this); break;
-
-      case PN_CONNECTION_INIT: handler.on_connection_init(*this); break;
-      case PN_CONNECTION_BOUND: handler.on_connection_bound(*this); break;
-      case PN_CONNECTION_UNBOUND: handler.on_connection_unbound(*this); break;
-      case PN_CONNECTION_LOCAL_OPEN: handler.on_connection_local_open(*this); break;
-      case PN_CONNECTION_LOCAL_CLOSE: handler.on_connection_local_close(*this); break;
-      case PN_CONNECTION_REMOTE_OPEN: handler.on_connection_remote_open(*this); break;
-      case PN_CONNECTION_REMOTE_CLOSE: handler.on_connection_remote_close(*this); break;
-      case PN_CONNECTION_FINAL: handler.on_connection_final(*this); break;
-
-      case PN_SESSION_INIT: handler.on_session_init(*this); break;
-      case PN_SESSION_LOCAL_OPEN: handler.on_session_local_open(*this); break;
-      case PN_SESSION_LOCAL_CLOSE: handler.on_session_local_close(*this); break;
-      case PN_SESSION_REMOTE_OPEN: handler.on_session_remote_open(*this); break;
-      case PN_SESSION_REMOTE_CLOSE: handler.on_session_remote_close(*this); break;
-      case PN_SESSION_FINAL: handler.on_session_final(*this); break;
-
-      case PN_LINK_INIT: handler.on_link_init(*this); break;
-      case PN_LINK_LOCAL_OPEN: handler.on_link_local_open(*this); break;
-      case PN_LINK_LOCAL_CLOSE: handler.on_link_local_close(*this); break;
-      case PN_LINK_LOCAL_DETACH: handler.on_link_local_detach(*this); break;
-      case PN_LINK_REMOTE_OPEN: handler.on_link_remote_open(*this); break;
-      case PN_LINK_REMOTE_CLOSE: handler.on_link_remote_close(*this); break;
-      case PN_LINK_REMOTE_DETACH: handler.on_link_remote_detach(*this); break;
-      case PN_LINK_FLOW: handler.on_link_flow(*this); break;
-      case PN_LINK_FINAL: handler.on_link_final(*this); break;
-
-      case PN_DELIVERY: handler.on_delivery(*this); break;
-
-      case PN_TRANSPORT: handler.on_transport(*this); break;
-      case PN_TRANSPORT_ERROR: handler.on_transport_error(*this); break;
-      case PN_TRANSPORT_HEAD_CLOSED: handler.on_transport_head_closed(*this); break;
-      case PN_TRANSPORT_TAIL_CLOSED: handler.on_transport_tail_closed(*this); break;
-      case PN_TRANSPORT_CLOSED: handler.on_transport_closed(*this); break;
-
-      case PN_SELECTABLE_INIT: handler.on_selectable_init(*this); break;
-      case PN_SELECTABLE_UPDATED: handler.on_selectable_updated(*this); break;
-      case PN_SELECTABLE_READABLE: handler.on_selectable_readable(*this); break;
-      case PN_SELECTABLE_WRITABLE: handler.on_selectable_writable(*this); break;
-      case PN_SELECTABLE_EXPIRED: handler.on_selectable_expired(*this); break;
-      case PN_SELECTABLE_ERROR: handler.on_selectable_error(*this); break;
-      case PN_SELECTABLE_FINAL: handler.on_selectable_final(*this); break;
-      default:
-        throw error(MSG("Invalid Proton event type " << type));
-    }
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/proton_handler.cpp b/proton-c/bindings/cpp/src/proton_handler.cpp
deleted file mode 100644
index 87d00a3..0000000
--- a/proton-c/bindings/cpp/src/proton_handler.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include "proton_handler.hpp"
-#include "proton_event.hpp"
-
-namespace proton {
-
-proton_handler::proton_handler() {}
-proton_handler::~proton_handler() {}
-
-// Everything goes to on_unhandled() unless overriden by subclass
-
-void proton_handler::on_reactor_init(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_reactor_quiesced(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_reactor_final(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_timer_task(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_connection_init(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_connection_bound(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_connection_unbound(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_connection_local_open(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_connection_local_close(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_connection_remote_open(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_connection_remote_close(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_connection_final(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_session_init(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_session_local_open(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_session_local_close(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_session_remote_open(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_session_remote_close(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_session_final(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_link_init(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_link_local_open(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_link_local_close(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_link_local_detach(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_link_remote_open(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_link_remote_close(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_link_remote_detach(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_link_flow(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_link_final(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_delivery(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_transport(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_transport_error(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_transport_head_closed(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_transport_tail_closed(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_transport_closed(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_selectable_init(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_selectable_updated(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_selectable_readable(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_selectable_writable(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_selectable_expired(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_selectable_error(proton_event &e) { on_unhandled(e); }
-void proton_handler::on_selectable_final(proton_event &e) { on_unhandled(e); }
-
-void proton_handler::on_unhandled(proton_event &) {}
-
-}
diff --git a/proton-c/bindings/cpp/src/reactor.cpp b/proton-c/bindings/cpp/src/reactor.cpp
deleted file mode 100644
index 39f670f..0000000
--- a/proton-c/bindings/cpp/src/reactor.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "reactor.hpp"
-#include "acceptor.hpp"
-
-#include "proton/connection.hpp"
-#include "proton/url.hpp"
-
-#include "contexts.hpp"
-#include "proton_bits.hpp"
-
-#include <proton/reactor.h>
-
-namespace proton {
-
-reactor reactor::create() {
-    return internal::take_ownership(pn_reactor()).get();
-}
-
-void reactor::run() { pn_reactor_run(pn_object()); }
-void reactor::start() { pn_reactor_start(pn_object()); }
-bool reactor::process() { return pn_reactor_process(pn_object()); }
-void reactor::stop() { pn_reactor_stop(pn_object()); }
-void reactor::wakeup() { pn_reactor_wakeup(pn_object()); }
-bool reactor::quiesced() { return pn_reactor_quiesced(pn_object()); }
-void reactor::yield() { pn_reactor_yield(pn_object()); }
-timestamp reactor::mark() { return timestamp(pn_reactor_mark(pn_object())); }
-timestamp reactor::now() { return timestamp(pn_reactor_now(pn_object())); }
-
-void acceptor::close() { pn_acceptor_close(pn_object()); }
-
-acceptor reactor::listen(const url& url){
-    return make_wrapper(pn_reactor_acceptor(pn_object(), url.host().c_str(), url.port().c_str(), 0));
-}
-
-void reactor::schedule(int delay, pn_handler_t* handler) {
-    pn_reactor_schedule(pn_object(), delay, handler);
-}
-
-connection reactor::connection(pn_handler_t* h) const {
-    return make_wrapper(pn_reactor_connection(pn_object(), h));
-}
-
-connection reactor::connection_to_host(const std::string &host, const std::string &port, pn_handler_t* h) const {
-    return make_wrapper(pn_reactor_connection_to_host(pn_object(), host.c_str(), port.c_str(), h));
-}
-
-void reactor::pn_handler(pn_handler_t* h) {
-    pn_reactor_set_handler(pn_object(), h);
-}
-
-pn_handler_t* reactor::pn_handler() const {
-    return pn_reactor_get_handler(pn_object());
-}
-
-void reactor::pn_global_handler(pn_handler_t* h) {
-    pn_reactor_set_global_handler(pn_object(), h);
-}
-
-pn_handler_t* reactor::pn_global_handler() const {
-    return pn_reactor_get_global_handler(pn_object());
-}
-
-duration reactor::timeout() {
-    pn_millis_t tmo = pn_reactor_get_timeout(pn_object());
-    if (tmo == PN_MILLIS_MAX)
-        return duration::FOREVER;
-    return duration(tmo);
-}
-
-void reactor::timeout(duration timeout) {
-    if (timeout == duration::FOREVER || timeout.milliseconds() > PN_MILLIS_MAX)
-        pn_reactor_set_timeout(pn_object(), PN_MILLIS_MAX);
-    else
-        pn_reactor_set_timeout(pn_object(), timeout.milliseconds());
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/receiver.cpp b/proton-c/bindings/cpp/src/receiver.cpp
deleted file mode 100644
index 68d55d0..0000000
--- a/proton-c/bindings/cpp/src/receiver.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include "proton/receiver.hpp"
-
-#include "proton/error.hpp"
-#include "proton/link.hpp"
-#include "proton/receiver_options.hpp"
-#include "proton/source.hpp"
-#include "proton/target.hpp"
-
-#include "msg.hpp"
-#include "proton_bits.hpp"
-#include "contexts.hpp"
-
-#include <proton/connection.h>
-#include <proton/session.h>
-#include <proton/link.h>
-#include <proton/event.h>
-#include <proton/reactor.h>
-
-namespace proton {
-
-receiver::receiver(pn_link_t* r): link(make_wrapper(r)) {}
-
-void receiver::open() {
-    attach();
-}
-
-void receiver::open(const receiver_options &opts) {
-    opts.apply(*this);
-    attach();
-}
-
-class source receiver::source() const {
-    return proton::source(*this);
-}
-
-class target receiver::target() const {
-    return proton::target(*this);
-}
-
-void receiver::add_credit(uint32_t credit) {
-    link_context &ctx = link_context::get(pn_object());
-    if (ctx.draining)
-        ctx.pending_credit += credit;
-    else
-        pn_link_flow(pn_object(), credit);
-}
-
-void receiver::drain() {
-    link_context &ctx = link_context::get(pn_object());
-    if (ctx.draining)
-        throw proton::error("drain already in progress");
-    else {
-        ctx.draining = true;
-        if (credit() > 0)
-            pn_link_set_drain(pn_object(), true);
-        else {
-            // Drain is already complete.  No state to communicate over the wire.
-            // Create dummy flow event where "drain finish" can be detected.
-            pn_connection_t *pnc = pn_session_connection(pn_link_session(pn_object()));
-            pn_collector_put(pn_connection_collector(pnc), PN_OBJECT, pn_object(), PN_LINK_FLOW);
-        }
-    }
-}
-
-receiver_iterator receiver_iterator::operator++() {
-    if (!!obj_) {
-        pn_link_t *lnk = pn_link_next(obj_.pn_object(), 0);
-        while (lnk) {
-            if (pn_link_is_receiver(lnk) && pn_link_session(lnk) == session_)
-                break;
-            lnk = pn_link_next(lnk, 0);
-        }
-        obj_ = lnk;
-    }
-    return *this;
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/receiver_options.cpp b/proton-c/bindings/cpp/src/receiver_options.cpp
deleted file mode 100644
index 4a4d80f..0000000
--- a/proton-c/bindings/cpp/src/receiver_options.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/receiver_options.hpp"
-#include "proton/messaging_handler.hpp"
-#include "proton/source_options.hpp"
-#include "proton/target_options.hpp"
-
-#include <proton/link.h>
-
-#include "contexts.hpp"
-#include "container_impl.hpp"
-#include "messaging_adapter.hpp"
-#include "proton_bits.hpp"
-
-namespace proton {
-
-template <class T> struct option {
-    T value;
-    bool set;
-
-    option() : value(), set(false) {}
-    option& operator=(const T& x) { value = x;  set = true; return *this; }
-    void update(const option<T>& x) { if (x.set) *this = x.value; }
-};
-
-class receiver_options::impl {
-    static link_context& get_context(receiver l) {
-        return link_context::get(unwrap(l));
-    }
-
-    static void set_delivery_mode(receiver l, proton::delivery_mode mode) {
-        switch (mode) {
-        case delivery_mode::AT_MOST_ONCE:
-            pn_link_set_snd_settle_mode(unwrap(l), PN_SND_SETTLED);
-            break;
-        case delivery_mode::AT_LEAST_ONCE:
-            pn_link_set_snd_settle_mode(unwrap(l), PN_SND_UNSETTLED);
-            pn_link_set_rcv_settle_mode(unwrap(l), PN_RCV_FIRST);
-            break;
-        default:
-            break;
-        }
-    }
-
-  public:
-    option<messaging_handler*> handler;
-    option<proton::delivery_mode> delivery_mode;
-    option<bool> auto_accept;
-    option<bool> auto_settle;
-    option<int> credit_window;
-    option<bool> dynamic_address;
-    option<source_options> source;
-    option<target_options> target;
-
-
-    void apply(receiver& r) {
-        if (r.uninitialized()) {
-            if (delivery_mode.set) set_delivery_mode(r, delivery_mode.value);
-            if (handler.set && handler.value) container::impl::set_handler(r, handler.value);
-            if (auto_settle.set) get_context(r).auto_settle = auto_settle.value;
-            if (auto_accept.set) get_context(r).auto_accept = auto_accept.value;
-            if (credit_window.set) get_context(r).credit_window = credit_window.value;
-
-            if (source.set) {
-                proton::source local_s(make_wrapper<proton::source>(pn_link_source(unwrap(r))));
-                source.value.apply(local_s);
-            }
-            if (target.set) {
-                proton::target local_t(make_wrapper<proton::target>(pn_link_target(unwrap(r))));
-                target.value.apply(local_t);
-            }
-        }
-    }
-
-    void update(const impl& x) {
-        handler.update(x.handler);
-        delivery_mode.update(x.delivery_mode);
-        auto_accept.update(x.auto_accept);
-        auto_settle.update(x.auto_settle);
-        credit_window.update(x.credit_window);
-        dynamic_address.update(x.dynamic_address);
-        source.update(x.source);
-        target.update(x.target);
-    }
-
-};
-
-receiver_options::receiver_options() : impl_(new impl()) {}
-receiver_options::receiver_options(const receiver_options& x) : impl_(new impl()) {
-    *this = x;
-}
-receiver_options::~receiver_options() {}
-
-receiver_options& receiver_options::operator=(const receiver_options& x) {
-    *impl_ = *x.impl_;
-    return *this;
-}
-
-void receiver_options::update(const receiver_options& x) { impl_->update(*x.impl_); }
-
-receiver_options& receiver_options::handler(class messaging_handler &h) { impl_->handler = &h; return *this; }
-receiver_options& receiver_options::delivery_mode(proton::delivery_mode m) {impl_->delivery_mode = m; return *this; }
-receiver_options& receiver_options::auto_accept(bool b) {impl_->auto_accept = b; return *this; }
-receiver_options& receiver_options::auto_settle(bool b) {impl_->auto_settle = b; return *this; }
-receiver_options& receiver_options::credit_window(int w) {impl_->credit_window = w; return *this; }
-receiver_options& receiver_options::source(source_options &s) {impl_->source = s; return *this; }
-receiver_options& receiver_options::target(target_options &s) {impl_->target = s; return *this; }
-
-void receiver_options::apply(receiver& r) const { impl_->apply(r); }
-
-} // namespace proton
diff --git a/proton-c/bindings/cpp/src/reconnect_timer.cpp b/proton-c/bindings/cpp/src/reconnect_timer.cpp
deleted file mode 100644
index c63f8a1..0000000
--- a/proton-c/bindings/cpp/src/reconnect_timer.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/reconnect_timer.hpp"
-#include "proton/error.hpp"
-#include "msg.hpp"
-#include <proton/types.h>
-#include <proton/reactor.h>
-
-namespace proton {
-
-reconnect_timer::reconnect_timer(uint32_t first, int32_t max, uint32_t increment,
-                                 bool doubling, int32_t max_retries, int32_t timeout) :
-    first_delay_(first), max_delay_(max), increment_(increment), doubling_(doubling),
-    max_retries_(max_retries), timeout_(timeout), retries_(0), next_delay_(-1), timeout_deadline_(0)
-    {}
-
-void reconnect_timer::reset() {
-    retries_ = 0;
-    next_delay_ = 0;
-    timeout_deadline_ = 0;
-}
-
-int reconnect_timer::next_delay(timestamp now) {
-    retries_++;
-    if (max_retries_ >= 0 && retries_ > max_retries_)
-        return -1;
-
-    if (retries_ == 1) {
-        if (timeout_ >= duration(0))
-            timeout_deadline_ = now + timeout_;
-        next_delay_ = first_delay_;
-    } else if (retries_ == 2) {
-        next_delay_ = next_delay_ + increment_;
-    } else {
-        next_delay_ = next_delay_ + ( doubling_ ? next_delay_ : increment_ );
-    }
-    if (timeout_deadline_ != timestamp(0) && now >= timeout_deadline_)
-        return -1;
-    if (max_delay_ >= duration(0) && next_delay_ > max_delay_)
-        next_delay_ = max_delay_;
-    if (timeout_deadline_ != timestamp(0) && (now + next_delay_ > timeout_deadline_))
-        next_delay_ = timeout_deadline_ - now;
-    return next_delay_.milliseconds();
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/sasl.cpp b/proton-c/bindings/cpp/src/sasl.cpp
deleted file mode 100644
index 73668cd..0000000
--- a/proton-c/bindings/cpp/src/sasl.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/sasl.hpp"
-
-namespace proton {
-
-enum sasl::outcome sasl::outcome() const { return static_cast<enum outcome>(pn_sasl_outcome(object_)); }
-
-std::string sasl::user() const {
-    const char *name = pn_sasl_get_user(object_);
-    return name ? std::string(name) : std::string();
-}
-
-std::string sasl::mech() const {
-    const char *m = pn_sasl_get_mech(object_);
-    return m ? std::string(m) : std::string();
-}
-
-} // namespace
diff --git a/proton-c/bindings/cpp/src/scalar_base.cpp b/proton-c/bindings/cpp/src/scalar_base.cpp
deleted file mode 100644
index 840a6e8..0000000
--- a/proton-c/bindings/cpp/src/scalar_base.cpp
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "msg.hpp"
-#include "types_internal.hpp"
-
-#include "proton/binary.hpp"
-#include "proton/decimal.hpp"
-#include "proton/internal/type_traits.hpp"
-#include "proton/scalar_base.hpp"
-#include "proton/symbol.hpp"
-#include "proton/timestamp.hpp"
-#include "proton/uuid.hpp"
-
-#include <ostream>
-#include <sstream>
-
-namespace proton {
-
-scalar_base::scalar_base() { atom_.type = PN_NULL; }
-scalar_base::scalar_base(const pn_atom_t& a) { set(a); }
-scalar_base::scalar_base(const scalar_base& x) { set(x.atom_); }
-
-scalar_base& scalar_base::operator=(const scalar_base& x) {
-    if (this != &x)
-        set(x.atom_);
-    return *this;
-}
-
-type_id scalar_base::type() const { return type_id(atom_.type); }
-
-bool scalar_base::empty() const { return type() == NULL_TYPE; }
-
-void scalar_base::set(const binary& x, pn_type_t t) {
-    atom_.type = t;
-    bytes_ = x;
-    atom_.u.as_bytes = pn_bytes(bytes_);
-}
-
-void scalar_base::set(const pn_atom_t& atom) {
-    if (type_id_is_string_like(type_id(atom.type))) {
-        set(bin(atom.u.as_bytes), atom.type);
-    } else {
-        atom_ = atom;
-        bytes_.clear();
-    }
-}
-
-void scalar_base::put_(bool x) { atom_.u.as_bool = x; atom_.type = PN_BOOL; }
-void scalar_base::put_(uint8_t x) { atom_.u.as_ubyte = x; atom_.type = PN_UBYTE; }
-void scalar_base::put_(int8_t x) { atom_.u.as_byte = x; atom_.type = PN_BYTE; }
-void scalar_base::put_(uint16_t x) { atom_.u.as_ushort = x; atom_.type = PN_USHORT; }
-void scalar_base::put_(int16_t x) { atom_.u.as_short = x; atom_.type = PN_SHORT; }
-void scalar_base::put_(uint32_t x) { atom_.u.as_uint = x; atom_.type = PN_UINT; }
-void scalar_base::put_(int32_t x) { atom_.u.as_int = x; atom_.type = PN_INT; }
-void scalar_base::put_(uint64_t x) { atom_.u.as_ulong = x; atom_.type = PN_ULONG; }
-void scalar_base::put_(int64_t x) { atom_.u.as_long = x; atom_.type = PN_LONG; }
-void scalar_base::put_(wchar_t x) { atom_.u.as_char = x; atom_.type = PN_CHAR; }
-void scalar_base::put_(float x) { atom_.u.as_float = x; atom_.type = PN_FLOAT; }
-void scalar_base::put_(double x) { atom_.u.as_double = x; atom_.type = PN_DOUBLE; }
-void scalar_base::put_(timestamp x) { atom_.u.as_timestamp = x.milliseconds(); atom_.type = PN_TIMESTAMP; }
-void scalar_base::put_(const decimal32& x) { byte_copy(atom_.u.as_decimal32, x); atom_.type = PN_DECIMAL32;; }
-void scalar_base::put_(const decimal64& x) { byte_copy(atom_.u.as_decimal64, x); atom_.type = PN_DECIMAL64; }
-void scalar_base::put_(const decimal128& x) { byte_copy(atom_.u.as_decimal128, x); atom_.type = PN_DECIMAL128; }
-void scalar_base::put_(const uuid& x) { byte_copy(atom_.u.as_uuid, x); atom_.type = PN_UUID; }
-void scalar_base::put_(const std::string& x) { set(binary(x), PN_STRING); }
-void scalar_base::put_(const symbol& x) { set(binary(x), PN_SYMBOL); }
-void scalar_base::put_(const binary& x) { set(x, PN_BINARY); }
-void scalar_base::put_(const char* x) { set(binary(std::string(x)), PN_STRING); }
-void scalar_base::put_(const null&) { atom_.type = PN_NULL; }
-
-void scalar_base::ok(pn_type_t t) const {
-    if (atom_.type != t) throw make_conversion_error(type_id(t), type());
-}
-
-void scalar_base::get_(bool& x) const { ok(PN_BOOL); x = atom_.u.as_bool; }
-void scalar_base::get_(uint8_t& x) const { ok(PN_UBYTE); x = atom_.u.as_ubyte; }
-void scalar_base::get_(int8_t& x) const { ok(PN_BYTE); x = atom_.u.as_byte; }
-void scalar_base::get_(uint16_t& x) const { ok(PN_USHORT); x = atom_.u.as_ushort; }
-void scalar_base::get_(int16_t& x) const { ok(PN_SHORT); x = atom_.u.as_short; }
-void scalar_base::get_(uint32_t& x) const { ok(PN_UINT); x = atom_.u.as_uint; }
-void scalar_base::get_(int32_t& x) const { ok(PN_INT); x = atom_.u.as_int; }
-void scalar_base::get_(wchar_t& x) const { ok(PN_CHAR); x = wchar_t(atom_.u.as_char); }
-void scalar_base::get_(uint64_t& x) const { ok(PN_ULONG); x = atom_.u.as_ulong; }
-void scalar_base::get_(int64_t& x) const { ok(PN_LONG); x = atom_.u.as_long; }
-void scalar_base::get_(timestamp& x) const { ok(PN_TIMESTAMP); x = atom_.u.as_timestamp; }
-void scalar_base::get_(float& x) const { ok(PN_FLOAT); x = atom_.u.as_float; }
-void scalar_base::get_(double& x) const { ok(PN_DOUBLE); x = atom_.u.as_double; }
-void scalar_base::get_(decimal32& x) const { ok(PN_DECIMAL32); byte_copy(x, atom_.u.as_decimal32); }
-void scalar_base::get_(decimal64& x) const { ok(PN_DECIMAL64); byte_copy(x, atom_.u.as_decimal64); }
-void scalar_base::get_(decimal128& x) const { ok(PN_DECIMAL128); byte_copy(x, atom_.u.as_decimal128); }
-void scalar_base::get_(uuid& x) const { ok(PN_UUID); byte_copy(x, atom_.u.as_uuid); }
-void scalar_base::get_(std::string& x) const { ok(PN_STRING); x = std::string(bytes_.begin(), bytes_.end()); }
-void scalar_base::get_(symbol& x) const { ok(PN_SYMBOL); x = symbol(bytes_.begin(), bytes_.end()); }
-void scalar_base::get_(binary& x) const { ok(PN_BINARY); x = bytes_; }
-void scalar_base::get_(null&) const { ok(PN_NULL); }
-
-namespace {
-
-struct equal_op {
-    const scalar_base& x;
-    equal_op(const scalar_base& s) : x(s) {}
-    template<class T> bool operator()(const T& y) { return (internal::get<T>(x) == y); }
-};
-
-struct less_op {
-    const scalar_base& x;
-    less_op(const scalar_base& s) : x(s) {}
-    template<class T> bool operator()(const T& y) { return (y < internal::get<T>(x)); }
-};
-
-struct ostream_op {
-    std::ostream& o;
-    ostream_op(std::ostream& o_) : o(o_) {}
-    template<class T> std::ostream& operator()(const T& x) { return o << x; }
-};
-
-} // namespace
-
-bool operator==(const scalar_base& x, const scalar_base& y) {
-    if (x.type() != y.type()) return false;
-    if (x.type() == NULL_TYPE) return true;
-    return internal::visit<bool>(x, equal_op(y));
-}
-
-bool operator<(const scalar_base& x, const scalar_base& y) {
-    if (x.type() != y.type()) return x.type() < y.type();
-    if (x.type() == NULL_TYPE) return false;
-    return internal::visit<bool>(x, less_op(y));
-}
-
-std::ostream& operator<<(std::ostream& o, const scalar_base& s) {
-    switch (s.type()) {
-      case NULL_TYPE: return o; // NULL is empty, doesn't print (like empty string)
-        // Print byte types as integer, not char.
-      case BYTE: return o << static_cast<int>(internal::get<int8_t>(s));
-      case UBYTE: return o << static_cast<unsigned int>(internal::get<uint8_t>(s));
-        // Other types printed using normal C++ operator <<
-      default: return internal::visit<std::ostream&>(s, ostream_op(o));
-    }
-}
-
-namespace internal {
-
-conversion_error make_coercion_error(const char* cpp, type_id amqp) {
-    return conversion_error(std::string("invalid proton::coerce<") + cpp + ">(" + type_name(amqp) + ")");
-}
-
-} // internal
-
-std::string to_string(const scalar_base& x) {
-    std::ostringstream os;
-    os << std::boolalpha << x;
-    return os.str();
-}
-
-} // proton
diff --git a/proton-c/bindings/cpp/src/scalar_test.cpp b/proton-c/bindings/cpp/src/scalar_test.cpp
deleted file mode 100644
index 54be0b9..0000000
--- a/proton-c/bindings/cpp/src/scalar_test.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "scalar_test.hpp"
-
-namespace {
-
-using namespace std;
-using namespace proton;
-
-using test::scalar_test_group;
-
-// NOTE: proton::coerce<> and bad proton::get() are tested in value_test to avoid redundant test code.
-
-void encode_decode_test() {
-    value v;
-    scalar a("foo");
-    v = a;                      // Assignment to value does encode, get<> does decode.
-    ASSERT_EQUAL(v, a);
-    ASSERT_EQUAL(std::string("foo"), get<std::string>(v));
-    scalar a2 = get<scalar>(v);
-    ASSERT_EQUAL(std::string("foo"), get<std::string>(a2));
-}
-
-void message_id_test() {
-    ASSERT_EQUAL(23, coerce<int64_t>(message_id(23)));
-    ASSERT_EQUAL(23u, get<uint64_t>(message_id(23)));
-    ASSERT(message_id("foo") != message_id(binary("foo")));
-    ASSERT_EQUAL(scalar("foo"), message_id("foo"));
-    ASSERT_EQUAL("foo", coerce<std::string>(message_id("foo")));
-    ASSERT(message_id("a") < message_id("z"));
-    uuid r = uuid::random();
-    ASSERT_EQUAL(r, get<uuid>(message_id(r)));
-}
-
-void annotation_key_test() {
-    ASSERT_EQUAL(23, coerce<int64_t>(annotation_key(23)));
-    ASSERT_EQUAL(23u, get<uint64_t>(annotation_key(23)));
-    ASSERT_EQUAL("foo", coerce<std::string>(annotation_key("foo")));
-    ASSERT_EQUAL(scalar(symbol("foo")), annotation_key("foo"));
-}
-
-template <class T> T make(const char c) { T x; std::fill(x.begin(), x.end(), c); return x; }
-
-}
-
-int main(int, char**) {
-    int failed = 0;
-    scalar_test_group<scalar>(failed);
-
-    RUN_TEST(failed, encode_decode_test());
-    RUN_TEST(failed, message_id_test());
-    RUN_TEST(failed, annotation_key_test());
-    return failed;
-}
diff --git a/proton-c/bindings/cpp/src/sender.cpp b/proton-c/bindings/cpp/src/sender.cpp
deleted file mode 100644
index 70e9fa6..0000000
--- a/proton-c/bindings/cpp/src/sender.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/sender.hpp"
-
-#include "proton/link.hpp"
-#include "proton/sender_options.hpp"
-#include "proton/source.hpp"
-#include "proton/target.hpp"
-#include "proton/tracker.hpp"
-
-#include <proton/delivery.h>
-#include <proton/link.h>
-#include <proton/types.h>
-
-#include "proton_bits.hpp"
-#include "contexts.hpp"
-
-#include <assert.h>
-
-namespace proton {
-
-sender::sender(pn_link_t *l): link(make_wrapper(l)) {}
-
-void sender::open() {
-    attach();
-}
-
-void sender::open(const sender_options &opts) {
-    opts.apply(*this);
-    attach();
-}
-
-class source sender::source() const {
-    return proton::source(*this);
-}
-
-class target sender::target() const {
-    return proton::target(*this);
-}
-
-namespace {
-// TODO: revisit if thread safety required
-uint64_t tag_counter = 0;
-}
-
-tracker sender::send(const message &message) {
-    uint64_t id = ++tag_counter;
-    pn_delivery_t *dlv =
-        pn_delivery(pn_object(), pn_dtag(reinterpret_cast<const char*>(&id), sizeof(id)));
-    std::vector<char> buf;
-    message.encode(buf);
-    assert(!buf.empty());
-    pn_link_send(pn_object(), &buf[0], buf.size());
-    pn_link_advance(pn_object());
-    if (pn_link_snd_settle_mode(pn_object()) == PN_SND_SETTLED)
-        pn_delivery_settle(dlv);
-    if (!pn_link_credit(pn_object()))
-        link_context::get(pn_object()).draining = false;
-    return make_wrapper<tracker>(dlv);
-}
-
-void sender::return_credit() {
-    link_context &lctx = link_context::get(pn_object());
-    lctx.draining = false;
-    pn_link_drained(pn_object());
-}
-
-sender_iterator sender_iterator::operator++() {
-    if (!!obj_) {
-        pn_link_t *lnk = pn_link_next(obj_.pn_object(), 0);
-        while (lnk) {
-            if (pn_link_is_sender(lnk) && pn_link_session(lnk) == session_)
-                break;
-            lnk = pn_link_next(lnk, 0);
-        }
-        obj_ = lnk;
-    }
-    return *this;
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/sender_options.cpp b/proton-c/bindings/cpp/src/sender_options.cpp
deleted file mode 100644
index 4f501e6..0000000
--- a/proton-c/bindings/cpp/src/sender_options.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/sender_options.hpp"
-#include "proton/messaging_handler.hpp"
-#include "proton/source_options.hpp"
-#include "proton/target_options.hpp"
-
-#include "container_impl.hpp"
-#include "contexts.hpp"
-#include "messaging_adapter.hpp"
-#include "proton_bits.hpp"
-
-namespace proton {
-
-template <class T> struct option {
-    T value;
-    bool set;
-
-    option() : value(), set(false) {}
-    option& operator=(const T& x) { value = x;  set = true; return *this; }
-    void update(const option<T>& x) { if (x.set) *this = x.value; }
-};
-
-class sender_options::impl {
-    static link_context& get_context(sender l) {
-        return link_context::get(unwrap(l));
-    }
-
-    static void set_delivery_mode(sender l, proton::delivery_mode mode) {
-        switch (mode) {
-        case delivery_mode::AT_MOST_ONCE:
-            pn_link_set_snd_settle_mode(unwrap(l), PN_SND_SETTLED);
-            break;
-        case delivery_mode::AT_LEAST_ONCE:
-            pn_link_set_snd_settle_mode(unwrap(l), PN_SND_UNSETTLED);
-            pn_link_set_rcv_settle_mode(unwrap(l), PN_RCV_FIRST);
-            break;
-        default:
-            break;
-        }
-    }
-
-  public:
-    option<messaging_handler*> handler;
-    option<proton::delivery_mode> delivery_mode;
-    option<bool> auto_settle;
-    option<source_options> source;
-    option<target_options> target;
-
-    void apply(sender& s) {
-        if (s.uninitialized()) {
-            if (delivery_mode.set) set_delivery_mode(s, delivery_mode.value);
-            if (handler.set && handler.value) container::impl::set_handler(s, handler.value);
-            if (auto_settle.set) get_context(s).auto_settle = auto_settle.value;
-            if (source.set) {
-                proton::source local_s(make_wrapper<proton::source>(pn_link_source(unwrap(s))));
-                source.value.apply(local_s);
-            }
-            if (target.set) {
-                proton::target local_t(make_wrapper<proton::target>(pn_link_target(unwrap(s))));
-                target.value.apply(local_t);
-            }
-        }
-    }
-
-    void update(const impl& x) {
-        handler.update(x.handler);
-        delivery_mode.update(x.delivery_mode);
-        auto_settle.update(x.auto_settle);
-        source.update(x.source);
-        target.update(x.target);
-    }
-
-};
-
-sender_options::sender_options() : impl_(new impl()) {}
-sender_options::sender_options(const sender_options& x) : impl_(new impl()) {
-    *this = x;
-}
-sender_options::~sender_options() {}
-
-sender_options& sender_options::operator=(const sender_options& x) {
-    *impl_ = *x.impl_;
-    return *this;
-}
-
-void sender_options::update(const sender_options& x) { impl_->update(*x.impl_); }
-
-sender_options& sender_options::handler(class messaging_handler &h) { impl_->handler = &h; return *this; }
-sender_options& sender_options::delivery_mode(proton::delivery_mode m) {impl_->delivery_mode = m; return *this; }
-sender_options& sender_options::auto_settle(bool b) {impl_->auto_settle = b; return *this; }
-sender_options& sender_options::source(const source_options &s) {impl_->source = s; return *this; }
-sender_options& sender_options::target(const target_options &s) {impl_->target = s; return *this; }
-
-void sender_options::apply(sender& s) const { impl_->apply(s); }
-
-} // namespace proton
diff --git a/proton-c/bindings/cpp/src/session.cpp b/proton-c/bindings/cpp/src/session.cpp
deleted file mode 100644
index de152d6..0000000
--- a/proton-c/bindings/cpp/src/session.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include "proton/session.hpp"
-
-#include "proton/connection.hpp"
-#include "proton/receiver_options.hpp"
-#include "proton/sender_options.hpp"
-#include "proton/session_options.hpp"
-
-#include "contexts.hpp"
-#include "proton_bits.hpp"
-
-#include <proton/connection.h>
-#include <proton/session.h>
-
-#include <string>
-
-namespace proton {
-
-void session::open() {
-    pn_session_open(pn_object());
-}
-
-void session::open(const session_options &opts) {
-    opts.apply(*this);
-    pn_session_open(pn_object());
-}
-
-void session::close()
-{
-    pn_session_close(pn_object());
-}
-
-container& session::container() const {
-    return connection().container();
-}
-
-connection session::connection() const {
-    return make_wrapper(pn_session_connection(pn_object()));
-}
-
-namespace {
-std::string next_link_name(const connection& c) {
-    io::link_namer* ln = connection_context::get(c).link_gen;
-
-    return ln ? ln->link_name() : uuid::random().str();
-}
-}
-
-sender session::open_sender(const std::string &addr) {
-    return open_sender(addr, sender_options());
-}
-
-sender session::open_sender(const std::string &addr, const sender_options &so) {
-    pn_link_t *lnk = pn_sender(pn_object(), next_link_name(connection()).c_str());
-    pn_terminus_set_address(pn_link_target(lnk), addr.c_str());
-    sender snd(make_wrapper<sender>(lnk));
-    snd.open(so);
-    return snd;
-}
-
-receiver session::open_receiver(const std::string &addr) {
-    return open_receiver(addr, receiver_options());
-}
-
-receiver session::open_receiver(const std::string &addr, const receiver_options &ro)
-{
-    pn_link_t *lnk = pn_receiver(pn_object(), next_link_name(connection()).c_str());
-    pn_terminus_set_address(pn_link_source(lnk), addr.c_str());
-    receiver rcv(make_wrapper<receiver>(lnk));
-    rcv.open(ro);
-    return rcv;
-}
-
-error_condition session::error() const {
-    return make_wrapper(pn_session_remote_condition(pn_object()));
-}
-
-size_t session::incoming_bytes() const {
-    return pn_session_incoming_bytes(pn_object());
-}
-
-size_t session::outgoing_bytes() const {
-    return pn_session_outgoing_bytes(pn_object());
-}
-
-sender_range session::senders() const {
-    pn_link_t *lnk = pn_link_head(pn_session_connection(pn_object()), 0);
-    while (lnk) {
-        if (pn_link_is_sender(lnk) && pn_link_session(lnk) == pn_object())
-            break;
-        lnk = pn_link_next(lnk, 0);
-    }
-    return sender_range(sender_iterator(make_wrapper<sender>(lnk), pn_object()));
-}
-
-receiver_range session::receivers() const {
-    pn_link_t *lnk = pn_link_head(pn_session_connection(pn_object()), 0);
-    while (lnk) {
-        if (pn_link_is_receiver(lnk) && pn_link_session(lnk) == pn_object())
-            break;
-        lnk = pn_link_next(lnk, 0);
-    }
-    return receiver_range(receiver_iterator(make_wrapper<receiver>(lnk), pn_object()));
-}
-
-session_iterator session_iterator::operator++() {
-    obj_ = pn_session_next(unwrap(obj_), 0);
-    return *this;
-}
-
-} // namespace proton
diff --git a/proton-c/bindings/cpp/src/session_options.cpp b/proton-c/bindings/cpp/src/session_options.cpp
deleted file mode 100644
index 2147fd4..0000000
--- a/proton-c/bindings/cpp/src/session_options.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/session_options.hpp"
-#include "proton/session.hpp"
-#include "proton/connection.hpp"
-#include "proton/container.hpp"
-
-#include <proton/session.h>
-
-#include "messaging_adapter.hpp"
-#include "container_impl.hpp"
-#include "proton_bits.hpp"
-
-namespace proton {
-
-template <class T> struct option {
-    T value;
-    bool set;
-
-    option() : value(), set(false) {}
-    option& operator=(const T& x) { value = x;  set = true; return *this; }
-    void update(const option<T>& x) { if (x.set) *this = x.value; }
-};
-
-class session_options::impl {
-  public:
-    option<messaging_handler *> handler;
-
-    void apply(session& s) {
-        if (s.uninitialized()) {
-            if (handler.set && handler.value) container::impl::set_handler(s, handler.value);
-        }
-    }
-
-};
-
-session_options::session_options() : impl_(new impl()) {}
-session_options::session_options(const session_options& x) : impl_(new impl()) {
-    *this = x;
-}
-session_options::~session_options() {}
-
-session_options& session_options::operator=(const session_options& x) {
-    *impl_ = *x.impl_;
-    return *this;
-}
-
-session_options& session_options::handler(class messaging_handler &h) { impl_->handler = &h; return *this; }
-
-void session_options::apply(session& s) const { impl_->apply(s); }
-
-
-
-
-} // namespace proton
diff --git a/proton-c/bindings/cpp/src/source.cpp b/proton-c/bindings/cpp/src/source.cpp
deleted file mode 100644
index a407d0b..0000000
--- a/proton-c/bindings/cpp/src/source.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton_bits.hpp"
-
-#include "proton/source.hpp"
-#include "proton/sender.hpp"
-#include "proton/receiver.hpp"
-
-#include "proton_bits.hpp"
-
-namespace proton {
-
-// Set parent_ non-null when the local terminus is authoritative and may need to be looked up.
-source::source(pn_terminus_t *t) : terminus(make_wrapper(t)) {}
-
-source::source(const sender& snd) : terminus(make_wrapper(pn_link_remote_source(unwrap(snd)))) { parent_ = unwrap(snd); }
-
-source::source(const receiver& rcv) : terminus(make_wrapper(pn_link_remote_source(unwrap(rcv)))) {}
-
-std::string source::address() const {
-    pn_terminus_t *authoritative = object_;
-    if (parent_ && pn_terminus_is_dynamic(object_))
-        authoritative = pn_link_source(parent_);
-    return str(pn_terminus_get_address(authoritative));
-}
-
-enum source::distribution_mode source::distribution_mode() const {
-  return (enum distribution_mode)pn_terminus_get_distribution_mode(object_);
-}
-
-source::filter_map source::filters() const {
-    codec::decoder d(make_wrapper(pn_terminus_filter(object_)));
-    filter_map map;
-    if (!d.empty()) {
-        d.rewind();
-        d >> map;
-    }
-    return map;
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/ssl.cpp b/proton-c/bindings/cpp/src/ssl.cpp
deleted file mode 100644
index 9a76442..0000000
--- a/proton-c/bindings/cpp/src/ssl.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include "proton/ssl.hpp"
-#include "proton/error.hpp"
-#include "msg.hpp"
-
-#include <proton/ssl.h>
-
-namespace proton {
-
-std::string ssl::cipher() const {
-    char buf[128];
-    if (pn_ssl_get_cipher_name(object_, buf, sizeof(buf)))
-        return std::string(buf);
-    return std::string();
-}
-
-int ssl::ssf() const {
-    return pn_ssl_get_ssf(object_);
-}
-
-std::string ssl::protocol() const {
-    char buf[128];
-    if (pn_ssl_get_protocol_name(object_, buf, sizeof(buf)))
-        return std::string(buf);
-    return std::string();
-}
-
-enum ssl::resume_status ssl::resume_status() const {
-    return (enum ssl::resume_status)pn_ssl_resume_status(object_);
-}
-
-std::string ssl::remote_subject() const {
-    const char *s = pn_ssl_get_remote_subject(object_);
-    return s ? std::string(s) : std::string();
-}
-
-
-} // namespace
diff --git a/proton-c/bindings/cpp/src/ssl_domain.cpp b/proton-c/bindings/cpp/src/ssl_domain.cpp
deleted file mode 100644
index bb95bec..0000000
--- a/proton-c/bindings/cpp/src/ssl_domain.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include "proton/ssl.hpp"
-#include "proton/error.hpp"
-#include "msg.hpp"
-
-#include <proton/ssl.h>
-
-namespace proton {
-
-/// TODO: This whole class isn't really needed as pn_ssl_domain_t is already refcounted, with shared ownership for all pn_ssl_t objects
-/// that hold one
-class ssl_domain_impl {
-  public:
-    ssl_domain_impl(bool is_server) : refcount_(1), pn_domain_(pn_ssl_domain(is_server ? PN_SSL_MODE_SERVER : PN_SSL_MODE_CLIENT)) {
-            if (!pn_domain_) throw error(MSG("SSL/TLS unavailable"));
-    }
-    ~ssl_domain_impl() { pn_ssl_domain_free(pn_domain_); }
-    void incref() { refcount_++; }
-    void decref() {
-        if (--refcount_ == 0) {
-            delete this;
-        }
-    }
-    pn_ssl_domain_t *pn_domain() { return pn_domain_; }
-  private:
-    int refcount_;
-    pn_ssl_domain_t *pn_domain_;
-    ssl_domain_impl(const ssl_domain_impl&);
-    ssl_domain_impl& operator=(const ssl_domain_impl&);
-};
-
-namespace internal {
-ssl_domain::ssl_domain(bool is_server) : impl_(0), server_type_(is_server) {}
-
-ssl_domain::ssl_domain(const ssl_domain &x) : impl_(x.impl_), server_type_(x.server_type_) {
-    if (impl_) impl_->incref();
-}
-
-ssl_domain& internal::ssl_domain::operator=(const ssl_domain&x) {
-    if (impl_) impl_->decref();
-    impl_ = x.impl_;
-    server_type_ = x.server_type_;
-    if (impl_) impl_->incref();
-    return *this;
-}
-
-ssl_domain::~ssl_domain() { if (impl_) impl_->decref(); }
-
-pn_ssl_domain_t *ssl_domain::pn_domain() {
-    if (!impl_)
-        // Lazily create in case never actually used or configured.
-        // The pn_ssl_domain_t is a heavy object.
-        impl_ = new ssl_domain_impl(server_type_);
-    return impl_->pn_domain();
-}
-
-} // namespace internal
-
-namespace {
-
-void set_cred(pn_ssl_domain_t *dom, const std::string &main, const std::string &extra, const std::string &pass, bool pwset) {
-    const char *cred2 = extra.empty() ? NULL : extra.c_str();
-    const char *pw = pwset ? pass.c_str() : NULL;
-    if (pn_ssl_domain_set_credentials(dom, main.c_str(), cred2, pw))
-        throw error(MSG("SSL certificate initialization failure for " << main << ":" <<
-                        (cred2 ? cred2 : "NULL") << ":" << (pw ? pw : "NULL")));
-}
-}
-
-ssl_server_options::ssl_server_options(ssl_certificate &cert) : internal::ssl_domain(true) {
-    set_cred(pn_domain(), cert.certdb_main_, cert.certdb_extra_, cert.passwd_, cert.pw_set_);
-}
-
-ssl_server_options::ssl_server_options(
-    ssl_certificate &cert,
-    const std::string &trust_db,
-    const std::string &advertise_db,
-    enum ssl::verify_mode mode) : internal::ssl_domain(true)
-{
-    pn_ssl_domain_t* dom = pn_domain();
-    set_cred(dom, cert.certdb_main_, cert.certdb_extra_, cert.passwd_, cert.pw_set_);
-    if (pn_ssl_domain_set_trusted_ca_db(dom, trust_db.c_str()))
-        throw error(MSG("SSL trust store initialization failure for " << trust_db));
-    const std::string &db = advertise_db.empty() ? trust_db : advertise_db;
-    if (pn_ssl_domain_set_peer_authentication(dom, pn_ssl_verify_mode_t(mode), db.c_str()))
-        throw error(MSG("SSL server configuration failure requiring client certificates using " << db));
-}
-
-ssl_server_options::ssl_server_options() : ssl_domain(true) {}
-
-namespace {
-void client_setup(pn_ssl_domain_t *dom, const std::string &trust_db, enum ssl::verify_mode mode) {
-    if (pn_ssl_domain_set_trusted_ca_db(dom, trust_db.c_str()))
-        throw error(MSG("SSL trust store initialization failure for " << trust_db));
-    if (pn_ssl_domain_set_peer_authentication(dom, pn_ssl_verify_mode_t(mode), NULL))
-        throw error(MSG("SSL client verify mode failure"));
-}
-}
-
-ssl_client_options::ssl_client_options(const std::string &trust_db, enum ssl::verify_mode mode) : ssl_domain(false) {
-    client_setup(pn_domain(), trust_db, mode);
-}
-
-ssl_client_options::ssl_client_options(ssl_certificate &cert, const std::string &trust_db, enum ssl::verify_mode mode) : ssl_domain(false) {
-    pn_ssl_domain_t *dom = pn_domain();
-    set_cred(dom, cert.certdb_main_, cert.certdb_extra_, cert.passwd_, cert.pw_set_);
-    client_setup(dom, trust_db, mode);
-}
-
-ssl_client_options::ssl_client_options() : ssl_domain(false) {}
-
-ssl_certificate::ssl_certificate(const std::string &main)
-    : certdb_main_(main), pw_set_(false) {}
-
-ssl_certificate::ssl_certificate(const std::string &main, const std::string &extra)
-    : certdb_main_(main), certdb_extra_(extra), pw_set_(false) {}
-
-ssl_certificate::ssl_certificate(const std::string &main, const std::string &extra, const std::string &pw)
-    : certdb_main_(main), certdb_extra_(extra), passwd_(pw), pw_set_(true) {}
-
-} // namespace
diff --git a/proton-c/bindings/cpp/src/target.cpp b/proton-c/bindings/cpp/src/target.cpp
deleted file mode 100644
index 2085601..0000000
--- a/proton-c/bindings/cpp/src/target.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton_bits.hpp"
-
-#include "proton/target.hpp"
-#include "proton/sender.hpp"
-#include "proton/receiver.hpp"
-
-#include "proton_bits.hpp"
-
-namespace proton {
-
-// Set parent_ non-null when the local terminus is authoritative and may need to be looked up.
-target::target(pn_terminus_t *t) : terminus(make_wrapper(t)) {}
-target::target(const sender& snd) : terminus(make_wrapper(pn_link_remote_target(unwrap(snd)))) {}
-target::target(const receiver& rcv) : terminus(make_wrapper(pn_link_remote_target(unwrap(rcv)))) { parent_ = unwrap(rcv); }
-
-std::string target::address() const {
-    pn_terminus_t *authoritative = object_;
-    if (parent_ && pn_terminus_is_dynamic(object_))
-        authoritative = pn_link_target(parent_);
-    return str(pn_terminus_get_address(authoritative));
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/terminus.cpp b/proton-c/bindings/cpp/src/terminus.cpp
deleted file mode 100644
index 8065fe4..0000000
--- a/proton-c/bindings/cpp/src/terminus.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/terminus.hpp"
-
-#include "proton/duration.hpp"
-#include "proton/value.hpp"
-
-#include "proton_bits.hpp"
-
-namespace proton {
-
-terminus::terminus(pn_terminus_t* t) :
-    object_(t), parent_(0)
-{}
-
-enum terminus::expiry_policy terminus::expiry_policy() const {
-    return (enum expiry_policy)pn_terminus_get_expiry_policy(object_);
-}
-
-duration terminus::timeout() const {
-    return duration::SECOND * pn_terminus_get_timeout(object_);
-}
-
-enum terminus::durability_mode terminus::durability_mode() {
-    return (enum durability_mode) pn_terminus_get_durability(object_);
-}
-
-bool terminus::dynamic() const {
-    return pn_terminus_is_dynamic(object_);
-}
-
-value terminus::node_properties() const {
-    return internal::value_ref(pn_terminus_properties(object_));
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/thread_safe_test.cpp b/proton-c/bindings/cpp/src/thread_safe_test.cpp
deleted file mode 100644
index 3a72f7f..0000000
--- a/proton-c/bindings/cpp/src/thread_safe_test.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/// Test reference counting for object wrappers, threads_safe<> wrappers and returned<> wrappers.
-///
-
-#include "test_bits.hpp"
-#include "proton_bits.hpp"
-
-#include "proton/thread_safe.hpp"
-#include "proton/io/connection_driver.hpp"
-
-#include <proton/connection.h>
-
-namespace {
-
-using namespace std;
-using namespace proton;
-
-void test_new() {
-    pn_connection_t* c = 0;
-    thread_safe<connection>* p = 0;
-    {
-        io::connection_driver e;
-        c = unwrap(e.connection());
-        int r = pn_refcount(c);
-        ASSERT(r >= 1); // engine may have internal refs (transport, collector).
-        p = make_thread_safe(e.connection()).release();
-        ASSERT_EQUAL(r+1, pn_refcount(c));
-        delete p;
-        ASSERT_EQUAL(r, pn_refcount(c));
-        p = make_thread_safe(e.connection()).release();
-    }
-    ASSERT_EQUAL(1, pn_refcount(c)); // Engine gone, thread_safe keeping c alive.
-    delete p;
-
-#if PN_CPP_HAS_SHARED_PTR
-    {
-        std::shared_ptr<thread_safe<connection> > sp;
-        {
-            io::connection_driver e;
-            c = unwrap(e.connection());
-            sp = make_shared_thread_safe(e.connection());
-        }
-        ASSERT_EQUAL(1, pn_refcount(c)); // Engine gone, sp keeping c alive.
-    }
-#endif
-#if PN_CPP_HAS_UNIQUE_PTR
-    {
-        std::unique_ptr<thread_safe<connection> > up;
-        {
-            io::connection_driver e;
-            c = unwrap(e.connection());
-            up = make_unique_thread_safe(e.connection());
-        }
-        ASSERT_EQUAL(1, pn_refcount(c)); // Engine gone, sp keeping c alive.
-    }
-#endif
-}
-
-void test_convert() {
-    // Verify refcounts as expected with conversion between proton::object
-    // and thread_safe.
-    connection c;
-    pn_connection_t* pc = 0;
-    {
-        io::connection_driver eng;
-        c = eng.connection();
-        pc = unwrap(c);         // Unwrap in separate scope to avoid confusion from temp values.
-    }
-    {
-        ASSERT_EQUAL(1, pn_refcount(pc));
-        returned<connection> pptr = make_thread_safe(c);
-        ASSERT_EQUAL(2, pn_refcount(pc));
-        returned<connection> pp2 = pptr;
-        ASSERT(!pptr.release()); // Transferred to pp2
-        ASSERT_EQUAL(2, pn_refcount(pc));
-        connection c2 = pp2;        // Transfer and convert to target
-        ASSERT_EQUAL(3, pn_refcount(pc)); // c, c2, thread_safe.
-        ASSERT(c == c2);
-    }
-    ASSERT_EQUAL(1, pn_refcount(pc)); // only c is left
-}
-
-}
-
-int main(int, char**) {
-    int failed = 0;
-    RUN_TEST(failed, test_new());
-    RUN_TEST(failed, test_convert());
-    return failed;
-}
diff --git a/proton-c/bindings/cpp/src/timestamp.cpp b/proton-c/bindings/cpp/src/timestamp.cpp
deleted file mode 100644
index da7c49f..0000000
--- a/proton-c/bindings/cpp/src/timestamp.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "proton/timestamp.hpp"
-
-#include "proton/internal/config.hpp"
-#include <proton/types.h>
-
-#include <iostream>
-
-#if PN_CPP_HAS_CHRONO
-#include <chrono>
-#else
-#include <time.h>
-#endif
-
-namespace proton {
-
-#if PN_CPP_HAS_CHRONO
-timestamp timestamp::now() {
-    using namespace std::chrono;
-    return timestamp( duration_cast<std::chrono::milliseconds>(system_clock::now().time_since_epoch()).count() );
-}
-#else
-// Fallback with low (seconds) precision
-timestamp timestamp::now() {
-    return timestamp( time(0)*1000 );
-}
-#endif
-
-std::ostream& operator<<(std::ostream& o, timestamp ts) { return o << ts.milliseconds(); }
-
-}
diff --git a/proton-c/bindings/cpp/src/tracker.cpp b/proton-c/bindings/cpp/src/tracker.cpp
deleted file mode 100644
index 3b15ed5..0000000
--- a/proton-c/bindings/cpp/src/tracker.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/tracker.hpp"
-
-#include "proton/sender.hpp"
-
-#include "proton_bits.hpp"
-
-#include <proton/delivery.h>
-
-namespace proton {
-
-tracker::tracker(pn_delivery_t *d): transfer(make_wrapper(d)) {}
-sender tracker::sender() const { return make_wrapper<class sender>(pn_delivery_link(pn_object())); }
-}
diff --git a/proton-c/bindings/cpp/src/transfer.cpp b/proton-c/bindings/cpp/src/transfer.cpp
deleted file mode 100644
index 78b6c0e..0000000
--- a/proton-c/bindings/cpp/src/transfer.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/delivery.hpp"
-
-#include "proton/connection.hpp"
-#include "proton/link.hpp"
-#include "proton/session.hpp"
-
-#include <proton/delivery.h>
-#include <proton/link.h>
-#include <proton/session.h>
-
-#include "proton_bits.hpp"
-
-namespace proton {
-
-session transfer::session() const { return make_wrapper(pn_link_session(pn_delivery_link(pn_object()))); }
-connection transfer::connection() const { return make_wrapper(pn_session_connection(pn_link_session(pn_delivery_link(pn_object())))); }
-container& transfer::container() const { return connection().container(); }
-
-bool transfer::settled() const { return pn_delivery_settled(pn_object()); }
-
-void transfer::settle() { pn_delivery_settle(pn_object()); }
-
-enum transfer::state transfer::state() const { return static_cast<enum state>(pn_delivery_remote_state(pn_object())); }
-}
diff --git a/proton-c/bindings/cpp/src/transport.cpp b/proton-c/bindings/cpp/src/transport.cpp
deleted file mode 100644
index da3119e..0000000
--- a/proton-c/bindings/cpp/src/transport.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/error.hpp"
-#include "proton/transport.hpp"
-#include "proton/error_condition.hpp"
-#include "proton/connection.hpp"
-#include "proton/ssl.hpp"
-#include "proton/sasl.hpp"
-#include <proton/transport.h>
-#include <proton/error.h>
-
-#include "msg.hpp"
-#include "proton_bits.hpp"
-
-
-namespace proton {
-
-connection transport::connection() const {
-    return make_wrapper(pn_transport_connection(pn_object()));
-}
-
-class ssl transport::ssl() const {
-    return make_wrapper(pn_ssl(pn_object()));
-}
-
-class sasl transport::sasl() const {
-    return make_wrapper(pn_sasl(pn_object()));
-}
-
-error_condition transport::error() const {
-    return make_wrapper(pn_transport_condition(pn_object()));
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/type_id.cpp b/proton-c/bindings/cpp/src/type_id.cpp
deleted file mode 100644
index b28a6e8..0000000
--- a/proton-c/bindings/cpp/src/type_id.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "types_internal.hpp"
-
-#include "proton/type_id.hpp"
-
-#include <ostream>
-
-namespace proton {
-
-std::string type_name(type_id t) {
-    switch (t) {
-      case NULL_TYPE: return "null";
-      case BOOLEAN: return "boolean";
-      case UBYTE: return "ubyte";
-      case BYTE: return "byte";
-      case USHORT: return "ushort";
-      case SHORT: return "short";
-      case UINT: return "uint";
-      case INT: return "int";
-      case CHAR: return "char";
-      case ULONG: return "ulong";
-      case LONG: return "long";
-      case TIMESTAMP: return "timestamp";
-      case FLOAT: return "float";
-      case DOUBLE: return "double";
-      case DECIMAL32: return "decimal32";
-      case DECIMAL64: return "decimal64";
-      case DECIMAL128: return "decimal128";
-      case UUID: return "uuid";
-      case BINARY: return "binary";
-      case STRING: return "string";
-      case SYMBOL: return "symbol";
-      case DESCRIBED: return "described";
-      case ARRAY: return "array";
-      case LIST: return "list";
-      case  MAP: return "map";
-    }
-// Avoid unreached diagnostic from clang
-#if defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wunreachable-code"
-#endif
-     return "unknown";
-#if defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-}
-
-std::ostream& operator<<(std::ostream& o, type_id t) { return o << type_name(t); }
-
-void assert_type_equal(type_id want, type_id got) {
-    if (want != got) throw make_conversion_error(want, got);
-}
-
-} // proton
diff --git a/proton-c/bindings/cpp/src/url.cpp b/proton-c/bindings/cpp/src/url.cpp
deleted file mode 100644
index 867f605..0000000
--- a/proton-c/bindings/cpp/src/url.cpp
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/url.hpp"
-
-#include "proton/error.hpp"
-
-#include "proton_bits.hpp"
-
-#include <cstdlib>
-#include <cstring>
-#include <iomanip>
-#include <sstream>
-#include <vector>
-
-namespace {
-
-/** URL-encode src and append to dst. */
-static std::string pni_urlencode(const std::string &src) {
-    static const char *bad = "@:/";
-
-    std::ostringstream dst;
-    dst << std::hex << std::uppercase << std::setfill('0');
-
-    std::size_t i = 0;
-    std::size_t j = src.find_first_of(bad);
-    while (j!=std::string::npos) {
-        dst << src.substr(i, j-i);
-        dst << "%" << std::setw(2) << src[j];
-        i = j + 1;
-        j = src.find_first_of(bad);
-    }
-    dst << src.substr(i);
-    return dst.str();
-}
-
-// Low level url parser
-static void pni_urldecode(const char *src, char *dst)
-{
-  const char *in = src;
-  char *out = dst;
-  while (*in != '\0')
-  {
-    if ('%' == *in)
-    {
-      if ((in[1] != '\0') && (in[2] != '\0'))
-      {
-        char esc[3];
-        esc[0] = in[1];
-        esc[1] = in[2];
-        esc[2] = '\0';
-        unsigned long d = std::strtoul(esc, NULL, 16);
-        *out = (char)d;
-        in += 3;
-        out++;
-      }
-      else
-      {
-        *out = *in;
-        in++;
-        out++;
-      }
-    }
-    else
-    {
-      *out = *in;
-      in++;
-      out++;
-    }
-  }
-  *out = '\0';
-}
-
-void parse_url(char *url, const char **scheme, const char **user, const char **pass, const char **host, const char **port, const char **path)
-{
-  if (!url) return;
-
-  char *slash = std::strchr(url, '/');
-
-  if (slash && slash>url) {
-    char *scheme_end = std::strstr(slash-1, "://");
-
-    if (scheme_end && scheme_end<slash) {
-      *scheme_end = '\0';
-      *scheme = url;
-      url = scheme_end + 3;
-      slash = std::strchr(url, '/');
-    }
-  }
-
-  if (slash) {
-    *slash = '\0';
-    *path = slash + 1;
-  }
-
-  char *at = std::strchr(url, '@');
-  if (at) {
-    *at = '\0';
-    char *up = url;
-    url = at + 1;
-    char *colon = std::strchr(up, ':');
-    if (colon) {
-      *colon = '\0';
-      char *p = colon + 1;
-      pni_urldecode(p, p);
-      *pass = p;
-    }
-    pni_urldecode(up, up);
-    *user = up;
-  }
-
-  *host = url;
-  char *open = (*url == '[') ? url : 0;
-  if (open) {
-    char *close = std::strchr(open, ']');
-    if (close) {
-        *host = open + 1;
-        *close = '\0';
-        url = close + 1;
-    }
-  }
-
-  char *colon = std::strchr(url, ':');
-  if (colon) {
-    *colon = '\0';
-    *port = colon + 1;
-  }
-}
-
-} // namespace
-
-namespace proton {
-
-struct url::impl {
-    static const char* const default_host;
-    const char* scheme;
-    const char* username;
-    const char* password;
-    const char* host;
-    const char* port;
-    const char* path;
-    std::vector<char> cstr;
-    mutable std::string str;
-
-    impl(const std::string& s) :
-        scheme(0), username(0), password(0), host(0), port(0), path(0),
-        cstr(s.size()+1, '\0')
-    {
-        std::copy(s.begin(), s.end(), cstr.begin());
-        parse_url(&cstr[0], &scheme, &username, &password, &host, &port, &path);
-    }
-
-    void defaults() {
-        if (!scheme || *scheme=='\0' ) scheme = proton::url::AMQP.c_str();
-        if (!host || *host=='\0' ) host = default_host;
-        if (!port || *port=='\0' ) port = scheme;
-    }
-
-    operator std::string() const {
-        if ( str.empty() ) {
-            if (scheme) {
-                str += scheme;
-                str += "://";
-            }
-            if (username) {
-                str += pni_urlencode(username);
-            }
-            if (password) {
-                str += ":";
-                str += pni_urlencode(password);
-            }
-            if (username || password) {
-                str += "@";
-            }
-            if (host) {
-                if (std::strchr(host, ':')) {
-                    str += '[';
-                    str += host;
-                    str += ']';
-                } else {
-                    str += host;
-                }
-            }
-            if (port) {
-                str += ':';
-                str += port;
-            }
-            if (path) {
-                str += '/';
-                str += path;
-            }
-        }
-        return str;
-    }
-
-};
-
-const char* const url::impl::default_host = "localhost";
-
-
-url_error::url_error(const std::string& s) : error(s) {}
-
-url::url(const std::string &s) : impl_(new impl(s)) { impl_->defaults(); }
-
-url::url(const std::string &s, bool d) : impl_(new impl(s)) { if (d) impl_->defaults(); }
-
-url::url(const url& u) : impl_(new impl(u)) {}
-
-url::~url() {}
-
-url& url::operator=(const url& u) {
-    if (this != &u) {
-        impl_.reset(new impl(*u.impl_));
-    }
-    return *this;
-}
-
-url::operator std::string() const { return *impl_; }
-
-std::string url::scheme() const { return str(impl_->scheme); }
-std::string url::user() const { return str(impl_->username); }
-std::string url::password() const { return str(impl_->password); }
-std::string url::host() const { return str(impl_->host); }
-std::string url::port() const { return str(impl_->port); }
-std::string url::path() const { return str(impl_->path); }
-
-std::string url::host_port() const { return host() + ":" + port(); }
-
-bool url::empty() const { return impl_->str.empty(); }
-
-const std::string url::AMQP("amqp");
-const std::string url::AMQPS("amqps");
-
-uint16_t url::port_int() const {
-    // TODO aconway 2015-10-27: full service name lookup
-    // astitcher 2016-11-17: It is hard to make the full service name lookup platform independent
-    if (port() == AMQP) return 5672;
-    if (port() == AMQPS) return 5671;
-    std::istringstream is(port());
-    uint16_t result;
-    is >> result;
-    if (is.fail())
-        throw url_error("invalid port '" + port() + "'");
-    return result;
-}
-
-std::ostream& operator<<(std::ostream& o, const url& u) {
-    return o << std::string(u);
-}
-
-std::string to_string(const url& u) {
-    return u;
-}
-
-std::istream& operator>>(std::istream& i, url& u) {
-    std::string s;
-    i >> s;
-    if (!i.fail() && !i.bad()) {
-        if (!s.empty()) {
-            url::impl* p = new url::impl(s);
-            p->defaults();
-            u.impl_.reset(p);
-        } else {
-            i.clear(std::ios::failbit);
-        }
-    }
-    return i;
-}
-
-} // namespace proton
diff --git a/proton-c/bindings/cpp/src/url_test.cpp b/proton-c/bindings/cpp/src/url_test.cpp
deleted file mode 100644
index 0727e2c..0000000
--- a/proton-c/bindings/cpp/src/url_test.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "test_bits.hpp"
-#include <proton/url.hpp>
-
-namespace {
-
-void check_url(const std::string& s,
-               const std::string& scheme,
-               const std::string& user,
-               const std::string& pwd,
-               const std::string& host,
-               const std::string& port,
-               const std::string& path
-              )
-{
-    proton::url u(s);
-    ASSERT_EQUAL(scheme, u.scheme());
-    ASSERT_EQUAL(user, u.user());
-    ASSERT_EQUAL(pwd, u.password());
-    ASSERT_EQUAL(host, u.host());
-    ASSERT_EQUAL(port, u.port());
-    ASSERT_EQUAL(path, u.path());
-}
-
-void parse_to_string_test() {
-    check_url("amqp://foo:xyz/path",
-              "amqp", "", "", "foo", "xyz", "path");
-    check_url("amqp://username:password@host:1234/path",
-              "amqp", "username", "password", "host", "1234", "path");
-    check_url("host:1234",
-              "amqp", "", "", "host", "1234", "");
-    check_url("host",
-              "amqp", "", "", "host", "amqp", "");
-    check_url("host/path",
-              "amqp", "", "", "host", "amqp", "path");
-    check_url("amqps://host",
-              "amqps", "", "", "host", "amqps", "");
-    check_url("/path",
-              "amqp", "", "", "localhost", "amqp", "path");
-    check_url("",
-              "amqp", "", "", "localhost", "amqp", "");
-    check_url(":1234",
-              "amqp", "", "", "localhost", "1234", "");
-}
-
-}
-
-int main(int, char**) {
-    int failed = 0;
-    RUN_TEST(failed, parse_to_string_test());
-    return failed;
-}
diff --git a/proton-c/bindings/cpp/src/uuid.cpp b/proton-c/bindings/cpp/src/uuid.cpp
deleted file mode 100644
index 7e0af2c..0000000
--- a/proton-c/bindings/cpp/src/uuid.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "types_internal.hpp"
-
-#include "proton/uuid.hpp"
-#include "proton/types_fwd.hpp"
-
-#include <cstdlib>
-#include <ctime>
-#include <sstream>
-#include <iomanip>
-
-#ifdef WIN32
-#include <process.h>
-#define GETPID _getpid
-#else
-#include <unistd.h>
-#define GETPID getpid
-#endif
-
-namespace proton {
-
-namespace {
-
-
-// Seed the random number generated once at startup.
-struct seed {
-    seed() {
-        // A hash of time and PID, time alone is a bad seed as programs started
-        // within the same second will get the same seed.
-        long secs = time(0);
-        long pid = GETPID();
-        std::srand(((secs*181)*((pid-83)*359))%104729);
-    }
-} seed_;
-
-}
-
-uuid uuid::copy() {
-    uuid u;
-    std::fill(u.begin(), u.end(), 0);
-    return u;
-}
-
-uuid uuid::copy(const char* bytes) {
-    uuid u;
-    if (bytes)
-        std::copy(bytes, bytes + u.size(), u.begin());
-    else
-        std::fill(u.begin(), u.end(), 0);
-    return u;
-}
-
-uuid uuid::random() {
-    uuid bytes;
-    int r = std::rand();
-    for (size_t i = 0; i < bytes.size(); ++i ) {
-        bytes[i] = r & 0xFF;
-        r >>= 8;
-        if (!r) r = std::rand();
-    }
-
-    // From RFC4122, the version bits are set to 0100
-    bytes[6] = (bytes[6] & 0x0F) | 0x40;
-
-    // From RFC4122, the top two bits of byte 8 get set to 01
-    bytes[8] = (bytes[8] & 0x3F) | 0x80;
-    return bytes;
-}
-
-/// UUID standard format: 8-4-4-4-12 (36 chars, 32 alphanumeric and 4 hypens)
-std::ostream& operator<<(std::ostream& o, const uuid& u) {
-    ios_guard restore_flags(o);
-    o << std::hex << std::setfill('0');
-    static const int segments[] = {4,2,2,2,6}; // 1 byte is 2 hex chars.
-    const uint8_t *p = reinterpret_cast<const uint8_t*>(u.begin());
-    for (size_t i = 0; i < sizeof(segments)/sizeof(segments[0]); ++i) {
-        if (i > 0)
-            o << '-';
-        for (int j = 0; j < segments[i]; ++j) {
-            o << std::setw(2) << printable_byte(*(p++));
-        }
-    }
-    return o;
-}
-
-std::string uuid::str() const {
-    std::ostringstream s;
-    s << *this;
-    return s.str();
-}
-
-}
diff --git a/proton-c/bindings/cpp/src/value.cpp b/proton-c/bindings/cpp/src/value.cpp
deleted file mode 100644
index ceb3463..0000000
--- a/proton-c/bindings/cpp/src/value.cpp
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "proton_bits.hpp"
-#include "proton/internal/data.hpp"
-#include "proton/value.hpp"
-#include "proton/types.hpp"
-#include "proton/scalar.hpp"
-#include "proton/error.hpp"
-
-#include <ostream>
-#include <sstream>
-
-namespace proton {
-
-using codec::decoder;
-using codec::encoder;
-using codec::start;
-
-value::value() {}
-value::value(const value& x) { *this = x; }
-#if PN_CPP_HAS_RVALUE_REFERENCES
-value::value(value&& x) { swap(*this, x); }
-value& value::operator=(value&& x) { swap(*this, x); return *this; }
-#endif
-
-value& value::operator=(const value& x) {
-    if (this != &x) {
-        if (x.empty())
-            clear();
-        else
-            data().copy(x.data_);
-    }
-    return *this;
-}
-
-void swap(value& x, value& y) { std::swap(x.data_, y.data_); }
-
-void value::clear() { if (!!data_) data_.clear(); }
-
-namespace internal {
-
-// On demand
-internal::data& value_base::data() {
-    if (!data_)
-        data_ = internal::data::create();
-    return data_;
-}
-
-}
-
-type_id value::type() const {
-    return (!data_ || data_.empty()) ? NULL_TYPE : codec::decoder(*this).next_type();
-}
-
-bool value::empty() const { return type() == NULL_TYPE; }
-
-namespace {
-
-// Compare nodes, return -1 if a<b, 0 if a==b, +1 if a>b
-// Forward-declare so we can use it recursively.
-int compare_next(decoder& a, decoder& b);
-
-template <class T> int compare(const T& a, const T& b) {
-    if (a < b) return -1;
-    else if (a > b) return +1;
-    else return 0;
-}
-
-int compare_container(decoder& a, decoder& b) {
-    start sa, sb;
-    a >> sa;
-    b >> sb;
-    // Compare described vs. not-described.
-    int cmp = compare(sa.is_described, sb.is_described);
-    if (cmp) return cmp;
-    // Lexical sort (including descriptor if there is one)
-    size_t min_size = std::min(sa.size, sb.size) + size_t(sa.is_described);
-    for (size_t i = 0; i < min_size; ++i) {
-        cmp = compare_next(a, b);
-        if (cmp) return cmp;
-    }
-    return compare(sa.size, sb.size);
-}
-
-template <class T> int compare_simple(decoder& a, decoder& b) {
-    T va = T();
-    T vb = T();
-    a >> va;
-    b >> vb;
-    return compare(va, vb);
-}
-
-int compare_next(decoder& a, decoder& b) {
-    // Sort by type_id first.
-    type_id ta = a.next_type(), tb = b.next_type();
-    int cmp = compare(ta, tb);
-    if (cmp) return cmp;
-
-    switch (ta) {
-      case NULL_TYPE: return 0;
-      case ARRAY:
-      case LIST:
-      case MAP:
-      case DESCRIBED:
-        return compare_container(a, b);
-      case BOOLEAN: return compare_simple<bool>(a, b);
-      case UBYTE: return compare_simple<uint8_t>(a, b);
-      case BYTE: return compare_simple<int8_t>(a, b);
-      case USHORT: return compare_simple<uint16_t>(a, b);
-      case SHORT: return compare_simple<int16_t>(a, b);
-      case UINT: return compare_simple<uint32_t>(a, b);
-      case INT: return compare_simple<int32_t>(a, b);
-      case ULONG: return compare_simple<uint64_t>(a, b);
-      case LONG: return compare_simple<int64_t>(a, b);
-      case CHAR: return compare_simple<wchar_t>(a, b);
-      case TIMESTAMP: return compare_simple<timestamp>(a, b);
-      case FLOAT: return compare_simple<float>(a, b);
-      case DOUBLE: return compare_simple<double>(a, b);
-      case DECIMAL32: return compare_simple<decimal32>(a, b);
-      case DECIMAL64: return compare_simple<decimal64>(a, b);
-      case DECIMAL128: return compare_simple<decimal128>(a, b);
-      case UUID: return compare_simple<uuid>(a, b);
-      case BINARY: return compare_simple<binary>(a, b);
-      case STRING: return compare_simple<std::string>(a, b);
-      case SYMBOL: return compare_simple<symbol>(a, b);
-    }
-// Avoid unreached diagnostic from clang
-#if defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wunreachable-code"
-#endif    
-    // Invalid but equal type_id, treat as equal.
-    return 0;
-#if defined(__clang__)
-#pragma GCC diagnostic pop
-#endif    
-}
-
-int compare(const value& x, const value& y) {
-    decoder a(x), b(y);
-    internal::state_guard s1(a), s2(b);
-    a.rewind();
-    b.rewind();
-    while (a.more() && b.more()) {
-        int cmp = compare_next(a, b);
-        if (cmp != 0) return cmp;
-    }
-    if (b.more()) return -1;
-    if (a.more()) return 1;
-    return 0;
-}
-
-} // namespace
-
-bool operator==(const value& x, const value& y) {
-    if (x.empty() && y.empty()) return true;
-    if (x.empty() || y.empty()) return false;
-    return compare(x, y) == 0;
-}
-
-bool operator<(const value& x, const value& y) {
-    if (x.empty() && y.empty()) return false;
-    if (x.empty()) return true; // empty is < !empty
-    return compare(x, y) < 0;
-}
-
-std::ostream& operator<<(std::ostream& o, const value& x) {
-    if (type_id_is_scalar(x.type()) || x.empty())
-        return o << proton::get<scalar>(x); // Print as a scalar
-    // Use pn_inspect for complex types.
-    proton::decoder d(x);
-    return o << d;
-}
-
-namespace internal {
-value_ref::value_ref(pn_data_t* p) { refer(p); }
-value_ref::value_ref(const internal::data& d) { refer(d); }
-value_ref::value_ref(const value_base& v) { refer(v); }
-
-void value_ref::refer(pn_data_t* p) { data_ = make_wrapper(p); }
-void value_ref::refer(const internal::data& d) { data_ = d; }
-void value_ref::refer(const value_base& v) { data_ = v.data_; }
-
-void value_ref::reset() { refer(0); }
-} // namespace internal
-
-std::string to_string(const value& x) {
-    std::ostringstream os;
-    os << std::boolalpha << x;
-    return os.str();
-}
-
-} // namespace proton
diff --git a/proton-c/bindings/cpp/src/value_test.cpp b/proton-c/bindings/cpp/src/value_test.cpp
deleted file mode 100644
index d9f0f4a..0000000
--- a/proton-c/bindings/cpp/src/value_test.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "scalar_test.hpp"
-
-namespace {
-
-using namespace std;
-using namespace proton;
-
-using test::many;
-using test::scalar_test_group;
-
-// Inserting and extracting arrays from a container T of type U
-template <class T> void sequence_test(
-    type_id tid, const many<typename T::value_type>& values, const string& s)
-{
-    T x(values.begin(), values.end());
-
-    value vx(x);                // construct
-    ASSERT_EQUAL(tid, vx.type());
-    ASSERT_EQUAL(x, get<T>(vx));
-    ASSERT_EQUAL(x, coerce<T>(vx));
-    {
-        T y;
-        get(vx, y);             // Two argument get.
-        ASSERT_EQUAL(x, y);
-    }
-    {
-        T y;
-        coerce(vx, y);          // Two argument coerce.
-        ASSERT_EQUAL(x, y);
-    }
-    value v2;                   // assign
-    v2 = x;
-    ASSERT_EQUAL(tid, v2.type());
-    ASSERT_EQUAL(x, get<T>(v2));
-    ASSERT_EQUAL(x, coerce<T>(v2));
-    ASSERT_EQUAL(vx, v2);
-
-    T y(x);
-    typename T::iterator it = y.begin();
-    *y.begin() = *(++it); // Second element is bigger so y is lexicographically bigger than x
-    value vy(y);
-    ASSERT(vx != vy);
-    ASSERT(vx < vy);
-    ASSERT(vy > vx);
-
-    ASSERT_EQUAL(s, to_string(vx));
-}
-
-template <class T, class U> void map_test(const U& values, const string& s) {
-    T m(values.begin(), values.end());
-    value v(m);
-    ASSERT_EQUAL(MAP, v.type());
-    T m2(get<T>(v));
-    ASSERT_EQUAL(m.size(), m2.size());
-    ASSERT_EQUAL(m, m2);
-    if (!s.empty())
-        ASSERT_EQUAL(s, to_string(v));
-}
-
-}
-
-int main(int, char**) {
-    int failed = 0;
-    scalar_test_group<value>(failed);
-
-    // Sequence tests
-    RUN_TEST(failed, sequence_test<list<bool> >(
-                 ARRAY, many<bool>() + false + true, "@PN_BOOL[false, true]"));
-    RUN_TEST(failed, sequence_test<vector<int> >(
-                 ARRAY, many<int>() + -1 + 2, "@PN_INT[-1, 2]"));
-    RUN_TEST(failed, sequence_test<deque<string> >(
-                 ARRAY, many<string>() + "a" + "b", "@PN_STRING[\"a\", \"b\"]"));
-    RUN_TEST(failed, sequence_test<deque<symbol> >(
-                 ARRAY, many<symbol>() + "a" + "b", "@PN_SYMBOL[:a, :b]"));
-    RUN_TEST(failed, sequence_test<vector<value> >(
-                 LIST, many<value>() + value(0) + value("a"), "[0, \"a\"]"));
-    RUN_TEST(failed, sequence_test<vector<scalar> >(
-                 LIST, many<scalar>() + scalar(0) + scalar("a"), "[0, \"a\"]"));
-
-    // // Map tests
-    typedef pair<string, uint64_t> si_pair;
-    many<si_pair> si_pairs;
-    si_pairs << si_pair("a", 0) << si_pair("b", 1) << si_pair("c", 2);
-
-    RUN_TEST(failed, (map_test<map<string, uint64_t> >(
-                          si_pairs, "{\"a\"=0, \"b\"=1, \"c\"=2}")));
-    RUN_TEST(failed, (map_test<vector<si_pair> >(
-                          si_pairs, "{\"a\"=0, \"b\"=1, \"c\"=2}")));
-
-    many<std::pair<value,value> > value_pairs(si_pairs);
-    RUN_TEST(failed, (map_test<map<value, value> >(
-                          value_pairs, "{\"a\"=0, \"b\"=1, \"c\"=2}")));
-
-    many<pair<scalar,scalar> > scalar_pairs(si_pairs);
-    RUN_TEST(failed, (map_test<map<scalar, scalar> >(
-                          scalar_pairs, "{\"a\"=0, \"b\"=1, \"c\"=2}")));
-
-    annotation_key ak(si_pairs[0].first);
-    pair<annotation_key, message_id> p(si_pairs[0]);
-    many<pair<annotation_key, message_id> > restricted_pairs(si_pairs);
-    RUN_TEST(failed, (map_test<map<annotation_key, message_id> >(
-                          restricted_pairs, "{:a=0, :b=1, :c=2}")));
-
-#if PN_CPP_HAS_CPP11
-    RUN_TEST(failed, sequence_test<forward_list<binary> >(
-                 ARRAY, many<binary>() + binary("xx") + binary("yy"), "@PN_BINARY[b\"xx\", b\"yy\"]"));
-    RUN_TEST(failed, (map_test<unordered_map<string, uint64_t> >(si_pairs, "")));
-#endif
-    return failed;
-}
diff --git a/proton-c/bindings/go/CMakeLists.txt b/proton-c/bindings/go/CMakeLists.txt
deleted file mode 100644
index 16c633b..0000000
--- a/proton-c/bindings/go/CMakeLists.txt
+++ /dev/null
@@ -1,79 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Go version
-execute_process(COMMAND ${GO_EXE} version OUTPUT_VARIABLE go_ver OUTPUT_STRIP_TRAILING_WHITESPACE)
-message(STATUS "Found Go: ${GO_EXE} (${go_ver})")
-
-set(GO_BUILD_FLAGS "" CACHE STRING "Flags for 'go build'")
-
-# Flags that differ for golang go and gcc go.
-if (go_ver MATCHES "gccgo")
-  # TODO aconway 2015-10-08: import cycles with -race under gccgo, investigate.
-  set(GO_TEST_FLAGS "-v" CACHE STRING "Flags for 'go test'")
-  set(GO_RPATH_FLAGS -gccgoflags "-Wl,-rpath=${CMAKE_BINARY_DIR}/proton-c")
-else()
-  set(GO_TEST_FLAGS "-v -race" CACHE STRING "Flags for 'go test'")
-  set(GO_RPATH_FLAGS -ldflags "-r ${CMAKE_BINARY_DIR}/proton-c")
-endif()
-
-separate_arguments(GO_BUILD_FLAGS)
-separate_arguments(GO_TEST_FLAGS)
-
-# Following are CACHE INTERNAL so examples/CMakeLists.txt can see them.
-set(GO_ENV ${env_py} --
-  "GOPATH=${CMAKE_CURRENT_SOURCE_DIR}"
-  "CGO_CFLAGS=-I${CMAKE_SOURCE_DIR}/proton-c/include -I${CMAKE_BINARY_DIR}/proton-c/include"
-  "CGO_LDFLAGS=-L${CMAKE_BINARY_DIR}/proton-c"
-  "PN_INTEROP_DIR=${CMAKE_SOURCE_DIR}/tests/interop"
-  CACHE INTERNAL "Run a command with Go environment variables")
-
-set(GO ${GO_ENV} ${GO_EXE} CACHE INTERNAL "Run go with environment set")
-
-set(GO_BUILD ${GO} build ${GO_BUILD_FLAGS} ${GO_RPATH_FLAGS} CACHE INTERNAL "Run go build")
-set(GO_INSTALL ${GO} install ${GO_BUILD_FLAGS} CACHE INTERNAL "Run go install" )
-set(GO_TEST ${GO} test ${GO_BUILD_FLAGS} ${GO_RPATH_FLAGS} ${GO_TEST_FLAGS} CACHE INTERNAL "Run go test")
-
-# Go tools insist on standard Go layout which puts compiled code in the source tree :(
-# Build output is all under git-ignored pkg or bin subdirectories, they are removed by make clean.
-
-# The go build tools handle dependency checks and incremental builds better than
-# CMake so just run them every time, they do nothing if nothing needs to be
-# done.
-add_custom_target(go-build ALL
-  COMMAND ${GO_INSTALL} qpid.apache.org/...
-  DEPENDS qpid-proton-core
-  WORKING_DIRECTORY $ENV{PWD})
-
-add_test(
-  NAME go-test COMMAND ${GO_TEST} qpid.apache.org/...
-  WORKING_DIRECTORY $ENV{PWD})
-
-# Make available to examples/go/CMakeLists
-set(GO_TARGETS go-build CACHE INTERNAL "Go package library targets")
-
-# Clean up go output directories.
-list(APPEND ADDITIONAL_MAKE_CLEAN_FILES
-  ${CMAKE_CURRENT_SOURCE_DIR}/pkg
-  ${CMAKE_CURRENT_SOURCE_DIR}/bin)
-
-# Install go sources.
-set (GO_INSTALL_DIR ${SHARE_INSTALL_DIR}/gocode/src CACHE PATH "Installation directory for Go code")
-mark_as_advanced (GO_INSTALL_DIR)
-install(DIRECTORY src/qpid.apache.org DESTINATION ${GO_INSTALL_DIR} COMPONENT Go)
diff --git a/proton-c/bindings/go/genwrap.go b/proton-c/bindings/go/genwrap.go
deleted file mode 100644
index 7782b0b..0000000
--- a/proton-c/bindings/go/genwrap.go
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-// Code generator to generate a thin Go wrapper API around the C proton API.
-//
-// Not run automatically, generated sources are checked in. To update the
-// generated sources run `go run genwrap.go` in this directory.
-//
-package main
-
-import (
-	"flag"
-	"fmt"
-	"io"
-	"io/ioutil"
-	"os"
-	"os/exec"
-	"path"
-	"regexp"
-	"strings"
-	"text/template"
-)
-
-var includeProton = "../../include/proton"
-var outpath = "src/qpid.apache.org/proton/wrappers_gen.go"
-
-func main() {
-	flag.Parse()
-	out, err := os.Create(outpath)
-	panicIf(err)
-	defer out.Close()
-
-	apis := []string{"session", "link", "delivery", "disposition", "condition", "terminus", "connection", "transport", "sasl"}
-	fmt.Fprintln(out, copyright)
-	fmt.Fprint(out, `
-package proton
-
-import (
-	"time"
-  "unsafe"
-)
-
-// #include <proton/types.h>
-// #include <proton/error.h>
-// #include <proton/condition.h>
-// #include <proton/event.h>
-// #include <stdlib.h>
-`)
-	for _, api := range apis {
-		fmt.Fprintf(out, "// #include <proton/%s.h>\n", api)
-	}
-	fmt.Fprintln(out, `import "C"`)
-
-	event(out)
-
-	for _, api := range apis {
-		fmt.Fprintf(out, "// Wrappers for declarations in %s.h\n\n", api)
-		header := readHeader(api)
-		enums := findEnums(header)
-		for _, e := range enums {
-			genEnum(out, e.Name, e.Values)
-		}
-		apiWrapFns(api, header, out)
-	}
-	out.Close()
-
-	// Run gofmt.
-	cmd := exec.Command("gofmt", "-w", outpath)
-	cmd.Stdout = os.Stdout
-	cmd.Stderr = os.Stderr
-	err = cmd.Run()
-	if err != nil {
-		fmt.Fprintf(os.Stderr, "gofmt: %s", err)
-		os.Exit(1)
-	}
-}
-
-// Identify acronyms that should be uppercase not Mixedcase
-var acronym = regexp.MustCompile("(?i)SASL|AMQP")
-
-func mixedCase(s string) string {
-	result := ""
-	for _, w := range strings.Split(s, "_") {
-		if acronym.MatchString(w) {
-			w = strings.ToUpper(w)
-		} else {
-			w = strings.ToUpper(w[0:1]) + strings.ToLower(w[1:])
-		}
-		result = result + w
-	}
-	return result
-}
-
-func mixedCaseTrim(s, prefix string) string {
-	return mixedCase(strings.TrimPrefix(s, prefix))
-}
-
-var templateFuncs = template.FuncMap{"mixedCase": mixedCase, "mixedCaseTrim": mixedCaseTrim}
-
-func doTemplate(out io.Writer, data interface{}, tmpl string) {
-	panicIf(template.Must(template.New("").Funcs(templateFuncs).Parse(tmpl)).Execute(out, data))
-}
-
-type enumType struct {
-	Name   string
-	Values []string
-}
-
-// Find enums in a header file return map of enum name to values.
-func findEnums(header string) (enums []enumType) {
-	for _, enum := range enumDefRe.FindAllStringSubmatch(header, -1) {
-		enums = append(enums, enumType{enum[2], enumValRe.FindAllString(enum[1], -1)})
-	}
-	return enums
-}
-
-// Types that are integral, not wrappers. Enums are added automatically.
-var simpleType = map[string]bool{
-	"State": true, // integral typedef
-}
-
-func genEnum(out io.Writer, name string, values []string) {
-	simpleType[mixedCase(name)] = true
-	doTemplate(out, []interface{}{name, values}, `
-{{$enumName := index . 0}}{{$values := index . 1}}
-type {{mixedCase $enumName}} C.pn_{{$enumName}}_t
-const ({{range $values}}
-	{{mixedCaseTrim . "PN_"}} {{mixedCase $enumName}} = C.{{.}} {{end}}
-)
-
-func (e {{mixedCase $enumName}}) String() string {
-	switch e {
-{{range $values}}
-	case C.{{.}}: return "{{mixedCaseTrim . "PN_"}}" {{end}}
-	}
-	return "unknown"
-}
-`)
-}
-
-func panicIf(err error) {
-	if err != nil {
-		panic(err)
-	}
-}
-
-func readHeader(name string) string {
-	file, err := os.Open(path.Join(includeProton, name+".h"))
-	panicIf(err)
-	defer file.Close()
-	s, err := ioutil.ReadAll(file)
-	panicIf(err)
-	return string(s)
-}
-
-var copyright string = `/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-//
-// NOTE: DO NOT EDIT. This file was generated by genwrap.go from the proton header files.
-// Update the generator and re-run if you need to modify this code.
-//
-`
-
-type eventType struct {
-	// C, function and interface names for the event
-	Name, Cname, Fname, Iname string
-}
-
-func newEventType(cName string) eventType {
-	var etype eventType
-	etype.Cname = cName
-	etype.Name = mixedCaseTrim(cName, "PN_")
-	etype.Fname = "On" + etype.Name
-	etype.Iname = etype.Fname + "Interface"
-	return etype
-}
-
-var (
-	enumDefRe   = regexp.MustCompile("typedef enum {([^}]*)} pn_([a-z_]+)_t;")
-	enumValRe   = regexp.MustCompile("PN_[A-Z_]+")
-	skipEventRe = regexp.MustCompile("EVENT_NONE|REACTOR|SELECTABLE|TIMER")
-	skipFnRe    = regexp.MustCompile("attach|context|class|collect|link_recv|link_send|transport_.*logf$|transport_.*trace|transport_head|transport_tail|transport_push|connection_set_password|link_get_drain")
-)
-
-// Generate event wrappers.
-func event(out io.Writer) {
-	event_h := readHeader("event")
-
-	// Event is implented by hand in wrappers.go
-
-	// Get all the pn_event_type_t enum values
-	var etypes []eventType
-	enums := findEnums(event_h)
-	for _, e := range enums[0].Values {
-		if skipEventRe.FindStringSubmatch(e) == nil {
-			etypes = append(etypes, newEventType(e))
-		}
-	}
-
-	doTemplate(out, etypes, `
-type EventType int
-const ({{range .}}
-	 E{{.Name}} EventType = C.{{.Cname}}{{end}}
-)
-`)
-
-	doTemplate(out, etypes, `
-func (e EventType) String() string {
-	switch e {
-{{range .}}
-	case C.{{.Cname}}: return "{{.Name}}"{{end}}
-	}
-	return "Unknown"
-}
-`)
-}
-
-type genType struct {
-	Ctype, Gotype string
-	ToGo          func(value string) string
-	ToC           func(value string) string
-	Assign        func(value string) string
-}
-
-func (g genType) printBody(out io.Writer, value string) {
-	if g.Gotype != "" {
-		fmt.Fprintf(out, "return %s", g.ToGo(value))
-	} else {
-		fmt.Fprintf(out, "%s", value)
-	}
-}
-
-func (g genType) goLiteral(value string) string {
-	return fmt.Sprintf("%s{%s}", g.Gotype, value)
-}
-
-func (g genType) goConvert(value string) string {
-	switch g.Gotype {
-	case "string":
-		return fmt.Sprintf("C.GoString(%s)", value)
-	case "Event":
-		return fmt.Sprintf("makeEvent(%s)", value)
-	default:
-		return fmt.Sprintf("%s(%s)", g.Gotype, value)
-	}
-}
-
-func mapType(ctype string) (g genType) {
-	g.Ctype = "C." + strings.Trim(ctype, " \n")
-
-	// Special-case mappings for C types, default: is the general wrapper type case.
-	switch g.Ctype {
-	case "C.void":
-		g.Gotype = ""
-	case "C.size_t":
-		g.Gotype = "uint"
-	case "C.int":
-		g.Gotype = "int"
-	case "C.void *":
-		g.Gotype = "unsafe.Pointer"
-		g.Ctype = "unsafe.Pointer"
-	case "C.bool":
-		g.Gotype = "bool"
-	case "C.ssize_t":
-		g.Gotype = "int"
-	case "C.uint64_t":
-		g.Gotype = "uint64"
-	case "C.uint32_t":
-		g.Gotype = "uint16"
-	case "C.uint16_t":
-		g.Gotype = "uint32"
-	case "C.const char *":
-		fallthrough
-	case "C.char *":
-		g.Gotype = "string"
-		g.Ctype = "C.CString"
-		g.ToC = func(v string) string { return fmt.Sprintf("%sC", v) }
-		g.Assign = func(v string) string {
-			return fmt.Sprintf("%sC := C.CString(%s)\n defer C.free(unsafe.Pointer(%sC))\n", v, v, v)
-		}
-	case "C.pn_seconds_t":
-		g.Gotype = "time.Duration"
-		g.ToGo = func(v string) string { return fmt.Sprintf("(time.Duration(%s) * time.Second)", v) }
-	case "C.pn_millis_t":
-		g.Gotype = "time.Duration"
-		g.ToGo = func(v string) string { return fmt.Sprintf("(time.Duration(%s) * time.Millisecond)", v) }
-		g.ToC = func(v string) string { return fmt.Sprintf("C.pn_millis_t(%s/time.Millisecond)", v) }
-	case "C.pn_timestamp_t":
-		g.Gotype = "time.Time"
-		g.ToC = func(v string) string { return fmt.Sprintf("pnTime(%s)", v) }
-		g.ToGo = func(v string) string { return fmt.Sprintf("goTime(%s)", v) }
-	case "C.pn_error_t *":
-		g.Gotype = "error"
-		g.ToGo = func(v string) string { return fmt.Sprintf("PnError(%s)", v) }
-	default:
-		pnId := regexp.MustCompile(" *pn_([a-z_]+)_t *\\*? *")
-		match := pnId.FindStringSubmatch(g.Ctype)
-		if match == nil {
-			panic(fmt.Errorf("unknown C type %#v", g.Ctype))
-		}
-		g.Gotype = mixedCase(match[1])
-		if !simpleType[g.Gotype] {
-			g.ToGo = g.goLiteral
-			g.ToC = func(v string) string { return v + ".pn" }
-		}
-	}
-	if g.ToGo == nil {
-		g.ToGo = g.goConvert // Use conversion by default.
-	}
-	if g.ToC == nil {
-		g.ToC = func(v string) string { return fmt.Sprintf("%s(%s)", g.Ctype, v) }
-	}
-	return
-}
-
-type genArg struct {
-	Name string
-	genType
-}
-
-var typeNameRe = regexp.MustCompile("^(.*( |\\*))([^ *]+)$")
-
-func splitArgs(argstr string) []genArg {
-	argstr = strings.Trim(argstr, " \n")
-	if argstr == "" {
-		return []genArg{}
-	}
-	args := make([]genArg, 0)
-	for _, item := range strings.Split(argstr, ",") {
-		item = strings.Trim(item, " \n")
-		typeName := typeNameRe.FindStringSubmatch(item)
-		if typeName == nil {
-			panic(fmt.Errorf("Can't split argument type/name %#v", item))
-		}
-		cType := strings.Trim(typeName[1], " \n")
-		name := strings.Trim(typeName[3], " \n")
-		if name == "type" {
-			name = "type_"
-		}
-		args = append(args, genArg{name, mapType(cType)})
-	}
-	return args
-}
-
-func goArgs(args []genArg) string {
-	l := ""
-	for i, arg := range args {
-		if i != 0 {
-			l += ", "
-		}
-		l += arg.Name + " " + arg.Gotype
-	}
-	return l
-}
-
-func cArgs(args []genArg) string {
-	l := ""
-	for _, arg := range args {
-		l += fmt.Sprintf(", %s", arg.ToC(arg.Name))
-	}
-	return l
-}
-
-func cAssigns(args []genArg) string {
-	l := "\n"
-	for _, arg := range args {
-		if arg.Assign != nil {
-			l += fmt.Sprintf("%s\n", arg.Assign(arg.Name))
-		}
-	}
-	return l
-}
-
-// Return the go name of the function or "" to skip the function.
-func goFnName(api, fname string) string {
-	// Skip class, context and attachment functions.
-	if skipFnRe.FindStringSubmatch(api+"_"+fname) != nil {
-		return ""
-	}
-	return mixedCaseTrim(fname, "get_")
-}
-
-func apiWrapFns(api, header string, out io.Writer) {
-	fmt.Fprintf(out, "type %s struct{pn *C.pn_%s_t}\n", mixedCase(api), api)
-	fmt.Fprintf(out, "func (%c %s) IsNil() bool { return %c.pn == nil }\n", api[0], mixedCase(api), api[0])
-	fmt.Fprintf(out, "func (%c %s) CPtr() unsafe.Pointer { return unsafe.Pointer(%c.pn) }\n", api[0], mixedCase(api), api[0])
-	fn := regexp.MustCompile(fmt.Sprintf(`PN_EXTERN ([a-z0-9_ ]+ *\*?) *pn_%s_([a-z_]+)\(pn_%s_t *\*[a-z_]+ *,? *([^)]*)\)`, api, api))
-	for _, m := range fn.FindAllStringSubmatch(header, -1) {
-		rtype, fname, argstr := mapType(m[1]), m[2], m[3]
-		gname := goFnName(api, fname)
-		if gname == "" { // Skip
-			continue
-		}
-		args := splitArgs(argstr)
-		fmt.Fprintf(out, "func (%c %s) %s", api[0], mixedCase(api), gname)
-		fmt.Fprintf(out, "(%s) %s { ", goArgs(args), rtype.Gotype)
-		fmt.Fprint(out, cAssigns(args))
-		rtype.printBody(out, fmt.Sprintf("C.pn_%s_%s(%c.pn%s)", api, fname, api[0], cArgs(args)))
-		fmt.Fprintf(out, "}\n")
-	}
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/README.md b/proton-c/bindings/go/src/qpid.apache.org/README.md
deleted file mode 100644
index ffd67f8..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/README.md
+++ /dev/null
@@ -1,97 +0,0 @@
-# Qpid Go packages for AMQP
-
-These packages provide [Go](http://golang.org) support for sending and receiving
-AMQP messages in client or server applications. Reference documentation is
-available at: <http://godoc.org/?q=qpid.apache.org>
-
-There are 3 packages:
-
-[qpid.apache.org/amqp](http://godoc.org/qpid.apache.org/amqp) provides functions
-to convert AMQP messages and data types to and from Go data types.  Used by both
-the proton and electron packages to manage AMQP data.
-
-[qpid.apache.org/electron](http://godoc.org/qpid.apache.org/electron) is a
-simple, concurrent-safe API for sending and receiving messages. It can be used
-with goroutines and channels to build concurrent AMQP clients and servers.
-
-[qpid.apache.org/proton](http://godoc.org/qpid.apache.org/proton) is an
-event-driven, concurrent-unsafe package that closely follows the proton C
-API. Most Go programmers will find the
-[electron](http://godoc.org/qpid.apache.org/electron) package easier to use.
-
-See the [examples](https://github.com/apache/qpid-proton/blob/master/examples/go/README.md)
-to help you get started.
-
-Feedback is encouraged at:
-
-- Email <proton@qpid.apache.org>
-- Create issues <https://issues.apache.org/jira/browse/PROTON>, attach patches to an issue.
-
-### Why two APIs?
-
-The `proton` API is a direct mapping of the proton C library into Go. It is
-usable but not very natural for a Go programmer because it takes an
-*event-driven* approach and has no built-in support for concurrent
-use. `electron` uses `proton` internally but provides a more Go-like API that is
-safe to use from multiple concurrent goroutines.
-
-Go encourages programs to be structured as concurrent *goroutines* that
-communicate via *channels*. Go literature distinguishes between:
-
-- *concurrency*: "keeping track of things that could be done in parallel"
-- *parallelism*: "actually doing things in parallel on multiple CPUs or cores"
-
-A Go program expresses concurrency by starting goroutines for potentially
-concurrent tasks. The Go runtime schedules the activity of goroutines onto a
-small number (possibly one) of actual parallel executions.
-
-Even with no hardware parallelism, goroutine concurrency lets the Go runtime
-order unpredictable events like file descriptors being readable/writable,
-channels having data, timers firing etc. Go automatically takes care of
-switching out goroutines that block or sleep so it is normal to write code in
-terms of blocking calls.
-
-By contrast, event-driven programming is based on polling mechanisms like
-`select`, `poll` or `epoll`. These also dispatch unpredictably ordered events to
-a single thread or a small thread pool. However this requires a different style
-of programming: "event-driven" or "reactive" programming. Go developers call it
-"inside-out" programming.  In an event-driven program blocking is a big problem
-as it consumes a scarce thread of execution, so actions that take time to
-complete have to be re-structured in terms of multiple events.
-
-The promise of Go is that you can express your program in concurrent, sequential
-terms and the Go runtime will turn it inside-out for you. You can start
-goroutines for all concurrent activities. They can loop forever or block for as
-long as they need waiting for timers, IO or any unpredictable event. Go will
-interleave and schedule them efficiently onto the available parallel hardware.
-
-For example: in the `electron` API, you can send a message and wait for it to be
-acknowledged in a single function. All the information about the message, why
-you sent it, and what to do when it is acknowledged can be held in local
-variables, all the code is in a simple sequence. Other goroutines in your
-program can be sending and receiving messages concurrently, they are not
-blocked.
-
-In the `proton` API, an event handler that sends a message must return
-*immediately*, it cannot block the event loop to wait for
-acknowledgement. Acknowledgement is a separate event, so the code for handling
-it is in a different event handler. Context information about the message has to
-be stored in some non-local variable that both functions can find. This makes
-the code harder to follow.
-
-The `proton` API is important because it is the foundation for the `electron`
-API, and may be useful for programs that need to be close to the original C
-library for some reason. However the `electron` API hides the event-driven
-details behind simple, sequential, concurrent-safe methods that can be called
-from arbitrary goroutines. Under the covers, data is passed through channels to
-dedicated `proton` goroutines so user goroutines can work concurrently with the
-proton event-loop.
-
-## New to Go?
-
-If you are new to Go then these are a good place to start:
-
-- [A Tour of Go](http://tour.golang.org)
-- [Effective Go](http://golang.org/doc/effective_go.html)
-
-Then look at the tools and docs at <http://golang.org> as you need them.
diff --git a/proton-c/bindings/go/src/qpid.apache.org/amqp/doc.go b/proton-c/bindings/go/src/qpid.apache.org/amqp/doc.go
deleted file mode 100644
index 97051a5..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/amqp/doc.go
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-/*
-Package amqp encodes and decodes AMQP 1.0 messages and data types as Go types.
-
-It follows the standard 'encoding' libraries pattern. The mapping between AMQP
-and Go types is described in the documentation of the Marshal and Unmarshal
-functions.
-
-Package 'electron' is a full AMQP 1.0 client/server toolkit using this package.
-
-AMQP 1.0 is an open standard for inter-operable message exchange, see <http://www.amqp.org/>
-*/
-package amqp
-
-// #cgo LDFLAGS: -lqpid-proton
-import "C"
-
-// This file is just for the package comment.
diff --git a/proton-c/bindings/go/src/qpid.apache.org/amqp/error.go b/proton-c/bindings/go/src/qpid.apache.org/amqp/error.go
deleted file mode 100644
index 3a178b2..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/amqp/error.go
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package amqp
-
-// #include <proton/error.h>
-import "C"
-
-import (
-	"fmt"
-	"reflect"
-)
-
-// Error is an AMQP error condition. It has a name and a description.
-// It implements the Go error interface so can be returned as an error value.
-//
-// You can pass amqp.Error to methods that send an error to a remote endpoint,
-// this gives you full control over what the remote endpoint will see.
-//
-// You can also pass any Go error to such functions, the remote peer
-// will see the equivalent of MakeError(error)
-//
-type Error struct{ Name, Description string }
-
-// Error implements the Go error interface for AMQP error errors.
-func (c Error) Error() string { return fmt.Sprintf("%s: %s", c.Name, c.Description) }
-
-// Errorf makes a Error with name and formatted description as per fmt.Sprintf
-func Errorf(name, format string, arg ...interface{}) Error {
-	return Error{name, fmt.Sprintf(format, arg...)}
-}
-
-// MakeError makes an AMQP error from a go error using the Go error type as the name
-// and the err.Error() string as the description.
-func MakeError(err error) Error {
-	return Error{reflect.TypeOf(err).Name(), err.Error()}
-}
-
-var (
-	InternalError         = "amqp:internal-error"
-	NotFound              = "amqp:not-found"
-	UnauthorizedAccess    = "amqp:unauthorized-access"
-	DecodeError           = "amqp:decode-error"
-	ResourceLimitExceeded = "amqp:resource-limit-exceeded"
-	NotAllowed            = "amqp:not-allowed"
-	InvalidField          = "amqp:invalid-field"
-	NotImplemented        = "amqp:not-implemented"
-	ResourceLocked        = "amqp:resource-locked"
-	PreconditionFailed    = "amqp:precondition-failed"
-	ResourceDeleted       = "amqp:resource-deleted"
-	IllegalState          = "amqp:illegal-state"
-	FrameSizeTooSmall     = "amqp:frame-size-too-small"
-)
-
-type PnErrorCode int
-
-func (e PnErrorCode) String() string {
-	switch e {
-	case C.PN_EOS:
-		return "end-of-data"
-	case C.PN_ERR:
-		return "error"
-	case C.PN_OVERFLOW:
-		return "overflow"
-	case C.PN_UNDERFLOW:
-		return "underflow"
-	case C.PN_STATE_ERR:
-		return "bad-state"
-	case C.PN_ARG_ERR:
-		return "invalid-argument"
-	case C.PN_TIMEOUT:
-		return "timeout"
-	case C.PN_INTR:
-		return "interrupted"
-	case C.PN_INPROGRESS:
-		return "in-progress"
-	default:
-		return fmt.Sprintf("unknown-error(%d)", e)
-	}
-}
-
-func PnError(e *C.pn_error_t) error {
-	if e == nil || C.pn_error_code(e) == 0 {
-		return nil
-	}
-	return fmt.Errorf("%s: %s", PnErrorCode(C.pn_error_code(e)), C.GoString(C.pn_error_text(e)))
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/amqp/interop_test.go b/proton-c/bindings/go/src/qpid.apache.org/amqp/interop_test.go
deleted file mode 100644
index b3e27bc..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/amqp/interop_test.go
+++ /dev/null
@@ -1,385 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-// Test that conversion of Go type to/from AMQP is compatible with other
-// bindings.
-//
-package amqp
-
-import (
-	"bytes"
-	"fmt"
-	"io"
-	"io/ioutil"
-	"os"
-	"reflect"
-	"strings"
-	"testing"
-)
-
-func checkEqual(want interface{}, got interface{}) error {
-	if !reflect.DeepEqual(want, got) {
-		return fmt.Errorf("%#v != %#v", want, got)
-	}
-	return nil
-}
-
-func getReader(t *testing.T, name string) (r io.Reader) {
-	dir := os.Getenv("PN_INTEROP_DIR")
-	if dir == "" {
-		t.Skip("no PN_INTEROP_DIR in environment")
-	}
-	r, err := os.Open(dir + "/" + name + ".amqp")
-	if err != nil {
-		t.Fatalf("can't open %#v: %v", name, err)
-	}
-	return
-}
-
-func remaining(d *Decoder) string {
-	remainder, _ := ioutil.ReadAll(io.MultiReader(d.Buffered(), d.reader))
-	return string(remainder)
-}
-
-// checkDecode: want is the expected value, gotPtr is a pointer to a
-// instance of the same type for Decode.
-func checkDecode(d *Decoder, want interface{}, gotPtr interface{}, t *testing.T) {
-
-	if err := d.Decode(gotPtr); err != nil {
-		t.Error("Decode failed", err)
-		return
-	}
-	got := reflect.ValueOf(gotPtr).Elem().Interface()
-	if err := checkEqual(want, got); err != nil {
-		t.Error("Decode bad value:", err)
-		return
-	}
-
-	// Try round trip encoding
-	bytes, err := Marshal(want, nil)
-	if err != nil {
-		t.Error("Marshal failed", err)
-		return
-	}
-	n, err := Unmarshal(bytes, gotPtr)
-	if err != nil {
-		t.Error("Unmarshal failed", err)
-		return
-	}
-	if err := checkEqual(n, len(bytes)); err != nil {
-		t.Error("Bad unmarshal length", err)
-		return
-	}
-	got = reflect.ValueOf(gotPtr).Elem().Interface()
-	if err = checkEqual(want, got); err != nil {
-		t.Error("Bad unmarshal value", err)
-		return
-	}
-}
-
-func TestUnmarshal(t *testing.T) {
-	bytes, err := ioutil.ReadAll(getReader(t, "strings"))
-	if err != nil {
-		t.Error(err)
-	}
-	for _, want := range []string{"abc\000defg", "abcdefg", "abcdefg", "", "", ""} {
-		var got string
-		n, err := Unmarshal(bytes, &got)
-		if err != nil {
-			t.Error(err)
-		}
-		if want != got {
-			t.Errorf("%#v != %#v", want, got)
-		}
-		bytes = bytes[n:]
-	}
-}
-
-func TestPrimitivesExact(t *testing.T) {
-	d := NewDecoder(getReader(t, "primitives"))
-	// Decoding into exact types
-	var b bool
-	checkDecode(d, true, &b, t)
-	checkDecode(d, false, &b, t)
-	var u8 uint8
-	checkDecode(d, uint8(42), &u8, t)
-	var u16 uint16
-	checkDecode(d, uint16(42), &u16, t)
-	var i16 int16
-	checkDecode(d, int16(-42), &i16, t)
-	var u32 uint32
-	checkDecode(d, uint32(12345), &u32, t)
-	var i32 int32
-	checkDecode(d, int32(-12345), &i32, t)
-	var u64 uint64
-	checkDecode(d, uint64(12345), &u64, t)
-	var i64 int64
-	checkDecode(d, int64(-12345), &i64, t)
-	var f32 float32
-	checkDecode(d, float32(0.125), &f32, t)
-	var f64 float64
-	checkDecode(d, float64(0.125), &f64, t)
-}
-
-func TestPrimitivesCompatible(t *testing.T) {
-	d := NewDecoder(getReader(t, "primitives"))
-	// Decoding into compatible types
-	var b bool
-	var i int
-	var u uint
-	var f float64
-	checkDecode(d, true, &b, t)
-	checkDecode(d, false, &b, t)
-	checkDecode(d, uint(42), &u, t)
-	checkDecode(d, uint(42), &u, t)
-	checkDecode(d, -42, &i, t)
-	checkDecode(d, uint(12345), &u, t)
-	checkDecode(d, -12345, &i, t)
-	checkDecode(d, uint(12345), &u, t)
-	checkDecode(d, -12345, &i, t)
-	checkDecode(d, 0.125, &f, t)
-	checkDecode(d, 0.125, &f, t)
-}
-
-// checkDecodeValue: want is the expected value, decode into a reflect.Value
-func checkDecodeInterface(d *Decoder, want interface{}, t *testing.T) {
-
-	var got, got2 interface{}
-	if err := d.Decode(&got); err != nil {
-		t.Error("Decode failed", err)
-		return
-	}
-	if err := checkEqual(want, got); err != nil {
-		t.Error(err)
-		return
-	}
-	// Try round trip encoding
-	bytes, err := Marshal(got, nil)
-	if err != nil {
-		t.Error(err)
-		return
-	}
-	n, err := Unmarshal(bytes, &got2)
-	if err != nil {
-		t.Error(err)
-		return
-	}
-	if err := checkEqual(n, len(bytes)); err != nil {
-		t.Error(err)
-		return
-	}
-	if err := checkEqual(want, got2); err != nil {
-		t.Error(err)
-		return
-	}
-}
-
-func TestPrimitivesInterface(t *testing.T) {
-	d := NewDecoder(getReader(t, "primitives"))
-	checkDecodeInterface(d, true, t)
-	checkDecodeInterface(d, false, t)
-	checkDecodeInterface(d, uint8(42), t)
-	checkDecodeInterface(d, uint16(42), t)
-	checkDecodeInterface(d, int16(-42), t)
-	checkDecodeInterface(d, uint32(12345), t)
-	checkDecodeInterface(d, int32(-12345), t)
-	checkDecodeInterface(d, uint64(12345), t)
-	checkDecodeInterface(d, int64(-12345), t)
-	checkDecodeInterface(d, float32(0.125), t)
-	checkDecodeInterface(d, float64(0.125), t)
-}
-
-func TestStrings(t *testing.T) {
-	d := NewDecoder(getReader(t, "strings"))
-	// Test decoding as plain Go strings
-	for _, want := range []string{"abc\000defg", "abcdefg", "abcdefg", "", "", ""} {
-		var got string
-		checkDecode(d, want, &got, t)
-	}
-	remains := remaining(d)
-	if remains != "" {
-		t.Errorf("leftover: %s", remains)
-	}
-
-	// Test decoding as specific string types
-	d = NewDecoder(getReader(t, "strings"))
-	var bytes []byte
-	var str, sym string
-	checkDecode(d, []byte("abc\000defg"), &bytes, t)
-	checkDecode(d, "abcdefg", &str, t)
-	checkDecode(d, "abcdefg", &sym, t)
-	checkDecode(d, make([]byte, 0), &bytes, t)
-	checkDecode(d, "", &str, t)
-	checkDecode(d, "", &sym, t)
-	remains = remaining(d)
-	if remains != "" {
-		t.Fatalf("leftover: %s", remains)
-	}
-
-	// Test some error handling
-	d = NewDecoder(getReader(t, "strings"))
-	var s string
-	err := d.Decode(s)
-	if err == nil {
-		t.Fatal("Expected error")
-	}
-	if !strings.Contains(err.Error(), "not a pointer") {
-		t.Error(err)
-	}
-	var i int
-	err = d.Decode(&i)
-	if !strings.Contains(err.Error(), "cannot unmarshal") {
-		t.Error(err)
-	}
-	_, err = Unmarshal([]byte{}, nil)
-	if !strings.Contains(err.Error(), "not enough data") {
-		t.Error(err)
-	}
-	_, err = Unmarshal([]byte("foobar"), nil)
-	if !strings.Contains(err.Error(), "invalid-argument") {
-		t.Error(err)
-	}
-}
-
-func TestEncodeDecode(t *testing.T) {
-	type data struct {
-		s  string
-		i  int
-		u8 uint8
-		b  bool
-		f  float32
-		v  interface{}
-	}
-
-	in := data{"foo", 42, 9, true, 1.234, "thing"}
-
-	buf := bytes.Buffer{}
-	e := NewEncoder(&buf)
-	if err := e.Encode(in.s); err != nil {
-		t.Error(err)
-	}
-	if err := e.Encode(in.i); err != nil {
-		t.Error(err)
-	}
-	if err := e.Encode(in.u8); err != nil {
-		t.Error(err)
-	}
-	if err := e.Encode(in.b); err != nil {
-		t.Error(err)
-	}
-	if err := e.Encode(in.f); err != nil {
-		t.Error(err)
-	}
-	if err := e.Encode(in.v); err != nil {
-		t.Error(err)
-	}
-
-	var out data
-	d := NewDecoder(&buf)
-	if err := d.Decode(&out.s); err != nil {
-		t.Error(err)
-	}
-	if err := d.Decode(&out.i); err != nil {
-		t.Error(err)
-	}
-	if err := d.Decode(&out.u8); err != nil {
-		t.Error(err)
-	}
-	if err := d.Decode(&out.b); err != nil {
-		t.Error(err)
-	}
-	if err := d.Decode(&out.f); err != nil {
-		t.Error(err)
-	}
-	if err := d.Decode(&out.v); err != nil {
-		t.Error(err)
-	}
-
-	if err := checkEqual(in, out); err != nil {
-		t.Error(err)
-	}
-}
-
-func TestMap(t *testing.T) {
-	d := NewDecoder(getReader(t, "maps"))
-
-	// Generic map
-	var m Map
-	checkDecode(d, Map{"one": int32(1), "two": int32(2), "three": int32(3)}, &m, t)
-
-	// Interface as map
-	var i interface{}
-	checkDecode(d, Map{int32(1): "one", int32(2): "two", int32(3): "three"}, &i, t)
-
-	d = NewDecoder(getReader(t, "maps"))
-	// Specific typed map
-	var m2 map[string]int
-	checkDecode(d, map[string]int{"one": 1, "two": 2, "three": 3}, &m2, t)
-
-	// Nested map
-	m = Map{int64(1): "one", "two": int32(2), true: Map{uint8(1): true, uint8(2): false}}
-	bytes, err := Marshal(m, nil)
-	if err != nil {
-		t.Fatal(err)
-	}
-	_, err = Unmarshal(bytes, &i)
-	if err != nil {
-		t.Fatal(err)
-	}
-	if err = checkEqual(m, i); err != nil {
-		t.Fatal(err)
-	}
-}
-
-func TestList(t *testing.T) {
-	d := NewDecoder(getReader(t, "lists"))
-	var l List
-	checkDecode(d, List{int32(32), "foo", true}, &l, t)
-	checkDecode(d, List{}, &l, t)
-}
-
-// TODO aconway 2015-09-08: the message.amqp file seems to be incorrectly coded as
-// as an AMQP string *inside* an AMQP binary?? Skip the test for now.
-func TODO_TestMessage(t *testing.T) {
-	bytes, err := ioutil.ReadAll(getReader(t, "message"))
-	if err != nil {
-		t.Fatal(err)
-	}
-
-	m, err := DecodeMessage(bytes)
-	if err != nil {
-		t.Fatal(err)
-	} else {
-		if err := checkEqual(m.Body(), "hello"); err != nil {
-			t.Error(err)
-		}
-	}
-
-	m2 := NewMessageWith("hello")
-	bytes2, err := m2.Encode(nil)
-	if err != nil {
-		t.Error(err)
-	} else {
-		if err = checkEqual(bytes, bytes2); err != nil {
-			t.Error(err)
-		}
-	}
-}
-
-// TODO aconway 2015-03-13: finish the full interop test
diff --git a/proton-c/bindings/go/src/qpid.apache.org/amqp/marshal.go b/proton-c/bindings/go/src/qpid.apache.org/amqp/marshal.go
deleted file mode 100644
index bce7323..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/amqp/marshal.go
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package amqp
-
-// #include <proton/codec.h>
-import "C"
-
-import (
-	"fmt"
-	"io"
-	"reflect"
-	"unsafe"
-)
-
-func dataError(prefix string, data *C.pn_data_t) error {
-	err := PnError(C.pn_data_error(data))
-	if err != nil {
-		err = fmt.Errorf("%s: %s", prefix, err.Error())
-	}
-	return err
-}
-
-/*
-Marshal encodes a Go value as AMQP data in buffer.
-If buffer is nil, or is not large enough, a new buffer  is created.
-
-Returns the buffer used for encoding with len() adjusted to the actual size of data.
-
-Go types are encoded as follows
-
- +-------------------------------------+--------------------------------------------+
- |Go type                              |AMQP type                                   |
- +-------------------------------------+--------------------------------------------+
- |bool                                 |bool                                        |
- +-------------------------------------+--------------------------------------------+
- |int8, int16, int32, int64 (int)      |byte, short, int, long (int or long)        |
- +-------------------------------------+--------------------------------------------+
- |uint8, uint16, uint32, uint64 (uint) |ubyte, ushort, uint, ulong (uint or ulong)  |
- +-------------------------------------+--------------------------------------------+
- |float32, float64                     |float, double.                              |
- +-------------------------------------+--------------------------------------------+
- |string                               |string                                      |
- +-------------------------------------+--------------------------------------------+
- |[]byte, Binary                       |binary                                      |
- +-------------------------------------+--------------------------------------------+
- |Symbol                               |symbol                                      |
- +-------------------------------------+--------------------------------------------+
- |interface{}                          |the contained type                          |
- +-------------------------------------+--------------------------------------------+
- |nil                                  |null                                        |
- +-------------------------------------+--------------------------------------------+
- |map[K]T                              |map with K and T converted as above         |
- +-------------------------------------+--------------------------------------------+
- |Map                                  |map, may have mixed types for keys, values  |
- +-------------------------------------+--------------------------------------------+
- |[]T                                  |list with T converted as above              |
- +-------------------------------------+--------------------------------------------+
- |List                                 |list, may have mixed types  values          |
- +-------------------------------------+--------------------------------------------+
-
-The following Go types cannot be marshaled: uintptr, function, interface, channel
-
-TODO
-
-Go types: array, slice, struct, complex64/128.
-
-AMQP types: decimal32/64/128, char, timestamp, uuid, array, multi-section message bodies.
-
-Described types.
-
-*/
-func Marshal(v interface{}, buffer []byte) (outbuf []byte, err error) {
-	defer doRecover(&err)
-	data := C.pn_data(0)
-	defer C.pn_data_free(data)
-	marshal(v, data)
-	encode := func(buf []byte) ([]byte, error) {
-		n := int(C.pn_data_encode(data, cPtr(buf), cLen(buf)))
-		switch {
-		case n == int(C.PN_OVERFLOW):
-			return buf, overflow
-		case n < 0:
-			return buf, dataError("marshal error", data)
-		default:
-			return buf[:n], nil
-		}
-	}
-	return encodeGrow(buffer, encode)
-}
-
-const minEncode = 256
-
-// overflow is returned when an encoding function can't fit data in the buffer.
-var overflow = fmt.Errorf("buffer too small")
-
-// encodeFn encodes into buffer[0:len(buffer)].
-// Returns buffer with length adjusted for data encoded.
-// If buffer too small, returns overflow as error.
-type encodeFn func(buffer []byte) ([]byte, error)
-
-// encodeGrow calls encode() into buffer, if it returns overflow grows the buffer.
-// Returns the final buffer.
-func encodeGrow(buffer []byte, encode encodeFn) ([]byte, error) {
-	if buffer == nil || len(buffer) == 0 {
-		buffer = make([]byte, minEncode)
-	}
-	var err error
-	for buffer, err = encode(buffer); err == overflow; buffer, err = encode(buffer) {
-		buffer = make([]byte, 2*len(buffer))
-	}
-	return buffer, err
-}
-
-func marshal(v interface{}, data *C.pn_data_t) {
-	switch v := v.(type) {
-	case nil:
-		C.pn_data_put_null(data)
-	case bool:
-		C.pn_data_put_bool(data, C.bool(v))
-	case int8:
-		C.pn_data_put_byte(data, C.int8_t(v))
-	case int16:
-		C.pn_data_put_short(data, C.int16_t(v))
-	case int32:
-		C.pn_data_put_int(data, C.int32_t(v))
-	case int64:
-		C.pn_data_put_long(data, C.int64_t(v))
-	case int:
-		if unsafe.Sizeof(0) == 8 {
-			C.pn_data_put_long(data, C.int64_t(v))
-		} else {
-			C.pn_data_put_int(data, C.int32_t(v))
-		}
-	case uint8:
-		C.pn_data_put_ubyte(data, C.uint8_t(v))
-	case uint16:
-		C.pn_data_put_ushort(data, C.uint16_t(v))
-	case uint32:
-		C.pn_data_put_uint(data, C.uint32_t(v))
-	case uint64:
-		C.pn_data_put_ulong(data, C.uint64_t(v))
-	case uint:
-		if unsafe.Sizeof(0) == 8 {
-			C.pn_data_put_ulong(data, C.uint64_t(v))
-		} else {
-			C.pn_data_put_uint(data, C.uint32_t(v))
-		}
-	case float32:
-		C.pn_data_put_float(data, C.float(v))
-	case float64:
-		C.pn_data_put_double(data, C.double(v))
-	case string:
-		C.pn_data_put_string(data, pnBytes([]byte(v)))
-	case []byte:
-		C.pn_data_put_binary(data, pnBytes(v))
-	case Binary:
-		C.pn_data_put_binary(data, pnBytes([]byte(v)))
-	case Symbol:
-		C.pn_data_put_symbol(data, pnBytes([]byte(v)))
-	case Map: // Special map type
-		C.pn_data_put_map(data)
-		C.pn_data_enter(data)
-		for key, val := range v {
-			marshal(key, data)
-			marshal(val, data)
-		}
-		C.pn_data_exit(data)
-	default:
-		switch reflect.TypeOf(v).Kind() {
-		case reflect.Map:
-			putMap(data, v)
-		case reflect.Slice:
-			putList(data, v)
-		default:
-			panic(fmt.Errorf("cannot marshal %s to AMQP", reflect.TypeOf(v)))
-		}
-	}
-	err := dataError("marshal", data)
-	if err != nil {
-		panic(err)
-	}
-	return
-}
-
-func clearMarshal(v interface{}, data *C.pn_data_t) {
-	C.pn_data_clear(data)
-	marshal(v, data)
-}
-
-func putMap(data *C.pn_data_t, v interface{}) {
-	mapValue := reflect.ValueOf(v)
-	C.pn_data_put_map(data)
-	C.pn_data_enter(data)
-	for _, key := range mapValue.MapKeys() {
-		marshal(key.Interface(), data)
-		marshal(mapValue.MapIndex(key).Interface(), data)
-	}
-	C.pn_data_exit(data)
-}
-
-func putList(data *C.pn_data_t, v interface{}) {
-	listValue := reflect.ValueOf(v)
-	C.pn_data_put_list(data)
-	C.pn_data_enter(data)
-	for i := 0; i < listValue.Len(); i++ {
-		marshal(listValue.Index(i).Interface(), data)
-	}
-	C.pn_data_exit(data)
-}
-
-// Encoder encodes AMQP values to an io.Writer
-type Encoder struct {
-	writer io.Writer
-	buffer []byte
-}
-
-// New encoder returns a new encoder that writes to w.
-func NewEncoder(w io.Writer) *Encoder {
-	return &Encoder{w, make([]byte, minEncode)}
-}
-
-func (e *Encoder) Encode(v interface{}) (err error) {
-	e.buffer, err = Marshal(v, e.buffer)
-	if err == nil {
-		_, err = e.writer.Write(e.buffer)
-	}
-	return err
-}
-
-func replace(data *C.pn_data_t, v interface{}) {
-	C.pn_data_clear(data)
-	marshal(v, data)
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/amqp/message.go b/proton-c/bindings/go/src/qpid.apache.org/amqp/message.go
deleted file mode 100644
index 753682e..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/amqp/message.go
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package amqp
-
-// #include <proton/codec.h>
-// #include <proton/types.h>
-// #include <proton/message.h>
-// #include <stdlib.h>
-//
-// /* Helper for setting message string fields */
-// typedef int (*set_fn)(pn_message_t*, const char*);
-// int msg_set_str(pn_message_t* m, char* s, set_fn set) {
-//     int result = set(m, s);
-//     free(s);
-//     return result;
-// }
-//
-import "C"
-
-import (
-	"fmt"
-	"runtime"
-	"time"
-	"unsafe"
-)
-
-// Message is the interface to an AMQP message.
-type Message interface {
-	// Durable indicates that any parties taking responsibility
-	// for the message must durably store the content.
-	Durable() bool
-	SetDurable(bool)
-
-	// Priority impacts ordering guarantees. Within a
-	// given ordered context, higher priority messages may jump ahead of
-	// lower priority messages.
-	Priority() uint8
-	SetPriority(uint8)
-
-	// TTL or Time To Live, a message it may be dropped after this duration
-	TTL() time.Duration
-	SetTTL(time.Duration)
-
-	// FirstAcquirer indicates
-	// that the recipient of the message is the first recipient to acquire
-	// the message, i.e. there have been no failed delivery attempts to
-	// other acquirers. Note that this does not mean the message has not
-	// been delivered to, but not acquired, by other recipients.
-	FirstAcquirer() bool
-	SetFirstAcquirer(bool)
-
-	// DeliveryCount tracks how many attempts have been made to
-	// delivery a message.
-	DeliveryCount() uint32
-	SetDeliveryCount(uint32)
-
-	// MessageId provides a unique identifier for a message.
-	// it can be an a string, an unsigned long, a uuid or a
-	// binary value.
-	MessageId() interface{}
-	SetMessageId(interface{})
-
-	UserId() string
-	SetUserId(string)
-
-	Address() string
-	SetAddress(string)
-
-	Subject() string
-	SetSubject(string)
-
-	ReplyTo() string
-	SetReplyTo(string)
-
-	// CorrelationId is set on correlated request and response messages. It can be
-	// an a string, an unsigned long, a uuid or a binary value.
-	CorrelationId() interface{}
-	SetCorrelationId(interface{})
-
-	ContentType() string
-	SetContentType(string)
-
-	ContentEncoding() string
-	SetContentEncoding(string)
-
-	// ExpiryTime indicates an absoulte time when the message may be dropped.
-	// A Zero time (i.e. t.isZero() == true) indicates a message never expires.
-	ExpiryTime() time.Time
-	SetExpiryTime(time.Time)
-
-	CreationTime() time.Time
-	SetCreationTime(time.Time)
-
-	GroupId() string
-	SetGroupId(string)
-
-	GroupSequence() int32
-	SetGroupSequence(int32)
-
-	ReplyToGroupId() string
-	SetReplyToGroupId(string)
-
-	// Instructions - AMQP delivery instructions.
-	Instructions() map[string]interface{}
-	SetInstructions(v map[string]interface{})
-
-	// Annotations - AMQP annotations.
-	Annotations() map[string]interface{}
-	SetAnnotations(v map[string]interface{})
-
-	// Properties - Application properties.
-	Properties() map[string]interface{}
-	SetProperties(v map[string]interface{})
-
-	// Inferred indicates how the message content
-	// is encoded into AMQP sections. If inferred is true then binary and
-	// list values in the body of the message will be encoded as AMQP DATA
-	// and AMQP SEQUENCE sections, respectively. If inferred is false,
-	// then all values in the body of the message will be encoded as AMQP
-	// VALUE sections regardless of their type.
-	Inferred() bool
-	SetInferred(bool)
-
-	// Marshal a Go value into the message body. See amqp.Marshal() for details.
-	Marshal(interface{})
-
-	// Unmarshal the message body into the value pointed to by v. See amqp.Unmarshal() for details.
-	Unmarshal(interface{})
-
-	// Body value resulting from the default unmarshalling of message body as interface{}
-	Body() interface{}
-
-	// Encode encodes the message as AMQP data. If buffer is non-nil and is large enough
-	// the message is encoded into it, otherwise a new buffer is created.
-	// Returns the buffer containing the message.
-	Encode(buffer []byte) ([]byte, error)
-
-	// Decode data into this message. Overwrites an existing message content.
-	Decode(buffer []byte) error
-
-	// Clear the message contents.
-	Clear()
-
-	// Copy the contents of another message to this one.
-	Copy(m Message) error
-}
-
-type message struct{ pn *C.pn_message_t }
-
-func freeMessage(m *message) {
-	C.pn_message_free(m.pn)
-	m.pn = nil
-}
-
-// NewMessage creates a new message instance.
-func NewMessage() Message {
-	m := &message{C.pn_message()}
-	runtime.SetFinalizer(m, freeMessage)
-	return m
-}
-
-// NewMessageWith creates a message with value as the body. Equivalent to
-//     m := NewMessage(); m.Marshal(body)
-func NewMessageWith(value interface{}) Message {
-	m := NewMessage()
-	m.Marshal(value)
-	return m
-}
-
-func (m *message) Clear() { C.pn_message_clear(m.pn) }
-
-func (m *message) Copy(x Message) error {
-	if data, err := x.Encode(nil); err == nil {
-		return m.Decode(data)
-	} else {
-		return err
-	}
-}
-
-// ==== message get functions
-
-func rewindGet(data *C.pn_data_t) (v interface{}) {
-	C.pn_data_rewind(data)
-	C.pn_data_next(data)
-	unmarshal(&v, data)
-	return v
-}
-
-func rewindMap(data *C.pn_data_t) (v map[string]interface{}) {
-	C.pn_data_rewind(data)
-	C.pn_data_next(data)
-	unmarshal(&v, data)
-	return v
-}
-
-func (m *message) Inferred() bool  { return bool(C.pn_message_is_inferred(m.pn)) }
-func (m *message) Durable() bool   { return bool(C.pn_message_is_durable(m.pn)) }
-func (m *message) Priority() uint8 { return uint8(C.pn_message_get_priority(m.pn)) }
-func (m *message) TTL() time.Duration {
-	return time.Duration(C.pn_message_get_ttl(m.pn)) * time.Millisecond
-}
-func (m *message) FirstAcquirer() bool        { return bool(C.pn_message_is_first_acquirer(m.pn)) }
-func (m *message) DeliveryCount() uint32      { return uint32(C.pn_message_get_delivery_count(m.pn)) }
-func (m *message) MessageId() interface{}     { return rewindGet(C.pn_message_id(m.pn)) }
-func (m *message) UserId() string             { return goString(C.pn_message_get_user_id(m.pn)) }
-func (m *message) Address() string            { return C.GoString(C.pn_message_get_address(m.pn)) }
-func (m *message) Subject() string            { return C.GoString(C.pn_message_get_subject(m.pn)) }
-func (m *message) ReplyTo() string            { return C.GoString(C.pn_message_get_reply_to(m.pn)) }
-func (m *message) CorrelationId() interface{} { return rewindGet(C.pn_message_correlation_id(m.pn)) }
-func (m *message) ContentType() string        { return C.GoString(C.pn_message_get_content_type(m.pn)) }
-func (m *message) ContentEncoding() string    { return C.GoString(C.pn_message_get_content_encoding(m.pn)) }
-
-func (m *message) ExpiryTime() time.Time {
-	return time.Unix(0, int64(time.Millisecond*time.Duration(C.pn_message_get_expiry_time(m.pn))))
-}
-func (m *message) CreationTime() time.Time {
-	return time.Unix(0, int64(time.Millisecond)*int64(C.pn_message_get_creation_time(m.pn)))
-}
-func (m *message) GroupId() string        { return C.GoString(C.pn_message_get_group_id(m.pn)) }
-func (m *message) GroupSequence() int32   { return int32(C.pn_message_get_group_sequence(m.pn)) }
-func (m *message) ReplyToGroupId() string { return C.GoString(C.pn_message_get_reply_to_group_id(m.pn)) }
-
-func (m *message) Instructions() map[string]interface{} {
-	return rewindMap(C.pn_message_instructions(m.pn))
-}
-func (m *message) Annotations() map[string]interface{} {
-	return rewindMap(C.pn_message_annotations(m.pn))
-}
-func (m *message) Properties() map[string]interface{} {
-	return rewindMap(C.pn_message_properties(m.pn))
-}
-
-// ==== message set methods
-
-func setData(v interface{}, data *C.pn_data_t) {
-	C.pn_data_clear(data)
-	marshal(v, data)
-}
-
-func dataString(data *C.pn_data_t) string {
-	str := C.pn_string(C.CString(""))
-	defer C.pn_free(unsafe.Pointer(str))
-	C.pn_inspect(unsafe.Pointer(data), str)
-	return C.GoString(C.pn_string_get(str))
-}
-
-func (m *message) SetInferred(b bool)  { C.pn_message_set_inferred(m.pn, C.bool(b)) }
-func (m *message) SetDurable(b bool)   { C.pn_message_set_durable(m.pn, C.bool(b)) }
-func (m *message) SetPriority(b uint8) { C.pn_message_set_priority(m.pn, C.uint8_t(b)) }
-func (m *message) SetTTL(d time.Duration) {
-	C.pn_message_set_ttl(m.pn, C.pn_millis_t(d/time.Millisecond))
-}
-func (m *message) SetFirstAcquirer(b bool)     { C.pn_message_set_first_acquirer(m.pn, C.bool(b)) }
-func (m *message) SetDeliveryCount(c uint32)   { C.pn_message_set_delivery_count(m.pn, C.uint32_t(c)) }
-func (m *message) SetMessageId(id interface{}) { setData(id, C.pn_message_id(m.pn)) }
-func (m *message) SetUserId(s string)          { C.pn_message_set_user_id(m.pn, pnBytes(([]byte)(s))) }
-func (m *message) SetAddress(s string) {
-	C.msg_set_str(m.pn, C.CString(s), C.set_fn(C.pn_message_set_address))
-}
-func (m *message) SetSubject(s string) {
-	C.msg_set_str(m.pn, C.CString(s), C.set_fn(C.pn_message_set_subject))
-}
-func (m *message) SetReplyTo(s string) {
-	C.msg_set_str(m.pn, C.CString(s), C.set_fn(C.pn_message_set_reply_to))
-}
-func (m *message) SetCorrelationId(c interface{}) { setData(c, C.pn_message_correlation_id(m.pn)) }
-func (m *message) SetContentType(s string) {
-	C.msg_set_str(m.pn, C.CString(s), C.set_fn(C.pn_message_set_content_type))
-}
-func (m *message) SetContentEncoding(s string) {
-	C.msg_set_str(m.pn, C.CString(s), C.set_fn(C.pn_message_set_content_encoding))
-}
-func (m *message) SetExpiryTime(t time.Time)   { C.pn_message_set_expiry_time(m.pn, pnTime(t)) }
-func (m *message) SetCreationTime(t time.Time) { C.pn_message_set_creation_time(m.pn, pnTime(t)) }
-func (m *message) SetGroupId(s string) {
-	C.msg_set_str(m.pn, C.CString(s), C.set_fn(C.pn_message_set_group_id))
-}
-func (m *message) SetGroupSequence(s int32) {
-	C.pn_message_set_group_sequence(m.pn, C.pn_sequence_t(s))
-}
-func (m *message) SetReplyToGroupId(s string) {
-	C.msg_set_str(m.pn, C.CString(s), C.set_fn(C.pn_message_set_reply_to_group_id))
-}
-
-func (m *message) SetInstructions(v map[string]interface{}) {
-	setData(v, C.pn_message_instructions(m.pn))
-}
-func (m *message) SetAnnotations(v map[string]interface{}) { setData(v, C.pn_message_annotations(m.pn)) }
-func (m *message) SetProperties(v map[string]interface{})  { setData(v, C.pn_message_properties(m.pn)) }
-
-// Marshal/Unmarshal body
-func (m *message) Marshal(v interface{})   { clearMarshal(v, C.pn_message_body(m.pn)) }
-func (m *message) Unmarshal(v interface{}) { rewindUnmarshal(v, C.pn_message_body(m.pn)) }
-func (m *message) Body() (v interface{})   { m.Unmarshal(&v); return }
-
-func (m *message) Decode(data []byte) error {
-	m.Clear()
-	if len(data) == 0 {
-		return fmt.Errorf("empty buffer for decode")
-	}
-	if C.pn_message_decode(m.pn, cPtr(data), cLen(data)) < 0 {
-		return fmt.Errorf("decoding message: %s", PnError(C.pn_message_error(m.pn)))
-	}
-	return nil
-}
-
-func DecodeMessage(data []byte) (m Message, err error) {
-	m = NewMessage()
-	err = m.Decode(data)
-	return
-}
-
-func (m *message) Encode(buffer []byte) ([]byte, error) {
-	encode := func(buf []byte) ([]byte, error) {
-		len := cLen(buf)
-		result := C.pn_message_encode(m.pn, cPtr(buf), &len)
-		switch {
-		case result == C.PN_OVERFLOW:
-			return buf, overflow
-		case result < 0:
-			return buf, fmt.Errorf("cannot encode message: %s", PnErrorCode(result))
-		default:
-			return buf[:len], nil
-		}
-	}
-	return encodeGrow(buffer, encode)
-}
-
-// TODO aconway 2015-09-14: Multi-section messages.
-
-// TODO aconway 2016-09-09: Message.String() use inspect.
diff --git a/proton-c/bindings/go/src/qpid.apache.org/amqp/message_test.go b/proton-c/bindings/go/src/qpid.apache.org/amqp/message_test.go
deleted file mode 100644
index 7a6e5a8..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/amqp/message_test.go
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package amqp
-
-import (
-	"testing"
-	"time"
-)
-
-func roundTrip(m Message) error {
-	buffer, err := m.Encode(nil)
-	if err != nil {
-		return err
-	}
-	m2, err := DecodeMessage(buffer)
-	if err != nil {
-		return err
-	}
-	return checkEqual(m, m2)
-}
-
-func TestDefaultMessage(t *testing.T) {
-	m := NewMessage()
-	// Check defaults
-	for _, data := range [][]interface{}{
-		{m.Inferred(), false},
-		{m.Durable(), false},
-		{m.Priority(), uint8(4)},
-		{m.TTL(), time.Duration(0)},
-		{m.UserId(), ""},
-		{m.Address(), ""},
-		{m.Subject(), ""},
-		{m.ReplyTo(), ""},
-		{m.ContentType(), ""},
-		{m.ContentEncoding(), ""},
-		{m.GroupId(), ""},
-		{m.GroupSequence(), int32(0)},
-		{m.ReplyToGroupId(), ""},
-		{m.MessageId(), nil},
-		{m.CorrelationId(), nil},
-		{m.Instructions(), map[string]interface{}{}},
-		{m.Annotations(), map[string]interface{}{}},
-		{m.Properties(), map[string]interface{}{}},
-		{m.Body(), nil},
-	} {
-		if err := checkEqual(data[0], data[1]); err != nil {
-			t.Error(err)
-		}
-	}
-	if err := roundTrip(m); err != nil {
-		t.Error(err)
-	}
-}
-
-func TestMessageRoundTrip(t *testing.T) {
-	m := NewMessage()
-	m.SetInferred(false)
-	m.SetDurable(true)
-	m.SetPriority(42)
-	m.SetTTL(0)
-	m.SetUserId("user")
-	m.SetAddress("address")
-	m.SetSubject("subject")
-	m.SetReplyTo("replyto")
-	m.SetContentType("content")
-	m.SetContentEncoding("encoding")
-	m.SetGroupId("group")
-	m.SetGroupSequence(42)
-	m.SetReplyToGroupId("replytogroup")
-	m.SetMessageId("id")
-	m.SetCorrelationId("correlation")
-	m.SetInstructions(map[string]interface{}{"instructions": "foo"})
-	m.SetAnnotations(map[string]interface{}{"annotations": "foo"})
-	m.SetProperties(map[string]interface{}{"int": int32(32), "bool": true, "string": "foo"})
-	m.Marshal("hello")
-
-	for _, data := range [][]interface{}{
-		{m.Inferred(), false},
-		{m.Durable(), true},
-		{m.Priority(), uint8(42)},
-		{m.TTL(), time.Duration(0)},
-		{m.UserId(), "user"},
-		{m.Address(), "address"},
-		{m.Subject(), "subject"},
-		{m.ReplyTo(), "replyto"},
-		{m.ContentType(), "content"},
-		{m.ContentEncoding(), "encoding"},
-		{m.GroupId(), "group"},
-		{m.GroupSequence(), int32(42)},
-		{m.ReplyToGroupId(), "replytogroup"},
-		{m.MessageId(), "id"},
-		{m.CorrelationId(), "correlation"},
-		{m.Instructions(), map[string]interface{}{"instructions": "foo"}},
-		{m.Annotations(), map[string]interface{}{"annotations": "foo"}},
-		{m.Properties(), map[string]interface{}{"int": int32(32), "bool": true, "string": "foo"}},
-		{m.Body(), "hello"},
-	} {
-		if err := checkEqual(data[0], data[1]); err != nil {
-			t.Error(err)
-		}
-	}
-	if err := roundTrip(m); err != nil {
-		t.Error(err)
-	}
-}
-
-func TestMessageBodyTypes(t *testing.T) {
-	var s string
-	var body interface{}
-	var i int64
-
-	m := NewMessageWith(int64(42))
-	m.Unmarshal(&body)
-	m.Unmarshal(&i)
-	if err := checkEqual(body.(int64), int64(42)); err != nil {
-		t.Error(err)
-	}
-	if err := checkEqual(i, int64(42)); err != nil {
-		t.Error(err)
-	}
-
-	m = NewMessageWith("hello")
-	m.Unmarshal(&s)
-	m.Unmarshal(&body)
-	if err := checkEqual(s, "hello"); err != nil {
-		t.Error(err)
-	}
-	if err := checkEqual(body.(string), "hello"); err != nil {
-		t.Error(err)
-	}
-	if err := roundTrip(m); err != nil {
-		t.Error(err)
-	}
-
-	m = NewMessageWith(Binary("bin"))
-	m.Unmarshal(&s)
-	m.Unmarshal(&body)
-	if err := checkEqual(body.(Binary), Binary("bin")); err != nil {
-		t.Error(err)
-	}
-	if err := checkEqual(s, "bin"); err != nil {
-		t.Error(err)
-	}
-	if err := roundTrip(m); err != nil {
-		t.Error(err)
-	}
-
-	// TODO aconway 2015-09-08: array etc.
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/amqp/types.go b/proton-c/bindings/go/src/qpid.apache.org/amqp/types.go
deleted file mode 100644
index 2852c23..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/amqp/types.go
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package amqp
-
-// #include <proton/codec.h>
-import "C"
-
-import (
-	"bytes"
-	"fmt"
-	"reflect"
-	"time"
-	"unsafe"
-)
-
-func (t C.pn_type_t) String() string {
-	switch C.pn_type_t(t) {
-	case C.PN_NULL:
-		return "null"
-	case C.PN_BOOL:
-		return "bool"
-	case C.PN_UBYTE:
-		return "ubyte"
-	case C.PN_BYTE:
-		return "byte"
-	case C.PN_USHORT:
-		return "ushort"
-	case C.PN_SHORT:
-		return "short"
-	case C.PN_CHAR:
-		return "char"
-	case C.PN_UINT:
-		return "uint"
-	case C.PN_INT:
-		return "int"
-	case C.PN_ULONG:
-		return "ulong"
-	case C.PN_LONG:
-		return "long"
-	case C.PN_TIMESTAMP:
-		return "timestamp"
-	case C.PN_FLOAT:
-		return "float"
-	case C.PN_DOUBLE:
-		return "double"
-	case C.PN_DECIMAL32:
-		return "decimal32"
-	case C.PN_DECIMAL64:
-		return "decimal64"
-	case C.PN_DECIMAL128:
-		return "decimal128"
-	case C.PN_UUID:
-		return "uuid"
-	case C.PN_BINARY:
-		return "binary"
-	case C.PN_STRING:
-		return "string"
-	case C.PN_SYMBOL:
-		return "symbol"
-	case C.PN_DESCRIBED:
-		return "described"
-	case C.PN_ARRAY:
-		return "array"
-	case C.PN_LIST:
-		return "list"
-	case C.PN_MAP:
-		return "map"
-	default:
-		return "no-data"
-	}
-}
-
-// Go types
-var (
-	bytesType = reflect.TypeOf([]byte{})
-	valueType = reflect.TypeOf(reflect.Value{})
-)
-
-// TODO aconway 2015-04-08: can't handle AMQP maps with key types that are not valid Go map keys.
-
-// Map is a generic map that can have mixed key and value types and so can represent any AMQP map
-type Map map[interface{}]interface{}
-
-// List is a generic list that can hold mixed values and can represent any AMQP list.
-//
-type List []interface{}
-
-// Symbol is a string that is encoded as an AMQP symbol
-type Symbol string
-
-func (s Symbol) GoString() string { return fmt.Sprintf("s\"%s\"", s) }
-
-// Binary is a string that is encoded as an AMQP binary.
-// It is a string rather than a byte[] because byte[] is not hashable and can't be used as
-// a map key, AMQP frequently uses binary types as map keys. It can convert to and from []byte
-type Binary string
-
-func (b Binary) GoString() string { return fmt.Sprintf("b\"%s\"", b) }
-
-// GoString for Map prints values with their types, useful for debugging.
-func (m Map) GoString() string {
-	out := &bytes.Buffer{}
-	fmt.Fprintf(out, "%T{", m)
-	i := len(m)
-	for k, v := range m {
-		fmt.Fprintf(out, "%T(%#v): %T(%#v)", k, k, v, v)
-		i--
-		if i > 0 {
-			fmt.Fprint(out, ", ")
-		}
-	}
-	fmt.Fprint(out, "}")
-	return out.String()
-}
-
-// GoString for List prints values with their types, useful for debugging.
-func (l List) GoString() string {
-	out := &bytes.Buffer{}
-	fmt.Fprintf(out, "%T{", l)
-	for i := 0; i < len(l); i++ {
-		fmt.Fprintf(out, "%T(%#v)", l[i], l[i])
-		if i == len(l)-1 {
-			fmt.Fprint(out, ", ")
-		}
-	}
-	fmt.Fprint(out, "}")
-	return out.String()
-}
-
-// pnTime converts Go time.Time to Proton millisecond Unix time.
-func pnTime(t time.Time) C.pn_timestamp_t {
-	secs := t.Unix()
-	// Note: sub-second accuracy is not guaraunteed if the Unix time in
-	// nanoseconds cannot be represented by an int64 (sometime around year 2260)
-	msecs := (t.UnixNano() % int64(time.Second)) / int64(time.Millisecond)
-	return C.pn_timestamp_t(secs*1000 + msecs)
-}
-
-// goTime converts a pn_timestamp_t to a Go time.Time.
-func goTime(t C.pn_timestamp_t) time.Time {
-	secs := int64(t) / 1000
-	nsecs := (int64(t) % 1000) * int64(time.Millisecond)
-	return time.Unix(secs, nsecs)
-}
-
-func goBytes(cBytes C.pn_bytes_t) (bytes []byte) {
-	if cBytes.start != nil {
-		bytes = C.GoBytes(unsafe.Pointer(cBytes.start), C.int(cBytes.size))
-	}
-	return
-}
-
-func goString(cBytes C.pn_bytes_t) (str string) {
-	if cBytes.start != nil {
-		str = C.GoStringN(cBytes.start, C.int(cBytes.size))
-	}
-	return
-}
-
-func pnBytes(b []byte) C.pn_bytes_t {
-	if len(b) == 0 {
-		return C.pn_bytes_t{0, nil}
-	} else {
-		return C.pn_bytes_t{C.size_t(len(b)), (*C.char)(unsafe.Pointer(&b[0]))}
-	}
-}
-
-func cPtr(b []byte) *C.char {
-	if len(b) == 0 {
-		return nil
-	}
-	return (*C.char)(unsafe.Pointer(&b[0]))
-}
-
-func cLen(b []byte) C.size_t {
-	return C.size_t(len(b))
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/amqp/unmarshal.go b/proton-c/bindings/go/src/qpid.apache.org/amqp/unmarshal.go
deleted file mode 100644
index 8f380a7..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/amqp/unmarshal.go
+++ /dev/null
@@ -1,557 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-oor more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package amqp
-
-// #include <proton/codec.h>
-import "C"
-
-import (
-	"bytes"
-	"fmt"
-	"io"
-	"reflect"
-	"unsafe"
-)
-
-const minDecode = 1024
-
-// Error returned if AMQP data cannot be unmarshaled as the desired Go type.
-type UnmarshalError struct {
-	// The name of the AMQP type.
-	AMQPType string
-	// The Go type.
-	GoType reflect.Type
-}
-
-func newUnmarshalError(pnType C.pn_type_t, v interface{}) *UnmarshalError {
-	return &UnmarshalError{C.pn_type_t(pnType).String(), reflect.TypeOf(v)}
-}
-
-func (e UnmarshalError) Error() string {
-	if e.GoType.Kind() != reflect.Ptr {
-		return fmt.Sprintf("cannot unmarshal to type %s, not a pointer", e.GoType)
-	} else {
-		return fmt.Sprintf("cannot unmarshal AMQP %s to %s", e.AMQPType, e.GoType)
-	}
-}
-
-func doRecover(err *error) {
-	r := recover()
-	switch r := r.(type) {
-	case nil:
-	case *UnmarshalError:
-		*err = r
-	default:
-		panic(r)
-	}
-}
-
-//
-// Decoding from a pn_data_t
-//
-// NOTE: we use panic() to signal a decoding error, simplifies decoding logic.
-// We recover() at the highest possible level - i.e. in the exported Unmarshal or Decode.
-//
-
-// Decoder decodes AMQP values from an io.Reader.
-//
-type Decoder struct {
-	reader io.Reader
-	buffer bytes.Buffer
-}
-
-// NewDecoder returns a new decoder that reads from r.
-//
-// The decoder has it's own buffer and may read more data than required for the
-// AMQP values requested.  Use Buffered to see if there is data left in the
-// buffer.
-//
-func NewDecoder(r io.Reader) *Decoder {
-	return &Decoder{r, bytes.Buffer{}}
-}
-
-// Buffered returns a reader of the data remaining in the Decoder's buffer. The
-// reader is valid until the next call to Decode.
-//
-func (d *Decoder) Buffered() io.Reader {
-	return bytes.NewReader(d.buffer.Bytes())
-}
-
-// Decode reads the next AMQP value from the Reader and stores it in the value pointed to by v.
-//
-// See the documentation for Unmarshal for details about the conversion of AMQP into a Go value.
-//
-func (d *Decoder) Decode(v interface{}) (err error) {
-	defer doRecover(&err)
-	data := C.pn_data(0)
-	defer C.pn_data_free(data)
-	var n int
-	for n == 0 {
-		n, err = decode(data, d.buffer.Bytes())
-		if err != nil {
-			return err
-		}
-		if n == 0 { // n == 0 means not enough data, read more
-			err = d.more()
-		} else {
-			unmarshal(v, data)
-		}
-	}
-	d.buffer.Next(n)
-	return
-}
-
-/*
-Unmarshal decodes AMQP-encoded bytes and stores the result in the value pointed to by v.
-Types are converted as follows:
-
- +---------------------------+----------------------------------------------------------------------+
- |To Go types                |From AMQP types                                                       |
- +===========================+======================================================================+
- |bool                       |bool                                                                  |
- +---------------------------+----------------------------------------------------------------------+
- |int, int8, int16,          |Equivalent or smaller signed integer type: byte, short, int, long.    |
- |int32, int64               |                                                                      |
- +---------------------------+----------------------------------------------------------------------+
- |uint, uint8, uint16,       |Equivalent or smaller unsigned integer type: ubyte, ushort, uint,     |
- |uint32, uint64 types       |ulong                                                                 |
- +---------------------------+----------------------------------------------------------------------+
- |float32, float64           |Equivalent or smaller float or double.                                |
- +---------------------------+----------------------------------------------------------------------+
- |string, []byte             |string, symbol or binary.                                             |
- +---------------------------+----------------------------------------------------------------------+
- |Symbol                     |symbol                                                                |
- +---------------------------+----------------------------------------------------------------------+
- |map[K]T                    |map, provided all keys and values can unmarshal to types K, T         |
- +---------------------------+----------------------------------------------------------------------+
- |Map                        |map, any AMQP map                                                     |
- +---------------------------+----------------------------------------------------------------------+
- |interface{}                |Any AMQP value can be unmarshaled to an interface{} as follows:       |
- |                           +------------------------+---------------------------------------------+
- |                           |AMQP Type               |Go Type in interface{}                       |
- |                           +========================+=============================================+
- |                           |bool                    |bool                                         |
- |                           +------------------------+---------------------------------------------+
- |                           |byte,short,int,long     |int8,int16,int32,int64                       |
- |                           +------------------------+---------------------------------------------+
- |                           |ubyte,ushort,uint,ulong |uint8,uint16,uint32,uint64                   |
- |                           +------------------------+---------------------------------------------+
- |                           |float, double           |float32, float64                             |
- |                           +------------------------+---------------------------------------------+
- |                           |string                  |string                                       |
- |                           +------------------------+---------------------------------------------+
- |                           |symbol                  |Symbol                                       |
- |                           +------------------------+---------------------------------------------+
- |                           |binary                  |Binary                                       |
- |                           +------------------------+---------------------------------------------+
- |                           |nulll                   |nil                                          |
- |                           +------------------------+---------------------------------------------+
- |                           |map                     |Map                                          |
- |                           +------------------------+---------------------------------------------+
- |                           |list                    |List                                         |
- +---------------------------+------------------------+---------------------------------------------+
-
-The following Go types cannot be unmarshaled: uintptr, function, interface, channel.
-
-TODO
-
-Go types: array, struct.
-
-AMQP types: decimal32/64/128, char (round trip), timestamp, uuid, array, multi-section message bodies.
-
-AMQP maps with mixed/unhashable key types need an alternate representation.
-
-Described types.
-*/
-func Unmarshal(bytes []byte, v interface{}) (n int, err error) {
-	defer doRecover(&err)
-
-	data := C.pn_data(0)
-	defer C.pn_data_free(data)
-	n, err = decode(data, bytes)
-	if err != nil {
-		return 0, err
-	}
-	if n == 0 {
-		return 0, fmt.Errorf("not enough data")
-	} else {
-		unmarshal(v, data)
-	}
-	return n, nil
-}
-
-// more reads more data when we can't parse a complete AMQP type
-func (d *Decoder) more() error {
-	var readSize int64 = minDecode
-	if int64(d.buffer.Len()) > readSize { // Grow by doubling
-		readSize = int64(d.buffer.Len())
-	}
-	var n int64
-	n, err := d.buffer.ReadFrom(io.LimitReader(d.reader, readSize))
-	if n == 0 && err == nil { // ReadFrom won't report io.EOF, just returns 0
-		err = io.EOF
-	}
-	return err
-}
-
-// Unmarshal from data into value pointed at by v.
-func unmarshal(v interface{}, data *C.pn_data_t) {
-	pnType := C.pn_data_type(data)
-	switch v := v.(type) {
-	case *bool:
-		switch pnType {
-		case C.PN_BOOL:
-			*v = bool(C.pn_data_get_bool(data))
-		default:
-			panic(newUnmarshalError(pnType, v))
-		}
-	case *int8:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = int8(C.pn_data_get_char(data))
-		case C.PN_BYTE:
-			*v = int8(C.pn_data_get_byte(data))
-		default:
-			panic(newUnmarshalError(pnType, v))
-		}
-	case *uint8:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = uint8(C.pn_data_get_char(data))
-		case C.PN_UBYTE:
-			*v = uint8(C.pn_data_get_ubyte(data))
-		default:
-			panic(newUnmarshalError(pnType, v))
-		}
-	case *int16:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = int16(C.pn_data_get_char(data))
-		case C.PN_BYTE:
-			*v = int16(C.pn_data_get_byte(data))
-		case C.PN_SHORT:
-			*v = int16(C.pn_data_get_short(data))
-		default:
-			panic(newUnmarshalError(pnType, v))
-		}
-	case *uint16:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = uint16(C.pn_data_get_char(data))
-		case C.PN_UBYTE:
-			*v = uint16(C.pn_data_get_ubyte(data))
-		case C.PN_USHORT:
-			*v = uint16(C.pn_data_get_ushort(data))
-		default:
-			panic(newUnmarshalError(pnType, v))
-		}
-	case *int32:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = int32(C.pn_data_get_char(data))
-		case C.PN_BYTE:
-			*v = int32(C.pn_data_get_byte(data))
-		case C.PN_SHORT:
-			*v = int32(C.pn_data_get_short(data))
-		case C.PN_INT:
-			*v = int32(C.pn_data_get_int(data))
-		default:
-			panic(newUnmarshalError(pnType, v))
-		}
-	case *uint32:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = uint32(C.pn_data_get_char(data))
-		case C.PN_UBYTE:
-			*v = uint32(C.pn_data_get_ubyte(data))
-		case C.PN_USHORT:
-			*v = uint32(C.pn_data_get_ushort(data))
-		case C.PN_UINT:
-			*v = uint32(C.pn_data_get_uint(data))
-		default:
-			panic(newUnmarshalError(pnType, v))
-		}
-
-	case *int64:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = int64(C.pn_data_get_char(data))
-		case C.PN_BYTE:
-			*v = int64(C.pn_data_get_byte(data))
-		case C.PN_SHORT:
-			*v = int64(C.pn_data_get_short(data))
-		case C.PN_INT:
-			*v = int64(C.pn_data_get_int(data))
-		case C.PN_LONG:
-			*v = int64(C.pn_data_get_long(data))
-		default:
-			panic(newUnmarshalError(pnType, v))
-		}
-
-	case *uint64:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = uint64(C.pn_data_get_char(data))
-		case C.PN_UBYTE:
-			*v = uint64(C.pn_data_get_ubyte(data))
-		case C.PN_USHORT:
-			*v = uint64(C.pn_data_get_ushort(data))
-		case C.PN_ULONG:
-			*v = uint64(C.pn_data_get_ulong(data))
-		default:
-			panic(newUnmarshalError(pnType, v))
-		}
-
-	case *int:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = int(C.pn_data_get_char(data))
-		case C.PN_BYTE:
-			*v = int(C.pn_data_get_byte(data))
-		case C.PN_SHORT:
-			*v = int(C.pn_data_get_short(data))
-		case C.PN_INT:
-			*v = int(C.pn_data_get_int(data))
-		case C.PN_LONG:
-			if unsafe.Sizeof(0) == 8 {
-				*v = int(C.pn_data_get_long(data))
-			} else {
-				panic(newUnmarshalError(pnType, v))
-			}
-		default:
-			panic(newUnmarshalError(pnType, v))
-		}
-
-	case *uint:
-		switch pnType {
-		case C.PN_CHAR:
-			*v = uint(C.pn_data_get_char(data))
-		case C.PN_UBYTE:
-			*v = uint(C.pn_data_get_ubyte(data))
-		case C.PN_USHORT:
-			*v = uint(C.pn_data_get_ushort(data))
-		case C.PN_UINT:
-			*v = uint(C.pn_data_get_uint(data))
-		case C.PN_ULONG:
-			if unsafe.Sizeof(0) == 8 {
-				*v = uint(C.pn_data_get_ulong(data))
-			} else {
-				panic(newUnmarshalError(pnType, v))
-			}
-		default:
-			panic(newUnmarshalError(pnType, v))
-		}
-
-	case *float32:
-		switch pnType {
-		case C.PN_FLOAT:
-			*v = float32(C.pn_data_get_float(data))
-		default:
-			panic(newUnmarshalError(pnType, v))
-		}
-
-	case *float64:
-		switch pnType {
-		case C.PN_FLOAT:
-			*v = float64(C.pn_data_get_float(data))
-		case C.PN_DOUBLE:
-			*v = float64(C.pn_data_get_double(data))
-		default:
-			panic(newUnmarshalError(pnType, v))
-		}
-
-	case *string:
-		switch pnType {
-		case C.PN_STRING:
-			*v = goString(C.pn_data_get_string(data))
-		case C.PN_SYMBOL:
-			*v = goString(C.pn_data_get_symbol(data))
-		case C.PN_BINARY:
-			*v = goString(C.pn_data_get_binary(data))
-		default:
-			panic(newUnmarshalError(pnType, v))
-		}
-
-	case *[]byte:
-		switch pnType {
-		case C.PN_STRING:
-			*v = goBytes(C.pn_data_get_string(data))
-		case C.PN_SYMBOL:
-			*v = goBytes(C.pn_data_get_symbol(data))
-		case C.PN_BINARY:
-			*v = goBytes(C.pn_data_get_binary(data))
-		default:
-			panic(newUnmarshalError(pnType, v))
-		}
-
-	case *Binary:
-		switch pnType {
-		case C.PN_BINARY:
-			*v = Binary(goBytes(C.pn_data_get_binary(data)))
-		default:
-			panic(newUnmarshalError(pnType, v))
-		}
-
-	case *Symbol:
-		switch pnType {
-		case C.PN_SYMBOL:
-			*v = Symbol(goBytes(C.pn_data_get_symbol(data)))
-		default:
-			panic(newUnmarshalError(pnType, v))
-		}
-
-	case *interface{}:
-		getInterface(data, v)
-
-	default:
-		if reflect.TypeOf(v).Kind() != reflect.Ptr {
-			panic(newUnmarshalError(pnType, v))
-		}
-		switch reflect.TypeOf(v).Elem().Kind() {
-		case reflect.Map:
-			getMap(data, v)
-		case reflect.Slice:
-			getList(data, v)
-		default:
-			panic(newUnmarshalError(pnType, v))
-		}
-	}
-	err := dataError("unmarshaling", data)
-	if err != nil {
-		panic(err)
-	}
-	return
-}
-
-func rewindUnmarshal(v interface{}, data *C.pn_data_t) {
-	C.pn_data_rewind(data)
-	C.pn_data_next(data)
-	unmarshal(v, data)
-}
-
-// Getting into an interface is driven completely by the AMQP type, since the interface{}
-// target is type-neutral.
-func getInterface(data *C.pn_data_t, v *interface{}) {
-	pnType := C.pn_data_type(data)
-	switch pnType {
-	case C.PN_BOOL:
-		*v = bool(C.pn_data_get_bool(data))
-	case C.PN_UBYTE:
-		*v = uint8(C.pn_data_get_ubyte(data))
-	case C.PN_BYTE:
-		*v = int8(C.pn_data_get_byte(data))
-	case C.PN_USHORT:
-		*v = uint16(C.pn_data_get_ushort(data))
-	case C.PN_SHORT:
-		*v = int16(C.pn_data_get_short(data))
-	case C.PN_UINT:
-		*v = uint32(C.pn_data_get_uint(data))
-	case C.PN_INT:
-		*v = int32(C.pn_data_get_int(data))
-	case C.PN_CHAR:
-		*v = uint8(C.pn_data_get_char(data))
-	case C.PN_ULONG:
-		*v = uint64(C.pn_data_get_ulong(data))
-	case C.PN_LONG:
-		*v = int64(C.pn_data_get_long(data))
-	case C.PN_FLOAT:
-		*v = float32(C.pn_data_get_float(data))
-	case C.PN_DOUBLE:
-		*v = float64(C.pn_data_get_double(data))
-	case C.PN_BINARY:
-		*v = Binary(goBytes(C.pn_data_get_binary(data)))
-	case C.PN_STRING:
-		*v = goString(C.pn_data_get_string(data))
-	case C.PN_SYMBOL:
-		*v = Symbol(goString(C.pn_data_get_symbol(data)))
-	case C.PN_MAP:
-		m := make(Map)
-		unmarshal(&m, data)
-		*v = m
-	case C.PN_LIST:
-		l := make(List, 0)
-		unmarshal(&l, data)
-		*v = l
-	default: // No data (-1 or NULL)
-		*v = nil
-	}
-}
-
-// get into map pointed at by v
-func getMap(data *C.pn_data_t, v interface{}) {
-	mapValue := reflect.ValueOf(v).Elem()
-	mapValue.Set(reflect.MakeMap(mapValue.Type())) // Clear the map
-	switch pnType := C.pn_data_type(data); pnType {
-	case C.PN_MAP:
-		count := int(C.pn_data_get_map(data))
-		if bool(C.pn_data_enter(data)) {
-			defer C.pn_data_exit(data)
-			for i := 0; i < count/2; i++ {
-				if bool(C.pn_data_next(data)) {
-					key := reflect.New(mapValue.Type().Key())
-					unmarshal(key.Interface(), data)
-					if bool(C.pn_data_next(data)) {
-						val := reflect.New(mapValue.Type().Elem())
-						unmarshal(val.Interface(), data)
-						mapValue.SetMapIndex(key.Elem(), val.Elem())
-					}
-				}
-			}
-		}
-	default: // Empty/error/unknown, leave map empty
-	}
-}
-
-func getList(data *C.pn_data_t, v interface{}) {
-	pnType := C.pn_data_type(data)
-	if pnType != C.PN_LIST {
-		panic(newUnmarshalError(pnType, v))
-	}
-	count := int(C.pn_data_get_list(data))
-	listValue := reflect.MakeSlice(reflect.TypeOf(v).Elem(), count, count)
-	if bool(C.pn_data_enter(data)) {
-		for i := 0; i < count; i++ {
-			if bool(C.pn_data_next(data)) {
-				val := reflect.New(listValue.Type().Elem())
-				unmarshal(val.Interface(), data)
-				listValue.Index(i).Set(val.Elem())
-			}
-		}
-		C.pn_data_exit(data)
-	}
-	reflect.ValueOf(v).Elem().Set(listValue)
-}
-
-// decode from bytes.
-// Return bytes decoded or 0 if we could not decode a complete object.
-//
-func decode(data *C.pn_data_t, bytes []byte) (int, error) {
-	if len(bytes) == 0 {
-		return 0, nil
-	}
-	n := int(C.pn_data_decode(data, cPtr(bytes), cLen(bytes)))
-	if n == int(C.PN_UNDERFLOW) {
-		C.pn_error_clear(C.pn_data_error(data))
-		return 0, nil
-	} else if n <= 0 {
-		return 0, fmt.Errorf("unmarshal %s", PnErrorCode(n))
-	}
-	return n, nil
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/amqp/url.go b/proton-c/bindings/go/src/qpid.apache.org/amqp/url.go
deleted file mode 100644
index fd6c8dc..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/amqp/url.go
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package amqp
-
-import (
-	"errors"
-	"net"
-	"net/url"
-	"strings"
-)
-
-const (
-	amqp  string = "amqp"
-	amqps        = "amqps"
-	defaulthost  = "localhost"
-)
-
-// The way this is used it can only get a hostport already validated by
-// the URL parser, so this means we can skip some error checks
-func splitHostPort(hostport string) (string, string, error) {
-	if hostport == "" {
-		return "", "", nil
-	}
-	if hostport[0] == '[' {
-		// There must be a matching ']' as already validated
-		if l := strings.LastIndex(hostport, "]"); len(hostport) == l+1 {
-			// trim off '[' and ']'
-			return hostport[1:l], "", nil
-		}
-	} else if strings.IndexByte(hostport, ':') < 0 {
-		return hostport, "", nil
-	}
-	return net.SplitHostPort(hostport)
-}
-
-func UpdateURL(in *url.URL) (err error) {
-	// Detect form without "amqp://" and stick it on front
-	// to make it match the usual proton defaults
-	u := new (url.URL)
-	*u = *in
-	if (u.Scheme != "" && u.Opaque != "") ||
-	   (u.Scheme == "" && u.Host == "") {
-		input := u.String()
-		input = "amqp://" + input
-		u, err = url.Parse(input)
-		if err != nil {
-			return
-		}
-	}
-	// If Scheme is still "" then default to amqp
-	if u.Scheme == "" {
-		u.Scheme = amqp
-	}
-	// Error if the scheme is not an amqp scheme
-	if u.Scheme != amqp && u.Scheme != amqps {
-		return errors.New("invalid amqp scheme")
-	}
-	// Decompose Host into host and port
-	host, port, err := splitHostPort(u.Host)
-	if err != nil {
-		return
-	}
-	if host == "" {
-		host = defaulthost
-	}
-	if port == "" {
-		port = u.Scheme
-	}
-	u.Host = net.JoinHostPort(host, port)
-	*in = *u
-	return nil
-}
-
-// ParseUrl parses an AMQP URL string and returns a net/url.Url.
-//
-// It is more forgiving than net/url.Parse and allows most of the parts of the
-// URL to be missing, assuming AMQP defaults.
-//
-func ParseURL(s string) (u *url.URL, err error) {
-	if u, err = url.Parse(s); err != nil {
-		return
-	}
-	if err = UpdateURL(u); err != nil {
-		u = nil
-	}
-	return u, err
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/amqp/url_test.go b/proton-c/bindings/go/src/qpid.apache.org/amqp/url_test.go
deleted file mode 100644
index f52d4bf..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/amqp/url_test.go
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package amqp
-
-import (
-	"fmt"
-)
-
-func ExampleParseURL() {
-	for _, s := range []string{
-		"amqp://username:password@host:1234/path",
-		"host:1234",
-		"host",
-		"host/path",
-		"amqps://host",
-		"/path",
-		"",
-		":1234",
-                // Taken out becasue the go 1.4 URL parser isn't the same as later
-		//"[::1]",
-		//"[::1",
-		// Output would be:
-		// amqp://[::1]:amqp
-		// parse amqp://[::1: missing ']' in host
-	} {
-		u, err := ParseURL(s)
-		if err != nil {
-			fmt.Println(err)
-		} else {
-			fmt.Println(u)
-		}
-	}
-	// Output:
-	// amqp://username:password@host:1234/path
-	// amqp://host:1234
-	// amqp://host:amqp
-	// amqp://host:amqp/path
-	// amqps://host:amqps
-	// amqp://localhost:amqp/path
-	// amqp://localhost:amqp
-	// parse :1234: missing protocol scheme
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/amqp/version.go b/proton-c/bindings/go/src/qpid.apache.org/amqp/version.go
deleted file mode 100644
index cefa904..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/amqp/version.go
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package amqp
-
-// Version check for proton library.
-// Done here because this is the lowest-level dependency for all the proton Go packages.
-
-// #include <proton/version.h>
-// #if PN_VERSION_MINOR < 10
-// #error packages qpid.apache.org/... require Proton-C library version 0.10 or greater
-// #endif
-import "C"
diff --git a/proton-c/bindings/go/src/qpid.apache.org/electron/auth_test.go b/proton-c/bindings/go/src/qpid.apache.org/electron/auth_test.go
deleted file mode 100644
index 73a9299..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/electron/auth_test.go
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package electron
-
-import (
-	"fmt"
-	"io/ioutil"
-	"os"
-	"os/exec"
-	"path/filepath"
-	"strings"
-	"testing"
-)
-
-func testAuthClientServer(t *testing.T, copts []ConnectionOption, sopts []ConnectionOption) (got connectionSettings, err error) {
-	client, server := newClientServerOpts(t, copts, sopts)
-	defer closeClientServer(client, server)
-
-	go func() {
-		for in := range server.Incoming() {
-			switch in := in.(type) {
-			case *IncomingConnection:
-				got = connectionSettings{user: in.User(), virtualHost: in.VirtualHost()}
-			}
-			in.Accept()
-		}
-	}()
-
-	err = client.Sync()
-	return
-}
-
-func TestAuthAnonymous(t *testing.T) {
-	fatalIf(t, configureSASL())
-	got, err := testAuthClientServer(t,
-		[]ConnectionOption{User("fred"), VirtualHost("vhost"), SASLAllowInsecure(true)},
-		[]ConnectionOption{SASLAllowedMechs("ANONYMOUS"), SASLAllowInsecure(true)})
-	fatalIf(t, err)
-	errorIf(t, checkEqual(connectionSettings{user: "anonymous", virtualHost: "vhost"}, got))
-}
-
-func TestAuthPlain(t *testing.T) {
-	fatalIf(t, configureSASL())
-	got, err := testAuthClientServer(t,
-		[]ConnectionOption{SASLAllowInsecure(true), SASLAllowedMechs("PLAIN"), User("fred@proton"), Password([]byte("xxx"))},
-		[]ConnectionOption{SASLAllowInsecure(true), SASLAllowedMechs("PLAIN")})
-	fatalIf(t, err)
-	errorIf(t, checkEqual(connectionSettings{user: "fred@proton"}, got))
-}
-
-func TestAuthBadPass(t *testing.T) {
-	fatalIf(t, configureSASL())
-	_, err := testAuthClientServer(t,
-		[]ConnectionOption{SASLAllowInsecure(true), SASLAllowedMechs("PLAIN"), User("fred@proton"), Password([]byte("yyy"))},
-		[]ConnectionOption{SASLAllowInsecure(true), SASLAllowedMechs("PLAIN")})
-	if err == nil {
-		t.Error("Expected auth failure for bad pass")
-	}
-}
-
-func TestAuthBadUser(t *testing.T) {
-	fatalIf(t, configureSASL())
-	_, err := testAuthClientServer(t,
-		[]ConnectionOption{SASLAllowInsecure(true), SASLAllowedMechs("PLAIN"), User("foo@bar"), Password([]byte("yyy"))},
-		[]ConnectionOption{SASLAllowInsecure(true), SASLAllowedMechs("PLAIN")})
-	if err == nil {
-		t.Error("Expected auth failure for bad user")
-	}
-}
-
-var confDir string
-var confErr error
-
-func configureSASL() error {
-	if confDir != "" || confErr != nil {
-		return confErr
-	}
-	confDir, confErr = ioutil.TempDir("", "")
-	if confErr != nil {
-		return confErr
-	}
-
-	GlobalSASLConfigDir(confDir)
-	GlobalSASLConfigName("test")
-	conf := filepath.Join(confDir, "test.conf")
-
-	db := filepath.Join(confDir, "proton.sasldb")
-	cmd := exec.Command("saslpasswd2", "-c", "-p", "-f", db, "-u", "proton", "fred")
-	cmd.Stdin = strings.NewReader("xxx") // Password
-	if out, err := cmd.CombinedOutput(); err != nil {
-		confErr = fmt.Errorf("saslpasswd2 failed: %s\n%s", err, out)
-		return confErr
-	}
-	confStr := "sasldb_path: " + db + "\nmech_list: EXTERNAL DIGEST-MD5 SCRAM-SHA-1 CRAM-MD5 PLAIN ANONYMOUS\n"
-	if err := ioutil.WriteFile(conf, []byte(confStr), os.ModePerm); err != nil {
-		confErr = fmt.Errorf("write conf file %s failed: %s", conf, err)
-	}
-	return confErr
-}
-
-func TestMain(m *testing.M) {
-	status := m.Run()
-	if confDir != "" {
-		_ = os.RemoveAll(confDir)
-	}
-	os.Exit(status)
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/electron/connection.go b/proton-c/bindings/go/src/qpid.apache.org/electron/connection.go
deleted file mode 100644
index 7f3050f..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/electron/connection.go
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package electron
-
-// #include <proton/disposition.h>
-import "C"
-
-import (
-	"net"
-	"qpid.apache.org/proton"
-	"sync"
-	"time"
-)
-
-// Settings associated with a Connection.
-type ConnectionSettings interface {
-	// Authenticated user name associated with the connection.
-	User() string
-
-	// The AMQP virtual host name for the connection.
-	//
-	// Optional, useful when the server has multiple names and provides different
-	// service based on the name the client uses to connect.
-	//
-	// By default it is set to the DNS host name that the client uses to connect,
-	// but it can be set to something different at the client side with the
-	// VirtualHost() option.
-	//
-	// Returns error if the connection fails to authenticate.
-	VirtualHost() string
-
-	// Heartbeat is the maximum delay between sending frames that the remote peer
-	// has requested of us. If the interval expires an empty "heartbeat" frame
-	// will be sent automatically to keep the connection open.
-	Heartbeat() time.Duration
-}
-
-// Connection is an AMQP connection, created by a Container.
-type Connection interface {
-	Endpoint
-	ConnectionSettings
-
-	// Sender opens a new sender on the DefaultSession.
-	Sender(...LinkOption) (Sender, error)
-
-	// Receiver opens a new Receiver on the DefaultSession().
-	Receiver(...LinkOption) (Receiver, error)
-
-	// DefaultSession() returns a default session for the connection. It is opened
-	// on the first call to DefaultSession and returned on subsequent calls.
-	DefaultSession() (Session, error)
-
-	// Session opens a new session.
-	Session(...SessionOption) (Session, error)
-
-	// Container for the connection.
-	Container() Container
-
-	// Disconnect the connection abruptly with an error.
-	Disconnect(error)
-
-	// Wait waits for the connection to be disconnected.
-	Wait() error
-
-	// WaitTimeout is like Wait but returns Timeout if the timeout expires.
-	WaitTimeout(time.Duration) error
-
-	// Incoming returns a channel for incoming endpoints opened by the remote peer.
-	// See the Incoming interface for more.
-	//
-	// Not receiving from Incoming() and calling Accept/Reject will block the
-	// electron event loop. You should run a loop to handle the types that
-	// interest you in a switch{} and and Accept() all others.
-	Incoming() <-chan Incoming
-}
-
-type connectionSettings struct {
-	user, virtualHost string
-	heartbeat         time.Duration
-}
-
-func (c connectionSettings) User() string             { return c.user }
-func (c connectionSettings) VirtualHost() string      { return c.virtualHost }
-func (c connectionSettings) Heartbeat() time.Duration { return c.heartbeat }
-
-// ConnectionOption can be passed when creating a connection to configure various options
-type ConnectionOption func(*connection)
-
-// User returns a ConnectionOption sets the user name for a connection
-func User(user string) ConnectionOption {
-	return func(c *connection) {
-		c.user = user
-		c.pConnection.SetUser(user)
-	}
-}
-
-// VirtualHost returns a ConnectionOption to set the AMQP virtual host for the connection.
-// Only applies to outbound client connection.
-func VirtualHost(virtualHost string) ConnectionOption {
-	return func(c *connection) {
-		c.virtualHost = virtualHost
-		c.pConnection.SetHostname(virtualHost)
-	}
-}
-
-// Password returns a ConnectionOption to set the password used to establish a
-// connection.  Only applies to outbound client connection.
-//
-// The connection will erase its copy of the password from memory as soon as it
-// has been used to authenticate. If you are concerned about paswords staying in
-// memory you should never store them as strings, and should overwrite your
-// copy as soon as you are done with it.
-//
-func Password(password []byte) ConnectionOption {
-	return func(c *connection) { c.pConnection.SetPassword(password) }
-}
-
-// Server returns a ConnectionOption to put the connection in server mode for incoming connections.
-//
-// A server connection will do protocol negotiation to accept a incoming AMQP
-// connection. Normally you would call this for a connection created by
-// net.Listener.Accept()
-//
-func Server() ConnectionOption {
-	return func(c *connection) { c.engine.Server(); c.server = true; AllowIncoming()(c) }
-}
-
-// AllowIncoming returns a ConnectionOption to enable incoming endpoints, see
-// Connection.Incoming() This is automatically set for Server() connections.
-func AllowIncoming() ConnectionOption {
-	return func(c *connection) { c.incoming = make(chan Incoming) }
-}
-
-// Parent returns a ConnectionOption that associates the Connection with it's Container
-// If not set a connection will create its own default container.
-func Parent(cont Container) ConnectionOption {
-	return func(c *connection) { c.container = cont.(*container) }
-}
-
-type connection struct {
-	endpoint
-	connectionSettings
-
-	defaultSessionOnce, closeOnce sync.Once
-
-	container   *container
-	conn        net.Conn
-	server      bool
-	incoming    chan Incoming
-	handler     *handler
-	engine      *proton.Engine
-	pConnection proton.Connection
-
-	defaultSession Session
-}
-
-// NewConnection creates a connection with the given options.
-func NewConnection(conn net.Conn, opts ...ConnectionOption) (*connection, error) {
-	c := &connection{
-		conn: conn,
-	}
-	c.handler = newHandler(c)
-	var err error
-	c.engine, err = proton.NewEngine(c.conn, c.handler.delegator)
-	if err != nil {
-		return nil, err
-	}
-	c.pConnection = c.engine.Connection()
-	for _, set := range opts {
-		set(c)
-	}
-	if c.container == nil {
-		c.container = NewContainer("").(*container)
-	}
-	c.pConnection.SetContainer(c.container.Id())
-	globalSASLInit(c.engine)
-
-	c.endpoint.init(c.engine.String())
-	go c.run()
-	return c, nil
-}
-
-func (c *connection) run() {
-	if !c.server {
-		c.pConnection.Open()
-	}
-	_ = c.engine.Run()
-	if c.incoming != nil {
-		close(c.incoming)
-	}
-	_ = c.closed(Closed)
-}
-
-func (c *connection) Close(err error) {
-	c.err.Set(err)
-	c.engine.Close(err)
-}
-
-func (c *connection) Disconnect(err error) {
-	c.err.Set(err)
-	c.engine.Disconnect(err)
-}
-
-func (c *connection) Session(opts ...SessionOption) (Session, error) {
-	var s Session
-	err := c.engine.InjectWait(func() error {
-		if c.Error() != nil {
-			return c.Error()
-		}
-		pSession, err := c.engine.Connection().Session()
-		if err == nil {
-			pSession.Open()
-			if err == nil {
-				s = newSession(c, pSession, opts...)
-			}
-		}
-		return err
-	})
-	return s, err
-}
-
-func (c *connection) Container() Container { return c.container }
-
-func (c *connection) DefaultSession() (s Session, err error) {
-	c.defaultSessionOnce.Do(func() {
-		c.defaultSession, err = c.Session()
-	})
-	if err == nil {
-		err = c.Error()
-	}
-	return c.defaultSession, err
-}
-
-func (c *connection) Sender(opts ...LinkOption) (Sender, error) {
-	if s, err := c.DefaultSession(); err == nil {
-		return s.Sender(opts...)
-	} else {
-		return nil, err
-	}
-}
-
-func (c *connection) Receiver(opts ...LinkOption) (Receiver, error) {
-	if s, err := c.DefaultSession(); err == nil {
-		return s.Receiver(opts...)
-	} else {
-		return nil, err
-	}
-}
-
-func (c *connection) Connection() Connection { return c }
-
-func (c *connection) Wait() error { return c.WaitTimeout(Forever) }
-func (c *connection) WaitTimeout(timeout time.Duration) error {
-	_, err := timedReceive(c.done, timeout)
-	if err == Timeout {
-		return Timeout
-	}
-	return c.Error()
-}
-
-func (c *connection) Incoming() <-chan Incoming {
-	assert(c.incoming != nil, "electron.Connection.Incoming() disabled for %s", c)
-	return c.incoming
-}
-
-type IncomingConnection struct {
-	incoming
-	connectionSettings
-	c *connection
-}
-
-func newIncomingConnection(c *connection) *IncomingConnection {
-	c.user = c.pConnection.Transport().User()
-	c.virtualHost = c.pConnection.RemoteHostname()
-	return &IncomingConnection{
-		incoming:           makeIncoming(c.pConnection),
-		connectionSettings: c.connectionSettings,
-		c:                  c}
-}
-
-// AcceptConnection is like Accept() but takes ConnectionOption s
-// For example you can set the Heartbeat() for the accepted connection.
-func (in *IncomingConnection) AcceptConnection(opts ...ConnectionOption) Connection {
-	return in.accept(func() Endpoint {
-		for _, opt := range opts {
-			opt(in.c)
-		}
-		in.c.pConnection.Open()
-		return in.c
-	}).(Connection)
-}
-
-func (in *IncomingConnection) Accept() Endpoint {
-	return in.AcceptConnection()
-}
-
-func sasl(c *connection) proton.SASL { return c.engine.Transport().SASL() }
-
-// SASLEnable returns a ConnectionOption that enables SASL authentication.
-// Only required if you don't set any other SASL options.
-func SASLEnable() ConnectionOption { return func(c *connection) { sasl(c) } }
-
-// SASLAllowedMechs returns a ConnectionOption to set the list of allowed SASL
-// mechanisms.
-//
-// Can be used on the client or the server to restrict the SASL for a connection.
-// mechs is a space-separated list of mechanism names.
-//
-func SASLAllowedMechs(mechs string) ConnectionOption {
-	return func(c *connection) { sasl(c).AllowedMechs(mechs) }
-}
-
-// SASLAllowInsecure returns a ConnectionOption that allows or disallows clear
-// text SASL authentication mechanisms
-//
-// By default the SASL layer is configured not to allow mechanisms that disclose
-// the clear text of the password over an unencrypted AMQP connection. This specifically
-// will disallow the use of the PLAIN mechanism without using SSL encryption.
-//
-// This default is to avoid disclosing password information accidentally over an
-// insecure network.
-//
-func SASLAllowInsecure(b bool) ConnectionOption {
-	return func(c *connection) { sasl(c).SetAllowInsecureMechs(b) }
-}
-
-// Heartbeat returns a ConnectionOption that requests the maximum delay
-// between sending frames for the remote peer. If we don't receive any frames
-// within 2*delay we will close the connection.
-//
-func Heartbeat(delay time.Duration) ConnectionOption {
-	// Proton-C divides the idle-timeout by 2 before sending, so compensate.
-	return func(c *connection) { c.engine.Transport().SetIdleTimeout(2 * delay) }
-}
-
-// GlobalSASLConfigDir sets the SASL configuration directory for every
-// Connection created in this process. If not called, the default is determined
-// by your SASL installation.
-//
-// You can set SASLAllowInsecure and SASLAllowedMechs on individual connections.
-//
-func GlobalSASLConfigDir(dir string) { globalSASLConfigDir = dir }
-
-// GlobalSASLConfigName sets the SASL configuration name for every Connection
-// created in this process. If not called the default is "proton-server".
-//
-// The complete configuration file name is
-//     <sasl-config-dir>/<sasl-config-name>.conf
-//
-// You can set SASLAllowInsecure and SASLAllowedMechs on individual connections.
-//
-func GlobalSASLConfigName(dir string) { globalSASLConfigName = dir }
-
-var (
-	globalSASLConfigName string
-	globalSASLConfigDir  string
-)
-
-// TODO aconway 2016-09-15: Current pn_sasl C impl config is broken, so all we
-// can realistically offer is global configuration. Later if/when the pn_sasl C
-// impl is fixed we can offer per connection over-rides.
-func globalSASLInit(eng *proton.Engine) {
-	sasl := eng.Transport().SASL()
-	if globalSASLConfigName != "" {
-		sasl.ConfigName(globalSASLConfigName)
-	}
-	if globalSASLConfigDir != "" {
-		sasl.ConfigPath(globalSASLConfigDir)
-	}
-}
-
-// Dial is shorthand for using net.Dial() then NewConnection()
-func Dial(network, addr string, opts ...ConnectionOption) (c Connection, err error) {
-	conn, err := net.Dial(network, addr)
-	if err == nil {
-		c, err = NewConnection(conn, opts...)
-	}
-	return
-}
-
-// DialWithDialer is shorthand for using dialer.Dial() then NewConnection()
-func DialWithDialer(dialer *net.Dialer, network, addr string, opts ...ConnectionOption) (c Connection, err error) {
-	conn, err := dialer.Dial(network, addr)
-	if err == nil {
-		c, err = NewConnection(conn, opts...)
-	}
-	return
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/electron/container.go b/proton-c/bindings/go/src/qpid.apache.org/electron/container.go
deleted file mode 100644
index efb24ff..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/electron/container.go
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package electron
-
-import (
-	"net"
-	"qpid.apache.org/proton"
-	"strconv"
-	"sync/atomic"
-)
-
-// Container is an AMQP container, it represents a single AMQP "application"
-// which can have multiple client or server connections.
-//
-// Each Container in a distributed AMQP application must have a unique
-// container-id which is applied to its connections.
-//
-// Create with NewContainer()
-//
-type Container interface {
-	// Id is a unique identifier for the container in your distributed application.
-	Id() string
-
-	// Connection creates a connection associated with this container.
-	Connection(conn net.Conn, opts ...ConnectionOption) (Connection, error)
-
-	// Dial is shorthand for
-	//     conn, err := net.Dial(); c, err := Connection(conn, opts...)
-	Dial(network string, addr string, opts ...ConnectionOption) (Connection, error)
-
-	// Accept is shorthand for:
-	//     conn, err := l.Accept(); c, err := Connection(conn, append(opts, Server()...)
-	Accept(l net.Listener, opts ...ConnectionOption) (Connection, error)
-
-	// String returns Id()
-	String() string
-}
-
-type container struct {
-	id         string
-	tagCounter uint64
-}
-
-func (cont *container) nextTag() string {
-	return strconv.FormatUint(atomic.AddUint64(&cont.tagCounter, 1), 32)
-}
-
-// NewContainer creates a new container. The id must be unique in your
-// distributed application, all connections created by the container
-// will have this container-id.
-//
-// If id == "" a random UUID will be generated for the id.
-func NewContainer(id string) Container {
-	if id == "" {
-		id = proton.UUID4().String()
-	}
-	cont := &container{id: id}
-	return cont
-}
-
-func (cont *container) Id() string { return cont.id }
-
-func (cont *container) String() string { return cont.Id() }
-
-func (cont *container) nextLinkName() string {
-	return cont.id + "@" + cont.nextTag()
-}
-
-func (cont *container) Connection(conn net.Conn, opts ...ConnectionOption) (Connection, error) {
-	return NewConnection(conn, append(opts, Parent(cont))...)
-}
-
-func (cont *container) Dial(network, address string, opts ...ConnectionOption) (c Connection, err error) {
-	conn, err := net.Dial(network, address)
-	if err == nil {
-		c, err = cont.Connection(conn, opts...)
-	}
-	return
-}
-
-func (cont *container) Accept(l net.Listener, opts ...ConnectionOption) (c Connection, err error) {
-	conn, err := l.Accept()
-	if err == nil {
-		c, err = cont.Connection(conn, append(opts, Server())...)
-	}
-	return
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/electron/doc.go b/proton-c/bindings/go/src/qpid.apache.org/electron/doc.go
deleted file mode 100644
index bc2c589..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/electron/doc.go
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-/*
-Package electron lets you write concurrent AMQP 1.0 messaging clients and servers.
-
-Start by creating a Container with NewContainer. An AMQP Container represents a
-single AMQP "application" and can contain client and server connections.
-
-You can enable AMQP over any connection that implements the standard net.Conn
-interface. Typically you can connect with net.Dial() or listen for server
-connections with net.Listen.  Enable AMQP by passing the net.Conn to
-Container.Connection().
-
-AMQP allows bi-direction peer-to-peer message exchange as well as
-client-to-broker. Messages are sent over "links". Each link is one-way and has a
-Sender and Receiver end. Connection.Sender() and Connection.Receiver() open
-links to Send() and Receive() messages. Connection.Incoming() lets you accept
-incoming links opened by the remote peer. You can open and accept multiple links
-in both directions on a single Connection.
-
-Some of the documentation examples show client and server side by side in a
-single program, in separate goroutines. This is only for example purposes, real
-AMQP applications would run in separate processes on the network.
-More realistic examples: https://github.com/apache/qpid-proton/blob/master/examples/go/README.md
-
-Some of the documentation examples show client and server side by side in a
-single program, in separate goroutines. This is only for example purposes, real
-AMQP applications would run in separate processes on the network.
-More realistic examples: https://github.com/apache/qpid-proton/blob/master/examples/go/README.md
-
-*/
-package electron
-
-//#cgo LDFLAGS: -lqpid-proton
-import "C"
-
-// Just for package comment
-
-/* DEVELOPER NOTES
-
-There is a single proton.Engine per connection, each driving it's own event-loop goroutine,
-and each with a 'handler'. Most state for a connection is maintained on the handler, and
-only accessed in the event-loop goroutine, so no locks are required there.
-
-The handler sets up channels as needed to get or send data from user goroutines
-using electron types like Sender or Receiver.
-
-Engine.Inject injects actions into the event loop from user goroutines. It is
-important to check at the start of an injected function that required objects
-are still valid, for example a link may be remotely closed between the time a
-Sender function calls Inject and the time the injected function is execute by
-the handler goroutine.
-
-*/
diff --git a/proton-c/bindings/go/src/qpid.apache.org/electron/electron_test.go b/proton-c/bindings/go/src/qpid.apache.org/electron/electron_test.go
deleted file mode 100644
index 294e952..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/electron/electron_test.go
+++ /dev/null
@@ -1,546 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package electron
-
-import (
-	"fmt"
-	"net"
-	"path"
-	"qpid.apache.org/amqp"
-	"reflect"
-	"runtime"
-	"testing"
-	"time"
-)
-
-func fatalIf(t *testing.T, err error) {
-	if err != nil {
-		_, file, line, ok := runtime.Caller(1) // annotate with location of caller.
-		if ok {
-			_, file = path.Split(file)
-		}
-		t.Fatalf("(from %s:%d) %v", file, line, err)
-	}
-}
-
-func errorIf(t *testing.T, err error) {
-	if err != nil {
-		_, file, line, ok := runtime.Caller(1) // annotate with location of caller.
-		if ok {
-			_, file = path.Split(file)
-		}
-		t.Errorf("(from %s:%d) %v", file, line, err)
-	}
-}
-
-func checkEqual(want interface{}, got interface{}) error {
-	if !reflect.DeepEqual(want, got) {
-		return fmt.Errorf("%#v != %#v", want, got)
-	}
-	return nil
-}
-
-// Start a server, return listening addr and channel for incoming Connections.
-func newServer(t *testing.T, cont Container, opts ...ConnectionOption) (net.Addr, <-chan Connection) {
-	listener, err := net.Listen("tcp", "")
-	fatalIf(t, err)
-	addr := listener.Addr()
-	ch := make(chan Connection)
-	go func() {
-		conn, err := listener.Accept()
-		c, err := cont.Connection(conn, append([]ConnectionOption{Server()}, opts...)...)
-		fatalIf(t, err)
-		ch <- c
-	}()
-	return addr, ch
-}
-
-// Open a client connection and session, return the session.
-func newClient(t *testing.T, cont Container, addr net.Addr, opts ...ConnectionOption) Session {
-	conn, err := net.Dial(addr.Network(), addr.String())
-	fatalIf(t, err)
-	c, err := cont.Connection(conn, opts...)
-	fatalIf(t, err)
-	sn, err := c.Session()
-	fatalIf(t, err)
-	return sn
-}
-
-// Return client and server ends of the same connection.
-func newClientServerOpts(t *testing.T, copts []ConnectionOption, sopts []ConnectionOption) (client Session, server Connection) {
-	addr, ch := newServer(t, NewContainer("test-server"), sopts...)
-	client = newClient(t, NewContainer("test-client"), addr, copts...)
-	return client, <-ch
-}
-
-// Return client and server ends of the same connection.
-func newClientServer(t *testing.T) (client Session, server Connection) {
-	return newClientServerOpts(t, nil, nil)
-}
-
-// Close client and server
-func closeClientServer(client Session, server Connection) {
-	client.Connection().Close(nil)
-	server.Close(nil)
-}
-
-// Send a message one way with a client sender and server receiver, verify ack.
-func TestClientSendServerReceive(t *testing.T) {
-	nLinks := 3
-	nMessages := 3
-
-	rchan := make(chan Receiver, nLinks)
-	client, server := newClientServer(t)
-	go func() {
-		for in := range server.Incoming() {
-			switch in := in.(type) {
-			case *IncomingReceiver:
-				in.SetCapacity(1)
-				in.SetPrefetch(false)
-				rchan <- in.Accept().(Receiver)
-			default:
-				in.Accept()
-			}
-		}
-	}()
-
-	defer func() { closeClientServer(client, server) }()
-
-	s := make([]Sender, nLinks)
-	for i := 0; i < nLinks; i++ {
-		var err error
-		s[i], err = client.Sender(Target(fmt.Sprintf("foo%d", i)))
-		if err != nil {
-			t.Fatal(err)
-		}
-	}
-	r := make([]Receiver, nLinks)
-	for i := 0; i < nLinks; i++ {
-		r[i] = <-rchan
-	}
-
-	for i := 0; i < nLinks; i++ {
-		for j := 0; j < nMessages; j++ {
-			// Client send
-			ack := make(chan Outcome, 1)
-			sendDone := make(chan struct{})
-			go func() {
-				defer close(sendDone)
-				m := amqp.NewMessageWith(fmt.Sprintf("foobar%v-%v", i, j))
-				var err error
-				s[i].SendAsync(m, ack, "testing")
-				if err != nil {
-					t.Fatal(err)
-				}
-			}()
-
-			// Server recieve
-			rm, err := r[i].Receive()
-			if err != nil {
-				t.Fatal(err)
-			}
-			if want, got := interface{}(fmt.Sprintf("foobar%v-%v", i, j)), rm.Message.Body(); want != got {
-				t.Errorf("%#v != %#v", want, got)
-			}
-
-			// Should not be acknowledged on client yet
-			<-sendDone
-			select {
-			case <-ack:
-				t.Errorf("unexpected ack")
-			default:
-			}
-
-			// Server send ack
-			if err := rm.Reject(); err != nil {
-				t.Error(err)
-			}
-			// Client get ack.
-			if a := <-ack; a.Value != "testing" || a.Error != nil || a.Status != Rejected {
-				t.Error("unexpected ack: ", a.Status, a.Error, a.Value)
-			}
-		}
-	}
-}
-
-func TestClientReceiver(t *testing.T) {
-	nMessages := 3
-	client, server := newClientServer(t)
-	go func() {
-		for in := range server.Incoming() {
-			switch in := in.(type) {
-			case *IncomingSender:
-				s := in.Accept().(Sender)
-				go func() {
-					for i := int32(0); i < int32(nMessages); i++ {
-						out := s.SendSync(amqp.NewMessageWith(i))
-						if out.Error != nil {
-							t.Error(out.Error)
-							return
-						}
-					}
-					s.Close(nil)
-				}()
-			default:
-				in.Accept()
-			}
-		}
-	}()
-
-	r, err := client.Receiver(Source("foo"))
-	if err != nil {
-		t.Fatal(err)
-	}
-	for i := int32(0); i < int32(nMessages); i++ {
-		rm, err := r.Receive()
-		if err != nil {
-			if err != Closed {
-				t.Error(err)
-			}
-			break
-		}
-		if err := rm.Accept(); err != nil {
-			t.Error(err)
-		}
-		if b, ok := rm.Message.Body().(int32); !ok || b != i {
-			t.Errorf("want %v, true got %v, %v", i, b, ok)
-		}
-	}
-	server.Close(nil)
-	client.Connection().Close(nil)
-}
-
-// Test timeout versions of waiting functions.
-func TestTimeouts(t *testing.T) {
-	var err error
-	rchan := make(chan Receiver, 1)
-	client, server := newClientServer(t)
-	go func() {
-		for i := range server.Incoming() {
-			switch i := i.(type) {
-			case *IncomingReceiver:
-				i.SetCapacity(1)
-				i.SetPrefetch(false)
-				rchan <- i.Accept().(Receiver) // Issue credit only on receive
-			default:
-				i.Accept()
-			}
-		}
-	}()
-	defer func() { closeClientServer(client, server) }()
-
-	// Open client sender
-	snd, err := client.Sender(Target("test"))
-	if err != nil {
-		t.Fatal(err)
-	}
-	rcv := <-rchan
-
-	// Test send with timeout
-	short := time.Millisecond
-	long := time.Second
-	m := amqp.NewMessage()
-	if err := snd.SendSyncTimeout(m, 0).Error; err != Timeout { // No credit, expect timeout.
-		t.Error("want Timeout got", err)
-	}
-	if err := snd.SendSyncTimeout(m, short).Error; err != Timeout { // No credit, expect timeout.
-		t.Error("want Timeout got", err)
-	}
-	// Test receive with timeout
-	if _, err = rcv.ReceiveTimeout(0); err != Timeout { // No credit, expect timeout.
-		t.Error("want Timeout got", err)
-	}
-	// Test receive with timeout
-	if _, err = rcv.ReceiveTimeout(short); err != Timeout { // No credit, expect timeout.
-		t.Error("want Timeout got", err)
-	}
-	// There is now a credit on the link due to receive
-	ack := make(chan Outcome)
-	snd.SendAsyncTimeout(m, ack, nil, short)
-	// Disposition should timeout
-	select {
-	case <-ack:
-		t.Errorf("want Timeout got %#v", ack)
-	case <-time.After(short):
-	}
-
-	// Receive and accept
-	rm, err := rcv.ReceiveTimeout(long)
-	if err != nil {
-		t.Fatal(err)
-	}
-	if err := rm.Accept(); err != nil {
-		t.Fatal(err)
-	}
-	// Sender get ack
-	if a := <-ack; a.Status != Accepted || a.Error != nil {
-		t.Errorf("want (accepted, nil) got %#v", a)
-	}
-}
-
-// A server that returns the opposite end of each client link via channels.
-type pairs struct {
-	t        *testing.T
-	client   Session
-	server   Connection
-	rchan    chan Receiver
-	schan    chan Sender
-	capacity int
-	prefetch bool
-}
-
-func newPairs(t *testing.T, capacity int, prefetch bool) *pairs {
-	p := &pairs{t: t, rchan: make(chan Receiver, 1), schan: make(chan Sender, 1)}
-	p.client, p.server = newClientServer(t)
-	go func() {
-		for i := range p.server.Incoming() {
-			switch i := i.(type) {
-			case *IncomingReceiver:
-				i.SetCapacity(capacity)
-				i.SetPrefetch(prefetch)
-				p.rchan <- i.Accept().(Receiver)
-			case *IncomingSender:
-				p.schan <- i.Accept().(Sender)
-			default:
-				i.Accept()
-			}
-		}
-	}()
-	return p
-}
-
-func (p *pairs) close() {
-	closeClientServer(p.client, p.server)
-}
-
-// Return a client sender and server receiver
-func (p *pairs) senderReceiver() (Sender, Receiver) {
-	snd, err := p.client.Sender()
-	fatalIf(p.t, err)
-	rcv := <-p.rchan
-	return snd, rcv
-}
-
-// Return a client receiver and server sender
-func (p *pairs) receiverSender() (Receiver, Sender) {
-	rcv, err := p.client.Receiver()
-	fatalIf(p.t, err)
-	snd := <-p.schan
-	return rcv, snd
-}
-
-type result struct {
-	label string
-	err   error
-	value interface{}
-}
-
-func (r result) String() string { return fmt.Sprintf("%v(%v)", r.err, r.label) }
-
-func doSend(snd Sender, results chan result) {
-	err := snd.SendSync(amqp.NewMessage()).Error
-	results <- result{"send", err, nil}
-}
-
-func doReceive(rcv Receiver, results chan result) {
-	msg, err := rcv.Receive()
-	results <- result{"receive", err, msg}
-}
-
-func doDisposition(ack <-chan Outcome, results chan result) {
-	results <- result{"disposition", (<-ack).Error, nil}
-}
-
-// Senders get credit immediately if receivers have prefetch set
-func TestSendReceivePrefetch(t *testing.T) {
-	pairs := newPairs(t, 1, true)
-	s, r := pairs.senderReceiver()
-	s.SendAsyncTimeout(amqp.NewMessage(), nil, nil, time.Second) // Should not block for credit.
-	if _, err := r.Receive(); err != nil {
-		t.Error(err)
-	}
-}
-
-// Senders do not get credit till Receive() if receivers don't have prefetch
-func TestSendReceiveNoPrefetch(t *testing.T) {
-	pairs := newPairs(t, 1, false)
-	s, r := pairs.senderReceiver()
-	done := make(chan struct{}, 1)
-	go func() {
-		s.SendAsyncTimeout(amqp.NewMessage(), nil, nil, time.Second) // Should block for credit.
-		close(done)
-	}()
-	select {
-	case <-done:
-		t.Errorf("send should be blocked on credit")
-	default:
-		if _, err := r.Receive(); err != nil {
-			t.Error(err)
-		} else {
-			<-done
-		} // Should be unblocked now
-	}
-}
-
-// Test that closing Links interrupts blocked link functions.
-func TestLinkCloseInterrupt(t *testing.T) {
-	want := amqp.Error{Name: "x", Description: "all bad"}
-	pairs := newPairs(t, 1, false)
-	results := make(chan result) // Collect expected errors
-
-	// Note closing the link does not interrupt Send() calls, the AMQP spec says
-	// that deliveries can be settled after the link is closed.
-
-	// Receiver.Close() interrupts Receive()
-	snd, rcv := pairs.senderReceiver()
-	go doReceive(rcv, results)
-	rcv.Close(want)
-	if r := <-results; want != r.err {
-		t.Errorf("want %#v got %#v", want, r)
-	}
-
-	// Remote Sender.Close() interrupts Receive()
-	snd, rcv = pairs.senderReceiver()
-	go doReceive(rcv, results)
-	snd.Close(want)
-	if r := <-results; want != r.err {
-		t.Errorf("want %#v got %#v", want, r)
-	}
-}
-
-// Test closing the server end of a connection.
-func TestConnectionCloseInterrupt1(t *testing.T) {
-	want := amqp.Error{Name: "x", Description: "bad"}
-	pairs := newPairs(t, 1, true)
-	results := make(chan result) // Collect expected errors
-
-	// Connection.Close() interrupts Send, Receive, Disposition.
-	snd, rcv := pairs.senderReceiver()
-	go doSend(snd, results)
-
-	if _, err := rcv.Receive(); err != nil {
-		t.Error("receive", err)
-	}
-	rcv, snd = pairs.receiverSender()
-	go doReceive(rcv, results)
-
-	snd, rcv = pairs.senderReceiver()
-	ack := snd.SendWaitable(amqp.NewMessage())
-	if _, err := rcv.Receive(); err != nil {
-		t.Error("receive", err)
-	}
-	go doDisposition(ack, results)
-
-	pairs.server.Close(want)
-	for i := 0; i < 3; i++ {
-		if r := <-results; want != r.err {
-			t.Errorf("want %v got %v", want, r)
-		}
-	}
-}
-
-// Test closing the client end of the connection.
-func TestConnectionCloseInterrupt2(t *testing.T) {
-	want := amqp.Error{Name: "x", Description: "bad"}
-	pairs := newPairs(t, 1, true)
-	results := make(chan result) // Collect expected errors
-
-	// Connection.Close() interrupts Send, Receive, Disposition.
-	snd, rcv := pairs.senderReceiver()
-	go doSend(snd, results)
-	if _, err := rcv.Receive(); err != nil {
-		t.Error("receive", err)
-	}
-
-	rcv, snd = pairs.receiverSender()
-	go doReceive(rcv, results)
-
-	snd, rcv = pairs.senderReceiver()
-	ack := snd.SendWaitable(amqp.NewMessage())
-	go doDisposition(ack, results)
-
-	pairs.client.Connection().Close(want)
-	for i := 0; i < 3; i++ {
-		if r := <-results; want != r.err {
-			t.Errorf("want %v got %v", want, r.err)
-		}
-	}
-}
-
-func heartbeat(c Connection) time.Duration {
-	return c.(*connection).engine.Transport().RemoteIdleTimeout()
-}
-
-func TestHeartbeat(t *testing.T) {
-	client, server := newClientServerOpts(t,
-		[]ConnectionOption{Heartbeat(102 * time.Millisecond)},
-		nil)
-	defer closeClientServer(client, server)
-
-	var serverHeartbeat time.Duration
-
-	go func() {
-		for in := range server.Incoming() {
-			switch in := in.(type) {
-			case *IncomingConnection:
-				serverHeartbeat = in.Heartbeat()
-				in.AcceptConnection(Heartbeat(101 * time.Millisecond))
-			default:
-				in.Accept()
-			}
-		}
-	}()
-
-	// Freeze the server to stop it sending heartbeats.
-	unfreeze := make(chan bool)
-	defer close(unfreeze)
-	freeze := func() error { return server.(*connection).engine.Inject(func() { <-unfreeze }) }
-
-	fatalIf(t, client.Sync())
-	errorIf(t, checkEqual(101*time.Millisecond, heartbeat(client.Connection())))
-	errorIf(t, checkEqual(102*time.Millisecond, serverHeartbeat))
-	errorIf(t, client.Connection().Error())
-
-	// Freeze the server for less than a heartbeat
-	fatalIf(t, freeze())
-	time.Sleep(50 * time.Millisecond)
-	unfreeze <- true
-	// Make sure server is still responding.
-	s, err := client.Sender()
-	errorIf(t, err)
-	errorIf(t, s.Sync())
-
-	// Freeze the server till the client times out the connection
-	fatalIf(t, freeze())
-	select {
-	case <-client.Done():
-		if amqp.ResourceLimitExceeded != client.Error().(amqp.Error).Name {
-			t.Error("bad timeout error:", client.Error())
-		}
-	case <-time.After(400 * time.Millisecond):
-		t.Error("connection failed to time out")
-	}
-
-	unfreeze <- true // Unfreeze the server
-	<-server.Done()
-	if amqp.ResourceLimitExceeded != server.Error().(amqp.Error).Name {
-		t.Error("bad timeout error:", server.Error())
-	}
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/electron/endpoint.go b/proton-c/bindings/go/src/qpid.apache.org/electron/endpoint.go
deleted file mode 100644
index ca93e5b..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/electron/endpoint.go
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package electron
-
-import (
-	"fmt"
-	"io"
-	"qpid.apache.org/proton"
-)
-
-// Closed is an alias for io.EOF. It is returned as an error when an endpoint
-// was closed cleanly.
-var Closed = io.EOF
-
-// Endpoint is the local end of a communications channel to the remote peer
-// process.  The following interface implement Endpoint: Connection, Session,
-// Sender and Receiver.
-//
-// You can create an endpoint with functions on Container, Connection and
-// Session. You can accept incoming endpoints from the remote peer using
-// Connection.Incoming()
-//
-type Endpoint interface {
-	// Close an endpoint and signal an error to the remote end if error != nil.
-	Close(error)
-
-	// String is a human readable identifier, useful for debugging and logging.
-	String() string
-
-	// Error returns nil if the endpoint is open, otherwise returns an error.
-	// Error() == Closed means the endpoint was closed without error.
-	Error() error
-
-	// Connection is the connection associated with this endpoint.
-	Connection() Connection
-
-	// Done returns a channel that will close when the endpoint closes.
-	// After Done() has closed, Error() will return the reason for closing.
-	Done() <-chan struct{}
-
-	// Sync() waits for the remote peer to confirm the endpoint is active or
-	// reject it with an error. You can call it immediately on new endpoints
-	// for more predictable error handling.
-	//
-	// AMQP is an asynchronous protocol. It is legal to create an endpoint and
-	// start using it without waiting for confirmation. This avoids a needless
-	// delay in the non-error case and throughput by "assuming the best".
-	//
-	// However if there *is* an error, these "optimistic" actions will fail. The
-	// endpoint and its children will be closed with an error. The error will only
-	// be detected when you try to use one of these endpoints or call Sync()
-	Sync() error
-
-	// Called in handler goroutine when endpoint is remotely closed.
-	closed(err error) error
-	wakeSync()
-}
-
-// Base implementation for Endpoint
-type endpoint struct {
-	err    proton.ErrorHolder
-	str    string // String() return value.
-	done   chan struct{}
-	active chan struct{}
-}
-
-func (e *endpoint) init(s string) {
-	e.str = s
-	e.done = make(chan struct{})
-	e.active = make(chan struct{})
-}
-
-// Called in proton goroutine on remote open.
-func (e *endpoint) wakeSync() {
-	select { // Close active channel if not already closed.
-	case <-e.active:
-	default:
-		close(e.active)
-	}
-}
-
-// Called in proton goroutine (from handler) on a Closed or Disconnected event.
-//
-// Set err if there is not already an error on the endpoint.
-// Return Error()
-func (e *endpoint) closed(err error) error {
-	select {
-	case <-e.done:
-		// Already closed
-	default:
-		e.err.Set(err)
-		e.err.Set(Closed)
-		e.wakeSync() // Make sure we wake up Sync()
-		close(e.done)
-	}
-	return e.Error()
-}
-
-func (e *endpoint) String() string { return e.str }
-
-func (e *endpoint) Error() error { return e.err.Get() }
-
-func (e *endpoint) Done() <-chan struct{} { return e.done }
-
-func (e *endpoint) Sync() error {
-	<-e.active
-	return e.Error()
-}
-
-// Call in proton goroutine to initiate closing an endpoint locally
-// handler will complete the close when remote end closes.
-func localClose(ep proton.Endpoint, err error) {
-	if ep.State().LocalActive() {
-		proton.CloseError(ep, err)
-	}
-}
-
-// Incoming is the interface for incoming endpoints, see Connection.Incoming()
-//
-// Call Incoming.Accept() to open the endpoint or Incoming.Reject() to close it
-// with optional error
-//
-// Implementing types are *IncomingConnection, *IncomingSession, *IncomingSender
-// and *IncomingReceiver. Each type provides methods to examine the incoming
-// endpoint request and set configuration options for the local endpoint
-// before calling Accept() or Reject()
-type Incoming interface {
-	// Accept and open the endpoint.
-	Accept() Endpoint
-
-	// Reject the endpoint with an error
-	Reject(error)
-
-	// wait for and call the accept function, call in proton goroutine.
-	wait() error
-	pEndpoint() proton.Endpoint
-}
-
-type incoming struct {
-	pep      proton.Endpoint
-	acceptCh chan func() error
-}
-
-func makeIncoming(e proton.Endpoint) incoming {
-	return incoming{pep: e, acceptCh: make(chan func() error)}
-}
-
-func (in *incoming) String() string   { return fmt.Sprintf("%s: %s", in.pep.Type(), in.pep) }
-func (in *incoming) Reject(err error) { in.acceptCh <- func() error { return err } }
-
-// Call in proton goroutine, wait for and call the accept function.
-func (in *incoming) wait() error { return (<-in.acceptCh)() }
-
-func (in *incoming) pEndpoint() proton.Endpoint { return in.pep }
-
-// Called in app goroutine to send an accept function to proton and return the resulting endpoint.
-func (in *incoming) accept(f func() Endpoint) Endpoint {
-	done := make(chan Endpoint)
-	in.acceptCh <- func() error {
-		ep := f()
-		done <- ep
-		return nil
-	}
-	return <-done
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/electron/error.go b/proton-c/bindings/go/src/qpid.apache.org/electron/error.go
deleted file mode 100644
index 4dcfd94..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/electron/error.go
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package electron
-
-import (
-	"fmt"
-)
-
-// assert panics if condition is false with optional formatted message
-func assert(condition bool, format ...interface{}) {
-	if !condition {
-		if len(format) > 0 {
-			panic(fmt.Errorf(format[0].(string), format[1:]...))
-		} else {
-			panic(fmt.Errorf("assertion failed"))
-		}
-	}
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/electron/ex_client_server_test.go b/proton-c/bindings/go/src/qpid.apache.org/electron/ex_client_server_test.go
deleted file mode 100644
index 93f275b..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/electron/ex_client_server_test.go
+++ /dev/null
@@ -1,81 +0,0 @@
-package electron_test
-
-import (
-	"fmt"
-	"net"
-	"qpid.apache.org/amqp"
-	"qpid.apache.org/electron"
-)
-
-//  Print errors
-func check(msg string, err error) bool {
-	if err != nil {
-		fmt.Printf("%s: %s\n", msg, err)
-	}
-	return err == nil
-}
-
-func runServer(cont electron.Container, l net.Listener) {
-	for c, err := cont.Accept(l); check("accept connection", err); c, err = cont.Accept(l) {
-		go func() { // Process connections concurrently, accepting AMQP endpoints
-			for in := range c.Incoming() {
-				ep := in.Accept() // Accept all endpoints
-				go func() {       // Process endpoints concurrently
-					switch ep := ep.(type) {
-					case electron.Sender:
-						m := amqp.NewMessageWith("hello yourself")
-						fmt.Printf("server %q sending %q\n", ep.Source(), m.Body())
-						ep.SendForget(m) // One-way send, client does not need to Accept.
-					case electron.Receiver:
-						if rm, err := ep.Receive(); check("server receive", err) {
-							fmt.Printf("server %q received %q\n", ep.Target(), rm.Message.Body())
-							err := rm.Accept() // Client is waiting for Accept.
-							check("accept message", err)
-						}
-					}
-				}()
-			}
-		}()
-	}
-}
-
-func startServer() (addr net.Addr) {
-	cont := electron.NewContainer("server")
-	if l, err := net.Listen("tcp", ""); check("listen", err) {
-		addr = l.Addr()
-		go runServer(cont, l)
-	}
-	return addr
-}
-
-// Connect to addr and send/receive a message.
-func client(addr net.Addr) {
-	if c, err := electron.Dial(addr.Network(), addr.String()); check("dial", err) {
-		defer c.Close(nil)
-		if s, err := c.Sender(electron.Target("target")); check("sender", err) {
-			fmt.Printf("client sending\n")
-			s.SendSync(amqp.NewMessageWith("hello")) // Send and wait for server to Accept()
-		}
-		if r, err := c.Receiver(electron.Source("source")); check("receiver", err) {
-			if rm, err := r.Receive(); err == nil {
-				fmt.Printf("client received %q\n", rm.Message.Body())
-			}
-		}
-	}
-}
-
-// Example client and server communicating via AMQP over a TCP/IP connection.
-//
-// Normally client and server would be separate processes.
-// For more realistic examples:
-//     https://github.com/apache/qpid-proton/blob/master/examples/go/README.md
-//
-func Example_clientServer() {
-	addr := startServer()
-	client(addr)
-	// Output:
-	// client sending
-	// server "target" received "hello"
-	// server "source" sending "hello yourself"
-	// client received "hello yourself"
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/electron/handler.go b/proton-c/bindings/go/src/qpid.apache.org/electron/handler.go
deleted file mode 100644
index af1efd6..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/electron/handler.go
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package electron
-
-import (
-	"qpid.apache.org/amqp"
-	"qpid.apache.org/proton"
-)
-
-// NOTE: methods in this file are called only in the proton goroutine unless otherwise indicated.
-
-type handler struct {
-	delegator    *proton.MessagingAdapter
-	connection   *connection
-	links        map[proton.Link]Endpoint
-	sentMessages map[proton.Delivery]sentMessage
-	sessions     map[proton.Session]*session
-}
-
-func newHandler(c *connection) *handler {
-	h := &handler{
-		connection:   c,
-		links:        make(map[proton.Link]Endpoint),
-		sentMessages: make(map[proton.Delivery]sentMessage),
-		sessions:     make(map[proton.Session]*session),
-	}
-	h.delegator = proton.NewMessagingAdapter(h)
-	// Disable auto features of MessagingAdapter, we do these ourselves.
-	h.delegator.Prefetch = 0
-	h.delegator.AutoAccept = false
-	h.delegator.AutoSettle = false
-	h.delegator.AutoOpen = false
-	return h
-}
-
-func (h *handler) linkError(l proton.Link, msg string) {
-	proton.CloseError(l, amqp.Errorf(amqp.InternalError, "%s for %s %s", msg, l.Type(), l))
-}
-
-func (h *handler) HandleMessagingEvent(t proton.MessagingEvent, e proton.Event) {
-	switch t {
-
-	case proton.MMessage:
-		if r, ok := h.links[e.Link()].(*receiver); ok {
-			r.message(e.Delivery())
-		} else {
-			h.linkError(e.Link(), "no receiver")
-		}
-
-	case proton.MSettled:
-		if sm, ok := h.sentMessages[e.Delivery()]; ok {
-			d := e.Delivery().Remote()
-			sm.ack <- Outcome{sentStatus(d.Type()), d.Condition().Error(), sm.value}
-			delete(h.sentMessages, e.Delivery())
-		}
-
-	case proton.MSendable:
-		if s, ok := h.links[e.Link()].(*sender); ok {
-			s.sendable()
-		} else {
-			h.linkError(e.Link(), "no sender")
-		}
-
-	case proton.MConnectionOpening:
-		h.connection.heartbeat = e.Transport().RemoteIdleTimeout()
-		if e.Connection().State().LocalUninit() { // Remotely opened
-			h.incoming(newIncomingConnection(h.connection))
-		}
-		h.connection.wakeSync()
-
-	case proton.MSessionOpening:
-		if e.Session().State().LocalUninit() { // Remotely opened
-			h.incoming(newIncomingSession(h, e.Session()))
-		}
-		h.sessions[e.Session()].wakeSync()
-
-	case proton.MSessionClosed:
-		h.sessionClosed(e.Session(), proton.EndpointError(e.Session()))
-
-	case proton.MLinkOpening:
-		l := e.Link()
-		if ss := h.sessions[l.Session()]; ss != nil {
-			if l.State().LocalUninit() { // Remotely opened.
-				if l.IsReceiver() {
-					h.incoming(newIncomingReceiver(ss, l))
-				} else {
-					h.incoming(newIncomingSender(ss, l))
-				}
-			}
-			if ep, ok := h.links[l]; ok {
-				ep.wakeSync()
-			} else {
-				h.linkError(l, "no link")
-			}
-		} else {
-			h.linkError(l, "no session")
-		}
-
-	case proton.MLinkClosing:
-		e.Link().Close()
-
-	case proton.MLinkClosed:
-		h.linkClosed(e.Link(), proton.EndpointError(e.Link()))
-
-	case proton.MConnectionClosing:
-		h.connection.err.Set(e.Connection().RemoteCondition().Error())
-
-	case proton.MConnectionClosed:
-		h.shutdown(proton.EndpointError(e.Connection()))
-
-	case proton.MDisconnected:
-		err := e.Transport().Condition().Error()
-		if err == nil {
-			err = amqp.Errorf(amqp.IllegalState, "unexpected disconnect on %s", h.connection)
-		}
-		h.shutdown(err)
-	}
-}
-
-func (h *handler) incoming(in Incoming) {
-	var err error
-	if h.connection.incoming != nil {
-		h.connection.incoming <- in
-		// Must block until accept/reject, subsequent events may use the incoming endpoint.
-		err = in.wait()
-	} else {
-		err = amqp.Errorf(amqp.NotAllowed, "rejected incoming %s %s",
-			in.pEndpoint().Type(), in.pEndpoint().String())
-	}
-	if err == nil {
-		in.pEndpoint().Open()
-	} else {
-		proton.CloseError(in.pEndpoint(), err)
-	}
-}
-
-func (h *handler) addLink(pl proton.Link, el Endpoint) {
-	h.links[pl] = el
-}
-
-func (h *handler) linkClosed(l proton.Link, err error) {
-	if link, ok := h.links[l]; ok {
-		_ = link.closed(err)
-		delete(h.links, l)
-		l.Free()
-	}
-}
-
-func (h *handler) sessionClosed(ps proton.Session, err error) {
-	if s, ok := h.sessions[ps]; ok {
-		delete(h.sessions, ps)
-		err = s.closed(err)
-		for l, _ := range h.links {
-			if l.Session() == ps {
-				h.linkClosed(l, err)
-			}
-		}
-		ps.Free()
-	}
-}
-
-func (h *handler) shutdown(err error) {
-	err = h.connection.closed(err)
-	for _, sm := range h.sentMessages {
-		// Don't block but ensure outcome is sent eventually.
-		if sm.ack != nil {
-			o := Outcome{Unacknowledged, err, sm.value}
-			select {
-			case sm.ack <- o:
-			default:
-				go func(ack chan<- Outcome) { ack <- o }(sm.ack) // Deliver it eventually
-			}
-		}
-	}
-	h.sentMessages = nil
-	for _, l := range h.links {
-		_ = l.closed(err)
-	}
-	h.links = nil
-	for _, s := range h.sessions {
-		_ = s.closed(err)
-	}
-	h.sessions = nil
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/electron/link.go b/proton-c/bindings/go/src/qpid.apache.org/electron/link.go
deleted file mode 100644
index 1d17894..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/electron/link.go
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package electron
-
-import (
-	"fmt"
-	"qpid.apache.org/proton"
-)
-
-// Settings associated with a link
-type LinkSettings interface {
-	// Source address that messages are coming from.
-	Source() string
-
-	// Target address that messages are going to.
-	Target() string
-
-	// Name is a unique name for the link among links between the same
-	// containers in the same direction. By default generated automatically.
-	LinkName() string
-
-	// IsSender is true if this is the sending end of the link.
-	IsSender() bool
-
-	// IsReceiver is true if this is the receiving end of the link.
-	IsReceiver() bool
-
-	// SndSettle defines when the sending end of the link settles message delivery.
-	SndSettle() SndSettleMode
-
-	// RcvSettle defines when the sending end of the link settles message delivery.
-	RcvSettle() RcvSettleMode
-
-	// Session containing the Link
-	Session() Session
-}
-
-// LinkOption can be passed when creating a sender or receiver link to set optional configuration.
-type LinkOption func(*linkSettings)
-
-// Source returns a LinkOption that sets address that messages are coming from.
-func Source(s string) LinkOption { return func(l *linkSettings) { l.source = s } }
-
-// Target returns a LinkOption that sets address that messages are going to.
-func Target(s string) LinkOption { return func(l *linkSettings) { l.target = s } }
-
-// LinkName returns a LinkOption that sets the link name.
-func LinkName(s string) LinkOption { return func(l *linkSettings) { l.target = s } }
-
-// SndSettle returns a LinkOption that sets the send settle mode
-func SndSettle(m SndSettleMode) LinkOption { return func(l *linkSettings) { l.sndSettle = m } }
-
-// RcvSettle returns a LinkOption that sets the send settle mode
-func RcvSettle(m RcvSettleMode) LinkOption { return func(l *linkSettings) { l.rcvSettle = m } }
-
-// SndSettleMode returns a LinkOption that defines when the sending end of the
-// link settles message delivery.
-type SndSettleMode proton.SndSettleMode
-
-// Capacity returns a LinkOption that sets the link capacity
-func Capacity(n int) LinkOption { return func(l *linkSettings) { l.capacity = n } }
-
-// Prefetch returns a LinkOption that sets a receivers pre-fetch flag. Not relevant for a sender.
-func Prefetch(p bool) LinkOption { return func(l *linkSettings) { l.prefetch = p } }
-
-// AtMostOnce returns a LinkOption that sets "fire and forget" mode, messages
-// are sent but no acknowledgment is received, messages can be lost if there is
-// a network failure. Sets SndSettleMode=SendSettled and RcvSettleMode=RcvFirst
-func AtMostOnce() LinkOption {
-	return func(l *linkSettings) {
-		SndSettle(SndSettled)(l)
-		RcvSettle(RcvFirst)(l)
-	}
-}
-
-// AtLeastOnce returns a LinkOption that requests acknowledgment for every
-// message, acknowledgment indicates the message was definitely received. In the
-// event of a failure, unacknowledged messages can be re-sent but there is a
-// chance that the message will be received twice in this case.  Sets
-// SndSettleMode=SndUnsettled and RcvSettleMode=RcvFirst
-func AtLeastOnce() LinkOption {
-	return func(l *linkSettings) {
-		SndSettle(SndUnsettled)(l)
-		RcvSettle(RcvFirst)(l)
-	}
-}
-
-const (
-	// Messages are sent unsettled
-	SndUnsettled = SndSettleMode(proton.SndUnsettled)
-	// Messages are sent already settled
-	SndSettled = SndSettleMode(proton.SndSettled)
-	// Sender can send either unsettled or settled messages.
-	SendMixed = SndSettleMode(proton.SndMixed)
-)
-
-// RcvSettleMode defines when the receiving end of the link settles message delivery.
-type RcvSettleMode proton.RcvSettleMode
-
-const (
-	// Receiver settles first.
-	RcvFirst = RcvSettleMode(proton.RcvFirst)
-	// Receiver waits for sender to settle before settling.
-	RcvSecond = RcvSettleMode(proton.RcvSecond)
-)
-
-type linkSettings struct {
-	source    string
-	target    string
-	linkName  string
-	isSender  bool
-	sndSettle SndSettleMode
-	rcvSettle RcvSettleMode
-	capacity  int
-	prefetch  bool
-	session   *session
-	pLink     proton.Link
-}
-
-type link struct {
-	endpoint
-	linkSettings
-}
-
-func (l *linkSettings) Source() string           { return l.source }
-func (l *linkSettings) Target() string           { return l.target }
-func (l *linkSettings) LinkName() string         { return l.linkName }
-func (l *linkSettings) IsSender() bool           { return l.isSender }
-func (l *linkSettings) IsReceiver() bool         { return !l.isSender }
-func (l *linkSettings) SndSettle() SndSettleMode { return l.sndSettle }
-func (l *linkSettings) RcvSettle() RcvSettleMode { return l.rcvSettle }
-
-func (l *link) Session() Session       { return l.session }
-func (l *link) Connection() Connection { return l.session.Connection() }
-func (l *link) engine() *proton.Engine { return l.session.connection.engine }
-func (l *link) handler() *handler      { return l.session.connection.handler }
-
-// Open a link and return the linkSettings.
-func makeLocalLink(sn *session, isSender bool, setting ...LinkOption) (linkSettings, error) {
-	l := linkSettings{
-		isSender: isSender,
-		capacity: 1,
-		prefetch: false,
-		session:  sn,
-	}
-	for _, set := range setting {
-		set(&l)
-	}
-	if l.linkName == "" {
-		l.linkName = l.session.connection.container.nextLinkName()
-	}
-	if l.IsSender() {
-		l.pLink = l.session.pSession.Sender(l.linkName)
-	} else {
-		l.pLink = l.session.pSession.Receiver(l.linkName)
-	}
-	if l.pLink.IsNil() {
-		return l, fmt.Errorf("cannot create link %s", l.pLink)
-	}
-	l.pLink.Source().SetAddress(l.source)
-	l.pLink.Target().SetAddress(l.target)
-	l.pLink.SetSndSettleMode(proton.SndSettleMode(l.sndSettle))
-	l.pLink.SetRcvSettleMode(proton.RcvSettleMode(l.rcvSettle))
-	l.pLink.Open()
-	return l, nil
-}
-
-func makeIncomingLinkSettings(pLink proton.Link, sn *session) linkSettings {
-	return linkSettings{
-		isSender:  pLink.IsSender(),
-		source:    pLink.RemoteSource().Address(),
-		target:    pLink.RemoteTarget().Address(),
-		linkName:  pLink.Name(),
-		sndSettle: SndSettleMode(pLink.RemoteSndSettleMode()),
-		rcvSettle: RcvSettleMode(pLink.RemoteRcvSettleMode()),
-		capacity:  1,
-		prefetch:  false,
-		pLink:     pLink,
-		session:   sn,
-	}
-}
-
-// Not part of Link interface but use by Sender and Receiver.
-func (l *link) Credit() (credit int, err error) {
-	err = l.engine().InjectWait(func() error {
-		if l.Error() != nil {
-			return l.Error()
-		}
-		credit = l.pLink.Credit()
-		return nil
-	})
-	return
-}
-
-// Not part of Link interface but use by Sender and Receiver.
-func (l *link) Capacity() int { return l.capacity }
-
-func (l *link) Close(err error) {
-	_ = l.engine().Inject(func() {
-		if l.Error() == nil {
-			localClose(l.pLink, err)
-		}
-	})
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/electron/receiver.go b/proton-c/bindings/go/src/qpid.apache.org/electron/receiver.go
deleted file mode 100644
index 781fd7c..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/electron/receiver.go
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package electron
-
-import (
-	"fmt"
-	"qpid.apache.org/amqp"
-	"qpid.apache.org/proton"
-	"time"
-)
-
-// Receiver is a Link that receives messages.
-//
-type Receiver interface {
-	Endpoint
-	LinkSettings
-
-	// Receive blocks until a message is available or until the Receiver is closed
-	// and has no more buffered messages.
-	Receive() (ReceivedMessage, error)
-
-	// ReceiveTimeout is like Receive but gives up after timeout, see Timeout.
-	//
-	// Note that that if Prefetch is false, after a Timeout the credit issued by
-	// Receive remains on the link. It will be used by the next call to Receive.
-	ReceiveTimeout(timeout time.Duration) (ReceivedMessage, error)
-
-	// Prefetch==true means the Receiver will automatically issue credit to the
-	// remote sender to keep its buffer as full as possible, i.e. it will
-	// "pre-fetch" messages independently of the application calling
-	// Receive(). This gives good throughput for applications that handle a
-	// continuous stream of messages. Larger capacity may improve throughput, the
-	// optimal value depends on the characteristics of your application.
-	//
-	// Prefetch==false means the Receiver will issue only issue credit when you
-	// call Receive(), and will only issue enough credit to satisfy the calls
-	// actually made. This gives lower throughput but will not fetch any messages
-	// in advance. It is good for synchronous applications that need to evaluate
-	// each message before deciding whether to receive another. The
-	// request-response pattern is a typical example.  If you make concurrent
-	// calls to Receive with pre-fetch disabled, you can improve performance by
-	// setting the capacity close to the expected number of concurrent calls.
-	//
-	Prefetch() bool
-
-	// Capacity is the size (number of messages) of the local message buffer
-	// These are messages received but not yet returned to the application by a call to Receive()
-	Capacity() int
-}
-
-// Receiver implementation
-type receiver struct {
-	link
-	buffer  chan ReceivedMessage
-	callers int
-}
-
-func (r *receiver) Capacity() int  { return cap(r.buffer) }
-func (r *receiver) Prefetch() bool { return r.prefetch }
-
-// Call in proton goroutine
-func newReceiver(ls linkSettings) *receiver {
-	r := &receiver{link: link{linkSettings: ls}}
-	r.endpoint.init(r.link.pLink.String())
-	if r.capacity < 1 {
-		r.capacity = 1
-	}
-	r.buffer = make(chan ReceivedMessage, r.capacity)
-	r.handler().addLink(r.pLink, r)
-	r.link.pLink.Open()
-	if r.prefetch {
-		r.flow(r.maxFlow())
-	}
-	return r
-}
-
-// Call in proton gorotine. Max additional credit we can request.
-func (r *receiver) maxFlow() int { return cap(r.buffer) - len(r.buffer) - r.pLink.Credit() }
-
-func (r *receiver) flow(credit int) {
-	if credit > 0 {
-		r.pLink.Flow(credit)
-	}
-}
-
-// Inject flow check per-caller call when prefetch is off.
-// Called with inc=1 at start of call, inc = -1 at end
-func (r *receiver) caller(inc int) {
-	_ = r.engine().Inject(func() {
-		r.callers += inc
-		need := r.callers - (len(r.buffer) + r.pLink.Credit())
-		max := r.maxFlow()
-		if need > max {
-			need = max
-		}
-		r.flow(need)
-	})
-}
-
-// Inject flow top-up if prefetch is enabled
-func (r *receiver) flowTopUp() {
-	if r.prefetch {
-		_ = r.engine().Inject(func() { r.flow(r.maxFlow()) })
-	}
-}
-
-func (r *receiver) Receive() (rm ReceivedMessage, err error) {
-	return r.ReceiveTimeout(Forever)
-}
-
-func (r *receiver) ReceiveTimeout(timeout time.Duration) (rm ReceivedMessage, err error) {
-	assert(r.buffer != nil, "Receiver is not open: %s", r)
-	if !r.prefetch { // Per-caller flow control
-		select { // Check for immediate availability, avoid caller() inject
-		case rm2, ok := <-r.buffer:
-			if ok {
-				rm = rm2
-			} else {
-				err = r.Error()
-			}
-			return
-		default: // Not immediately available, inject caller() counts
-			r.caller(+1)
-			defer r.caller(-1)
-		}
-	}
-	rmi, err := timedReceive(r.buffer, timeout)
-	switch err {
-	case nil:
-		r.flowTopUp()
-		rm = rmi.(ReceivedMessage)
-	case Closed:
-		err = r.Error()
-	}
-	return
-}
-
-// Called in proton goroutine on MMessage event.
-func (r *receiver) message(delivery proton.Delivery) {
-	if r.pLink.State().RemoteClosed() {
-		localClose(r.pLink, r.pLink.RemoteCondition().Error())
-		return
-	}
-	if delivery.HasMessage() {
-		m, err := delivery.Message()
-		if err != nil {
-			localClose(r.pLink, err)
-			return
-		}
-		assert(m != nil)
-		r.pLink.Advance()
-		if r.pLink.Credit() < 0 {
-			localClose(r.pLink, fmt.Errorf("received message in excess of credit limit"))
-		} else {
-			// We never issue more credit than cap(buffer) so this will not block.
-			r.buffer <- ReceivedMessage{m, delivery, r}
-		}
-	}
-}
-
-func (r *receiver) closed(err error) error {
-	e := r.link.closed(err)
-	if r.buffer != nil {
-		close(r.buffer)
-	}
-	return e
-}
-
-// ReceivedMessage contains an amqp.Message and allows the message to be acknowledged.
-type ReceivedMessage struct {
-	// Message is the received message.
-	Message amqp.Message
-
-	pDelivery proton.Delivery
-	receiver  Receiver
-}
-
-// Acknowledge a ReceivedMessage with the given delivery status.
-func (rm *ReceivedMessage) acknowledge(status uint64) error {
-	return rm.receiver.(*receiver).engine().Inject(func() {
-		// Deliveries are valid as long as the connection is, unless settled.
-		rm.pDelivery.SettleAs(uint64(status))
-	})
-}
-
-// Accept tells the sender that we take responsibility for processing the message.
-func (rm *ReceivedMessage) Accept() error { return rm.acknowledge(proton.Accepted) }
-
-// Reject tells the sender we consider the message invalid and unusable.
-func (rm *ReceivedMessage) Reject() error { return rm.acknowledge(proton.Rejected) }
-
-// Release tells the sender we will not process the message but some other
-// receiver might.
-func (rm *ReceivedMessage) Release() error { return rm.acknowledge(proton.Released) }
-
-// IncomingReceiver is sent on the Connection.Incoming() channel when there is
-// an incoming request to open a receiver link.
-type IncomingReceiver struct {
-	incoming
-	linkSettings
-}
-
-func newIncomingReceiver(sn *session, pLink proton.Link) *IncomingReceiver {
-	return &IncomingReceiver{
-		incoming:     makeIncoming(pLink),
-		linkSettings: makeIncomingLinkSettings(pLink, sn),
-	}
-}
-
-// SetCapacity sets the capacity of the incoming receiver, call before Accept()
-func (in *IncomingReceiver) SetCapacity(capacity int) { in.capacity = capacity }
-
-// SetPrefetch sets the pre-fetch mode of the incoming receiver, call before Accept()
-func (in *IncomingReceiver) SetPrefetch(prefetch bool) { in.prefetch = prefetch }
-
-// Accept accepts an incoming receiver endpoint
-func (in *IncomingReceiver) Accept() Endpoint {
-	return in.accept(func() Endpoint { return newReceiver(in.linkSettings) })
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/electron/sender.go b/proton-c/bindings/go/src/qpid.apache.org/electron/sender.go
deleted file mode 100644
index f46fdc4..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/electron/sender.go
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package electron
-
-// #include <proton/disposition.h>
-import "C"
-
-import (
-	"fmt"
-	"qpid.apache.org/amqp"
-	"qpid.apache.org/proton"
-	"time"
-)
-
-// Sender is a Link that sends messages.
-//
-// The result of sending a message is provided by an Outcome value.
-//
-// A sender can buffer messages up to the credit limit provided by the remote receiver.
-// All the Send* methods will block if the buffer is full until there is space.
-// Send*Timeout methods will give up after the timeout and set Timeout as Outcome.Error.
-//
-type Sender interface {
-	Endpoint
-	LinkSettings
-
-	// SendSync sends a message and blocks until the message is acknowledged by the remote receiver.
-	// Returns an Outcome, which may contain an error if the message could not be sent.
-	SendSync(m amqp.Message) Outcome
-
-	// SendWaitable puts a message in the send buffer and returns a channel that
-	// you can use to wait for the Outcome of just that message. The channel is
-	// buffered so you can receive from it whenever you want without blocking.
-	//
-	// Note: can block if there is no space to buffer the message.
-	SendWaitable(m amqp.Message) <-chan Outcome
-
-	// SendForget buffers a message for sending and returns, with no notification of the outcome.
-	//
-	// Note: can block if there is no space to buffer the message.
-	SendForget(m amqp.Message)
-
-	// SendAsync puts a message in the send buffer and returns immediately.  An
-	// Outcome with Value = value will be sent to the ack channel when the remote
-	// receiver has acknowledged the message or if there is an error.
-	//
-	// You can use the same ack channel for many calls to SendAsync(), possibly on
-	// many Senders. The channel will receive the outcomes in the order they
-	// become available. The channel should be buffered and/or served by dedicated
-	// goroutines to avoid blocking the connection.
-	//
-	// If ack == nil no Outcome is sent.
-	//
-	// Note: can block if there is no space to buffer the message.
-	SendAsync(m amqp.Message, ack chan<- Outcome, value interface{})
-
-	SendAsyncTimeout(m amqp.Message, ack chan<- Outcome, value interface{}, timeout time.Duration)
-
-	SendWaitableTimeout(m amqp.Message, timeout time.Duration) <-chan Outcome
-
-	SendForgetTimeout(m amqp.Message, timeout time.Duration)
-
-	SendSyncTimeout(m amqp.Message, timeout time.Duration) Outcome
-}
-
-// Outcome provides information about the outcome of sending a message.
-type Outcome struct {
-	// Status of the message: was it sent, how was it acknowledged.
-	Status SentStatus
-	// Error is a local error if Status is Unsent or Unacknowledged, a remote error otherwise.
-	Error error
-	// Value provided by the application in SendAsync()
-	Value interface{}
-}
-
-func (o Outcome) send(ack chan<- Outcome) {
-	if ack != nil {
-		ack <- o
-	}
-}
-
-// SentStatus indicates the status of a sent message.
-type SentStatus int
-
-const (
-	// Message was never sent
-	Unsent SentStatus = iota
-	// Message was sent but never acknowledged. It may or may not have been received.
-	Unacknowledged
-	// Message was accepted by the receiver (or was sent pre-settled, accept is assumed)
-	Accepted
-	// Message was rejected as invalid by the receiver
-	Rejected
-	// Message was not processed by the receiver but may be valid for a different receiver
-	Released
-	// Receiver responded with an unrecognized status.
-	Unknown
-)
-
-// String human readable name for SentStatus.
-func (s SentStatus) String() string {
-	switch s {
-	case Unsent:
-		return "unsent"
-	case Unacknowledged:
-		return "unacknowledged"
-	case Accepted:
-		return "accepted"
-	case Rejected:
-		return "rejected"
-	case Released:
-		return "released"
-	case Unknown:
-		return "unknown"
-	default:
-		return fmt.Sprintf("invalid(%d)", s)
-	}
-}
-
-// Convert proton delivery state code to SentStatus value
-func sentStatus(d uint64) SentStatus {
-	switch d {
-	case proton.Accepted:
-		return Accepted
-	case proton.Rejected:
-		return Rejected
-	case proton.Released, proton.Modified:
-		return Released
-	default:
-		return Unknown
-	}
-}
-
-// Sender implementation, held by handler.
-type sender struct {
-	link
-	credit chan struct{} // Signal available credit.
-}
-
-func (s *sender) SendAsyncTimeout(m amqp.Message, ack chan<- Outcome, v interface{}, t time.Duration) {
-	// wait for credit
-	if _, err := timedReceive(s.credit, t); err != nil {
-		if err == Closed && s.Error() != nil {
-			err = s.Error()
-		}
-		Outcome{Unsent, err, v}.send(ack)
-		return
-	}
-	// Send a message in handler goroutine
-	err := s.engine().Inject(func() {
-		if s.Error() != nil {
-			Outcome{Unsent, s.Error(), v}.send(ack)
-			return
-		}
-
-		delivery, err2 := s.pLink.Send(m)
-		switch {
-		case err2 != nil:
-			Outcome{Unsent, err2, v}.send(ack)
-		case ack == nil || s.SndSettle() == SndSettled: // Pre-settled
-			if s.SndSettle() != SndUnsettled { // Not forced to send unsettled by link policy
-				delivery.Settle()
-			}
-			Outcome{Accepted, nil, v}.send(ack) // Assume accepted
-		default:
-			s.handler().sentMessages[delivery] = sentMessage{ack, v} // Register with handler
-		}
-		if s.pLink.Credit() > 0 { // Signal there is still credit
-			s.sendable()
-		}
-	})
-	if err != nil {
-		Outcome{Unsent, err, v}.send(ack)
-	}
-}
-
-// Set credit flag if not already set. Non-blocking, any goroutine
-func (s *sender) sendable() {
-	select { // Non-blocking
-	case s.credit <- struct{}{}:
-	default:
-	}
-}
-
-func (s *sender) SendWaitableTimeout(m amqp.Message, t time.Duration) <-chan Outcome {
-	out := make(chan Outcome, 1)
-	s.SendAsyncTimeout(m, out, nil, t)
-	return out
-}
-
-func (s *sender) SendForgetTimeout(m amqp.Message, t time.Duration) {
-	s.SendAsyncTimeout(m, nil, nil, t)
-}
-
-func (s *sender) SendSyncTimeout(m amqp.Message, t time.Duration) Outcome {
-	deadline := time.Now().Add(t)
-	ack := s.SendWaitableTimeout(m, t)
-	t = deadline.Sub(time.Now()) // Adjust for time already spent.
-	if t < 0 {
-		t = 0
-	}
-	if out, err := timedReceive(ack, t); err == nil {
-		return out.(Outcome)
-	} else {
-		if err == Closed && s.Error() != nil {
-			err = s.Error()
-		}
-		return Outcome{Unacknowledged, err, nil}
-	}
-}
-
-func (s *sender) SendAsync(m amqp.Message, ack chan<- Outcome, v interface{}) {
-	s.SendAsyncTimeout(m, ack, v, Forever)
-}
-
-func (s *sender) SendWaitable(m amqp.Message) <-chan Outcome {
-	return s.SendWaitableTimeout(m, Forever)
-}
-
-func (s *sender) SendForget(m amqp.Message) {
-	s.SendForgetTimeout(m, Forever)
-}
-
-func (s *sender) SendSync(m amqp.Message) Outcome {
-	return <-s.SendWaitable(m)
-}
-
-// handler goroutine
-func (s *sender) closed(err error) error {
-	close(s.credit)
-	return s.link.closed(err)
-}
-
-func newSender(ls linkSettings) *sender {
-	s := &sender{link: link{linkSettings: ls}, credit: make(chan struct{}, 1)}
-	s.endpoint.init(s.link.pLink.String())
-	s.handler().addLink(s.pLink, s)
-	s.link.pLink.Open()
-	return s
-}
-
-// sentMessage records a sent message on the handler.
-type sentMessage struct {
-	ack   chan<- Outcome
-	value interface{}
-}
-
-// IncomingSender is sent on the Connection.Incoming() channel when there is
-// an incoming request to open a sender link.
-type IncomingSender struct {
-	incoming
-	linkSettings
-}
-
-func newIncomingSender(sn *session, pLink proton.Link) *IncomingSender {
-	return &IncomingSender{
-		incoming:     makeIncoming(pLink),
-		linkSettings: makeIncomingLinkSettings(pLink, sn),
-	}
-}
-
-// Accept accepts an incoming sender endpoint
-func (in *IncomingSender) Accept() Endpoint {
-	return in.accept(func() Endpoint { return newSender(in.linkSettings) })
-}
-
-// Call in injected functions to check if the sender is valid.
-func (s *sender) valid() bool {
-	s2, ok := s.handler().links[s.pLink].(*sender)
-	return ok && s2 == s
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/electron/session.go b/proton-c/bindings/go/src/qpid.apache.org/electron/session.go
deleted file mode 100644
index 6dae354..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/electron/session.go
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package electron
-
-import (
-	"qpid.apache.org/proton"
-)
-
-// Session is an AMQP session, it contains Senders and Receivers.
-type Session interface {
-	Endpoint
-
-	// Sender opens a new sender.
-	Sender(...LinkOption) (Sender, error)
-
-	// Receiver opens a new Receiver.
-	Receiver(...LinkOption) (Receiver, error)
-}
-
-type session struct {
-	endpoint
-	pSession                         proton.Session
-	connection                       *connection
-	incomingCapacity, outgoingWindow uint
-}
-
-// SessionOption can be passed when creating a Session
-type SessionOption func(*session)
-
-// IncomingCapacity returns a Session Option that sets the size (in bytes) of
-// the session's incoming data buffer.
-func IncomingCapacity(bytes uint) SessionOption {
-	return func(s *session) { s.incomingCapacity = bytes }
-}
-
-// OutgoingWindow returns a Session Option that sets the outgoing window size (in frames).
-func OutgoingWindow(frames uint) SessionOption {
-	return func(s *session) { s.outgoingWindow = frames }
-}
-
-// in proton goroutine
-func newSession(c *connection, es proton.Session, setting ...SessionOption) *session {
-	s := &session{
-		connection: c,
-		pSession:   es,
-	}
-	s.endpoint.init(es.String())
-	for _, set := range setting {
-		set(s)
-	}
-	c.handler.sessions[s.pSession] = s
-	s.pSession.SetIncomingCapacity(s.incomingCapacity)
-	s.pSession.SetOutgoingWindow(s.outgoingWindow)
-	s.pSession.Open()
-	return s
-}
-
-func (s *session) Connection() Connection     { return s.connection }
-func (s *session) pEndpoint() proton.Endpoint { return s.pSession }
-func (s *session) engine() *proton.Engine     { return s.connection.engine }
-
-func (s *session) Close(err error) {
-	_ = s.engine().Inject(func() {
-		if s.Error() == nil {
-			localClose(s.pSession, err)
-		}
-	})
-}
-
-func (s *session) Sender(setting ...LinkOption) (snd Sender, err error) {
-	err = s.engine().InjectWait(func() error {
-		if s.Error() != nil {
-			return s.Error()
-		}
-		l, err := makeLocalLink(s, true, setting...)
-		if err == nil {
-			snd = newSender(l)
-		}
-		return err
-	})
-	return
-}
-
-func (s *session) Receiver(setting ...LinkOption) (rcv Receiver, err error) {
-	err = s.engine().InjectWait(func() error {
-		if s.Error() != nil {
-			return s.Error()
-		}
-		l, err := makeLocalLink(s, false, setting...)
-		if err == nil {
-			rcv = newReceiver(l)
-		}
-		return err
-	})
-	return
-}
-
-// IncomingSender is sent on the Connection.Incoming() channel when there is an
-// incoming request to open a session.
-type IncomingSession struct {
-	incoming
-	h                                *handler
-	pSession                         proton.Session
-	incomingCapacity, outgoingWindow uint
-}
-
-func newIncomingSession(h *handler, ps proton.Session) *IncomingSession {
-	return &IncomingSession{incoming: makeIncoming(ps), h: h, pSession: ps}
-}
-
-// SetIncomingCapacity sets the session buffer capacity of an incoming session in bytes.
-func (in *IncomingSession) SetIncomingCapacity(bytes uint) { in.incomingCapacity = bytes }
-
-// SetOutgoingWindow sets the session outgoing window of an incoming session in frames.
-func (in *IncomingSession) SetOutgoingWindow(frames uint) { in.outgoingWindow = frames }
-
-// Accept an incoming session endpoint.
-func (in *IncomingSession) Accept() Endpoint {
-	return in.accept(func() Endpoint {
-		return newSession(in.h.connection, in.pSession, IncomingCapacity(in.incomingCapacity), OutgoingWindow(in.outgoingWindow))
-	})
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/electron/time.go b/proton-c/bindings/go/src/qpid.apache.org/electron/time.go
deleted file mode 100644
index 51bfbc5..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/electron/time.go
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package electron
-
-import (
-	"fmt"
-	"math"
-	"reflect"
-	"time"
-)
-
-// Timeout is the error returned if an operation does not complete on time.
-//
-// Methods named *Timeout in this package take time.Duration timeout parameter.
-//
-// If timeout > 0 and there is no result available before the timeout, they
-// return a zero or nil value and Timeout as an error.
-//
-// If timeout == 0 they will return a result if one is immediatley available or
-// nil/zero and Timeout as an error if not.
-//
-// If timeout == Forever the function will return only when there is a result or
-// some non-timeout error occurs.
-//
-var Timeout = fmt.Errorf("timeout")
-
-// Forever can be used as a timeout parameter to indicate wait forever.
-const Forever time.Duration = math.MaxInt64
-
-// timedReceive receives on channel (which can be a chan of any type), waiting
-// up to timeout.
-//
-// timeout==0 means do a non-blocking receive attempt. timeout < 0 means block
-// forever. Other values mean block up to the timeout.
-//
-// Returns error Timeout on timeout, Closed on channel close.
-func timedReceive(channel interface{}, timeout time.Duration) (interface{}, error) {
-	cases := []reflect.SelectCase{
-		reflect.SelectCase{Dir: reflect.SelectRecv, Chan: reflect.ValueOf(channel)},
-	}
-	if timeout == 0 { // Non-blocking
-		cases = append(cases, reflect.SelectCase{Dir: reflect.SelectDefault})
-	} else { // Block up to timeout
-		cases = append(cases,
-			reflect.SelectCase{Dir: reflect.SelectRecv, Chan: reflect.ValueOf(After(timeout))})
-	}
-	chosen, value, ok := reflect.Select(cases)
-	switch {
-	case chosen == 0 && ok:
-		return value.Interface(), nil
-	case chosen == 0 && !ok:
-		return nil, Closed
-	default:
-		return nil, Timeout
-	}
-}
-
-// After is like time.After but returns a nil channel if timeout == Forever
-// since selecting on a nil channel will never return.
-func After(timeout time.Duration) <-chan time.Time {
-	if timeout == Forever {
-		return nil
-	} else {
-		return time.After(timeout)
-	}
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/doc.go b/proton-c/bindings/go/src/qpid.apache.org/proton/doc.go
deleted file mode 100644
index 083f701..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/doc.go
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-/*
-Package proton wraps Proton-C, an event-driven, concurrent-unsafe AMQP 1.0
-C library (package 'electron' is more "Go-like" and concurrent-safe)
-
-Consult the C API documentation at http://qpid.apache.org/proton for more
-information about the types here. There is a 1-1 correspondence between C type
-pn_foo_t and Go type proton.Foo, and between C function
-
-    pn_foo_do_something(pn_foo_t*, ...)
-
-and Go method
-
-    func (proton.Foo) DoSomething(...)
-
-The proton.Engine type pumps data between a Go net.Conn and a proton event loop
-goroutine that feeds events to a proton.MessagingHandler, which you must implement.
-See the Engine documentation for more.
-
-MessagingHandler defines an event handling interface that you can implement to
-react to AMQP protocol events. There is also a lower-level EventHandler, but
-MessagingHandler provides a simpler set of events and automates common tasks for you,
-for most applications it will be more convenient.
-
-NOTE: Methods on most types defined in this package (Sessions, Links etc.)  can
-*only* be called in the event handler goroutine of the relevant
-Connection/Engine, either by the HandleEvent method of a handler type or in a
-function injected into the goroutine via Inject() or InjectWait() Handlers and
-injected functions can set up channels to communicate with other goroutines.
-Note the Injecter associated with a handler available as part of the Event value
-passed to HandleEvent.
-
-Separate Engine instances are independent, and can run concurrently.
-
-The 'electron' package is built on the proton package but instead offers a
-concurrent-safe API that can use simple procedural loops rather than event
-handlers to express application logic. It is easier to use for most
-applications.
-
-*/
-package proton
-
-// #cgo LDFLAGS: -lqpid-proton
-import "C"
-
-// This file is just for the package comment.
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/engine.go b/proton-c/bindings/go/src/qpid.apache.org/proton/engine.go
deleted file mode 100644
index c0f0093..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/engine.go
+++ /dev/null
@@ -1,422 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package proton
-
-import (
-	"fmt"
-	"net"
-	"os"
-	"strings"
-	"sync"
-	"time"
-	"unsafe"
-)
-
-/*
-#include <proton/connection.h>
-#include <proton/event.h>
-#include <proton/error.h>
-#include <proton/handlers.h>
-#include <proton/session.h>
-#include <proton/transport.h>
-#include <memory.h>
-#include <stdlib.h>
-*/
-import "C"
-
-// Injecter allows functions to be "injected" into the event-processing loop, to
-// be called in the same goroutine as event handlers.
-type Injecter interface {
-	// Inject a function into the engine goroutine.
-	//
-	// f() will be called in the same goroutine as event handlers, so it can safely
-	// use values belonging to event handlers without synchronization. f() should
-	// not block, no further events or injected functions can be processed until
-	// f() returns.
-	//
-	// Returns a non-nil error if the function could not be injected and will
-	// never be called. Otherwise the function will eventually be called.
-	//
-	// Note that proton values (Link, Session, Connection etc.) that existed when
-	// Inject(f) was called may have become invalid by the time f() is executed.
-	// Handlers should handle keep track of Closed events to ensure proton values
-	// are not used after they become invalid. One technique is to have map from
-	// proton values to application values. Check that the map has the correct
-	// proton/application value pair at the start of the injected function and
-	// delete the value from the map when handling a Closed event.
-	Inject(f func()) error
-
-	// InjectWait is like Inject but does not return till f() has completed.
-	// If f() cannot be injected it returns the error from Inject(), otherwise
-	// it returns the error from f()
-	InjectWait(f func() error) error
-}
-
-// Engine reads from a net.Conn, decodes AMQP events and calls the appropriate
-// Handler functions sequentially in a single goroutine. Actions taken by
-// Handler functions (such as sending messages) are encoded and written to the
-// net.Conn. You can create multiple Engines to handle multiple connections
-// concurrently.
-//
-// You implement the EventHandler and/or MessagingHandler interfaces and provide
-// those values to NewEngine(). Their HandleEvent method will be called in the
-// event-handling goroutine.
-//
-// Handlers can pass values from an event (Connections, Links, Deliveries etc.) to
-// other goroutines, store them, or use them as map indexes. Effectively they are
-// just pointers.  Other goroutines cannot call their methods directly but they can
-// can create a function closure to call such methods and pass it to Engine.Inject()
-// to have it evaluated in the engine goroutine.
-//
-// You are responsible for ensuring you don't use an event value after it is
-// invalid. The handler methods will tell you when a value is no longer valid. For
-// example after a LinkClosed event, that link is no longer valid. If you do
-// Link.Close() yourself (in a handler or injected function) the link remains valid
-// until the corresponing LinkClosed event is received by the handler.
-//
-// Engine.Close() will take care of cleaning up any remaining values when you are
-// done with the Engine. All values associated with a engine become invalid when you
-// call Engine.Close()
-//
-// The qpid.apache.org/proton/concurrent package will do all this for you, so it
-// may be a better choice for some applications.
-//
-type Engine struct {
-	// Error is set on exit from Run() if there was an error.
-	err    ErrorHolder
-	inject chan func()
-
-	conn       net.Conn
-	connection Connection
-	transport  Transport
-	collector  *C.pn_collector_t
-	handlers   []EventHandler // Handlers for proton events.
-	running    chan struct{}  // This channel will be closed when the goroutines are done.
-	closeOnce  sync.Once
-	timer      *time.Timer
-	traceEvent bool
-}
-
-const bufferSize = 4096
-
-func envBool(name string) bool {
-	v := strings.ToLower(os.Getenv(name))
-	return v == "true" || v == "1" || v == "yes" || v == "on"
-}
-
-// Create a new Engine and call Initialize() with conn and handlers
-func NewEngine(conn net.Conn, handlers ...EventHandler) (*Engine, error) {
-	eng := &Engine{}
-	return eng, eng.Initialize(conn, handlers...)
-}
-
-// Initialize an Engine with a connection and handlers. Start it with Run()
-func (eng *Engine) Initialize(conn net.Conn, handlers ...EventHandler) error {
-	eng.inject = make(chan func())
-	eng.conn = conn
-	eng.connection = Connection{C.pn_connection()}
-	eng.transport = Transport{C.pn_transport()}
-	eng.collector = C.pn_collector()
-	eng.handlers = handlers
-	eng.running = make(chan struct{})
-	eng.timer = time.NewTimer(0)
-	eng.traceEvent = envBool("PN_TRACE_EVT")
-	if eng.transport.IsNil() || eng.connection.IsNil() || eng.collector == nil {
-		eng.free()
-		return fmt.Errorf("proton.NewEngine cannot allocate")
-	}
-	C.pn_connection_collect(eng.connection.pn, eng.collector)
-	return nil
-}
-
-// Create a byte slice backed by C memory.
-// Empty or error (size <= 0) returns a nil byte slice.
-func cByteSlice(start unsafe.Pointer, size int) []byte {
-	if start == nil || size <= 0 {
-		return nil
-	} else {
-		// Slice from very large imaginary array in C memory
-		return (*[1 << 30]byte)(start)[:size:size]
-	}
-}
-
-func (eng *Engine) Connection() Connection {
-	return eng.connection
-}
-
-func (eng *Engine) Transport() Transport {
-	return eng.transport
-}
-
-func (eng *Engine) String() string {
-	return fmt.Sprintf("[%s]%s-%s", eng.Id(), eng.conn.LocalAddr(), eng.conn.RemoteAddr())
-}
-
-func (eng *Engine) Id() string {
-	// Use transport address to match default PN_TRACE_FRM=1 output.
-	return fmt.Sprintf("%p", eng.Transport().CPtr())
-}
-
-func (eng *Engine) Error() error {
-	return eng.err.Get()
-}
-
-// Inject a function into the Engine's event loop.
-//
-// f() will be called in the same event-processing goroutine that calls Handler
-// methods. f() can safely call methods on values that belong to this engine
-// (Sessions, Links etc)
-//
-// The injected function has no parameters or return values. It is normally a
-// closure and can use channels to communicate with the injecting goroutine if
-// necessary.
-//
-// Returns a non-nil error if the engine is closed before the function could be
-// injected.
-func (eng *Engine) Inject(f func()) error {
-	select {
-	case eng.inject <- f:
-		return nil
-	case <-eng.running:
-		return eng.Error()
-	}
-}
-
-// InjectWait is like Inject but does not return till f() has completed or the
-// engine is closed, and returns an error value from f()
-func (eng *Engine) InjectWait(f func() error) error {
-	done := make(chan error)
-	defer close(done)
-	err := eng.Inject(func() { done <- f() })
-	if err != nil {
-		return err
-	}
-	select {
-	case <-eng.running:
-		return eng.Error()
-	case err := <-done:
-		return err
-	}
-}
-
-// Server puts the Engine in server mode, meaning it will auto-detect security settings on
-// the incoming connnection such as use of SASL and SSL.
-// Must be called before Run()
-//
-func (eng *Engine) Server() { eng.Transport().SetServer() }
-
-func (eng *Engine) disconnect(err error) {
-	cond := eng.Transport().Condition()
-	cond.SetError(err)              // Set the provided error.
-	cond.SetError(eng.conn.Close()) // Use connection error if cond is not already set.
-	eng.transport.CloseTail()
-	eng.transport.CloseHead()
-}
-
-// Close the engine's connection.
-// If err != nil pass it to the remote end as the close condition.
-// Returns when the remote end closes or disconnects.
-func (eng *Engine) Close(err error) {
-	_ = eng.Inject(func() { CloseError(eng.Connection(), err) })
-	<-eng.running
-}
-
-// CloseTimeout like Close but disconnect if the remote end doesn't close within timeout.
-func (eng *Engine) CloseTimeout(err error, timeout time.Duration) {
-	_ = eng.Inject(func() { CloseError(eng.Connection(), err) })
-	select {
-	case <-eng.running:
-	case <-time.After(timeout):
-		eng.Disconnect(err)
-	}
-}
-
-// Disconnect the engine's connection immediately without an AMQP close.
-// Process any termination events before returning.
-func (eng *Engine) Disconnect(err error) {
-	_ = eng.Inject(func() { eng.disconnect(err) })
-	<-eng.running
-}
-
-// Let proton run timed activity and set up the next tick
-func (eng *Engine) tick() {
-	now := time.Now()
-	next := eng.Transport().Tick(now)
-	if !next.IsZero() {
-		eng.timer.Reset(next.Sub(now))
-	}
-}
-
-func (eng *Engine) dispatch() bool {
-	for ce := C.pn_collector_peek(eng.collector); ce != nil; ce = C.pn_collector_peek(eng.collector) {
-		e := makeEvent(ce, eng)
-		if eng.traceEvent {
-			eng.transport.Log(e.String())
-		}
-		for _, h := range eng.handlers {
-			h.HandleEvent(e)
-		}
-		if e.Type() == EConnectionRemoteOpen {
-			eng.tick() // Update the tick if changed by remote.
-		}
-		C.pn_collector_pop(eng.collector)
-	}
-	return !eng.transport.Closed() || C.pn_collector_peek(eng.collector) != nil
-}
-
-func (eng *Engine) writeBuffer() []byte {
-	size := eng.Transport().Pending() // Evaluate before Head(), may change buffer.
-	start := eng.Transport().Head()
-	return cByteSlice(start, size)
-}
-
-func (eng *Engine) readBuffer() []byte {
-	size := eng.Transport().Capacity()
-	start := eng.Transport().Tail()
-	return cByteSlice(start, size)
-}
-
-func (eng *Engine) free() {
-	if !eng.transport.IsNil() {
-		eng.transport.Unbind()
-		eng.transport.Free()
-		eng.transport = Transport{}
-	}
-	if !eng.connection.IsNil() {
-		eng.connection.Free()
-		eng.connection = Connection{}
-	}
-	if eng.collector != nil {
-		C.pn_collector_release(eng.collector)
-		C.pn_collector_free(eng.collector)
-		eng.collector = nil
-	}
-}
-
-// Run the engine. Engine.Run() will exit when the engine is closed or
-// disconnected.  You can check for errors after exit with Engine.Error().
-//
-func (eng *Engine) Run() error {
-	defer eng.free()
-	eng.transport.Bind(eng.connection)
-	eng.tick() // Start ticking if needed
-
-	// Channels for read and write buffers going in and out of the read/write goroutines.
-	// The channels are unbuffered: we want to exchange buffers in seuquence.
-	readsIn, writesIn := make(chan []byte), make(chan []byte)
-	readsOut, writesOut := make(chan []byte), make(chan []byte)
-
-	wait := sync.WaitGroup{}
-	wait.Add(2) // Read and write goroutines
-
-	go func() { // Read goroutine
-		defer wait.Done()
-		for {
-			rbuf, ok := <-readsIn
-			if !ok {
-				return
-			}
-			n, err := eng.conn.Read(rbuf)
-			if n > 0 {
-				readsOut <- rbuf[:n]
-			} else if err != nil {
-				_ = eng.Inject(func() {
-					eng.Transport().Condition().SetError(err)
-					eng.Transport().CloseTail()
-				})
-				return
-			}
-		}
-	}()
-
-	go func() { // Write goroutine
-		defer wait.Done()
-		for {
-			wbuf, ok := <-writesIn
-			if !ok {
-				return
-			}
-			n, err := eng.conn.Write(wbuf)
-			if n > 0 {
-				writesOut <- wbuf[:n]
-			} else if err != nil {
-				_ = eng.Inject(func() {
-					eng.Transport().Condition().SetError(err)
-					eng.Transport().CloseHead()
-				})
-				return
-			}
-		}
-	}()
-
-	for eng.dispatch() {
-		readBuf := eng.readBuffer()
-		writeBuf := eng.writeBuffer()
-		// Note that getting the buffers can generate events (eg. SASL events) that
-		// might close the transport. Check if we are already finished before
-		// blocking for IO.
-		if !eng.dispatch() {
-			break
-		}
-
-		// sendReads/sendWrites are nil (not sendable in select) unless we have a
-		// buffer to read/write
-		var sendReads, sendWrites chan []byte
-		if readBuf != nil {
-			sendReads = readsIn
-		}
-		if writeBuf != nil {
-			sendWrites = writesIn
-		}
-
-		// Send buffers to the read/write goroutines if we have them.
-		// Get buffers from the read/write goroutines and process them
-		// Check for injected functions
-		select {
-
-		case sendReads <- readBuf:
-
-		case sendWrites <- writeBuf:
-
-		case buf := <-readsOut:
-			eng.transport.Process(uint(len(buf)))
-
-		case buf := <-writesOut:
-			eng.transport.Pop(uint(len(buf)))
-
-		case f, ok := <-eng.inject: // Function injected from another goroutine
-			if ok {
-				f()
-			}
-
-		case <-eng.timer.C:
-			eng.tick()
-		}
-	}
-
-	eng.err.Set(EndpointError(eng.Connection()))
-	eng.err.Set(eng.Transport().Condition().Error())
-	close(readsIn)
-	close(writesIn)
-	close(eng.running)   // Signal goroutines have exited and Error is set, disable Inject()
-	_ = eng.conn.Close() // Close conn, force read/write goroutines to exit (they will Inject)
-	wait.Wait()          // Wait for goroutines
-	return eng.err.Get()
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/error.go b/proton-c/bindings/go/src/qpid.apache.org/proton/error.go
deleted file mode 100644
index 80d9680..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/error.go
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-// Internal implementation details - ignore.
-package proton
-
-// #cgo LDFLAGS: -lqpid-proton
-// #include <proton/error.h>
-// #include <proton/codec.h>
-import "C"
-
-import (
-	"fmt"
-	"sync"
-	"sync/atomic"
-)
-
-type PnErrorCode int
-
-func (e PnErrorCode) String() string {
-	switch e {
-	case C.PN_EOS:
-		return "end-of-data"
-	case C.PN_ERR:
-		return "error"
-	case C.PN_OVERFLOW:
-		return "overflow"
-	case C.PN_UNDERFLOW:
-		return "underflow"
-	case C.PN_STATE_ERR:
-		return "bad-state"
-	case C.PN_ARG_ERR:
-		return "invalid-argument"
-	case C.PN_TIMEOUT:
-		return "timeout"
-	case C.PN_INTR:
-		return "interrupted"
-	case C.PN_INPROGRESS:
-		return "in-progress"
-	default:
-		return fmt.Sprintf("unknown-error(%d)", e)
-	}
-}
-
-func PnError(e *C.pn_error_t) error {
-	if e == nil || C.pn_error_code(e) == 0 {
-		return nil
-	}
-	return fmt.Errorf("%s: %s", PnErrorCode(C.pn_error_code(e)), C.GoString(C.pn_error_text(e)))
-}
-
-// ErrorHolder is a goroutine-safe error holder that keeps the first error that is set.
-type ErrorHolder struct {
-	once  sync.Once
-	value atomic.Value
-}
-
-// Set the error if not already set, return the error in the Holder.
-func (e *ErrorHolder) Set(err error) {
-	if err != nil {
-		e.once.Do(func() { e.value.Store(err) })
-	}
-}
-
-// Get the error.
-func (e *ErrorHolder) Get() (err error) {
-	err, _ = e.value.Load().(error)
-	return
-}
-
-// assert panics if condition is false with optional formatted message
-func assert(condition bool, format ...interface{}) {
-	if !condition {
-		if len(format) > 0 {
-			panic(fmt.Errorf(format[0].(string), format[1:]...))
-		} else {
-			panic(fmt.Errorf("assertion failed"))
-		}
-	}
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/handlers.go b/proton-c/bindings/go/src/qpid.apache.org/proton/handlers.go
deleted file mode 100644
index 961136e..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/handlers.go
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package proton
-
-import "fmt"
-
-// EventHandler handles core proton events.
-type EventHandler interface {
-	// HandleEvent is called with an event.
-	// Typically HandleEvent() is implemented as a switch on e.Type()
-	// Returning an error will stop the Engine.
-	HandleEvent(e Event)
-}
-
-// MessagingHandler provides an alternative interface to EventHandler.
-// it is easier to use for most applications that send and receive messages.
-//
-// Implement this interface and then wrap your value with a MessagingHandlerDelegator.
-// MessagingHandlerDelegator implements EventHandler and can be registered with a Engine.
-//
-type MessagingHandler interface {
-	// HandleMessagingEvent is called with  MessagingEvent.
-	// Typically HandleEvent() is implemented as a switch on e.Type()
-	// Returning an error will stop the Engine.
-	HandleMessagingEvent(MessagingEvent, Event)
-}
-
-// MessagingEvent provides a set of events that are easier to work with than the
-// core events defined by EventType
-//
-// There are 3 types of "endpoint": Connection, Session and Link.  For each
-// endpoint there are 5 events: Opening, Opened, Closing, Closed and Error.
-//
-// The meaning of these events is as follows:
-//
-// Opening: The remote end opened, the local end will open automatically.
-//
-// Opened: Both ends are open, regardless of which end opened first.
-//
-// Closing: The remote end closed without error, the local end will close automatically.
-//
-// Error: The remote end closed with an error, the local end will close automatically.
-//
-// Closed: Both ends are closed, regardless of which end closed first or if there was an error.
-// No further events will be received for the endpoint.
-//
-type MessagingEvent int
-
-const (
-	// The event loop starts.
-	MStart MessagingEvent = iota
-	// The peer closes the connection with an error condition.
-	MConnectionError
-	// The peer closes the session with an error condition.
-	MSessionError
-	// The peer closes the link with an error condition.
-	MLinkError
-	// The peer Initiates the opening of the connection.
-	MConnectionOpening
-	// The peer initiates the opening of the session.
-	MSessionOpening
-	// The peer initiates the opening of the link.
-	MLinkOpening
-	// The connection is opened.
-	MConnectionOpened
-	// The session is opened.
-	MSessionOpened
-	// The link is opened.
-	MLinkOpened
-	// The peer initiates the closing of the connection.
-	MConnectionClosing
-	// The peer initiates the closing of the session.
-	MSessionClosing
-	// The peer initiates the closing of the link.
-	MLinkClosing
-	// Both ends of the connection are closed.
-	MConnectionClosed
-	// Both ends of the session are closed.
-	MSessionClosed
-	// Both ends of the link are closed.
-	MLinkClosed
-	// The sender link has credit and messages can
-	// therefore be transferred.
-	MSendable
-	// The remote peer accepts an outgoing message.
-	MAccepted
-	// The remote peer rejects an outgoing message.
-	MRejected
-	// The peer releases an outgoing message. Note that this may be in response to
-	// either the RELEASE or MODIFIED state as defined by the AMQP specification.
-	MReleased
-	// The peer has settled the outgoing message. This is the point at which it
-	// should never be re-transmitted.
-	MSettled
-	// A message is received. Call Event.Delivery().Message() to decode as an amqp.Message.
-	// To manage the outcome of this messages (e.g. to accept or reject the message)
-	// use Event.Delivery().
-	MMessage
-	// A network connection was disconnected.
-	MDisconnected
-)
-
-func (t MessagingEvent) String() string {
-	switch t {
-	case MStart:
-		return "Start"
-	case MConnectionError:
-		return "ConnectionError"
-	case MSessionError:
-		return "SessionError"
-	case MLinkError:
-		return "LinkError"
-	case MConnectionOpening:
-		return "ConnectionOpening"
-	case MSessionOpening:
-		return "SessionOpening"
-	case MLinkOpening:
-		return "LinkOpening"
-	case MConnectionOpened:
-		return "ConnectionOpened"
-	case MSessionOpened:
-		return "SessionOpened"
-	case MLinkOpened:
-		return "LinkOpened"
-	case MConnectionClosing:
-		return "ConnectionClosing"
-	case MSessionClosing:
-		return "SessionClosing"
-	case MLinkClosing:
-		return "LinkClosing"
-	case MConnectionClosed:
-		return "ConnectionClosed"
-	case MSessionClosed:
-		return "SessionClosed"
-	case MLinkClosed:
-		return "LinkClosed"
-	case MDisconnected:
-		return "Disconnected"
-	case MSendable:
-		return "Sendable"
-	case MAccepted:
-		return "Accepted"
-	case MRejected:
-		return "Rejected"
-	case MReleased:
-		return "Released"
-	case MSettled:
-		return "Settled"
-	case MMessage:
-		return "Message"
-	default:
-		return "Unknown"
-	}
-}
-
-// ResourceHandler provides a simple way to track the creation and deletion of
-// various proton objects.
-// endpointDelegator captures common patterns for endpoints opening/closing
-type endpointDelegator struct {
-	remoteOpen, remoteClose, localOpen, localClose EventType
-	opening, opened, closing, closed, error        MessagingEvent
-	endpoint                                       func(Event) Endpoint
-	delegator                                      *MessagingAdapter
-}
-
-// HandleEvent handles an open/close event for an endpoint in a generic way.
-func (d endpointDelegator) HandleEvent(e Event) {
-	endpoint := d.endpoint(e)
-	state := endpoint.State()
-
-	switch e.Type() {
-
-	case d.localOpen:
-		if state.RemoteActive() {
-			d.delegator.mhandler.HandleMessagingEvent(d.opened, e)
-		}
-
-	case d.remoteOpen:
-		d.delegator.mhandler.HandleMessagingEvent(d.opening, e)
-		switch {
-		case state.LocalActive():
-			d.delegator.mhandler.HandleMessagingEvent(d.opened, e)
-		case state.LocalUninit():
-			if d.delegator.AutoOpen {
-				endpoint.Open()
-			}
-		}
-
-	case d.remoteClose:
-		if endpoint.RemoteCondition().IsSet() { // Closed with error
-			d.delegator.mhandler.HandleMessagingEvent(d.error, e)
-		} else {
-			d.delegator.mhandler.HandleMessagingEvent(d.closing, e)
-		}
-		if state.LocalClosed() {
-			d.delegator.mhandler.HandleMessagingEvent(d.closed, e)
-		} else if state.LocalActive() {
-			endpoint.Close()
-		}
-
-	case d.localClose:
-		if state.RemoteClosed() {
-			d.delegator.mhandler.HandleMessagingEvent(d.closed, e)
-		}
-
-	default:
-		// We shouldn't be called with any other event type.
-		panic(fmt.Errorf("internal error, not an open/close event: %s", e))
-	}
-}
-
-type flowcontroller struct {
-	window, drained int
-}
-
-func (d flowcontroller) HandleEvent(e Event) {
-	link := e.Link()
-
-	switch e.Type() {
-	case ELinkLocalOpen, ELinkRemoteOpen, ELinkFlow, EDelivery:
-		if link.IsReceiver() {
-			d.drained += link.Drained()
-			if d.drained != 0 {
-				link.Flow(d.window - link.Credit())
-			}
-		}
-	}
-}
-
-// MessagingAdapter implments a EventHandler and delegates to a MessagingHandler.
-// You can modify the exported fields before you pass the MessagingAdapter to
-// a Engine.
-type MessagingAdapter struct {
-	mhandler                  MessagingHandler
-	connection, session, link endpointDelegator
-	flowcontroller            EventHandler
-
-	// AutoSettle (default true) automatically pre-settle outgoing messages.
-	AutoSettle bool
-	// AutoAccept (default true) automatically accept and settle incoming messages
-	// if they are not settled by the delegate.
-	AutoAccept bool
-	// AutoOpen (default true) automatically open remotely opened endpoints.
-	AutoOpen bool
-	// Prefetch (default 10) initial credit to issue for incoming links.
-	Prefetch int
-	// PeerCloseIsError (default false) if true a close by the peer will be treated as an error.
-	PeerCloseError bool
-}
-
-func NewMessagingAdapter(h MessagingHandler) *MessagingAdapter {
-	return &MessagingAdapter{
-		mhandler:       h,
-		flowcontroller: nil,
-		AutoSettle:     true,
-		AutoAccept:     true,
-		AutoOpen:       true,
-		Prefetch:       10,
-		PeerCloseError: false,
-	}
-}
-
-func handleIf(h EventHandler, e Event) {
-	if h != nil {
-		h.HandleEvent(e)
-	}
-}
-
-// Handle a proton event by passing the corresponding MessagingEvent(s) to
-// the MessagingHandler.
-func (d *MessagingAdapter) HandleEvent(e Event) {
-	handleIf(d.flowcontroller, e)
-
-	switch e.Type() {
-
-	case EConnectionInit:
-		d.connection = endpointDelegator{
-			EConnectionRemoteOpen, EConnectionRemoteClose, EConnectionLocalOpen, EConnectionLocalClose,
-			MConnectionOpening, MConnectionOpened, MConnectionClosing, MConnectionClosed,
-			MConnectionError,
-			func(e Event) Endpoint { return e.Connection() },
-			d,
-		}
-		d.session = endpointDelegator{
-			ESessionRemoteOpen, ESessionRemoteClose, ESessionLocalOpen, ESessionLocalClose,
-			MSessionOpening, MSessionOpened, MSessionClosing, MSessionClosed,
-			MSessionError,
-			func(e Event) Endpoint { return e.Session() },
-			d,
-		}
-		d.link = endpointDelegator{
-			ELinkRemoteOpen, ELinkRemoteClose, ELinkLocalOpen, ELinkLocalClose,
-			MLinkOpening, MLinkOpened, MLinkClosing, MLinkClosed,
-			MLinkError,
-			func(e Event) Endpoint { return e.Link() },
-			d,
-		}
-		if d.Prefetch > 0 {
-			d.flowcontroller = flowcontroller{window: d.Prefetch, drained: 0}
-		}
-		d.mhandler.HandleMessagingEvent(MStart, e)
-
-	case EConnectionRemoteOpen:
-
-		d.connection.HandleEvent(e)
-
-	case EConnectionRemoteClose:
-		d.connection.HandleEvent(e)
-		e.Connection().Transport().CloseTail()
-
-	case EConnectionLocalOpen, EConnectionLocalClose:
-		d.connection.HandleEvent(e)
-
-	case ESessionRemoteOpen, ESessionRemoteClose, ESessionLocalOpen, ESessionLocalClose:
-		d.session.HandleEvent(e)
-
-	case ELinkRemoteOpen:
-		e.Link().Source().Copy(e.Link().RemoteSource())
-		e.Link().Target().Copy(e.Link().RemoteTarget())
-		d.link.HandleEvent(e)
-
-	case ELinkRemoteClose, ELinkLocalOpen, ELinkLocalClose:
-		d.link.HandleEvent(e)
-
-	case ELinkFlow:
-		if e.Link().IsSender() && e.Link().Credit() > 0 {
-			d.mhandler.HandleMessagingEvent(MSendable, e)
-		}
-
-	case EDelivery:
-		if e.Delivery().Link().IsReceiver() {
-			d.incoming(e)
-		} else {
-			d.outgoing(e)
-		}
-
-	case ETransportClosed:
-		d.mhandler.HandleMessagingEvent(MDisconnected, e)
-	}
-}
-
-func (d *MessagingAdapter) incoming(e Event) {
-	delivery := e.Delivery()
-	if delivery.HasMessage() {
-		d.mhandler.HandleMessagingEvent(MMessage, e)
-		if d.AutoAccept && !delivery.Settled() {
-			delivery.Accept()
-		}
-		if delivery.Current() {
-			e.Link().Advance()
-		}
-	} else if delivery.Updated() && delivery.Settled() {
-		d.mhandler.HandleMessagingEvent(MSettled, e)
-	}
-	return
-}
-
-func (d *MessagingAdapter) outgoing(e Event) {
-	delivery := e.Delivery()
-	if delivery.Updated() {
-		switch delivery.Remote().Type() {
-		case Accepted:
-			d.mhandler.HandleMessagingEvent(MAccepted, e)
-		case Rejected:
-			d.mhandler.HandleMessagingEvent(MRejected, e)
-		case Released, Modified:
-			d.mhandler.HandleMessagingEvent(MReleased, e)
-		}
-		if delivery.Settled() {
-			// The delivery was settled remotely, inform the local end.
-			d.mhandler.HandleMessagingEvent(MSettled, e)
-		}
-		if d.AutoSettle {
-			delivery.Settle() // Local settle, don't mhandler MSettled till the remote end settles.
-		}
-	}
-	return
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/message.go b/proton-c/bindings/go/src/qpid.apache.org/proton/message.go
deleted file mode 100644
index 2336483..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/message.go
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package proton
-
-// #include <proton/types.h>
-// #include <proton/message.h>
-// #include <proton/codec.h>
-import "C"
-
-import (
-	"fmt"
-	"qpid.apache.org/amqp"
-	"strconv"
-	"sync/atomic"
-)
-
-// HasMessage is true if all message data is available.
-// Equivalent to !d.isNil && d.Readable() && !d.Partial()
-func (d Delivery) HasMessage() bool { return !d.IsNil() && d.Readable() && !d.Partial() }
-
-// Message decodes the message containined in a delivery.
-//
-// Must be called in the correct link context with this delivery as the current message,
-// handling an MMessage event is always a safe context to call this function.
-//
-// Will return an error if message is incomplete or not current.
-func (delivery Delivery) Message() (m amqp.Message, err error) {
-	if !delivery.Readable() {
-		return nil, fmt.Errorf("delivery is not readable")
-	}
-	if delivery.Partial() {
-		return nil, fmt.Errorf("delivery has partial message")
-	}
-	data := make([]byte, delivery.Pending())
-	result := delivery.Link().Recv(data)
-	if result != len(data) {
-		return nil, fmt.Errorf("cannot receive message: %s", PnErrorCode(result))
-	}
-	m = amqp.NewMessage()
-	err = m.Decode(data)
-	return
-}
-
-// Process-wide atomic counter for generating tag names
-var tagCounter uint64
-
-func nextTag() string {
-	return strconv.FormatUint(atomic.AddUint64(&tagCounter, 1), 32)
-}
-
-// Send sends a amqp.Message over a Link.
-// Returns a Delivery that can be use to determine the outcome of the message.
-func (link Link) Send(m amqp.Message) (Delivery, error) {
-	if !link.IsSender() {
-		return Delivery{}, fmt.Errorf("attempt to send message on receiving link")
-	}
-
-	delivery := link.Delivery(nextTag())
-	bytes, err := m.Encode(nil)
-	if err != nil {
-		return Delivery{}, fmt.Errorf("cannot send mesage %s", err)
-	}
-	result := link.SendBytes(bytes)
-	link.Advance()
-	if result != len(bytes) {
-		if result < 0 {
-			return delivery, fmt.Errorf("send failed %v", PnErrorCode(result))
-		} else {
-			return delivery, fmt.Errorf("send incomplete %v of %v", result, len(bytes))
-		}
-	}
-	if link.RemoteSndSettleMode() == SndSettled {
-		delivery.Settle()
-	}
-	return delivery, nil
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/proton_test.go b/proton-c/bindings/go/src/qpid.apache.org/proton/proton_test.go
deleted file mode 100644
index aad93eb..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/proton_test.go
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package proton
-
-import (
-	"fmt"
-	"net"
-	"path"
-	"runtime"
-	"testing"
-	"time"
-)
-
-func errorIf(t *testing.T, err error) {
-	if err != nil {
-		_, file, line, ok := runtime.Caller(1) // annotate with location of caller.
-		if ok {
-			_, file = path.Split(file)
-		}
-		t.Errorf("(from %s:%d) %v", file, line, err)
-	}
-}
-
-func fatalIf(t *testing.T, err error) {
-	if err != nil {
-		_, file, line, ok := runtime.Caller(1) // annotate with location of caller.
-		if ok {
-			_, file = path.Split(file)
-		}
-		t.Fatalf("(from %s:%d) %v", file, line, err)
-	}
-}
-
-type events []EventType
-
-type testEngine struct {
-	Engine
-	events chan EventType
-}
-
-func newTestEngine(conn net.Conn) (*testEngine, error) {
-	testEng := &testEngine{events: make(chan EventType, 1000)}
-	return testEng, testEng.Initialize(conn, testEng)
-}
-
-func (eng *testEngine) HandleEvent(e Event) {
-	eng.events <- e.Type()
-}
-
-func (eng *testEngine) expect(events []EventType) error {
-	timer := time.After(5 * time.Second)
-	for _, want := range events {
-		select {
-		case got := <-eng.events:
-			if want != got {
-				return fmt.Errorf("want %s, got %s", want, got)
-			}
-		case <-timer:
-			return fmt.Errorf("expect timeout")
-		}
-	}
-	return nil
-}
-
-func Test(t *testing.T) {
-	cConn, sConn := net.Pipe()
-	client, err := newTestEngine(cConn)
-	fatalIf(t, err)
-	server, err := newTestEngine(sConn)
-	fatalIf(t, err)
-	server.Server()
-	go client.Run()
-	go server.Run()
-	fatalIf(t, server.expect(events{EConnectionInit, EConnectionBound}))
-	fatalIf(t, client.expect(events{EConnectionInit, EConnectionBound}))
-	fatalIf(t, client.InjectWait(func() error { client.Connection().Open(); return nil }))
-	fatalIf(t, client.expect(events{EConnectionLocalOpen}))
-	fatalIf(t, server.expect(events{EConnectionRemoteOpen}))
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/uuid.go b/proton-c/bindings/go/src/qpid.apache.org/proton/uuid.go
deleted file mode 100644
index f2dc70e..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/uuid.go
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-package proton
-
-import (
-	"fmt"
-	"math/rand"
-	"sync"
-	"time"
-)
-
-// UUID is a 16-byte Universally Unique Identifier
-type UUID [16]byte
-
-// String gives a UUID in standard string format.
-func (u UUID) String() string {
-	return fmt.Sprintf("%X-%X-%X-%X-%X", u[0:4], u[4:6], u[6:8], u[8:10], u[10:])
-}
-
-// Don't mess with the default random source.
-var randomSource = rand.NewSource(time.Now().UnixNano())
-var randomLock sync.Mutex
-
-func random() byte {
-	randomLock.Lock()
-	defer randomLock.Unlock()
-	return byte(randomSource.Int63())
-}
-
-// UUID4 returns a randomly-generated (version 4) UUID, as per RFC4122
-func UUID4() UUID {
-	var u UUID
-	for i := 0; i < len(u); i++ {
-		u[i] = random()
-	}
-	// See /https://tools.ietf.org/html/rfc4122#section-4.4
-	u[6] = (u[6] & 0x0F) | 0x40 // Version bits to 4
-	u[8] = (u[8] & 0x3F) | 0x80 // Reserved bits (top two) set to 01
-	return u
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/wrappers.go b/proton-c/bindings/go/src/qpid.apache.org/proton/wrappers.go
deleted file mode 100644
index 4d55e4f..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/wrappers.go
+++ /dev/null
@@ -1,431 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-// This file contains special-case wrapper functions or wrappers that don't follow
-// the pattern of genwrap.go.
-
-package proton
-
-//#include <proton/codec.h>
-//#include <proton/connection.h>
-//#include <proton/delivery.h>
-//#include <proton/event.h>
-//#include <proton/link.h>
-//#include <proton/link.h>
-//#include <proton/object.h>
-//#include <proton/sasl.h>
-//#include <proton/session.h>
-//#include <proton/transport.h>
-//#include <stdlib.h>
-import "C"
-
-import (
-	"fmt"
-	"qpid.apache.org/amqp"
-	"reflect"
-	"time"
-	"unsafe"
-)
-
-// TODO aconway 2015-05-05: Documentation for generated types.
-
-// CHandle holds an unsafe.Pointer to a proton C struct, the C type depends on the
-// Go type implementing this interface. For low level, at-your-own-risk use only.
-type CHandle interface {
-	// CPtr returns the unsafe C pointer, equivalent to a C void*.
-	CPtr() unsafe.Pointer
-}
-
-// Incref increases the refcount of a proton value, which prevents the
-// underlying C struct being freed until you call Decref().
-//
-// It can be useful to "pin" a proton value in memory while it is in use by
-// goroutines other than the event loop goroutine. For example if you Incref() a
-// Link, the underlying object is not freed when the link is closed, so means
-// other goroutines can continue to safely use it as an index in a map or inject
-// it into the event loop goroutine. There will of course be an error if you try
-// to use a link after it is closed, but not a segmentation fault.
-func Incref(c CHandle) {
-	if p := c.CPtr(); p != nil {
-		C.pn_incref(p)
-	}
-}
-
-// Decref decreases the refcount of a proton value, freeing the underlying C
-// struct if this is the last reference.  Only call this if you previously
-// called Incref() for this value.
-func Decref(c CHandle) {
-	if p := c.CPtr(); p != nil {
-		C.pn_decref(p)
-	}
-}
-
-// Event is an AMQP protocol event.
-type Event struct {
-	pn         *C.pn_event_t
-	eventType  EventType
-	connection Connection
-	transport  Transport
-	session    Session
-	link       Link
-	delivery   Delivery
-	injecter   Injecter
-}
-
-func makeEvent(pn *C.pn_event_t, injecter Injecter) Event {
-	return Event{
-		pn:         pn,
-		eventType:  EventType(C.pn_event_type(pn)),
-		connection: Connection{C.pn_event_connection(pn)},
-		transport:  Transport{C.pn_event_transport(pn)},
-		session:    Session{C.pn_event_session(pn)},
-		link:       Link{C.pn_event_link(pn)},
-		delivery:   Delivery{C.pn_event_delivery(pn)},
-		injecter:   injecter,
-	}
-}
-func (e Event) IsNil() bool            { return e.eventType == EventType(0) }
-func (e Event) Type() EventType        { return e.eventType }
-func (e Event) Connection() Connection { return e.connection }
-func (e Event) Transport() Transport   { return e.transport }
-func (e Event) Session() Session       { return e.session }
-func (e Event) Link() Link             { return e.link }
-func (e Event) Delivery() Delivery     { return e.delivery }
-func (e Event) String() string         { return e.Type().String() }
-
-// Injecter should not be used in a handler function, but it can be passed to
-// other goroutines (via a channel or to a goroutine started by handler
-// functions) to let them inject functions back into the handlers goroutine.
-func (e Event) Injecter() Injecter { return e.injecter }
-
-// Data holds a pointer to decoded AMQP data.
-// Use amqp.marshal/unmarshal to access it as Go data types.
-//
-type Data struct{ pn *C.pn_data_t }
-
-func NewData(p unsafe.Pointer) Data { return Data{(*C.pn_data_t)(p)} }
-
-func (d Data) Free()                   { C.pn_data_free(d.pn) }
-func (d Data) Pointer() unsafe.Pointer { return unsafe.Pointer(d.pn) }
-func (d Data) Clear()                  { C.pn_data_clear(d.pn) }
-func (d Data) Rewind()                 { C.pn_data_rewind(d.pn) }
-func (d Data) Error() error            { return PnError(C.pn_data_error(d.pn)) }
-
-// State holds the state flags for an AMQP endpoint.
-type State byte
-
-const (
-	SLocalUninit  State = C.PN_LOCAL_UNINIT
-	SLocalActive        = C.PN_LOCAL_ACTIVE
-	SLocalClosed        = C.PN_LOCAL_CLOSED
-	SRemoteUninit       = C.PN_REMOTE_UNINIT
-	SRemoteActive       = C.PN_REMOTE_ACTIVE
-	SRemoteClosed       = C.PN_REMOTE_CLOSED
-)
-
-// Has is True if bits & state is non 0.
-func (s State) Has(bits State) bool { return s&bits != 0 }
-
-func (s State) LocalUninit() bool  { return s.Has(SLocalUninit) }
-func (s State) LocalActive() bool  { return s.Has(SLocalActive) }
-func (s State) LocalClosed() bool  { return s.Has(SLocalClosed) }
-func (s State) RemoteUninit() bool { return s.Has(SRemoteUninit) }
-func (s State) RemoteActive() bool { return s.Has(SRemoteActive) }
-func (s State) RemoteClosed() bool { return s.Has(SRemoteClosed) }
-
-// Return a State containig just the local flags
-func (s State) Local() State { return State(s & C.PN_LOCAL_MASK) }
-
-// Return a State containig just the remote flags
-func (s State) Remote() State { return State(s & C.PN_REMOTE_MASK) }
-
-// Endpoint is the common interface for Connection, Link and Session.
-type Endpoint interface {
-	// State is the open/closed state.
-	State() State
-	// Open an endpoint.
-	Open()
-	// Close an endpoint.
-	Close()
-	// Condition holds a local error condition.
-	Condition() Condition
-	// RemoteCondition holds a remote error condition.
-	RemoteCondition() Condition
-	// Human readable name
-	String() string
-	// Human readable endpoint type "link", "session" etc.
-	Type() string
-}
-
-// CloseError sets an error condition (if err != nil) on an endpoint and closes
-// the endpoint if not already closed
-func CloseError(e Endpoint, err error) {
-	if err != nil {
-		e.Condition().SetError(err)
-	}
-	e.Close()
-}
-
-// EndpointError returns the remote error if there is one, the local error if not
-// nil if there is no error.
-func EndpointError(e Endpoint) error {
-	err := e.RemoteCondition().Error()
-	if err == nil {
-		err = e.Condition().Error()
-	}
-	return err
-}
-
-const (
-	Received uint64 = C.PN_RECEIVED
-	Accepted        = C.PN_ACCEPTED
-	Rejected        = C.PN_REJECTED
-	Released        = C.PN_RELEASED
-	Modified        = C.PN_MODIFIED
-)
-
-// SettleAs is equivalent to d.Update(disposition); d.Settle()
-func (d Delivery) SettleAs(disposition uint64) {
-	d.Update(disposition)
-	d.Settle()
-}
-
-// Accept accepts and settles a delivery.
-func (d Delivery) Accept() { d.SettleAs(Accepted) }
-
-// Reject rejects and settles a delivery
-func (d Delivery) Reject() { d.SettleAs(Rejected) }
-
-// Release releases and settles a delivery
-// If delivered is true the delivery count for the message will be increased.
-func (d Delivery) Release(delivered bool) {
-	if delivered {
-		d.SettleAs(Modified)
-	} else {
-		d.SettleAs(Released)
-	}
-}
-
-type DeliveryTag struct{ pn C.pn_delivery_tag_t }
-
-func (t DeliveryTag) String() string { return C.GoStringN(t.pn.start, C.int(t.pn.size)) }
-
-func (l Link) Recv(buf []byte) int {
-	if len(buf) == 0 {
-		return 0
-	}
-	return int(C.pn_link_recv(l.pn, (*C.char)(unsafe.Pointer(&buf[0])), C.size_t(len(buf))))
-}
-
-func (l Link) SendBytes(bytes []byte) int {
-	return int(C.pn_link_send(l.pn, cPtr(bytes), cLen(bytes)))
-}
-
-func pnTag(tag string) C.pn_delivery_tag_t {
-	bytes := []byte(tag)
-	return C.pn_dtag(cPtr(bytes), cLen(bytes))
-}
-
-func (l Link) Delivery(tag string) Delivery {
-	return Delivery{C.pn_delivery(l.pn, pnTag(tag))}
-}
-
-func (l Link) Connection() Connection { return l.Session().Connection() }
-
-// Human-readable link description including name, source, target and direction.
-func (l Link) String() string {
-	switch {
-	case l.IsNil():
-		return fmt.Sprintf("<nil-link>")
-	case l.IsSender():
-		return fmt.Sprintf("%s(%s->%s)", l.Name(), l.Source().Address(), l.Target().Address())
-	default:
-		return fmt.Sprintf("%s(%s<-%s)", l.Name(), l.Target().Address(), l.Source().Address())
-	}
-}
-
-func (l Link) Type() string {
-	if l.IsSender() {
-		return "link(sender)"
-	} else {
-		return "link(receiver)"
-	}
-}
-
-// IsDrain calls pn_link_get_drain(), it conflicts with pn_link_drain() under the normal mapping.
-func (l Link) IsDrain() bool {
-	return bool(C.pn_link_get_drain(l.pn))
-}
-
-func cPtr(b []byte) *C.char {
-	if len(b) == 0 {
-		return nil
-	}
-	return (*C.char)(unsafe.Pointer(&b[0]))
-}
-
-func cLen(b []byte) C.size_t {
-	return C.size_t(len(b))
-}
-
-func (s Session) Sender(name string) Link {
-	cname := C.CString(name)
-	defer C.free(unsafe.Pointer(cname))
-	return Link{C.pn_sender(s.pn, cname)}
-}
-
-func (s Session) Receiver(name string) Link {
-	cname := C.CString(name)
-	defer C.free(unsafe.Pointer(cname))
-	return Link{C.pn_receiver(s.pn, cname)}
-}
-
-func (t Transport) String() string {
-	return fmt.Sprintf("(Transport)(%p)", t.CPtr())
-}
-
-// Unique (per process) string identifier for a connection, useful for debugging.
-func (c Connection) String() string {
-	// Use the transport address to match the default transport logs from PN_TRACE.
-	return fmt.Sprintf("(Connection)(%p)", c.Transport().CPtr())
-}
-
-func (c Connection) Type() string {
-	return "connection"
-}
-
-// Head functions don't follow the normal naming conventions so missed by the generator.
-
-func (c Connection) LinkHead(s State) Link {
-	return Link{C.pn_link_head(c.pn, C.pn_state_t(s))}
-}
-
-func (c Connection) SessionHead(s State) Session {
-	return Session{C.pn_session_head(c.pn, C.pn_state_t(s))}
-}
-
-func (c Connection) Links(state State) (links []Link) {
-	for l := c.LinkHead(state); !l.IsNil(); l = l.Next(state) {
-		links = append(links, l)
-	}
-	return
-}
-
-func (c Connection) Sessions(state State) (sessions []Session) {
-	for s := c.SessionHead(state); !s.IsNil(); s = s.Next(state) {
-		sessions = append(sessions, s)
-	}
-	return
-}
-
-// SetPassword takes []byte not string because it is impossible to erase a string
-// from memory reliably. Proton will not keep the password in memory longer than
-// needed, the caller should overwrite their copy on return.
-//
-// The password must not contain embedded nul characters, a trailing nul is ignored.
-func (c Connection) SetPassword(password []byte) {
-	if len(password) == 0 || password[len(password)-1] != 0 {
-		password = append(password, 0) // Proton requires a terminating null.
-	}
-	C.pn_connection_set_password(c.pn, (*C.char)(unsafe.Pointer(&password[0])))
-}
-
-func (s Session) String() string {
-	return fmt.Sprintf("(Session)(%p)", s.pn) // TODO aconway 2016-09-12: should print channel number.
-}
-
-func (s Session) Type() string { return "session" }
-
-// Error returns an instance of amqp.Error or nil.
-func (c Condition) Error() error {
-	if c.IsNil() || !c.IsSet() {
-		return nil
-	}
-	return amqp.Error{Name: c.Name(), Description: c.Description()}
-}
-
-// Set a Go error into a condition.
-// If it is not an amqp.Condition use the error type as name, error string as description.
-func (c Condition) SetError(err error) {
-	if err != nil {
-		if cond, ok := err.(amqp.Error); ok {
-			c.SetName(cond.Name)
-			c.SetDescription(cond.Description)
-		} else {
-			c.SetName(reflect.TypeOf(err).Name())
-			c.SetDescription(err.Error())
-		}
-	}
-}
-
-func (c Connection) Session() (Session, error) {
-	s := Session{C.pn_session(c.pn)}
-	if s.IsNil() {
-		return s, Connection(c).Error()
-	}
-	return s, nil
-}
-
-// pnTime converts Go time.Time to Proton millisecond Unix time.
-//
-// Note: t.isZero() is converted to C.pn_timestamp_t(0) and vice-versa. These
-// are used as "not set" sentinel values by the Go and Proton APIs, so it is
-// better to conserve the "zeroness" even though they don't represent the same
-// time instant.
-//
-func pnTime(t time.Time) (pnt C.pn_timestamp_t) {
-	if !t.IsZero() {
-		pnt = C.pn_timestamp_t(t.Unix()*1000 + int64(t.Nanosecond())/int64(time.Millisecond))
-	}
-	return
-}
-
-// goTime converts a pn_timestamp_t to a Go time.Time.
-//
-// Note: C.pn_timestamp_t(0) is converted to a zero time.Time and
-// vice-versa. These are used as "not set" sentinel values by the Go and Proton
-// APIs, so it is better to conserve the "zeroness" even though they don't
-// represent the same time instant.
-//
-func goTime(pnt C.pn_timestamp_t) (t time.Time) {
-	if pnt != 0 {
-		t = time.Unix(int64(pnt/1000), int64(pnt%1000)*int64(time.Millisecond))
-	}
-	return
-}
-
-// Special treatment for Transport.Head, return value is unsafe.Pointer not string
-func (t Transport) Head() unsafe.Pointer {
-	return unsafe.Pointer(C.pn_transport_head(t.pn))
-}
-
-// Special treatment for Transport.Tail, return value is unsafe.Pointer not string
-func (t Transport) Tail() unsafe.Pointer {
-	return unsafe.Pointer(C.pn_transport_tail(t.pn))
-}
-
-// Special treatment for Transport.Push, takes []byte instead of char*, size
-func (t Transport) Push(bytes []byte) int {
-	return int(C.pn_transport_push(t.pn, (*C.char)(unsafe.Pointer(&bytes[0])), C.size_t(len(bytes))))
-}
-
-// Get the SASL object for the transport.
-func (t Transport) SASL() SASL {
-	return SASL{C.pn_sasl(t.pn)}
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/proton/wrappers_gen.go b/proton-c/bindings/go/src/qpid.apache.org/proton/wrappers_gen.go
deleted file mode 100644
index 19bfde2..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/proton/wrappers_gen.go
+++ /dev/null
@@ -1,937 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
-*/
-
-//
-// NOTE: DO NOT EDIT. This file was generated by genwrap.go from the proton header files.
-// Update the generator and re-run if you need to modify this code.
-//
-
-package proton
-
-import (
-	"time"
-	"unsafe"
-)
-
-// #include <proton/types.h>
-// #include <proton/error.h>
-// #include <proton/condition.h>
-// #include <proton/event.h>
-// #include <stdlib.h>
-// #include <proton/session.h>
-// #include <proton/link.h>
-// #include <proton/delivery.h>
-// #include <proton/disposition.h>
-// #include <proton/condition.h>
-// #include <proton/terminus.h>
-// #include <proton/connection.h>
-// #include <proton/transport.h>
-// #include <proton/sasl.h>
-import "C"
-
-type EventType int
-
-const (
-	EConnectionInit         EventType = C.PN_CONNECTION_INIT
-	EConnectionBound        EventType = C.PN_CONNECTION_BOUND
-	EConnectionUnbound      EventType = C.PN_CONNECTION_UNBOUND
-	EConnectionLocalOpen    EventType = C.PN_CONNECTION_LOCAL_OPEN
-	EConnectionRemoteOpen   EventType = C.PN_CONNECTION_REMOTE_OPEN
-	EConnectionLocalClose   EventType = C.PN_CONNECTION_LOCAL_CLOSE
-	EConnectionRemoteClose  EventType = C.PN_CONNECTION_REMOTE_CLOSE
-	EConnectionFinal        EventType = C.PN_CONNECTION_FINAL
-	ESessionInit            EventType = C.PN_SESSION_INIT
-	ESessionLocalOpen       EventType = C.PN_SESSION_LOCAL_OPEN
-	ESessionRemoteOpen      EventType = C.PN_SESSION_REMOTE_OPEN
-	ESessionLocalClose      EventType = C.PN_SESSION_LOCAL_CLOSE
-	ESessionRemoteClose     EventType = C.PN_SESSION_REMOTE_CLOSE
-	ESessionFinal           EventType = C.PN_SESSION_FINAL
-	ELinkInit               EventType = C.PN_LINK_INIT
-	ELinkLocalOpen          EventType = C.PN_LINK_LOCAL_OPEN
-	ELinkRemoteOpen         EventType = C.PN_LINK_REMOTE_OPEN
-	ELinkLocalClose         EventType = C.PN_LINK_LOCAL_CLOSE
-	ELinkRemoteClose        EventType = C.PN_LINK_REMOTE_CLOSE
-	ELinkLocalDetach        EventType = C.PN_LINK_LOCAL_DETACH
-	ELinkRemoteDetach       EventType = C.PN_LINK_REMOTE_DETACH
-	ELinkFlow               EventType = C.PN_LINK_FLOW
-	ELinkFinal              EventType = C.PN_LINK_FINAL
-	EDelivery               EventType = C.PN_DELIVERY
-	ETransport              EventType = C.PN_TRANSPORT
-	ETransportAuthenticated EventType = C.PN_TRANSPORT_AUTHENTICATED
-	ETransportError         EventType = C.PN_TRANSPORT_ERROR
-	ETransportHeadClosed    EventType = C.PN_TRANSPORT_HEAD_CLOSED
-	ETransportTailClosed    EventType = C.PN_TRANSPORT_TAIL_CLOSED
-	ETransportClosed        EventType = C.PN_TRANSPORT_CLOSED
-)
-
-func (e EventType) String() string {
-	switch e {
-
-	case C.PN_CONNECTION_INIT:
-		return "ConnectionInit"
-	case C.PN_CONNECTION_BOUND:
-		return "ConnectionBound"
-	case C.PN_CONNECTION_UNBOUND:
-		return "ConnectionUnbound"
-	case C.PN_CONNECTION_LOCAL_OPEN:
-		return "ConnectionLocalOpen"
-	case C.PN_CONNECTION_REMOTE_OPEN:
-		return "ConnectionRemoteOpen"
-	case C.PN_CONNECTION_LOCAL_CLOSE:
-		return "ConnectionLocalClose"
-	case C.PN_CONNECTION_REMOTE_CLOSE:
-		return "ConnectionRemoteClose"
-	case C.PN_CONNECTION_FINAL:
-		return "ConnectionFinal"
-	case C.PN_SESSION_INIT:
-		return "SessionInit"
-	case C.PN_SESSION_LOCAL_OPEN:
-		return "SessionLocalOpen"
-	case C.PN_SESSION_REMOTE_OPEN:
-		return "SessionRemoteOpen"
-	case C.PN_SESSION_LOCAL_CLOSE:
-		return "SessionLocalClose"
-	case C.PN_SESSION_REMOTE_CLOSE:
-		return "SessionRemoteClose"
-	case C.PN_SESSION_FINAL:
-		return "SessionFinal"
-	case C.PN_LINK_INIT:
-		return "LinkInit"
-	case C.PN_LINK_LOCAL_OPEN:
-		return "LinkLocalOpen"
-	case C.PN_LINK_REMOTE_OPEN:
-		return "LinkRemoteOpen"
-	case C.PN_LINK_LOCAL_CLOSE:
-		return "LinkLocalClose"
-	case C.PN_LINK_REMOTE_CLOSE:
-		return "LinkRemoteClose"
-	case C.PN_LINK_LOCAL_DETACH:
-		return "LinkLocalDetach"
-	case C.PN_LINK_REMOTE_DETACH:
-		return "LinkRemoteDetach"
-	case C.PN_LINK_FLOW:
-		return "LinkFlow"
-	case C.PN_LINK_FINAL:
-		return "LinkFinal"
-	case C.PN_DELIVERY:
-		return "Delivery"
-	case C.PN_TRANSPORT:
-		return "Transport"
-	case C.PN_TRANSPORT_AUTHENTICATED:
-		return "TransportAuthenticated"
-	case C.PN_TRANSPORT_ERROR:
-		return "TransportError"
-	case C.PN_TRANSPORT_HEAD_CLOSED:
-		return "TransportHeadClosed"
-	case C.PN_TRANSPORT_TAIL_CLOSED:
-		return "TransportTailClosed"
-	case C.PN_TRANSPORT_CLOSED:
-		return "TransportClosed"
-	}
-	return "Unknown"
-}
-
-// Wrappers for declarations in session.h
-
-type Session struct{ pn *C.pn_session_t }
-
-func (s Session) IsNil() bool          { return s.pn == nil }
-func (s Session) CPtr() unsafe.Pointer { return unsafe.Pointer(s.pn) }
-func (s Session) Free() {
-	C.pn_session_free(s.pn)
-}
-func (s Session) State() State {
-	return State(C.pn_session_state(s.pn))
-}
-func (s Session) Error() error {
-	return PnError(C.pn_session_error(s.pn))
-}
-func (s Session) Condition() Condition {
-	return Condition{C.pn_session_condition(s.pn)}
-}
-func (s Session) RemoteCondition() Condition {
-	return Condition{C.pn_session_remote_condition(s.pn)}
-}
-func (s Session) Connection() Connection {
-	return Connection{C.pn_session_connection(s.pn)}
-}
-func (s Session) Open() {
-	C.pn_session_open(s.pn)
-}
-func (s Session) Close() {
-	C.pn_session_close(s.pn)
-}
-func (s Session) IncomingCapacity() uint {
-	return uint(C.pn_session_get_incoming_capacity(s.pn))
-}
-func (s Session) SetIncomingCapacity(capacity uint) {
-	C.pn_session_set_incoming_capacity(s.pn, C.size_t(capacity))
-}
-func (s Session) OutgoingWindow() uint {
-	return uint(C.pn_session_get_outgoing_window(s.pn))
-}
-func (s Session) SetOutgoingWindow(window uint) {
-	C.pn_session_set_outgoing_window(s.pn, C.size_t(window))
-}
-func (s Session) OutgoingBytes() uint {
-	return uint(C.pn_session_outgoing_bytes(s.pn))
-}
-func (s Session) IncomingBytes() uint {
-	return uint(C.pn_session_incoming_bytes(s.pn))
-}
-func (s Session) Next(state State) Session {
-	return Session{C.pn_session_next(s.pn, C.pn_state_t(state))}
-}
-
-// Wrappers for declarations in link.h
-
-type SndSettleMode C.pn_snd_settle_mode_t
-
-const (
-	SndUnsettled SndSettleMode = C.PN_SND_UNSETTLED
-	SndSettled   SndSettleMode = C.PN_SND_SETTLED
-	SndMixed     SndSettleMode = C.PN_SND_MIXED
-)
-
-func (e SndSettleMode) String() string {
-	switch e {
-
-	case C.PN_SND_UNSETTLED:
-		return "SndUnsettled"
-	case C.PN_SND_SETTLED:
-		return "SndSettled"
-	case C.PN_SND_MIXED:
-		return "SndMixed"
-	}
-	return "unknown"
-}
-
-type RcvSettleMode C.pn_rcv_settle_mode_t
-
-const (
-	RcvFirst  RcvSettleMode = C.PN_RCV_FIRST
-	RcvSecond RcvSettleMode = C.PN_RCV_SECOND
-)
-
-func (e RcvSettleMode) String() string {
-	switch e {
-
-	case C.PN_RCV_FIRST:
-		return "RcvFirst"
-	case C.PN_RCV_SECOND:
-		return "RcvSecond"
-	}
-	return "unknown"
-}
-
-type Link struct{ pn *C.pn_link_t }
-
-func (l Link) IsNil() bool          { return l.pn == nil }
-func (l Link) CPtr() unsafe.Pointer { return unsafe.Pointer(l.pn) }
-func (l Link) Free() {
-	C.pn_link_free(l.pn)
-}
-func (l Link) Name() string {
-	return C.GoString(C.pn_link_name(l.pn))
-}
-func (l Link) IsSender() bool {
-	return bool(C.pn_link_is_sender(l.pn))
-}
-func (l Link) IsReceiver() bool {
-	return bool(C.pn_link_is_receiver(l.pn))
-}
-func (l Link) State() State {
-	return State(C.pn_link_state(l.pn))
-}
-func (l Link) Error() error {
-	return PnError(C.pn_link_error(l.pn))
-}
-func (l Link) Condition() Condition {
-	return Condition{C.pn_link_condition(l.pn)}
-}
-func (l Link) RemoteCondition() Condition {
-	return Condition{C.pn_link_remote_condition(l.pn)}
-}
-func (l Link) Session() Session {
-	return Session{C.pn_link_session(l.pn)}
-}
-func (l Link) Next(state State) Link {
-	return Link{C.pn_link_next(l.pn, C.pn_state_t(state))}
-}
-func (l Link) Open() {
-	C.pn_link_open(l.pn)
-}
-func (l Link) Close() {
-	C.pn_link_close(l.pn)
-}
-func (l Link) Detach() {
-	C.pn_link_detach(l.pn)
-}
-func (l Link) Source() Terminus {
-	return Terminus{C.pn_link_source(l.pn)}
-}
-func (l Link) Target() Terminus {
-	return Terminus{C.pn_link_target(l.pn)}
-}
-func (l Link) RemoteSource() Terminus {
-	return Terminus{C.pn_link_remote_source(l.pn)}
-}
-func (l Link) RemoteTarget() Terminus {
-	return Terminus{C.pn_link_remote_target(l.pn)}
-}
-func (l Link) Current() Delivery {
-	return Delivery{C.pn_link_current(l.pn)}
-}
-func (l Link) Advance() bool {
-	return bool(C.pn_link_advance(l.pn))
-}
-func (l Link) Credit() int {
-	return int(C.pn_link_credit(l.pn))
-}
-func (l Link) Queued() int {
-	return int(C.pn_link_queued(l.pn))
-}
-func (l Link) RemoteCredit() int {
-	return int(C.pn_link_remote_credit(l.pn))
-}
-func (l Link) Drained() int {
-	return int(C.pn_link_drained(l.pn))
-}
-func (l Link) Available() int {
-	return int(C.pn_link_available(l.pn))
-}
-func (l Link) SndSettleMode() SndSettleMode {
-	return SndSettleMode(C.pn_link_snd_settle_mode(l.pn))
-}
-func (l Link) RcvSettleMode() RcvSettleMode {
-	return RcvSettleMode(C.pn_link_rcv_settle_mode(l.pn))
-}
-func (l Link) SetSndSettleMode(mode SndSettleMode) {
-	C.pn_link_set_snd_settle_mode(l.pn, C.pn_snd_settle_mode_t(mode))
-}
-func (l Link) SetRcvSettleMode(mode RcvSettleMode) {
-	C.pn_link_set_rcv_settle_mode(l.pn, C.pn_rcv_settle_mode_t(mode))
-}
-func (l Link) RemoteSndSettleMode() SndSettleMode {
-	return SndSettleMode(C.pn_link_remote_snd_settle_mode(l.pn))
-}
-func (l Link) RemoteRcvSettleMode() RcvSettleMode {
-	return RcvSettleMode(C.pn_link_remote_rcv_settle_mode(l.pn))
-}
-func (l Link) Unsettled() int {
-	return int(C.pn_link_unsettled(l.pn))
-}
-func (l Link) Offered(credit int) {
-	C.pn_link_offered(l.pn, C.int(credit))
-}
-func (l Link) Flow(credit int) {
-	C.pn_link_flow(l.pn, C.int(credit))
-}
-func (l Link) Drain(credit int) {
-	C.pn_link_drain(l.pn, C.int(credit))
-}
-func (l Link) SetDrain(drain bool) {
-	C.pn_link_set_drain(l.pn, C.bool(drain))
-}
-func (l Link) Draining() bool {
-	return bool(C.pn_link_draining(l.pn))
-}
-
-// Wrappers for declarations in delivery.h
-
-type Delivery struct{ pn *C.pn_delivery_t }
-
-func (d Delivery) IsNil() bool          { return d.pn == nil }
-func (d Delivery) CPtr() unsafe.Pointer { return unsafe.Pointer(d.pn) }
-func (d Delivery) Tag() DeliveryTag {
-	return DeliveryTag{C.pn_delivery_tag(d.pn)}
-}
-func (d Delivery) Link() Link {
-	return Link{C.pn_delivery_link(d.pn)}
-}
-func (d Delivery) Local() Disposition {
-	return Disposition{C.pn_delivery_local(d.pn)}
-}
-func (d Delivery) LocalState() uint64 {
-	return uint64(C.pn_delivery_local_state(d.pn))
-}
-func (d Delivery) Remote() Disposition {
-	return Disposition{C.pn_delivery_remote(d.pn)}
-}
-func (d Delivery) RemoteState() uint64 {
-	return uint64(C.pn_delivery_remote_state(d.pn))
-}
-func (d Delivery) Settled() bool {
-	return bool(C.pn_delivery_settled(d.pn))
-}
-func (d Delivery) Pending() uint {
-	return uint(C.pn_delivery_pending(d.pn))
-}
-func (d Delivery) Partial() bool {
-	return bool(C.pn_delivery_partial(d.pn))
-}
-func (d Delivery) Writable() bool {
-	return bool(C.pn_delivery_writable(d.pn))
-}
-func (d Delivery) Readable() bool {
-	return bool(C.pn_delivery_readable(d.pn))
-}
-func (d Delivery) Updated() bool {
-	return bool(C.pn_delivery_updated(d.pn))
-}
-func (d Delivery) Update(state uint64) {
-	C.pn_delivery_update(d.pn, C.uint64_t(state))
-}
-func (d Delivery) Clear() {
-	C.pn_delivery_clear(d.pn)
-}
-func (d Delivery) Current() bool {
-	return bool(C.pn_delivery_current(d.pn))
-}
-func (d Delivery) Settle() {
-	C.pn_delivery_settle(d.pn)
-}
-func (d Delivery) Dump() {
-	C.pn_delivery_dump(d.pn)
-}
-func (d Delivery) Buffered() bool {
-	return bool(C.pn_delivery_buffered(d.pn))
-}
-
-// Wrappers for declarations in disposition.h
-
-type Disposition struct{ pn *C.pn_disposition_t }
-
-func (d Disposition) IsNil() bool          { return d.pn == nil }
-func (d Disposition) CPtr() unsafe.Pointer { return unsafe.Pointer(d.pn) }
-func (d Disposition) Type() uint64 {
-	return uint64(C.pn_disposition_type(d.pn))
-}
-func (d Disposition) Condition() Condition {
-	return Condition{C.pn_disposition_condition(d.pn)}
-}
-func (d Disposition) Data() Data {
-	return Data{C.pn_disposition_data(d.pn)}
-}
-func (d Disposition) SectionNumber() uint16 {
-	return uint16(C.pn_disposition_get_section_number(d.pn))
-}
-func (d Disposition) SetSectionNumber(section_number uint16) {
-	C.pn_disposition_set_section_number(d.pn, C.uint32_t(section_number))
-}
-func (d Disposition) SectionOffset() uint64 {
-	return uint64(C.pn_disposition_get_section_offset(d.pn))
-}
-func (d Disposition) SetSectionOffset(section_offset uint64) {
-	C.pn_disposition_set_section_offset(d.pn, C.uint64_t(section_offset))
-}
-func (d Disposition) IsFailed() bool {
-	return bool(C.pn_disposition_is_failed(d.pn))
-}
-func (d Disposition) SetFailed(failed bool) {
-	C.pn_disposition_set_failed(d.pn, C.bool(failed))
-}
-func (d Disposition) IsUndeliverable() bool {
-	return bool(C.pn_disposition_is_undeliverable(d.pn))
-}
-func (d Disposition) SetUndeliverable(undeliverable bool) {
-	C.pn_disposition_set_undeliverable(d.pn, C.bool(undeliverable))
-}
-func (d Disposition) Annotations() Data {
-	return Data{C.pn_disposition_annotations(d.pn)}
-}
-
-// Wrappers for declarations in condition.h
-
-type Condition struct{ pn *C.pn_condition_t }
-
-func (c Condition) IsNil() bool          { return c.pn == nil }
-func (c Condition) CPtr() unsafe.Pointer { return unsafe.Pointer(c.pn) }
-func (c Condition) IsSet() bool {
-	return bool(C.pn_condition_is_set(c.pn))
-}
-func (c Condition) Clear() {
-	C.pn_condition_clear(c.pn)
-}
-func (c Condition) Name() string {
-	return C.GoString(C.pn_condition_get_name(c.pn))
-}
-func (c Condition) SetName(name string) int {
-	nameC := C.CString(name)
-	defer C.free(unsafe.Pointer(nameC))
-
-	return int(C.pn_condition_set_name(c.pn, nameC))
-}
-func (c Condition) Description() string {
-	return C.GoString(C.pn_condition_get_description(c.pn))
-}
-func (c Condition) SetDescription(description string) int {
-	descriptionC := C.CString(description)
-	defer C.free(unsafe.Pointer(descriptionC))
-
-	return int(C.pn_condition_set_description(c.pn, descriptionC))
-}
-func (c Condition) Info() Data {
-	return Data{C.pn_condition_info(c.pn)}
-}
-func (c Condition) IsRedirect() bool {
-	return bool(C.pn_condition_is_redirect(c.pn))
-}
-func (c Condition) RedirectHost() string {
-	return C.GoString(C.pn_condition_redirect_host(c.pn))
-}
-func (c Condition) RedirectPort() int {
-	return int(C.pn_condition_redirect_port(c.pn))
-}
-
-// Wrappers for declarations in terminus.h
-
-type TerminusType C.pn_terminus_type_t
-
-const (
-	Unspecified TerminusType = C.PN_UNSPECIFIED
-	Source      TerminusType = C.PN_SOURCE
-	Target      TerminusType = C.PN_TARGET
-	Coordinator TerminusType = C.PN_COORDINATOR
-)
-
-func (e TerminusType) String() string {
-	switch e {
-
-	case C.PN_UNSPECIFIED:
-		return "Unspecified"
-	case C.PN_SOURCE:
-		return "Source"
-	case C.PN_TARGET:
-		return "Target"
-	case C.PN_COORDINATOR:
-		return "Coordinator"
-	}
-	return "unknown"
-}
-
-type Durability C.pn_durability_t
-
-const (
-	Nondurable    Durability = C.PN_NONDURABLE
-	Configuration Durability = C.PN_CONFIGURATION
-	Deliveries    Durability = C.PN_DELIVERIES
-)
-
-func (e Durability) String() string {
-	switch e {
-
-	case C.PN_NONDURABLE:
-		return "Nondurable"
-	case C.PN_CONFIGURATION:
-		return "Configuration"
-	case C.PN_DELIVERIES:
-		return "Deliveries"
-	}
-	return "unknown"
-}
-
-type ExpiryPolicy C.pn_expiry_policy_t
-
-const (
-	ExpireWithLink       ExpiryPolicy = C.PN_EXPIRE_WITH_LINK
-	ExpireWithSession    ExpiryPolicy = C.PN_EXPIRE_WITH_SESSION
-	ExpireWithConnection ExpiryPolicy = C.PN_EXPIRE_WITH_CONNECTION
-	ExpireNever          ExpiryPolicy = C.PN_EXPIRE_NEVER
-)
-
-func (e ExpiryPolicy) String() string {
-	switch e {
-
-	case C.PN_EXPIRE_WITH_LINK:
-		return "ExpireWithLink"
-	case C.PN_EXPIRE_WITH_SESSION:
-		return "ExpireWithSession"
-	case C.PN_EXPIRE_WITH_CONNECTION:
-		return "ExpireWithConnection"
-	case C.PN_EXPIRE_NEVER:
-		return "ExpireNever"
-	}
-	return "unknown"
-}
-
-type DistributionMode C.pn_distribution_mode_t
-
-const (
-	DistModeUnspecified DistributionMode = C.PN_DIST_MODE_UNSPECIFIED
-	DistModeCopy        DistributionMode = C.PN_DIST_MODE_COPY
-	DistModeMove        DistributionMode = C.PN_DIST_MODE_MOVE
-)
-
-func (e DistributionMode) String() string {
-	switch e {
-
-	case C.PN_DIST_MODE_UNSPECIFIED:
-		return "DistModeUnspecified"
-	case C.PN_DIST_MODE_COPY:
-		return "DistModeCopy"
-	case C.PN_DIST_MODE_MOVE:
-		return "DistModeMove"
-	}
-	return "unknown"
-}
-
-type Terminus struct{ pn *C.pn_terminus_t }
-
-func (t Terminus) IsNil() bool          { return t.pn == nil }
-func (t Terminus) CPtr() unsafe.Pointer { return unsafe.Pointer(t.pn) }
-func (t Terminus) Type() TerminusType {
-	return TerminusType(C.pn_terminus_get_type(t.pn))
-}
-func (t Terminus) SetType(type_ TerminusType) int {
-	return int(C.pn_terminus_set_type(t.pn, C.pn_terminus_type_t(type_)))
-}
-func (t Terminus) Address() string {
-	return C.GoString(C.pn_terminus_get_address(t.pn))
-}
-func (t Terminus) SetAddress(address string) int {
-	addressC := C.CString(address)
-	defer C.free(unsafe.Pointer(addressC))
-
-	return int(C.pn_terminus_set_address(t.pn, addressC))
-}
-func (t Terminus) SetDistributionMode(mode DistributionMode) int {
-	return int(C.pn_terminus_set_distribution_mode(t.pn, C.pn_distribution_mode_t(mode)))
-}
-func (t Terminus) Durability() Durability {
-	return Durability(C.pn_terminus_get_durability(t.pn))
-}
-func (t Terminus) SetDurability(durability Durability) int {
-	return int(C.pn_terminus_set_durability(t.pn, C.pn_durability_t(durability)))
-}
-func (t Terminus) ExpiryPolicy() ExpiryPolicy {
-	return ExpiryPolicy(C.pn_terminus_get_expiry_policy(t.pn))
-}
-func (t Terminus) SetExpiryPolicy(policy ExpiryPolicy) int {
-	return int(C.pn_terminus_set_expiry_policy(t.pn, C.pn_expiry_policy_t(policy)))
-}
-func (t Terminus) Timeout() time.Duration {
-	return (time.Duration(C.pn_terminus_get_timeout(t.pn)) * time.Second)
-}
-func (t Terminus) SetTimeout(timeout time.Duration) int {
-	return int(C.pn_terminus_set_timeout(t.pn, C.pn_seconds_t(timeout)))
-}
-func (t Terminus) IsDynamic() bool {
-	return bool(C.pn_terminus_is_dynamic(t.pn))
-}
-func (t Terminus) SetDynamic(dynamic bool) int {
-	return int(C.pn_terminus_set_dynamic(t.pn, C.bool(dynamic)))
-}
-func (t Terminus) Properties() Data {
-	return Data{C.pn_terminus_properties(t.pn)}
-}
-func (t Terminus) Capabilities() Data {
-	return Data{C.pn_terminus_capabilities(t.pn)}
-}
-func (t Terminus) Outcomes() Data {
-	return Data{C.pn_terminus_outcomes(t.pn)}
-}
-func (t Terminus) Filter() Data {
-	return Data{C.pn_terminus_filter(t.pn)}
-}
-func (t Terminus) Copy(src Terminus) int {
-	return int(C.pn_terminus_copy(t.pn, src.pn))
-}
-
-// Wrappers for declarations in connection.h
-
-type Connection struct{ pn *C.pn_connection_t }
-
-func (c Connection) IsNil() bool          { return c.pn == nil }
-func (c Connection) CPtr() unsafe.Pointer { return unsafe.Pointer(c.pn) }
-func (c Connection) Free() {
-	C.pn_connection_free(c.pn)
-}
-func (c Connection) Release() {
-	C.pn_connection_release(c.pn)
-}
-func (c Connection) Error() error {
-	return PnError(C.pn_connection_error(c.pn))
-}
-func (c Connection) State() State {
-	return State(C.pn_connection_state(c.pn))
-}
-func (c Connection) Open() {
-	C.pn_connection_open(c.pn)
-}
-func (c Connection) Close() {
-	C.pn_connection_close(c.pn)
-}
-func (c Connection) Reset() {
-	C.pn_connection_reset(c.pn)
-}
-func (c Connection) Condition() Condition {
-	return Condition{C.pn_connection_condition(c.pn)}
-}
-func (c Connection) RemoteCondition() Condition {
-	return Condition{C.pn_connection_remote_condition(c.pn)}
-}
-func (c Connection) Container() string {
-	return C.GoString(C.pn_connection_get_container(c.pn))
-}
-func (c Connection) SetContainer(container string) {
-	containerC := C.CString(container)
-	defer C.free(unsafe.Pointer(containerC))
-
-	C.pn_connection_set_container(c.pn, containerC)
-}
-func (c Connection) SetUser(user string) {
-	userC := C.CString(user)
-	defer C.free(unsafe.Pointer(userC))
-
-	C.pn_connection_set_user(c.pn, userC)
-}
-func (c Connection) User() string {
-	return C.GoString(C.pn_connection_get_user(c.pn))
-}
-func (c Connection) Hostname() string {
-	return C.GoString(C.pn_connection_get_hostname(c.pn))
-}
-func (c Connection) SetHostname(hostname string) {
-	hostnameC := C.CString(hostname)
-	defer C.free(unsafe.Pointer(hostnameC))
-
-	C.pn_connection_set_hostname(c.pn, hostnameC)
-}
-func (c Connection) RemoteContainer() string {
-	return C.GoString(C.pn_connection_remote_container(c.pn))
-}
-func (c Connection) RemoteHostname() string {
-	return C.GoString(C.pn_connection_remote_hostname(c.pn))
-}
-func (c Connection) OfferedCapabilities() Data {
-	return Data{C.pn_connection_offered_capabilities(c.pn)}
-}
-func (c Connection) DesiredCapabilities() Data {
-	return Data{C.pn_connection_desired_capabilities(c.pn)}
-}
-func (c Connection) Properties() Data {
-	return Data{C.pn_connection_properties(c.pn)}
-}
-func (c Connection) RemoteOfferedCapabilities() Data {
-	return Data{C.pn_connection_remote_offered_capabilities(c.pn)}
-}
-func (c Connection) RemoteDesiredCapabilities() Data {
-	return Data{C.pn_connection_remote_desired_capabilities(c.pn)}
-}
-func (c Connection) RemoteProperties() Data {
-	return Data{C.pn_connection_remote_properties(c.pn)}
-}
-func (c Connection) Transport() Transport {
-	return Transport{C.pn_connection_transport(c.pn)}
-}
-
-// Wrappers for declarations in transport.h
-
-type Transport struct{ pn *C.pn_transport_t }
-
-func (t Transport) IsNil() bool          { return t.pn == nil }
-func (t Transport) CPtr() unsafe.Pointer { return unsafe.Pointer(t.pn) }
-func (t Transport) SetServer() {
-	C.pn_transport_set_server(t.pn)
-}
-func (t Transport) Free() {
-	C.pn_transport_free(t.pn)
-}
-func (t Transport) User() string {
-	return C.GoString(C.pn_transport_get_user(t.pn))
-}
-func (t Transport) RequireAuth(required bool) {
-	C.pn_transport_require_auth(t.pn, C.bool(required))
-}
-func (t Transport) IsAuthenticated() bool {
-	return bool(C.pn_transport_is_authenticated(t.pn))
-}
-func (t Transport) RequireEncryption(required bool) {
-	C.pn_transport_require_encryption(t.pn, C.bool(required))
-}
-func (t Transport) IsEncrypted() bool {
-	return bool(C.pn_transport_is_encrypted(t.pn))
-}
-func (t Transport) Condition() Condition {
-	return Condition{C.pn_transport_condition(t.pn)}
-}
-func (t Transport) Error() error {
-	return PnError(C.pn_transport_error(t.pn))
-}
-func (t Transport) Bind(connection Connection) int {
-	return int(C.pn_transport_bind(t.pn, connection.pn))
-}
-func (t Transport) Unbind() int {
-	return int(C.pn_transport_unbind(t.pn))
-}
-func (t Transport) Log(message string) {
-	messageC := C.CString(message)
-	defer C.free(unsafe.Pointer(messageC))
-
-	C.pn_transport_log(t.pn, messageC)
-}
-func (t Transport) ChannelMax() uint32 {
-	return uint32(C.pn_transport_get_channel_max(t.pn))
-}
-func (t Transport) SetChannelMax(channel_max uint32) int {
-	return int(C.pn_transport_set_channel_max(t.pn, C.uint16_t(channel_max)))
-}
-func (t Transport) RemoteChannelMax() uint32 {
-	return uint32(C.pn_transport_remote_channel_max(t.pn))
-}
-func (t Transport) MaxFrame() uint16 {
-	return uint16(C.pn_transport_get_max_frame(t.pn))
-}
-func (t Transport) SetMaxFrame(size uint16) {
-	C.pn_transport_set_max_frame(t.pn, C.uint32_t(size))
-}
-func (t Transport) RemoteMaxFrame() uint16 {
-	return uint16(C.pn_transport_get_remote_max_frame(t.pn))
-}
-func (t Transport) IdleTimeout() time.Duration {
-	return (time.Duration(C.pn_transport_get_idle_timeout(t.pn)) * time.Millisecond)
-}
-func (t Transport) SetIdleTimeout(timeout time.Duration) {
-	C.pn_transport_set_idle_timeout(t.pn, C.pn_millis_t(timeout/time.Millisecond))
-}
-func (t Transport) RemoteIdleTimeout() time.Duration {
-	return (time.Duration(C.pn_transport_get_remote_idle_timeout(t.pn)) * time.Millisecond)
-}
-func (t Transport) Input(bytes string, available uint) int {
-	bytesC := C.CString(bytes)
-	defer C.free(unsafe.Pointer(bytesC))
-
-	return int(C.pn_transport_input(t.pn, bytesC, C.size_t(available)))
-}
-func (t Transport) Output(bytes string, size uint) int {
-	bytesC := C.CString(bytes)
-	defer C.free(unsafe.Pointer(bytesC))
-
-	return int(C.pn_transport_output(t.pn, bytesC, C.size_t(size)))
-}
-func (t Transport) Capacity() int {
-	return int(C.pn_transport_capacity(t.pn))
-}
-func (t Transport) Process(size uint) int {
-	return int(C.pn_transport_process(t.pn, C.size_t(size)))
-}
-func (t Transport) CloseTail() int {
-	return int(C.pn_transport_close_tail(t.pn))
-}
-func (t Transport) Pending() int {
-	return int(C.pn_transport_pending(t.pn))
-}
-func (t Transport) Peek(dst string, size uint) int {
-	dstC := C.CString(dst)
-	defer C.free(unsafe.Pointer(dstC))
-
-	return int(C.pn_transport_peek(t.pn, dstC, C.size_t(size)))
-}
-func (t Transport) Pop(size uint) {
-	C.pn_transport_pop(t.pn, C.size_t(size))
-}
-func (t Transport) CloseHead() int {
-	return int(C.pn_transport_close_head(t.pn))
-}
-func (t Transport) Quiesced() bool {
-	return bool(C.pn_transport_quiesced(t.pn))
-}
-func (t Transport) Closed() bool {
-	return bool(C.pn_transport_closed(t.pn))
-}
-func (t Transport) Tick(now time.Time) time.Time {
-	return goTime(C.pn_transport_tick(t.pn, pnTime(now)))
-}
-func (t Transport) Connection() Connection {
-	return Connection{C.pn_transport_connection(t.pn)}
-}
-
-// Wrappers for declarations in sasl.h
-
-type SASLOutcome C.pn_sasl_outcome_t
-
-const (
-	SASLNone SASLOutcome = C.PN_SASL_NONE
-	SASLOk   SASLOutcome = C.PN_SASL_OK
-	SASLAuth SASLOutcome = C.PN_SASL_AUTH
-	SASLSys  SASLOutcome = C.PN_SASL_SYS
-	SASLPerm SASLOutcome = C.PN_SASL_PERM
-	SASLTemp SASLOutcome = C.PN_SASL_TEMP
-)
-
-func (e SASLOutcome) String() string {
-	switch e {
-
-	case C.PN_SASL_NONE:
-		return "SASLNone"
-	case C.PN_SASL_OK:
-		return "SASLOk"
-	case C.PN_SASL_AUTH:
-		return "SASLAuth"
-	case C.PN_SASL_SYS:
-		return "SASLSys"
-	case C.PN_SASL_PERM:
-		return "SASLPerm"
-	case C.PN_SASL_TEMP:
-		return "SASLTemp"
-	}
-	return "unknown"
-}
-
-type SASL struct{ pn *C.pn_sasl_t }
-
-func (s SASL) IsNil() bool          { return s.pn == nil }
-func (s SASL) CPtr() unsafe.Pointer { return unsafe.Pointer(s.pn) }
-func (s SASL) Done(outcome SASLOutcome) {
-	C.pn_sasl_done(s.pn, C.pn_sasl_outcome_t(outcome))
-}
-func (s SASL) Outcome() SASLOutcome {
-	return SASLOutcome(C.pn_sasl_outcome(s.pn))
-}
-func (s SASL) User() string {
-	return C.GoString(C.pn_sasl_get_user(s.pn))
-}
-func (s SASL) Mech() string {
-	return C.GoString(C.pn_sasl_get_mech(s.pn))
-}
-func (s SASL) AllowedMechs(mechs string) {
-	mechsC := C.CString(mechs)
-	defer C.free(unsafe.Pointer(mechsC))
-
-	C.pn_sasl_allowed_mechs(s.pn, mechsC)
-}
-func (s SASL) SetAllowInsecureMechs(insecure bool) {
-	C.pn_sasl_set_allow_insecure_mechs(s.pn, C.bool(insecure))
-}
-func (s SASL) AllowInsecureMechs() bool {
-	return bool(C.pn_sasl_get_allow_insecure_mechs(s.pn))
-}
-func (s SASL) ConfigName(name string) {
-	nameC := C.CString(name)
-	defer C.free(unsafe.Pointer(nameC))
-
-	C.pn_sasl_config_name(s.pn, nameC)
-}
-func (s SASL) ConfigPath(path string) {
-	pathC := C.CString(path)
-	defer C.free(unsafe.Pointer(pathC))
-
-	C.pn_sasl_config_path(s.pn, pathC)
-}
diff --git a/proton-c/bindings/go/src/qpid.apache.org/readme-go-get.md b/proton-c/bindings/go/src/qpid.apache.org/readme-go-get.md
deleted file mode 100644
index 6eb1e2b..0000000
--- a/proton-c/bindings/go/src/qpid.apache.org/readme-go-get.md
+++ /dev/null
@@ -1,18 +0,0 @@
-The go-only subtree of proton is maintained on the branch `go1` for the `go get`
-command.  `go1` is special to the `go get` command, it will use that branch
-rather than `master` when it is present.
-
-Created with:
-
-    git subtree split --prefix=proton-c/bindings/go/src/qpid.apache.org -b go1
-
-Update with:
-
-    git checkout go1
-    git merge -s recursive -Xsubtree=proton-c/bindings/go/src/qpid.apache.org master
-
-To see the branch description: `git config branch.go1.description`
-
-NOTE: when updating the branch, you should also visit the doc pages at
-https://godoc.org/?q=qpid.apache.org and click "Refresh now" at the bottom of
-the page
diff --git a/proton-c/bindings/javascript/CMakeLists.txt b/proton-c/bindings/javascript/CMakeLists.txt
deleted file mode 100644
index 971097c..0000000
--- a/proton-c/bindings/javascript/CMakeLists.txt
+++ /dev/null
@@ -1,279 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
- 
-# This file allows cross-compiling of proton to JavaScript using emscripten
-# (https://github.com/kripken/emscripten). As it is really a cross-compilation
-# (as opposed to a binding like with swig) the approach is rather different and
-# somewhat replicates the main build in the proton-c/CMakeLists.txt using quite
-# a bit of "copy and paste reuse".
-# TODO refactor this file (and proton-c/CMakeLists.txt) to keep the main
-# compilation and cross-compilation consistent.
-
-message(STATUS "Found emscripten, using that to build JavaScript binding")
-
-# Find and install the node.js packages that we might need. We can assume that
-# node.js itself is installed because Emscripten has a dependency on it.
-find_package(NodePackages)
-
-# Describe the target OS we are building to - Emscripten mimics the Linux platform.
-set(CMAKE_SYSTEM_NAME Linux)
-set(CMAKE_SYSTEM_VERSION 1)
-set(CMAKE_CROSSCOMPILING TRUE)
-
-# Specify the compiler to use for cross-compilation.
-set(CMAKE_C_COMPILER "${EMCC}")
-
-# Don't do compiler autodetection, since we are cross-compiling.
-include(CMakeForceCompiler)
-CMAKE_FORCE_C_COMPILER("${CMAKE_C_COMPILER}" Clang)
-
-# The Proton default build type is RelWithDebInfo, but for JavaScript the C debug
-# mechanism is irrelevant. If Debug is explicitly set we turn off optimisations
-# and don't run the closure compiler so any error/profiling messages are readable.
-if (CMAKE_BUILD_TYPE STREQUAL "Debug")
-    message(STATUS "JavaScript build type is \"Debug\"")
-else()
-    set(CMAKE_BUILD_TYPE Release)
-    message(STATUS "JavaScript build type is \"Release\"")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
-    set(EMSCRIPTEN_LINK_OPTIMISATIONS "-O2 --closure 1")
-endif()
-
-# From this point we should be using emscripten compilation tools.
-message(STATUS "emscripten compilation environment:")
-message(STATUS "CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}")
-
-
-# Set this to the proton-c directory, we're cross-compiling code from there.
-set(PN_PATH ${CMAKE_SOURCE_DIR}/proton-c)
-
-
-# TODO the OpenSSL stuff won't work for emscripten by default. It might well be
-# possible to compile it from source using emscripten (that's the standard practice
-# for libraries with emscripten) see https://github.com/kripken/emscripten/wiki/FAQ
-# "Q. How do I link against system libraries like SDL, boost, etc.?"
-# Though it might be more natural to simply use a TLS protected wss:// WebSocket URL.
-#  set(pn_ssl_impl src/ssl/openssl.c)
-#  set(SSL_LIB ${OPENSSL_LIBRARIES})
-set(pn_ssl_impl ${PN_PATH}/src/ssl/ssl_stub.c)
-
-# emscripten is Linux like so use the posix impls.
-set(pn_io_impl ${PN_PATH}/src/posix/io.c)
-set(pn_selector_impl ${PN_PATH}/src/posix/selector.c)
-
-CHECK_LIBRARY_EXISTS (uuid uuid_generate "" UUID_GENERATE_IN_UUID)
-if (UUID_GENERATE_IN_UUID)
-  set (UUID_LIB uuid)
-endif (UUID_GENERATE_IN_UUID)
-
-# Generate encodings.h and protocol.h
-# It may be possible to use the ones generated for the main proton-c build but
-# qpid-proton-core has a dependency on the generated files, so I'm not sure if
-# it'll work without a command that can be run as a dependency. Probably best
-# do it this way when cross-compiling - though more copy'n'paste
-add_custom_command(
-  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/encodings.h
-  COMMAND python ${PN_PATH}/env.py PYTHONPATH=${PN_PATH} python ${PN_PATH}/src/codec/encodings.h.py > ${CMAKE_CURRENT_BINARY_DIR}/encodings.h
-  DEPENDS ${PN_PATH}/src/codec/encodings.h.py
-  )
-
-add_custom_command(
-  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/protocol.h
-  COMMAND python ${PN_PATH}/env.py PYTHONPATH=${PN_PATH} python ${PN_PATH}/src/protocol.h.py > ${CMAKE_CURRENT_BINARY_DIR}/protocol.h
-  DEPENDS ${PN_PATH}/src/protocol.h.py
-  )
-
-set(COMPILE_WARNING_FLAGS "-Werror -Wall -pedantic-errors -Wno-comment -Wno-warn-absolute-paths")
-
-# Explicitly set PLATFORM_DEFINITIONS to Linux ones for emscripten as we don't
-# want to inadvertently use Windows versions if we happen to be cross-compiling
-# from a Windows platform
-set(PLATFORM_DEFINITIONS "USE_CLOCK_GETTIME;USE_UUID_GENERATE;USE_STRERROR_R;USE_ATOLL")
-
-# The following is largely a copy from the the main proton-c/CMakeLists.txt.
-# The main difference is prefixing paths with ${PN_PATH}/ as we can't use a
-# relative path from this CMakeLists.txt.
-
-set(qpid-proton-platform
-  ${pn_io_impl}
-  ${pn_selector_impl}
-  ${PN_PATH}/src/platform.c
-  ${pn_ssl_impl}
-  )
-
-set(qpid-proton-core
-  ${PN_PATH}/src/object/object.c
-  ${PN_PATH}/src/object/list.c
-  ${PN_PATH}/src/object/map.c
-  ${PN_PATH}/src/object/string.c
-  ${PN_PATH}/src/object/iterator.c
-  ${PN_PATH}/src/object/record.c
-
-  ${PN_PATH}/src/log.c
-  ${PN_PATH}/src/util.c
-  ${PN_PATH}/src/url.c
-  ${PN_PATH}/src/error.c
-  ${PN_PATH}/src/buffer.c
-  ${PN_PATH}/src/parser.c
-  ${PN_PATH}/src/scanner.c
-  ${PN_PATH}/src/types.c
-
-  ${PN_PATH}/src/framing/framing.c
-
-  ${PN_PATH}/src/codec/codec.c
-  ${PN_PATH}/src/codec/decoder.c
-  ${PN_PATH}/src/codec/encoder.c
-
-  ${PN_PATH}/src/dispatcher/dispatcher.c
-  ${PN_PATH}/src/engine/engine.c
-  ${PN_PATH}/src/events/event.c
-  ${PN_PATH}/src/transport/autodetect.c
-  ${PN_PATH}/src/transport/transport.c
-  ${PN_PATH}/src/message/message.c
-  ${PN_PATH}/src/sasl/sasl.c
-  ${PN_PATH}/src/sasl/none_sasl.c
-
-  ${PN_PATH}/src/messenger/messenger.c
-  ${PN_PATH}/src/messenger/subscription.c
-  ${PN_PATH}/src/messenger/store.c
-  ${PN_PATH}/src/messenger/transform.c
-  ${PN_PATH}/src/selectable.c
-
-  ${CMAKE_CURRENT_BINARY_DIR}/encodings.h
-  ${CMAKE_CURRENT_BINARY_DIR}/protocol.h
-  )
-
-set_source_files_properties(
-  ${qpid-proton-core}
-  PROPERTIES
-  COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_LANGUAGE_FLAGS}"
-  )
-
-set_source_files_properties(
-  ${qpid-proton-platform}
-  PROPERTIES
-  COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_PLATFORM_FLAGS}"
-  COMPILE_DEFINITIONS "${PLATFORM_DEFINITIONS}"
-  )
-
-# Compile Proton into LLVM bitcode which will be used later in the linking stage
-# of add_executable for compilation into Javascript.
-add_library(
-  qpid-proton-bitcode SHARED
-
-  ${qpid-proton-core}
-  ${qpid-proton-platform}
-  )
-
-set_target_properties(
-  qpid-proton-bitcode
-  PROPERTIES
-  VERSION   "${PN_LIB_SOMAJOR}.${PN_LIB_SOMINOR}"
-  SOVERSION "${PN_LIB_SOMAJOR}"
-  LINK_FLAGS "${CATCH_UNDEFINED}"
-  )
-target_link_libraries(qpid-proton-bitcode)
-
-
-# Compile the send-async.c and recv-async.c examples into JavaScript
-include_directories(${Proton_SOURCE_DIR}/examples/c/include)
-add_executable(send-async.js ${Proton_SOURCE_DIR}/examples/c/messenger/send-async.c)
-target_link_libraries(send-async.js qpid-proton-bitcode)
-
-add_executable(recv-async.js ${Proton_SOURCE_DIR}/examples/c/messenger/recv-async.c)
-target_link_libraries(recv-async.js qpid-proton-bitcode)
-
-set_target_properties(
-  send-async.js recv-async.js
-  PROPERTIES
-  COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_PLATFORM_FLAGS}"
-  RUNTIME_OUTPUT_DIRECTORY examples
-  DEPENDS ws
-
-  LINK_FLAGS "-s \"WEBSOCKET_SUBPROTOCOL='AMQPWSB10'\" -${EMSCRIPTEN_LINK_OPTIMISATIONS}"
-  )
-
-# Build the main JavaScript library called proton-messenger.js
-add_executable(proton-messenger.js binding.c)
-target_link_libraries(proton-messenger.js qpid-proton-bitcode ${UUID_LIB})
-
-set_target_properties(
-  proton-messenger.js
-  PROPERTIES
-  COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_PLATFORM_FLAGS}"
-
-  # The --memory-init-file 0 stops emscripten emitting a separate memory
-  # initialization file, if this was enabled it makes packaging harder as
-  # applications would expect proton-messenger.js.mem to be served too. It's even
-  # more fiddly with node.js packages. This behaviour might be reinstated if the
-  # packaging mechanism improves.
-
-  LINK_FLAGS "-s \"EXPORT_NAME='proton'\" -s \"WEBSOCKET_SUBPROTOCOL='AMQPWSB10'\" ${EMSCRIPTEN_LINK_OPTIMISATIONS} --memory-init-file 0 --pre-js ${CMAKE_CURRENT_SOURCE_DIR}/binding-open.js --pre-js ${CMAKE_CURRENT_SOURCE_DIR}/module.js --pre-js ${CMAKE_CURRENT_SOURCE_DIR}/error.js --pre-js ${CMAKE_CURRENT_SOURCE_DIR}/messenger.js --pre-js ${CMAKE_CURRENT_SOURCE_DIR}/subscription.js --pre-js ${CMAKE_CURRENT_SOURCE_DIR}/message.js --pre-js ${CMAKE_CURRENT_SOURCE_DIR}/data.js --pre-js ${CMAKE_CURRENT_SOURCE_DIR}/data-uuid.js --pre-js ${CMAKE_CURRENT_SOURCE_DIR}/data-symbol.js --pre-js ${CMAKE_CURRENT_SOURCE_DIR}/data-described.js --pre-js ${CMAKE_CURRENT_SOURCE_DIR}/data-array.js --pre-js ${CMAKE_CURRENT_SOURCE_DIR}/data-typed-number.js --pre-js ${CMAKE_CURRENT_SOURCE_DIR}/data-long.js --pre-js ${CMAKE_CURRENT_SOURCE_DIR}/data-binary.js --post-js ${CMAKE_CURRENT_SOURCE_DIR}/binding-close.js -s DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=\"[]\" -s EXPORTED_FUNCTIONS=\"['_pn_get_version_major', '_pn_get_version_minor', '_pn_uuid_generate', '_pn_bytes', '_pn_error_text', '_pn_code', '_pn_messenger', '_pn_messenger_name', '_pn_messenger_set_blocking', '_pn_messenger_free', '_pn_messenger_errno', '_pn_messenger_error', '_pn_messenger_get_outgoing_window', '_pn_messenger_set_outgoing_window', '_pn_messenger_get_incoming_window', '_pn_messenger_set_incoming_window', '_pn_messenger_start', '_pn_messenger_stop', '_pn_messenger_stopped', '_pn_messenger_subscribe', '_pn_messenger_put', '_pn_messenger_status', '_pn_messenger_buffered', '_pn_messenger_settle', '_pn_messenger_outgoing_tracker', '_pn_messenger_recv', '_pn_messenger_receiving', '_pn_messenger_get', '_pn_messenger_incoming_tracker', '_pn_messenger_incoming_subscription', '_pn_messenger_accept', '_pn_messenger_reject', '_pn_messenger_outgoing', '_pn_messenger_incoming',  '_pn_messenger_route', '_pn_messenger_rewrite', '_pn_messenger_set_passive', '_pn_messenger_selectable', '_pn_subscription_get_context', '_pn_subscription_set_context', '_pn_subscription_address', '_pn_message', '_pn_message_id', '_pn_message_correlation_id', '_pn_message_free', '_pn_message_errno', '_pn_message_error', '_pn_message_clear', '_pn_message_is_inferred', '_pn_message_set_inferred', '_pn_message_is_durable', '_pn_message_set_durable', '_pn_message_get_priority', '_pn_message_set_priority', '_pn_message_get_ttl', '_pn_message_set_ttl', '_pn_message_is_first_acquirer', '_pn_message_set_first_acquirer', '_pn_message_get_delivery_count', '_pn_message_set_delivery_count', '_pn_message_get_user_id', '_pn_message_set_user_id', '_pn_message_get_address', '_pn_message_set_address', '_pn_message_get_subject', '_pn_message_set_subject', '_pn_message_get_reply_to', '_pn_message_set_reply_to', '_pn_message_get_content_type', '_pn_message_set_content_type', '_pn_message_get_content_encoding', '_pn_message_set_content_encoding', '_pn_message_get_expiry_time', '_pn_message_set_expiry_time', '_pn_message_get_creation_time', '_pn_message_set_creation_time', '_pn_message_get_group_id', '_pn_message_set_group_id', '_pn_message_get_group_sequence', '_pn_message_set_group_sequence', '_pn_message_get_reply_to_group_id', '_pn_message_set_reply_to_group_id', '_pn_message_encode', '_pn_message_decode', '_pn_message_instructions', '_pn_message_annotations', '_pn_message_properties', '_pn_message_body', '_pn_data', '_pn_data_free', '_pn_data_error', '_pn_data_errno', '_pn_data_clear', '_pn_data_rewind', '_pn_data_next', '_pn_data_prev', '_pn_data_enter', '_pn_data_exit', '_pn_data_lookup', '_pn_data_narrow', '_pn_data_widen', '_pn_data_type', '_pn_data_encode', '_pn_data_decode', '_pn_data_put_list', '_pn_data_put_map', '_pn_data_put_array', '_pn_data_put_described', '_pn_data_put_null', '_pn_data_put_bool', '_pn_data_put_ubyte', '_pn_data_put_byte', '_pn_data_put_ushort', '_pn_data_put_short', '_pn_data_put_uint', '_pn_data_put_int', '_pn_data_put_char', '_pn_data_put_ulong', '_pn_data_put_long', '_pn_data_put_timestamp', '_pn_data_put_float', '_pn_data_put_double', '_pn_data_put_decimal32', '_pn_data_put_decimal64', '_pn_data_put_decimal128', '_pn_data_put_uuid', '_pn_data_put_binary', '_pn_data_put_string', '_pn_data_put_symbol', '_pn_data_get_list', '_pn_data_get_map', '_pn_data_get_array', '_pn_data_is_array_described', '_pn_data_get_array_type', '_pn_data_is_described', '_pn_data_is_null', '_pn_data_get_bool', '_pn_data_get_ubyte', '_pn_data_get_byte', '_pn_data_get_ushort', '_pn_data_get_short', '_pn_data_get_uint', '_pn_data_get_int', '_pn_data_get_char', '_pn_data_get_ulong', '_pn_data_get_long', '_pn_data_get_timestamp', '_pn_data_get_float', '_pn_data_get_double', '_pn_data_get_decimal32', '_pn_data_get_decimal64', '_pn_data_get_decimal128', '_pn_data_get_uuid', '_pn_data_get_binary', '_pn_data_get_string', '_pn_data_get_symbol', '_pn_data_copy', '_pn_data_format', '_pn_data_dump', '_pn_selectable_readable', '_pn_selectable_is_reading', '_pn_selectable_writable', '_pn_selectable_is_writing', '_pn_selectable_is_terminal', '_pn_selectable_get_fd', '_pn_selectable_free']\""
-  )
-
-# This command packages up the compiled proton-messenger.js into a node.js package
-# called qpid-proton-messenger and copies it to the <proton>/node_modules directory.
-# This allows the node.js test and example programs to do:
-# var proton = require("qpid-proton-messenger");
-add_custom_command(
-    TARGET proton-messenger.js
-    COMMAND ${CMAKE_COMMAND}
-            -E copy_directory 
-            ${CMAKE_CURRENT_SOURCE_DIR}/qpid-proton-messenger
-            ${PROJECT_SOURCE_DIR}/node_modules/qpid-proton-messenger
-    COMMAND ${CMAKE_COMMAND}
-            -E copy
-            ${CMAKE_CURRENT_BINARY_DIR}/proton-messenger.js
-            ${PROJECT_SOURCE_DIR}/node_modules/qpid-proton-messenger/lib
-   COMMENT "Building qpid-proton-messenger package for node.js"
-)
-
-# The cleanall target removes the qpid-proton-messenger package from <proton>/node_modules
-add_custom_target(
-    cleanall
-    COMMAND echo "CLEAN NODE MODULES"
-    COMMAND ${CMAKE_COMMAND}
-            -E remove_directory
-            ${PROJECT_SOURCE_DIR}/node_modules/qpid-proton-messenger
-)
-
-# If the docs target is specified and the jsdoc3 package for node.js has been
-# installed then build the JavaScript API documentation.
-if (NODE_JSDOC_FOUND)
-    set(JSDOC_EXE ${PROJECT_SOURCE_DIR}/node_modules/.bin/jsdoc)
-
-    message(STATUS "Documentation Enabled. Using ${JSDOC_EXE} to build JavaScript docs")
-    add_custom_target(docs-js COMMAND ${JSDOC_EXE}
-                      -d ${CMAKE_CURRENT_BINARY_DIR}/html
-                      ${CMAKE_CURRENT_SOURCE_DIR}/module.js
-                      ${CMAKE_CURRENT_SOURCE_DIR}/error.js
-                      ${CMAKE_CURRENT_SOURCE_DIR}/messenger.js
-                      ${CMAKE_CURRENT_SOURCE_DIR}/subscription.js
-                      ${CMAKE_CURRENT_SOURCE_DIR}/message.js
-                      ${CMAKE_CURRENT_SOURCE_DIR}/data.js
-                      ${CMAKE_CURRENT_SOURCE_DIR}/data-uuid.js
-                      ${CMAKE_CURRENT_SOURCE_DIR}/data-symbol.js
-                      ${CMAKE_CURRENT_SOURCE_DIR}/data-described.js
-                      ${CMAKE_CURRENT_SOURCE_DIR}/data-array.js
-                      ${CMAKE_CURRENT_SOURCE_DIR}/data-typed-number.js
-                      ${CMAKE_CURRENT_SOURCE_DIR}/data-long.js
-                      ${CMAKE_CURRENT_SOURCE_DIR}/data-binary.js)
-    add_dependencies(docs docs-js)
-endif (NODE_JSDOC_FOUND)
-
diff --git a/proton-c/bindings/javascript/LICENSE b/proton-c/bindings/javascript/LICENSE
deleted file mode 100644
index 6b0b127..0000000
--- a/proton-c/bindings/javascript/LICENSE
+++ /dev/null
@@ -1,203 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-
diff --git a/proton-c/bindings/javascript/README b/proton-c/bindings/javascript/README
deleted file mode 100644
index 2dea949..0000000
--- a/proton-c/bindings/javascript/README
+++ /dev/null
@@ -1,426 +0,0 @@
-Qpid Proton JavaScript Language Bindings
-========================================
-
-The code contained herein provides JavaScript language bindings for working
-with the Qpid Proton AMQP 1.0 protocol engine and messenger library.
-
-Important Note - Modern Browser Needed
-======================================
-
-The JavaScript binding requires ArrayBuffer/TypedArray and WebSocket support.
-Both of these are available in most "modern" browser versions. The author has
-only tried running on FireFox and Chrome, though recent Safari, Opera and IE10+
-*should* work too - YMMV. It might be possible to polyfill for older browsers
-but the author hasn't tried this.
-
-Important Note - WebSocket Transport!!!
-=======================================
-
-Before going any further it is really important to realise that the JavaScript
-bindings to Proton are somewhat different to the bindings for other languages
-because of the restrictions of the execution environment. In particular it is
-very important to note that the JavaScript bindings by default use a WebSocket
-transport and not a TCP transport, so whilst it's possible to create Server style
-applications that clients can connect to (e.g. recv.js and send.js) note that:
-
-JavaScript clients cannot *directly* talk to "normal" AMQP applications such as
-qpidd or (by default) the Java Broker because they use a standard TCP transport.
-
-This is a slightly irksome issue, but there's no getting away from it because
-it's a security restriction imposed by the browser environment.
-
-
-At the moment even for Node.js we are limited to using a WebSocket transport, but
-it is on the author's "TODO" list to look at providing a means to use either a
-WebSocket transport or a native TCP transport (via node's net library). It should
-also be possible to use native TCP for Chrome "packaged apps", but again this is
-only on the TODO list so if you want to talk to a "normal" AMQP application you
-must live with the WebSocket constraints.
-
-Option 1. proxy from WebSockets to TCP sockets. The application
-<proton>/examples/messenger/javascript/proxy.js
-is a simple Node.js WebSocket<->TCP Socket proxy, simply doing:
-
-node proxy.js
-
-will stand up a proxy listening by default on WebSocket port 5673 and forwarding
-to TCP port 5672 (this is configurable, for options do: node proxy.js -h)
-
-Rather than using a stand-alone proxy it is possible to have applications stand
-up their own proxy (where lport = listen port, thost = target host and
-tport = target port):
-
-var proxy = require('./ws2tcp.js');
-proxy.ws2tcp(lport, thost, tport);
-
-For talking to the C++ broker unfortunately proxying is currently the only option
-as qpidd does not have a WebSocket transport.
-
-Option 2. The Java Broker's WebSocket transport.
-Recent releases of the Qpid Java Broker provide a native WebSocket transport which
-means that the JavaScript binding can talk to it with no additional requirements.
-It is necessary to configure the Java Broker as the WebSocket transport is not
-enabled by default. In <qpid-work>/config.json in the "ports" array you need to add:
-
-{
-    "authenticationProvider" : "passwordFile",
-    "name" : "AMQP-WS",
-    "port" : "5673",
-    "transports" : [ "WS" ]
-}
-
-This sets the JavaBroker to listen on WebSocket port 5673 similar to the proxy.
-
-
-One gotcha that still bites the author *** DO NOT FORGET *** that you will be
-using ports that you are not used to!! If you are not connecting check that the
-proxy is running and that you are specifying the right ports. I still mess up :-(
-
-WebRTC Transport
-================
-
-A WebRTC Transport is supported by emscripten, though the author has not tried it.
-If you wan to play with this you are very much on your own at the moment YMMV.
-
-This is configured by adding to the LINK_FLAGS in CMakeLists.txt
--s \"SOCKET_WEBRTC=1\"
-
-  /* WebRTC sockets supports several options on the Module object.
-
-     * Module['host']: true if this peer is hosting, false otherwise
-     * Module['webrtc']['broker']: hostname for the p2p broker that this peer should use
-     * Module['webrtc']['session']: p2p session for that this peer will join, or undefined if this peer is hosting
-     * Module['webrtc']['hostOptions']: options to pass into p2p library if this peer is hosting
-     * Module['webrtc']['onpeer']: function(peer, route), invoked when this peer is ready to connect
-     * Module['webrtc']['onconnect']: function(peer), invoked when a new peer connection is ready
-     * Module['webrtc']['ondisconnect']: function(peer), invoked when an existing connection is closed
-     * Module['webrtc']['onerror']: function(error), invoked when an error occurs
-   */
-
-If you wanted to play with these you'd likely have to tweak the module.js code in
-<proton>/proton-c/bindings/javascript
-
-The emscripten documentation is a bit light on the WebRTC Transport too, though
-
-emscripten/tests/test_sockets.py
-emscripten/tests/sockets/webrtc_host.c
-emscripten/tests/sockets/webrtc_peer.c
-emscripten/tests/sockets/p2p/broker/p2p-broker.js
-emscripten/tests/sockets/p2p/client/p2p-client.js
-
-Look like they provide a starting point.
-Very much TODO......
-
-
-Creating The Bindings
-=====================
-
-To generate the JavaScript bindings we actually cross-compile from proton-c
-
-You will need to have emscripten (https://github.com/kripken/emscripten) installed
-to do the cross-compilation and in addition you will require a few things that
-emscripten itself depends upon.
-
-http://kripken.github.io/emscripten-site/docs/building_from_source/index.html#installing-from-source
-http://kripken.github.io/emscripten-site/docs/building_from_source/toolchain_what_is_needed.html
-provide instructions for installing emscripten and the "fastcomp" LLVM backend.
-This approach lets users use the "bleeding edge" version of emscripten on the
-"incoming" branch (pretty much analogous to building qpid/proton off svn trunk).
-This is the approach that the author of the JavaScript Bindings tends to use.
-
-
-http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html
-provides some fairly easy to follow instructions for getting started on several
-platforms the main dependencies are as follows (on Windows the SDK includes these):
-
-* The Emscripten code, from github (git clone git://github.com/kripken/emscripten.git).
-* LLVM with Clang. Emscripten uses LLVM and Clang, but at the moment the JavaScript
-  back-end for LLVM is off on a branch so you can't use a stock LLVM/Clang.
-  http://kripken.github.io/emscripten-site/docs/building_from_source/LLVM-Backend.html
-  http://kripken.github.io/emscripten-site/docs/building_from_source/building_fastcomp_manually_from_source.html#building-fastcomp-from-source
-  has lots of explanation and some easy to follow instructions for downloading
-  and building fastcomp
-* Node.js (0.8 or above; 0.10.17 or above to run websocket-using servers in node)
-* Python 2.7.3
-* Java is required in order to use the Closure Compiler to minify the code.
-  
-
-If you haven't run Emscripten before it's a good idea to have a play with the
-tutorial here:
-http://kripken.github.io/emscripten-site/docs/getting_started/Tutorial.html
-
-
-
-when you are all set up with emscripten and have got the basic tests in the
-tutorial running building Proton should be simple, simply go to the Proton root
-directory and follow the main instructions in the README there, in precis (from
-the root directory) it's:
-
-  mkdir build
-  cd build
-  cmake ..
-  make
-
-and you should be all set, to test it's all working do (from the build directory):
-  cd proton-c/bindings/javascript/examples
-
-  node recv-async.js
-
-in one window and
-
-  node send-async.js
-
-in another.
-
-These examples are actually JavaScript applications that have been directly
-compiled from recv-async.c and send-async.c in <proton>/examples/messenger/c
-if you'd prefer to write applications in C and compile them to JavaScript that
-is a perfectly valid approach and these examples provide a reasonable starting
-point for doing so.
-
-Documentation
-=============
-
-When you've successfully got a working build do:
-
-  make docs
-
-Which will make all of the proton documentation including the JavaScript docs.
-If successful the JSDoc generated documentation should be found here:
-
-<proton>/build/proton-c/bindings/javascript/html/index.html
-
-
-Using "native" JavaScript
-=========================
-
-The examples in <proton>/examples/messenger/javascript are the best starting point.
-
-In practice the examples follow a fairly similar pattern to the Python bindings
-the most important thing to bear in mind though is that JavaScript is completely
-asynchronous/non-blocking, which can catch the unwary.
-
-An application follows the following (rough) steps:
-
-1. (optional) Set the heap size.
-It's important to realise that most of the library code is compiled C code and
-the runtime uses a "virtual heap" to support the underlying malloc/free. This is
-implemented internally as an ArrayBuffer with a default size of 16777216.
-
-To allocate a larger heap an application must set the PROTON_TOTAL_MEMORY global.
-In Node.js this would look like (see send.js):
-PROTON_TOTAL_MEMORY = 50000000; // Note no var - it needs to be global.
-
-In a browser it would look like (see send.html):
-<script type="text/javascript">PROTON_TOTAL_MEMORY = 50000000;</script>
-
-2. Load the library and create a message and messenger.
-In Node.js this would look like (see send.js):
-var proton = require("qpid-proton-messenger");
-var message = new proton.Message();
-var messenger = new proton.Messenger();
-
-In a browser it would look like (see send.html):
-<script type="text/javascript" src="../../../node_modules/qpid-proton-messenger/lib/proton-messenger.js"></script>
-
-<script type="text/javascript">
-var message = new proton.Message();
-var messenger = new proton.Messenger();
-....
-
-3. Set up event handlers as necessary.
-
-messenger.on('error', <error callback>);
-messenger.on('work', <work callback>);
-messenger.on('subscription', <subscription callback>);
-
-
-The work callback is triggered on WebSocket events, so in general you would use
-this to send and receive messages, for example in recv.js we have:
-
-var pumpData = function() {
-    while (messenger.incoming()) {
-        var t = messenger.get(message);
-
-        console.log("Address: " + message.getAddress());
-        console.log("Subject: " + message.getSubject());
-
-        // body is the body as a native JavaScript Object, useful for most real cases.
-        //console.log("Content: " + message.body);
-
-        // data is the body as a proton.Data Object, used in this case because
-        // format() returns exactly the same representation as recv.c
-        console.log("Content: " + message.data.format());
-
-        messenger.accept(t);
-    }
-};
-
-messenger.on('work', pumpData);
-
-
-The subscription callback is triggered when the address provided in a call to
-messenger.subscribe(<address>);
-
-Gets resolved. An example of its usage can be found in qpid-config.js which is
-a fully functioning and complete port of the python qpid-config tool. It also
-illustrates how to do asynchronous request/response based applications.
-
-Aside from the asynchronous aspects the rest of the API is essentially the same
-as the Python binding aside from minor things such as camel casing method names etc.
-
-Serialisation/Deserialisation, Types etc.
-=========================================
-
-The JavaScript binding tries to be as simple, intuitive and natural as possible
-so when sending a message all native JavaScript types including Object literals
-and Arrays are transparently supported, for example.
-
-var message = new proton.Message();
-message.setAddress('amqp://localhost');
-message.setSubject('UK.NEWS');
-message.body = ['Rod', 'Jane', 'Freddy', {cat: true, donkey: 'hee haw'}];
-
-
-The main thing to bear in mind is that (particularly for sending messages) we
-may need to use "adapters" to make sure values are correctly interpreted and
-encoded to the correct type in the AMQP type system. This is especially important
-when interoperating with a peer written in a strongly typed language (C/C++/Java).
-
-Some examples of available types follow:
-
-// UUID
-message.body = new proton.Data.Uuid();
-
-// AMQP Symbol
-message.body = new proton.Data.Symbol("My Symbol");
-
-// Binary data (created from a gibberish String in this case).
-message.body = new proton.Data.Binary("Monkey Bathпогромзхцвбнм");
-
-// Binary data (Get a Uint8Array view of the data and directly access that).
-message.body = new proton.Data.Binary(4);
-var buffer = message.body.getBuffer();
-buffer[0] = 65;
-buffer[1] = 77;
-buffer[2] = 81;
-buffer[3] = 80;
-
-// Binary Data (Created from an Array, you can use an ArrayBuffer/TypedArray too).
-message.body = new proton.Data.Binary([65, 77, 81, 80]);
-
-
-Note that the implementation of proton.Data.Binary tries to minimise copying so
-it accesses the internal emscripten heap *directly* this requires memory management
-which is mostly handled transparently, but users need to be aware that the
-underlying memory is "owned" by the Message Object, so if Binary data needs to
-be maintained after the next call to messenger.get(message); it must be
-*explicitly* copied. For more detail do "make docs" and see:
-<proton>/build/proton-c/bindings/javascript/html/proton.Data.Binary.html
-
-
-// AMQP Described (value, descriptor)
-message.body = new proton.Data.Described('persian, 'com.cheezburger.icanhas');
-
-// AMQP Timestamp maps to native JavaScript Date.
-message.body = new Date();
-
-// Various AMQP Array examples.
-message.body = new proton.Data.Array('INT', [1, 3, 5, 7], "odd numbers");
-message.body = new proton.Data.Array('UINT', [1, 3, 5, 7], "odd");
-message.body = new proton.Data.Array('ULONG', [1, 3, 5, 7], "odd");
-message.body = new proton.Data.Array('FLOAT', [1, 3, 5, 7], "odd");
-message.body = new proton.Data.Array('STRING', ["1", "3", "5", "7"], "odd");
-
-// A JavaScript TypedArray will map directly to and from an AMQP Array of the
-// appropriate type (Internally sets a descriptor of 'TypedArray').
-message.body = new Uint8Array([1, 3, 5, 7]);
-
-// UUID Array
-message.body = new proton.Data.Array('UUID', [new proton.Data.Uuid(), new proton.Data.Uuid(), new proton.Data.Uuid(), new proton.Data.Uuid()], "unique");
-
-// Null
-message.body = null;
-
-// Boolean
-message.body = true;
-
-// Native JavaScript Array maps to an AMQP List
-message.body = ['Rod', 'Jane', 'Freddy'];
-
-// Native JavaScript Object maps to an AMQP Map
-message.body = ['Rod', 'Jane', 'Freddy', {cat: true, donkey: 'hee haw'}];
-
-// JavaScript only has a "number" type so the binding provides "decorator"
-// methods added to the JavaScript Number class. To access this from number
-// primitives it is necessary to either use braces or use a "double dot" so that
-// the interpreter can disambiguate from a simple decimal point. The binding will
-// attempt to use the correct type such that message.body = 2147483647; would be
-// sent as an AMQP integer, but because of the way JavaScript coerces integers
-// message.body = 2147483647.0; would also be sent as an AMQP integer because
-// 2147483647.0 gets transparently conveted to 2147483647 by the interpreter, so
-// to explicitly send this as an AMQP float we'd need to do:
-// message.body = 2147483647.0.float();
-
-// Some more number examples:
-message.body = 66..char();  // char - note double dot. (66).char(); works too.
-message.body = 2147483647;  // int
-message.body = -2147483649; // long
-message.body = 12147483649; // long
-message.body = (12147483649).long(); // long
-message.body = (17223372036854778000).ulong(); // ulong
-message.body = (121474.836490).float(); // float
-message.body = 12147483649.0.float(); // float
-message.body = (4294967296).uint(); // uint
-message.body = (255).ubyte(); // ubyte
-
-Note too that floats are subject to a loss of precision
-
-
-Fortunately most of these quirks only affect serialisation.when the binding
-receives a message it will attempt to decode it into the most "natural" native
-JavaScript type.
-
-
-One additional decoding "quirk" can be caused by C++ qpid::messaging clients. It
-is unfortunately quite common for C++ clients to incorrectly encode Strings as
-AMQP Binary by neglecting to provide an encoding. The QMF Management Agent is one
-such culprit. This is a bit of a pain, especially because of proton.Data.Binary
-memory management quirks and having to remember to explicitly copy the data
-on each call to messenger.get(message); In order to cater for this an overloaded
-messenger.get(message, true); has been provided. Setting the second parameter to
-true forces any received Binary payloads to be decoded as Strings. If you know
-that producers might behave in this way and you are not expecting any "real"
-Binary data from the producer this convenience mechanism results in nice clean
-JavaScript Objects being received and is extremely useful for things like QMF.
-
-JSON
-====
-
-As well as allowing native JavaScript Objects and Arrays to be transparently
-serialised and deserialised via the AMQP type system it is also possible to
-serialise/deserialise as JSON.
-
-message.setAddress('amqp://localhost');
-message.setContentType('application/json');
-message.body = {array: [1, 2, 3, 4], object: {name: "John Smith", age: 65}};
-
-On the wire the above will be encoded as an opaque binary in an AMQP data section
-but will be deserialised into a JavaScript Object in exactly the same was as the
-previous examples that use the AMQP type system.
-
-SUPPORT
-=======
-
-To report bugs in the bindings, or to request an enhancement, please file
-a tracker request:
-
-    https://issues.apache.org/jira/browse/PROTON
-
-The main support channel is the qpid-users mailing list, see:
-
-    http://qpid.apache.org/discussion.html#mailing-lists
-
-You can also directly interact with the development team and other users
-in the #qpid channel on irc.freenode.net.
-
diff --git a/proton-c/bindings/javascript/TODO b/proton-c/bindings/javascript/TODO
deleted file mode 100644
index 81d5e9e..0000000
--- a/proton-c/bindings/javascript/TODO
+++ /dev/null
@@ -1,49 +0,0 @@
-Qpid Proton JavaScript Language Bindings TODO List
-==================================================
-
-Network code is currently limited to a WebSocket transport, including for Node.js
-It would be good to allow a configurable transport so that Node.js and Chrome
-packaged apps could use native TCP sockets.
-
-The JavaScript binding is pure JavaScript, which has been trans-compiled from C
-to JavaScript using emscripten. This allows the same code to be used in a browser
-and Node.js, but it potentially has a performance penalty in Node.js. An alternative
-for Node.js might be to build a SWIG binding (recent versions of SWIG support
-JavaScript). This should be viewed as a complementary not competing approach as
-it would only work for environments like Node.js and definitely *not* browser
-environments, which clearly require pure JavaScript.
-
-Optimisation are enabled for compiling and linking but there hasn't been any
-profiling done yet. The binding code *shouldn't* be the bottleneck but it's
-always possible that I messed up.
-
-Error handling is nowhere near as good as it should be, though this is mostly
-because Messenger itself is a bit lacking on the error handling/recovery front.
-
-Although described as "Proton" this is currently a JavaScript binding for Messenger
-and associated Message & Data classes. There has been some talk on the user list
-of an alternative reactive API based on proton Engine. This might ultimately be
-a better fit for JavaScript but it is very much in its infancy and I haven't
-really looked at it yet.
-
-proton-j seems to use hawt-dispatch, which is modelled after Grand Central
-Dispatch so I need to work out what it's using it do do and whether there are
-parallels in proton-c
-
-Although the WebSocket transport uses the sub-protocol 'AMQPWSB10' as specified
-in http://docs.oasis-open.org/amqp-bindmap/amqp-wsb/v1.0/amqp-wsb-v1.0.html
-section 2.1 it is not technically compliant with the spec. as the AMQP data is
-created by the proton-c code, which produces a data-stream for the TCP transport
-whereas the WebSocket spec. seems to want to make use of the fact that WebSocket
-is a frame based transport (whereas TCP is not). This is quite hard to resolve
-as the binding simply sends the contents of the octet buffer created by proton
-over the transport and thus to make this binding compliant with the spec. would
-require a change to the underlying proton-c code! It is possible that this may be
-done in future as SCTP support would require the ability to push AMQP frames too.
-In the mean time fortunately the Java Broker WebSocket transport is actually
-tolerant of this off-spec. behaviour. My personal view is that both approaches
-should be valid and in particular using the standard TCP framing means that it
-is straightforward to create WebSocket<->TCP proxies, which is useful given that
-only the Java Broker currently has a native WebSocket transport.
-
-
diff --git a/proton-c/bindings/javascript/binding-close.js b/proton-c/bindings/javascript/binding-close.js
deleted file mode 100644
index 07b68c2..0000000
--- a/proton-c/bindings/javascript/binding-close.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/**
- * These values are essentially constants sitting in the proton namespace
- * that is to say they will be exported via:
- * proton.VERSION_MAJOR
- * proton.VERSION_MINOR
- * We have to set them after pn_get_version_major/pn_get_version_minor have been
- * defined so we must do it here in binding-close.js as it's a --post-js block.
- */
-Module['VERSION_MAJOR'] = _pn_get_version_major();
-Module['VERSION_MINOR'] = _pn_get_version_minor();
-
-})(); // End of self calling lambda used to wrap library.
-
diff --git a/proton-c/bindings/javascript/binding-open.js b/proton-c/bindings/javascript/binding-open.js
deleted file mode 100644
index 40e1b12..0000000
--- a/proton-c/bindings/javascript/binding-open.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-(function() { // Start of self-calling lambda used to avoid polluting global namespace.
diff --git a/proton-c/bindings/javascript/binding.c b/proton-c/bindings/javascript/binding.c
deleted file mode 100644
index 8da83f6..0000000
--- a/proton-c/bindings/javascript/binding.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*
- * This file is largely just a stub, we're actually creating a JavaScript library
- * rather than an executable so most of the  work is done at the link stage.
- * We do however need to link the libqpid-proton-bitcode.so with *something* and
- * this is it. This file also provides a way to pass any global variable or
- * #defined values to the JavaScript binding by providing wrapper functions.
- */
-#include <uuid/uuid.h>
-#include <stdio.h>
-#include <proton/version.h>
-
-// To access #define values in JavaScript we need to wrap them in a function.
-int pn_get_version_major() {return PN_VERSION_MAJOR;}
-int pn_get_version_minor() {return PN_VERSION_MINOR;}
-void pn_uuid_generate(uuid_t out) { uuid_generate(out); }
-
diff --git a/proton-c/bindings/javascript/data-array.js b/proton-c/bindings/javascript/data-array.js
deleted file mode 100644
index 6f9776d..0000000
--- a/proton-c/bindings/javascript/data-array.js
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*****************************************************************************/
-/*                                                                           */
-/*                             proton.Data.Array                             */
-/*                                                                           */
-/*****************************************************************************/
-
-/**
- * TODO make this behave more like a native JavaScript Array: http://www.bennadel.com/blog/2292-extending-javascript-arrays-while-keeping-native-bracket-notation-functionality.htm
- * Create a proton.Data.Array.
- * @classdesc
- * This class represents an AMQP Array.
- * @constructor proton.Data.Array
- * @param {string|number} type the type of the Number either as a string or number.
- *        Stored internally as a string corresponding to one of the TypeNames.       
- * @param {Array|TypedArray} elements the Native JavaScript Array or TypedArray that we wish to serialise.
- * @param {object} descriptor an optional object describing the type.
- */
-Data['Array'] = function(type, elements, descriptor) { // Data.Array Constructor.
-    // This block caters for an empty Array or a Described empty Array.
-    if (arguments.length < 2) {
-        descriptor = type;
-        type = 'NULL';
-        elements = [];
-    }
-
-    this['type']  = (typeof type === 'number') ? Data['TypeNames'][type] : type;
-    this['elements'] = elements;
-    this['descriptor'] = descriptor;
-};
-
-/**
- * @method toString
- * @memberof! proton.Data.Array#
- * @returns {string} the String form of a {@link proton.Data.Array}.
- */
-Data['Array'].prototype.toString = function() {
-    var descriptor = (this['descriptor'] == null) ? '' : ':' + this['descriptor'];
-    return this['type'] + 'Array' + descriptor + '[' + this['elements'] + ']';
-};
-
-/**
- * @method valueOf
- * @memberof! proton.Data.Array#
- * @returns {Array} the elements of the {@link proton.Data.Array}.
- */
-Data['Array'].prototype.valueOf = function() {
-    return this['elements'];
-};
-
-/**
- * Compare two instances of proton.Data.Array for equality. N.B. this method
- * compares the value of every Array element so its performance is O(n).
- * @method equals
- * @memberof! proton.Data.Array#
- * @param {proton.Data.Array} rhs the instance we wish to compare this instance with.
- * @returns {boolean} true iff the two compared instances are equal.
- */
-Data['Array'].prototype['equals'] = function(rhs) {
-    if (rhs instanceof Data['Array'] &&
-        // Check the string value of the descriptors.
-        (('' + this['descriptor']) === ('' + rhs['descriptor'])) &&
-        (this['type'] === rhs['type'])) {
-        var elements = this['elements'];
-        var relements = rhs['elements'];
-        var length = elements.length;
-        if (length === relements.length) {
-            for (var i = 0; i < length; i++) {
-                if (elements[i].valueOf() !== relements[i].valueOf()) {
-                    return false;
-                }
-            }
-            return true;
-        } else {
-            return false;
-        }
-    } else {
-        return false;
-    }
-};
-
diff --git a/proton-c/bindings/javascript/data-binary.js b/proton-c/bindings/javascript/data-binary.js
deleted file mode 100644
index 27bac59..0000000
--- a/proton-c/bindings/javascript/data-binary.js
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*****************************************************************************/
-/*                                                                           */
-/*                             proton.Data.Binary                            */
-/*                                                                           */
-/*****************************************************************************/
-
-/**
- * Create a proton.Data.Binary. This constructor takes one or two parameters.
- * The first parameter may serve different purposes depending on its type;
- * If value is a number then it represents the size of the Binary data buffer,
- * if it is a string then we copy the string to the buffer, if it is an Array
- * or a TypedArray then we copy the data to the buffer. The optional second
- * parameter is a pointer to the data in an internal data store. If start is
- * not specified then the number of bytes specified in the first parameter
- * will be allocated in the internal data store and start will point to the
- * start of that block of data.
- * @classdesc
- * This class represents an AMQP Binary type. This class allows us to create and
- * use raw binary data and map it efficiently between JavaScript client code and
- * the underlying implementation, where all data is managed on a "virtual heap".
- * <p>
- * Client applications should generally not have to care about memory management
- * as, for most common use cases, client applications would "transfer ownership"
- * to a "container" which would then "own" the underlying data and free the data
- * held by the {@link proton.Data.Binary}.
- * <p>
- * As an example one common use-case would be where client application creates a
- * {@link proton.Data.Binary} specifying the required size. It would usually then
- * call getBuffer() to access the underlying Uint8Array. At this point the client
- * "owns" the data and so would have to call free() if it did nothing more with
- * the Binary, however when {@link proton.Data.putBINARY} is called the ownership
- * of the raw data on the virtual heap transfers from the Binary to the Data and
- * the client no longer needs to call free() itself. In this case the putBINARY()
- * call transfers ownership and can then safely call free() on the Binary.
- * <p>
- * Conversely a common use-case when receiving data is where a Binary may be
- * created by {@link proton.Data#getBINARY}. In this case the Binary is simply a
- * "view" onto the bytes owned by the Data instance. A client application can
- * safely access the bytes from the view, but if it wishes to use the bytes beyond
- * the scope of the Data instance (e.g. after the next {@link proton.Messenger#get}
- * call then the client must explicitly *copy* the bytes into a new buffer, for
- * example via copyBuffer().
- * <p>
- * Most of the {@link proton.Data} methods that take {@link proton.Data.Binary}
- * as a parameter "consume" the underlying data and take responsibility for
- * freeing it from the heap e.g. {@link proton.Data#putBINARY}, {@link proton.Data#decode}.
- * For the methods that return a {@link proton.Data.Binary} the call to
- * {@link proton.Data#getBINARY}, which is the most common case, returns a Binary
- * that has a "view" of the underlying data that is actually owned by the Data
- * instance and thus doesn't need to be explicitly freed on the Binary. The call
- * to {@link proton.Data#encode} however returns a Binary that represents a *copy*
- * of the underlying data, in this case (like a client calling new proton.Data.Binary)
- * the client takes responsibility for freeing the data, unless of course it is
- * subsequently passed to a method that will consume the data (putBINARY/decode).
- * @constructor proton.Data.Binary
- * @param {(number|string|Array|TypedArray)} value If value is a number then it 
- *        represents the size of the Binary data buffer, if it is a string then
- *        we copy the string to the buffer, if it is an Array or a TypedArray
- *        then we copy the data to the buffer. N.B. although convenient do bear
- *        in mind that using a mechanism other than constructing with a simple
- *        size will result in some form of additional data copy.
- * @param {number} start an optional pointer to the start of the Binary data buffer.
- */
-Data['Binary'] = function(value, start) { // Data.Binary Constructor.
-    /**
-     * If the start pointer is specified then the underlying binary data is owned
-     * by another object, so we set the call to free to be a null function. If
-     * the start pointer is not passed then we allocate storage of the specified
-     * size on the emscripten heap and set the call to free to free the data from
-     * the emscripten heap.
-     */
-    var size = value;
-    if (start) {
-        this['free'] = function() {};
-    } else { // Create Binary from Array, ArrayBuffer or TypedArray.
-        var hasArrayBuffer = (typeof ArrayBuffer === 'function');
-        if (Data.isArray(value) ||
-            (hasArrayBuffer && value instanceof ArrayBuffer) || 
-            (value.buffer && hasArrayBuffer && value.buffer instanceof ArrayBuffer)) {
-            value = new Uint8Array(value);
-            size = value.length;
-            start = _malloc(size); // Allocate storage from emscripten heap.
-            Module['HEAPU8'].set(value, start); // Copy the data to the emscripten heap.
-        } else if (Data.isString(value)) { // Create Binary from native string
-            value = unescape(encodeURIComponent(value)); // Create a C-like UTF representation.
-            size = value.length;
-            start = _malloc(size); // Allocate storage from emscripten heap.
-            for (var i = 0; i < size; i++) {
-                setValue(start + i, value.charCodeAt(i), 'i8', 1);
-            }
-        } else { // Create unpopulated Binary of specified size.
-            // If the type is not a number by this point then an unrecognised data
-            // type has been passed so we create a zero length Binary.
-            size = Data.isNumber(size) ? size : 0;
-            start = _malloc(size); // Allocate storage from emscripten heap.
-        }
-        this['free'] = function() {
-            _free(this.start);
-            this.size = 0;
-            this.start = 0;
-            // Set free to a null function to prevent possibility of a "double free".
-            this['free'] = function() {};
-        };
-    }
-
-    this.size = size;
-    this.start = start;
-};
-
-/**
- * Get a Uint8Array view of the data. N.B. this is just a *view* of the data,
- * which will go out of scope on the next call to {@link proton.Messenger.get}. If
- * a client wants to retain the data then copy should be used to explicitly
- * create a copy of the data which the client then owns to do with as it wishes.
- * @method getBuffer
- * @returns {Uint8Array} a new Uint8Array view of the data.
- * @memberof! proton.Data.Binary#
- */
-Data['Binary'].prototype['getBuffer'] = function() {
-    return new Uint8Array(HEAPU8.buffer, this.start, this.size);
-};
-
-/**
- * Explicitly create a *copy* of the Binary, copying the underlying binary data too.
- * @method copy
- * @param {number} offset an optional offset into the underlying buffer from
- *        where we want to copy the data, default is zero.
- * @param {number} n an optional number of bytes to copy, default is this.size - offset.
- * @returns {proton.Data.Binary} a new {@link proton.Data.Binary} created by copying the underlying binary data.
- * @memberof! proton.Data.Binary#
- */
-Data['Binary'].prototype['copy'] = function(offset, n) {
-    offset = offset | 0;
-    n = n ? n : (this.size - offset);
-
-    if (offset >= this.size) {
-        offset = 0;
-        n = 0;
-    } else if ((offset + n) > this.size) {
-        n = this.size - offset; // Clamp length
-    }
-
-    var start = _malloc(n); // Allocate storage from emscripten heap.
-    _memcpy(start, this.start + offset, n); // Copy the raw data to new buffer.
-
-    return new Data['Binary'](n, start);
-};
-
-/**
- * Converts the {@link proton.Data.Binary} to a string. This is clearly most
- * useful when the binary data is actually a binary representation of a string
- * such as a C style ASCII string.
- * @method toString
- * @memberof! proton.Data.Binary#
- * @returns {string} the String form of a {@link proton.Data.Binary}.
- */
-Data['Binary'].prototype.toString = Data['Binary'].prototype.valueOf = function() {
-    // Create a native JavaScript String from the start/size information.
-    return Pointer_stringify(this.start, this.size);
-};
-
diff --git a/proton-c/bindings/javascript/data-described.js b/proton-c/bindings/javascript/data-described.js
deleted file mode 100644
index e1f9d84..0000000
--- a/proton-c/bindings/javascript/data-described.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*****************************************************************************/
-/*                                                                           */
-/*                             proton.Data.Described                         */
-/*                                                                           */
-/*****************************************************************************/
-
-/**
- * Create a proton.Data.Described.
- * @classdesc
- * This class represents an AMQP Described.
- * @constructor proton.Data.Described
- * @param {object} value the value of the described type.
- * @param {string} descriptor an optional string describing the type.
- * @property {object} value the actual value of the described type.
- * @property {string} descriptor a string describing the type.
- */
-Data['Described'] = function(value, descriptor) { // Data.Described Constructor.
-    this['value'] = value;
-    this['descriptor'] = descriptor;
-};
-
-/**
- * @method toString
- * @memberof! proton.Data.Described#
- * @returns {string} the String form of a {@link proton.Data.Described}.
- */
-Data['Described'].prototype.toString = function() {
-    return 'Described(' + this['value'] + ', ' + this['descriptor'] + ')';
-};
-
-/**
- * @method valueOf
- * @memberof! proton.Data.Described#
- * @returns {object} the value of the {@link proton.Data.Described}.
- */
-Data['Described'].prototype.valueOf = function() {
-    return this['value'];
-};
-
-/**
- * Compare two instances of proton.Data.Described for equality.
- * @method equals
- * @memberof! proton.Data.Described#
- * @param {proton.Data.Described} rhs the instance we wish to compare this instance with.
- * @returns {boolean} true iff the two compared instances are equal.
- */
-Data['Described'].prototype['equals'] = function(rhs) {
-    if (rhs instanceof Data['Described']) {
-        return ((this['descriptor'] === rhs['descriptor']) && (this['value'] === rhs['value']));
-    } else {
-        return false;
-    }
-};
-
diff --git a/proton-c/bindings/javascript/data-long.js b/proton-c/bindings/javascript/data-long.js
deleted file mode 100644
index 38fb6c8..0000000
--- a/proton-c/bindings/javascript/data-long.js
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*****************************************************************************/
-/*                                                                           */
-/*                             proton.Data.Long                              */
-/*                                                                           */
-/*****************************************************************************/
-
-/**
- * Create a proton.Data.Long.
- * @classdesc
- * This class represents a 64 bit Integer value. It is used primarily to pass and
- * return 64 bit Integer values to and from the emscripten compiled proton-c library.
- * This class is needed because JavaScript cannot natively represent 64 bit
- * Integers with sufficient accuracy.
- * @constructor proton.Data.Long
- * @param {number} low the least significant word.
- * @param {number} high the most significant word.
- */
-// Use dot notation as it is a "protected" inner class not exported from the closure.
-Data.Long = function(low, high) { // Data.Long Constructor.
-    this.low  = low  | 0;  // force into 32 signed bits.
-    this.high = high | 0;  // force into 32 signed bits.
-};
-
-// proton.Data.Long constants.
-Data.Long.TWO_PWR_16_DBL_ = 1 << 16;
-Data.Long.TWO_PWR_32_DBL_ = Data.Long.TWO_PWR_16_DBL_ * Data.Long.TWO_PWR_16_DBL_;
-Data.Long.TWO_PWR_64_DBL_ = Data.Long.TWO_PWR_32_DBL_ * Data.Long.TWO_PWR_32_DBL_;
-Data.Long.TWO_PWR_63_DBL_ = Data.Long.TWO_PWR_64_DBL_ / 2;
-Data.Long.MAX_VALUE = new Data.Long(0xFFFFFFFF | 0, 0x7FFFFFFF | 0);
-Data.Long.MIN_VALUE = new Data.Long(0, 0x80000000 | 0);
-Data.Long.ZERO = new Data.Long(0, 0);
-Data.Long.ONE  = new Data.Long(1, 0);
-
-/**
- * @method fromNumber
- * @memberof! proton.Data.Long#
- * @returns {proton.Data.Long} an instance of {@link proton.Data.Long} created
- *          using a native JavaScript number.
- */
-Data.Long.fromNumber = function(value) {
-    if (isNaN(value) || !isFinite(value)) {
-        return Data.Long.ZERO;
-    } else if (value <= -Data.Long.TWO_PWR_63_DBL_) {
-        return Data.Long.MIN_VALUE;
-    } else if (value + 1 >= Data.Long.TWO_PWR_63_DBL_) {
-        return Data.Long.MAX_VALUE;
-    } else if (value < 0) {
-        return Data.Long.fromNumber(-value).negate();
-    } else {
-      return new Data.Long(
-          (value % Data.Long.TWO_PWR_32_DBL_) | 0,
-          (value / Data.Long.TWO_PWR_32_DBL_) | 0);
-    }
-};
-
-/**
- * Return the twos complement of this instance.
- * @method negate
- * @memberof! proton.Data.Long#
- * @returns {proton.Data.Long} the twos complement of this instance.
- */
-Data.Long.prototype.negate = function() {
-    if (this.equals(Data.Long.MIN_VALUE)) {
-        return Data.Long.MIN_VALUE;
-    } else {
-        return this.not().add(Data.Long.ONE);
-    }
-};
-
-/**
- * Add two instances of {@link proton.Data.Long}.
- * @method add
- * @memberof! proton.Data.Long#
- * @param {proton.Data.Long} rhs the instance we wish to add to this instance.
- * @returns {proton.Data.Long} the sum of this value and the rhs.
- */
-Data.Long.prototype.add = function(rhs) {
-    // Divide each number into 4 chunks of 16 bits, and then sum the chunks.
-
-    var a48 = this.high >>> 16;
-    var a32 = this.high & 0xFFFF;
-    var a16 = this.low >>> 16;
-    var a00 = this.low & 0xFFFF;
-
-    var b48 = rhs.high >>> 16;
-    var b32 = rhs.high & 0xFFFF;
-    var b16 = rhs.low >>> 16;
-    var b00 = rhs.low & 0xFFFF;
-
-    var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
-    c00 += a00 + b00;
-    c16 += c00 >>> 16;
-    c00 &= 0xFFFF;
-    c16 += a16 + b16;
-    c32 += c16 >>> 16;
-    c16 &= 0xFFFF;
-    c32 += a32 + b32;
-    c48 += c32 >>> 16;
-    c32 &= 0xFFFF;
-    c48 += a48 + b48;
-    c48 &= 0xFFFF;
-    return new Data.Long((c16 << 16) | c00, (c48 << 16) | c32);
-};
-
-/**
- * Return the complement of this instance.
- * @method not
- * @memberof! proton.Data.Long#
- * @returns {proton.Data.Long} the complement of this instance.
- */
-Data.Long.prototype.not = function() {
-    return new Data.Long(~this.low, ~this.high);
-};
-
-/**
- * Compare two instances of {@link proton.Data.Long} for equality.
- * @method equals
- * @memberof! proton.Data.Long#
- * @param {proton.Data.Long} rhs the instance we wish to compare this instance with.
- * @returns {boolean} true iff the two compared instances are equal.
- */
-Data.Long.prototype.equals = function(other) {
-    return (this.high == other.high) && (this.low == other.low);
-};
-
-/**
- * @method getHighBits
- * @memberof! proton.Data.Long#
- * @returns {number} the most significant word of a {@link proton.Data.Long}.
- */
-Data.Long.prototype.getHighBits = function() {
-    return this.high;
-};
-
-/**
- * @method getLowBits
- * @memberof! proton.Data.Long#
- * @returns {number} the least significant word of a {@link proton.Data.Long}.
- */
-Data.Long.prototype.getLowBits = function() {
-    return this.low;
-};
-
-/**
- * @method getLowBitsUnsigned
- * @memberof! proton.Data.Long#
- * @returns {number} the least significant word of a {@link proton.Data.Long}
- *          as an unsigned value.
- */
-Data.Long.prototype.getLowBitsUnsigned = function() {
-    return (this.low >= 0) ? this.low : Data.Long.TWO_PWR_32_DBL_ + this.low;
-};
-
-/**
- * @method toNumber
- * @memberof! proton.Data.Long#
- * @returns {number} a native JavaScript number (with possible loss of precision).
- */
-Data.Long.prototype.toNumber = function() {
-    return (this.high * Data.Long.TWO_PWR_32_DBL_) + this.getLowBitsUnsigned();
-};
-
-/**
- * @method toString
- * @memberof! proton.Data.Long#
- * @returns {string} the String form of a {@link proton.Data.Long}.
- */
-Data.Long.prototype.toString = function() {
-    return this.high + ':' + this.getLowBitsUnsigned();
-};
-
diff --git a/proton-c/bindings/javascript/data-symbol.js b/proton-c/bindings/javascript/data-symbol.js
deleted file mode 100644
index c742acb..0000000
--- a/proton-c/bindings/javascript/data-symbol.js
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*****************************************************************************/
-/*                                                                           */
-/*                             proton.Data.Symbol                            */
-/*                                                                           */
-/*****************************************************************************/
-
-/**
- * Create a proton.Data.Symbol.
- * @classdesc
- * This class represents an AMQP Symbol. This class is necessary primarily as a
- * way to enable us to distinguish between a native String and a Symbol in the
- * JavaScript type system.
- * @constructor proton.Data.Symbol
- * @param {string} s a symbol.
- */
-Data['Symbol'] = function(s) { // Data.Symbol Constructor.
-    this.value = s;
-};
-
-/**
- * @method toString
- * @memberof! proton.Data.Symbol#
- * @returns {string} the String form of a {@link proton.Data.Symbol}.
- */
-Data['Symbol'].prototype.toString = Data['Symbol'].prototype.valueOf = function() {
-    return this.value;
-};
-
-/**
- * Compare two instances of proton.Data.Symbol for equality.
- * @method equals
- * @memberof! proton.Data.Symbol#
- * @param {proton.Data.Symbol} rhs the instance we wish to compare this instance with.
- * @returns {boolean} true iff the two compared instances are equal.
- */
-Data['Symbol'].prototype['equals'] = function(rhs) {
-    return this.toString() === rhs.toString();
-};
-
diff --git a/proton-c/bindings/javascript/data-typed-number.js b/proton-c/bindings/javascript/data-typed-number.js
deleted file mode 100644
index 034d4ec..0000000
--- a/proton-c/bindings/javascript/data-typed-number.js
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*****************************************************************************/
-/*                                                                           */
-/*                             proton.Data.TypedNumber                       */
-/*                                                                           */
-/*****************************************************************************/
-
-// ---------------------- JavaScript Number Extensions ------------------------ 
-
-Number.prototype['ubyte'] = function() {
-    return new Data.TypedNumber('UBYTE', this);
-};
-
-Number.prototype['byte'] = function() {
-    return new Data.TypedNumber('BYTE', this);
-};
-
-Number.prototype['ushort'] = function() {
-    return new Data.TypedNumber('USHORT', this);
-};
-
-Number.prototype['short'] = function() {
-    return new Data.TypedNumber('SHORT', this);
-};
-
-Number.prototype['uint'] = function() {
-    return new Data.TypedNumber('UINT', this);
-};
-
-Number.prototype['int'] = function() {
-    return new Data.TypedNumber('INT', this);
-};
-
-Number.prototype['ulong'] = function() {
-    return new Data.TypedNumber('ULONG', this);
-};
-
-Number.prototype['long'] = function() {
-    return new Data.TypedNumber('LONG', this);
-};
-
-Number.prototype['float'] = function() {
-    return new Data.TypedNumber('FLOAT', this);
-};
-
-Number.prototype['double'] = function() {
-    return new Data.TypedNumber('DOUBLE', this);
-};
-
-Number.prototype['char'] = function() {
-    return new Data.TypedNumber('CHAR', this);
-};
-
-String.prototype['char'] = function() {
-    return new Data.TypedNumber('CHAR', this.charCodeAt(0));
-};
-
-// ------------------------- proton.Data.TypedNumber -------------------------- 
-/**
- * Create a proton.Data.TypedNumber.
- * @classdesc
- * This class is a simple wrapper class that allows a "type" to be recorded for
- * a number. The idea is that the JavaScript Number class is extended with extra
- * methods to allow numbers to be "modified" to TypedNumbers, so for example
- * 1.0.float() would modify 1.0 by returning a TypedNumber with type = FLOAT
- * and value = 1. The strings used for type correspond to the names of the Data
- * put* methods e.g. UBYTE, BYTE, USHORT, SHORT, UINT, INT, ULONG, LONG, FLOAT,
- * DOUBLE, CHAR so that the correct method to call can be derived from the type.
- * @constructor proton.Data.TypedNumber
- * @param {(string|number)} type the type of the Number either as a string or number.
- *        Stored internally as a string corresponding to one of the TypeNames.
- * @param {number} value the value of the Number.
- */
-// Use dot notation as it is a "protected" inner class not exported from the closure.
-Data.TypedNumber = function(type, value) { // Data.TypedNumber Constructor.
-    this.type  = (typeof type === 'number') ? Data['TypeNames'][type] : type;
-    this.value = value;
-};
-
-/**
- * @method toString
- * @memberof! proton.Data.TypedNumber#
- * @returns {string} the String form of a {@link proton.Data.TypedNumber}.
- */
-Data.TypedNumber.prototype.toString = Data.TypedNumber.prototype.valueOf = function() {
-    return +this.value;
-};
-
-
diff --git a/proton-c/bindings/javascript/data-uuid.js b/proton-c/bindings/javascript/data-uuid.js
deleted file mode 100644
index 4fee84a..0000000
--- a/proton-c/bindings/javascript/data-uuid.js
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*****************************************************************************/
-/*                                                                           */
-/*                             proton.Data.Uuid                              */
-/*                                                                           */
-/*****************************************************************************/
-
-/**
- * Create a proton.Data.Uuid which is a type 4 UUID.
- * @classdesc
- * This class represents a type 4 UUID, wich may use crypto libraries to generate
- * the UUID if supported by the platform (e.g. node.js or a modern browser)
- * @constructor proton.Data.Uuid
- * @param {number|Array|string} u a UUID. If null a type 4 UUID is generated wich may use crypto if
- *        supported by the platform. If u is an emscripten "pointer" we copy the
- *        data from that. If u is a JavaScript Array we use it as-is. If u is a
- *        String then we try to parse that as a UUID.
- * @property {Array} uuid is the compact array form of the UUID.
- */
-Data['Uuid'] = function(u) { // Data.Uuid Constructor.
-    // Helper to copy from emscriptem allocated storage into JavaScript Array.
-    function _p2a(p) {
-        var uuid = new Array(16);
-        for (var i = 0; i < 16; i++) {
-            uuid[i] = getValue(p + i, 'i8') & 0xFF; // & 0xFF converts to unsigned.
-        }
-        return uuid;
-    };
-
-    if (!u) { // Generate UUID using emscriptem's uuid_generate implementation.
-        var sp = Runtime.stackSave();
-        var p = allocate(16, 'i8', ALLOC_STACK); // Create temporary pointer storage.
-        _uuid_generate(p);      // Generate UUID into allocated pointer.
-        this['uuid'] = _p2a(p); // Copy from allocated storage into JavaScript Array.
-        Runtime.stackRestore(sp);
-    } else if (Data.isNumber(u)) { // Use pointer that has been passed in.
-        this['uuid'] = _p2a(u);    // Copy from allocated storage into JavaScript Array.
-    } else if (Data.isArray(u)) { // Use array that has been passed in.
-        this['uuid'] = u; // Just use the JavaScript Array.
-    } else if (Data.isString(u)) { // Parse String form UUID.
-        if (u.length === 36) {
-            var i = 0;
-            var uuid = new Array(16);
-            u.toLowerCase().replace(/[0-9a-f]{2}/g, function(byte) {
-                if (i < 16) {
-                    uuid[i++] = parseInt(byte, 16);
-                }
-            });
-            this['uuid'] = uuid;
-        }
-    }
-    this.string = null;
-};
-
-/**
- * Returns the string representation of the proton.Data.Uuid.
- * @method toString
- * @memberof! proton.Data.Uuid#
- * @returns {string} the String
- *          /[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}/
- *          form of a {@link proton.Data.Uuid}.
- */
-Data['Uuid'].prototype.toString = Data['Uuid'].prototype.valueOf = function() {
-    if (!this.string) { // Check if we've cached the string version.
-        var i = 0;
-        var uu = this['uuid'];
-        var uuid = 'xxxx-xx-xx-xx-xxxxxx'.replace(/[x]/g, function(c) {
-            var r = uu[i].toString(16);
-            r = (r.length === 1) ? '0' + r : r; // Zero pad single digit hex values
-            i++;
-            return r;
-        });
-        this.string = uuid;
-    }
-    return this.string;
-};
-
-/**
- * Compare two instances of proton.Data.Uuid for equality.
- * @method equals
- * @memberof! proton.Data.Uuid#
- * @param {proton.Data.Uuid} rhs the instance we wish to compare this instance with.
- * @returns {boolean} true iff the two compared instances are equal.
- */
-Data['Uuid'].prototype['equals'] = function(rhs) {
-    return this.toString() === rhs.toString();
-};
-
diff --git a/proton-c/bindings/javascript/data.js b/proton-c/bindings/javascript/data.js
deleted file mode 100644
index 061d2bd..0000000
--- a/proton-c/bindings/javascript/data.js
+++ /dev/null
@@ -1,1582 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*****************************************************************************/
-/*                                                                           */
-/*                                    Data                                   */
-/*                                                                           */
-/*****************************************************************************/
-
-/**
- * Constructs a proton.Data instance.
- * @classdesc
- * The Data class provides an interface for decoding, extracting, creating, and
- * encoding arbitrary AMQP data. A Data object contains a tree of AMQP values.
- * Leaf nodes in this tree correspond to scalars in the AMQP type system such as
- * ints<INT> or strings<STRING>. Non-leaf nodes in this tree correspond to compound
- * values in the AMQP type system such as lists<LIST>, maps<MAP>, arrays<ARRAY>,
- * or described values<DESCRIBED>. The root node of the tree is the Data object
- * itself and can have an arbitrary number of children.
- * <p>
- * A Data object maintains the notion of the current sibling node and a current
- * parent node. Siblings are ordered within their parent. Values are accessed
- * and/or added by using the next, prev, enter, and exit methods to navigate to
- * the desired location in the tree and using the supplied variety of put* and
- * get* methods to access or add a value of the desired type.
- * <p>
- * The put* methods will always add a value after the current node in the tree.
- * If the current node has a next sibling the put* method will overwrite the value
- * on this node. If there is no current node or the current node has no next
- * sibling then one will be added. The put* methods always set the added/modified
- * node to the current node. The get* methods read the value of the current node
- * and do not change which node is current.
- * @constructor proton.Data
- * @param {number} data an optional pointer to a pn_data_t instance. If supplied
- *        the underlying data is "owned" by another object (for example a Message)
- *        and that object is assumed to be responsible for freeing the data if
- *        necessary. If no data is supplied then the Data is stand-alone and the
- *        client application is responsible for freeing the underlying data via
- *        a call to free().
- * @param {boolean} decodeBinaryAsString if set decode any AMQP Binary payload
- *        objects as strings. This can be useful as the data in Binary objects
- *        will be overwritten with subsequent calls to get, so they must be
- *        explicitly copied. Needless to say it is only safe to set this flag if
- *        you know that the data you are dealing with is actually a string, for
- *        example C/C++ applications often seem to encode strings as AMQP binary,
- *        a common cause of interoperability problems.
- */
-Module['Data'] = function(data, decodeBinaryAsString) { // Data Constructor.
-    if (!data) {
-        this._data = _pn_data(16); // Default capacity is 16
-        this['free'] = function() {
-            _pn_data_free(this._data);
-            // Set free to a null function to prevent possibility of a "double free".
-            this['free'] = function() {};
-        };
-    } else {
-        this._data = data;
-        this['free'] = function() {};
-    }
-    this._decodeBinaryAsString = decodeBinaryAsString;
-};
-
-// Expose constructor as package scope variable to make internal calls less verbose.
-var Data = Module['Data'];
-
-// Expose prototype as a variable to make method declarations less verbose.
-var _Data_ = Data.prototype;
-
-// ************************** Class properties ********************************
-
-Data['NULL']       = 1;
-Data['BOOL']       = 2;
-Data['UBYTE']      = 3;
-Data['BYTE']       = 4;
-Data['USHORT']     = 5;
-Data['SHORT']      = 6;
-Data['UINT']       = 7;
-Data['INT']        = 8;
-Data['CHAR']       = 9;
-Data['ULONG']      = 10;
-Data['LONG']       = 11;
-Data['TIMESTAMP']  = 12;
-Data['FLOAT']      = 13;
-Data['DOUBLE']     = 14;
-Data['DECIMAL32']  = 15;
-Data['DECIMAL64']  = 16;
-Data['DECIMAL128'] = 17;
-Data['UUID']       = 18;
-Data['BINARY']     = 19;
-Data['STRING']     = 20;
-Data['SYMBOL']     = 21;
-Data['DESCRIBED']  = 22;
-Data['ARRAY']      = 23;
-Data['LIST']       = 24;
-Data['MAP']        = 25;
-
-/**
- * Look-up table mapping proton-c types to the accessor method used to
- * deserialise the type. N.B. this is a simple Array and not a map because the
- * types that we get back from pn_data_type are integers from the pn_type_t enum.
- * @property {Array<String>} TypeNames ['NULL', 'NULL', 'BOOL', 'UBYTE', 'BYTE',
- * 'USHORT', 'SHORT', 'UINT', 'INT', 'CHAR', 'ULONG', 'LONG', 'TIMESTAMP',
- * 'FLOAT', 'DOUBLE', 'DECIMAL32', 'DECIMAL64', 'DECIMAL128', 'UUID',
- * 'BINARY', 'STRING', 'SYMBOL', 'DESCRIBED', 'ARRAY', 'LIST', 'MAP']
- * @memberof! proton.Data
- */
-Data['TypeNames'] = [
-    'NULL',       // 0
-    'NULL',       // PN_NULL       = 1
-    'BOOL',       // PN_BOOL       = 2
-    'UBYTE',      // PN_UBYTE      = 3
-    'BYTE',       // PN_BYTE       = 4
-    'USHORT',     // PN_USHORT     = 5
-    'SHORT',      // PN_SHORT      = 6
-    'UINT',       // PN_UINT       = 7
-    'INT',        // PN_INT        = 8
-    'CHAR',       // PN_CHAR       = 9
-    'ULONG',      // PN_ULONG      = 10
-    'LONG',       // PN_LONG       = 11
-    'TIMESTAMP',  // PN_TIMESTAMP  = 12
-    'FLOAT',      // PN_FLOAT      = 13
-    'DOUBLE',     // PN_DOUBLE     = 14
-    'DECIMAL32',  // PN_DECIMAL32  = 15
-    'DECIMAL64',  // PN_DECIMAL64  = 16
-    'DECIMAL128', // PN_DECIMAL128 = 17
-    'UUID',       // PN_UUID       = 18
-    'BINARY',     // PN_BINARY     = 19
-    'STRING',     // PN_STRING     = 20
-    'SYMBOL',     // PN_SYMBOL     = 21
-    'DESCRIBED',  // PN_DESCRIBED  = 22
-    'ARRAY',      // PN_ARRAY      = 23
-    'LIST',       // PN_LIST       = 24
-    'MAP'         // PN_MAP        = 25
-];
-
-// *************************** Class methods **********************************
-
-/**
- * Test if a given Object is a JavaScript Array.
- * @method isArray
- * @memberof! proton.Data
- * @param {object} o the Object that we wish to test.
- * @returns {boolean} true iff the Object is a JavaScript Array.
- */
-Data.isArray = Array.isArray || function(o) {
-    return Object.prototype.toString.call(o) === '[object Array]';
-};
-
-/**
- * Test if a given Object is a JavaScript Number.
- * @method isNumber
- * @memberof! proton.Data
- * @param {object} o the Object that we wish to test.
- * @returns {boolean} true iff the Object is a JavaScript Number.
- */
-Data.isNumber = function(o) {
-    return typeof o === 'number' || 
-          (typeof o === 'object' && Object.prototype.toString.call(o) === '[object Number]');
-};
-
-/**
- * Test if a given Object is a JavaScript String.
- * @method isString
- * @memberof! proton.Data
- * @param {object} o the Object that we wish to test.
- * @returns {boolean} true iff the Object is a JavaScript String.
- */
-Data.isString = function(o) {
-    return typeof o === 'string' ||
-          (typeof o === 'object' && Object.prototype.toString.call(o) === '[object String]');
-};
-
-/**
- * Test if a given Object is a JavaScript Boolean.
- * @method isBoolean
- * @memberof! proton.Data
- * @param {object} o the Object that we wish to test.
- * @returns {boolean} true iff the Object is a JavaScript Boolean.
- */
-Data.isBoolean = function(o) {
-    return typeof o === 'boolean' ||
-          (typeof o === 'object' && Object.prototype.toString.call(o) === '[object Boolean]');
-};
-
-
-// ************************* Protected methods ********************************
-
-// We use the dot notation rather than associative array form for protected
-// methods so they are visible to this "package", but the Closure compiler will
-// minify and obfuscate names, effectively making a defacto "protected" method.
-
-/**
- * This helper method checks the supplied error code, converts it into an
- * exception and throws the exception. This method will try to use the message
- * populated in pn_data_error(), if present, but if not it will fall
- * back to using the basic error code rendering from pn_code().
- * @param code the error code to check.
- */
-_Data_._check = function(code) {
-    if (code < 0) {
-        var errno = this['getErrno']();
-        var message = errno ? this['getError']() : Pointer_stringify(_pn_code(code));
-
-        throw new Module['DataError'](message);
-    } else {
-        return code;
-    }
-};
-
-
-// *************************** Public methods *********************************
-
-/**
- * @method getErrno
- * @memberof! proton.Data#
- * @returns {number} the most recent error message code.
- */
-_Data_['getErrno'] = function() {
-    return _pn_data_errno(this._data);
-};
-
-/**
- * @method getError
- * @memberof! proton.Data#
- * @returns {string} the most recent error message as a String.
- */
-_Data_['getError'] = function() {
-    return Pointer_stringify(_pn_error_text(_pn_data_error(this._data)));
-};
-
-/**
- * Clears the data object.
- * @method clear
- * @memberof! proton.Data#
- */
-_Data_['clear'] = function() {
-    _pn_data_clear(this._data);
-};
-
-/**
- * Clears current node and sets the parent to the root node.  Clearing the current
- * node sets it _before_ the first node, calling next() will advance to the first node.
- * @method rewind
- * @memberof! proton.Data#
- */
-_Data_['rewind'] = function() {
-    _pn_data_rewind(this._data);
-};
-
-/**
- * Advances the current node to its next sibling and returns its type. If there
- * is no next sibling the current node remains unchanged and null is returned.
- * @method next
- * @memberof! proton.Data#
- * @returns {number} the type of the next sibling or null.
- */
-_Data_['next'] = function() {
-    var found = _pn_data_next(this._data);
-    if (found) {
-        return this.type();
-    } else {
-        return null;
-    }
-};
-
-/**
- * Advances the current node to its previous sibling and returns its type. If there
- * is no previous sibling the current node remains unchanged and null is returned.
- * @method prev
- * @memberof! proton.Data#
- * @returns {number} the type of the previous sibling or null.
- */
-_Data_['prev'] = function() {
-    var found = _pn_data_prev(this._data);
-    if (found) {
-        return this.type();
-    } else {
-        return null;  
-    }
-};
-
-/**
- * Sets the parent node to the current node and clears the current node. Clearing
- * the current node sets it _before_ the first child, next() advances to the first child.
- * @method enter
- * @memberof! proton.Data#
- */
-_Data_['enter'] = function() {
-    return (_pn_data_enter(this._data) > 0);
-};
-
-/**
- * Sets the current node to the parent node and the parent node to its own parent.
- * @method exit
- * @memberof! proton.Data#
- */
-_Data_['exit'] = function() {
-    return (_pn_data_exit(this._data) > 0);
-};
-
-/**
- * Look up a value by name. N.B. Need to use getObject() to retrieve the actual
- * value after lookup suceeds.
- * @method lookup
- * @memberof! proton.Data#
- * @param {string} name the name of the property to look up.
- * @returns {boolean} true iff the lookup succeeded.
- */
-_Data_['lookup'] = function(name) {
-    var sp = Runtime.stackSave();
-    var lookup = _pn_data_lookup(this._data, allocate(intArrayFromString(name), 'i8', ALLOC_STACK));
-    Runtime.stackRestore(sp);
-    return (lookup > 0);
-};
-
-// TODO document - not quite sure what these are for?
-_Data_['narrow'] = function() {
-    _pn_data_narrow(this._data);
-};
-
-_Data_['widen'] = function() {
-    _pn_data_widen(this._data);
-};
-
-/**
- * @method type
- * @memberof! proton.Data#
- * @returns {number} the type of the current node or null if the type is unknown.
- */
-_Data_['type'] = function() {
-    var dtype = _pn_data_type(this._data);
-    if (dtype === -1) {
-        return null;
-    } else {
-        return dtype;
-    }
-};
-
-/**
- * Return a Binary representation of the data encoded in AMQP format. N.B. the
- * returned {@link proton.Data.Binary} "owns" the underlying raw data and is thus
- * responsible for freeing it or passing it to a method that consumes a Binary
- * such as {@link proton.Data.decode} or {@link proton.Data.putBINARY}.
- * @method encode
- * @memberof! proton.Data#
- * @returns {proton.Data.Binary} a representation of the data encoded in AMQP format.
- */
-_Data_['encode'] = function() {
-    var size = 1024;
-    while (true) {
-        var bytes = _malloc(size); // Allocate storage from emscripten heap.
-        var cd = _pn_data_encode(this._data, bytes, size);
-
-        if (cd === Module['Error']['OVERFLOW']) {
-            _free(bytes);
-            size *= 2;
-        } else if (cd >= 0) {
-            return new Data['Binary'](cd, bytes);
-        } else {
-            _free(bytes);
-            this._check(cd);
-            return;
-        }
-    }
-};
-
-/**
- * Decodes the first value from supplied Binary AMQP data and returns a new
- * {@link proton.Data.Binary} containing the remainder of the data or null if
- * all the supplied data has been consumed. N.B. this method "consumes" data
- * from a {@link proton.Data.Binary} in other words it takes responsibility for
- * the underlying data and frees the raw data from the Binary.
- * @method decode
- * @memberof! proton.Data#
- * @param {proton.Data.Binary} encoded the AMQP encoded binary data.
- * @returns {proton.Data.Binary} a Binary containing the remaining bytes or null
- *          if all the data has been consumed.
- */
-_Data_['decode'] = function(encoded) {
-    var start = encoded.start;
-    var size = encoded.size;
-    var consumed = this._check(_pn_data_decode(this._data, start, size));
-
-    size = size - consumed;
-    start = _malloc(size); // Allocate storage from emscripten heap.
-    _memcpy(start, encoded.start + consumed, size);
-
-    encoded['free'](); // Free the original Binary.
-    return size > 0 ? new Data['Binary'](size, start) : null;
-};
-
-/**
- * Puts a list node. Elements may be filled by entering the list
- * node and putting element values.
- * <pre>
- *  var data = new proton.Data();
- *  data.putLISTNODE();
- *  data.enter();
- *  data.putINT(1);
- *  data.putINT(2);
- *  data.putINT(3);
- *  data.exit();
- * </pre>
- * @method putLISTNODE
- * @memberof! proton.Data#
- */
-_Data_['putLISTNODE'] = function() {
-    this._check(_pn_data_put_list(this._data));
-};
-
-/**
- * Puts a map node. Elements may be filled by entering the map node
- * and putting alternating key value pairs.
- * <pre>
- *  var data = new proton.Data();
- *  data.putMAPNODE();
- *  data.enter();
- *  data.putSTRING('key');
- *  data.putSTRING('value');
- *  data.exit();
- * </pre>
- * @method putMAPNODE
- * @memberof! proton.Data#
- */
-_Data_['putMAPNODE'] = function() {
-    this._check(_pn_data_put_map(this._data));
-};
-
-/**
- * Puts an array node. Elements may be filled by entering the array node and
- * putting the element values. The values must all be of the specified array
- * element type. If an array is described then the first child value of the array
- * is the descriptor and may be of any type.
- * <pre>
- *  var data = new proton.Data();
- *  data.putARRAYNODE(false, proton.Data.INT);
- *  data.enter();
- *  data.putINT(1);
- *  data.putINT(2);
- *  data.putINT(3);
- *  data.exit();
- *
- *  data.putARRAYNODE(true, proton.Data.DOUBLE);
- *  data.enter();
- *  data.putSYMBOL('array-descriptor');
- *  data.putDOUBLE(1.1);
- *  data.putDOUBLE(1.2);
- *  data.putDOUBLE(1.3);
- *  data.exit();
- * </pre>
- * @method putARRAYNODE
- * @param {boolean} described specifies whether the array is described.
- * @param {number} type the type of the array elements.
- * @memberof! proton.Data#
- */
-_Data_['putARRAYNODE'] = function(described, type) {
-    this._check(_pn_data_put_array(this._data, described, type));
-};
-
-/**
- * Puts a described node. A described node has two children, the descriptor and
- * value. These are specified by entering the node and putting the desired values.
- * <pre>
- *  var data = new proton.Data();
- *  data.putDESCRIBEDNODE();
- *  data.enter();
- *  data.putSYMBOL('value-descriptor');
- *  data.putSTRING('the value');
- *  data.exit();
- * </pre>
- * @method putDESCRIBEDNODE
- * @memberof! proton.Data#
- */
-_Data_['putDESCRIBEDNODE'] = function() {
-    this._check(_pn_data_put_described(this._data));
-};
-
-/**
- * Puts a null value.
- * @method putNULL
- * @memberof! proton.Data#
- */
-_Data_['putNULL'] = function() {
-    this._check(_pn_data_put_null(this._data));
-};
-
-/**
- * Puts a boolean value.
- * @method putBOOL
- * @memberof! proton.Data#
- * @param {boolean} b a boolean value.
- */
-_Data_['putBOOL'] = function(b) {
-    this._check(_pn_data_put_bool(this._data, b));
-};
-
-/**
- * Puts a unsigned byte value.
- * @method putUBYTE
- * @memberof! proton.Data#
- * @param {number} ub an integral value.
- */
-_Data_['putUBYTE'] = function(ub) {
-    this._check(_pn_data_put_ubyte(this._data, ub));
-};
-
-/**
- * Puts a signed byte value.
- * @method putBYTE
- * @memberof! proton.Data#
- * @param {number} b an integral value.
- */
-_Data_['putBYTE'] = function(b) {
-    this._check(_pn_data_put_byte(this._data, b));
-};
-
-/**
- * Puts a unsigned short value.
- * @method putUSHORT
- * @memberof! proton.Data#
- * @param {number} us an integral value.
- */
-_Data_['putUSHORT'] = function(us) {
-    this._check(_pn_data_put_ushort(this._data, us));
-};
-
-/**
- * Puts a signed short value.
- * @method putSHORT
- * @memberof! proton.Data#
- * @param {number} s an integral value.
- */
-_Data_['putSHORT'] = function(s) {
-    this._check(_pn_data_put_short(this._data, s));
-};
-
-/**
- * Puts a unsigned integer value.
- * @method putUINT
- * @memberof! proton.Data#
- * @param {number} ui an integral value.
- */
-_Data_['putUINT'] = function(ui) {
-    this._check(_pn_data_put_uint(this._data, ui));
-};
-
-/**
- * Puts a signed integer value.
- * @method putINT
- * @memberof! proton.Data#
- * @param {number} i an integral value.
- */
-_Data_['putINT'] = function(i) {
-    this._check(_pn_data_put_int(this._data, i));
-};
-
-/**
- * Puts a signed char value.
- * @method putCHAR
- * @memberof! proton.Data#
- * @param {(string|number)} c a single character expressed either as a string or a number.
- */
-_Data_['putCHAR'] = function(c) {
-    c = Data.isString(c) ? c.charCodeAt(0) : c;
-    this._check(_pn_data_put_char(this._data, c));
-};
-
-/**
- * Puts a unsigned long value. N.B. large values can suffer from a loss of
- * precision as JavaScript numbers are restricted to 64 bit double values.
- * @method putULONG
- * @memberof! proton.Data#
- * @param {number} ul an integral value.
- */
-_Data_['putULONG'] = function(ul) {
-    // If the supplied number exceeds the range of Data.Long invert it before
-    // constructing the Data.Long.
-    ul = (ul >= Data.Long.TWO_PWR_63_DBL_) ? (ul = -(Data.Long.TWO_PWR_64_DBL_ - ul)) : ul;
-    var long = Data.Long.fromNumber(ul);
-    this._check(_pn_data_put_ulong(this._data, long.getLowBitsUnsigned(), long.getHighBits()));
-};
-
-/**
- * Puts a signed long value. N.B. large values can suffer from a loss of
- * precision as JavaScript numbers are restricted to 64 bit double values.
- * @method putLONG
- * @memberof! proton.Data#
- * @param {number} i an integral value.
- */
-_Data_['putLONG'] = function(l) {
-    var long = Data.Long.fromNumber(l);
-    this._check(_pn_data_put_long(this._data, long.getLowBitsUnsigned(), long.getHighBits()));
-};
-
-/**
- * Puts a timestamp.
- * @method putTIMESTAMP
- * @memberof! proton.Data#
- * @param {(number|Date)} d a Date value.
- */
-_Data_['putTIMESTAMP'] = function(d) {
-    // Note that a timestamp is a 64 bit number so we have to use a proton.Data.Long.
-    var timestamp = Data.Long.fromNumber(d.valueOf());
-    this._check(_pn_data_put_timestamp(this._data, timestamp.getLowBitsUnsigned(), timestamp.getHighBits()));
-};
-
-/**
- * Puts a float value. N.B. converting between floats and doubles is imprecise
- * so the resulting value might not quite be what you expect.
- * @method putFLOAT
- * @memberof! proton.Data#
- * @param {number} f a floating point value.
- */
-_Data_['putFLOAT'] = function(f) {
-    this._check(_pn_data_put_float(this._data, f));
-};
-
-/**
- * Puts a double value.
- * @method putDOUBLE
- * @memberof! proton.Data#
- * @param {number} d a floating point value.
- */
-_Data_['putDOUBLE'] = function(d) {
-    this._check(_pn_data_put_double(this._data, d));
-};
-
-/**
- * Puts a decimal32 value.
- * @method putDECIMAL32
- * @memberof! proton.Data#
- * @param {number} d a decimal32 value.
- */
-_Data_['putDECIMAL32'] = function(d) {
-    this._check(_pn_data_put_decimal32(this._data, d));
-};
-
-/**
- * Puts a decimal64 value.
- * @method putDECIMAL64
- * @memberof! proton.Data#
- * @param {number} d a decimal64 value.
- */
-_Data_['putDECIMAL64'] = function(d) {
-    this._check(_pn_data_put_decimal64(this._data, d));
-};
-
-/**
- * Puts a decimal128 value.
- * @method putDECIMAL128
- * @memberof! proton.Data#
- * @param {number} d a decimal128 value.
- */
-_Data_['putDECIMAL128'] = function(d) {
-    this._check(_pn_data_put_decimal128(this._data, d));
-};
-
-/**
- * Puts a UUID value.
- * @method putUUID
- * @memberof! proton.Data#
- * @param {proton.Data.Uuid} u a uuid value
- */
-_Data_['putUUID'] = function(u) {
-    var sp = Runtime.stackSave();
-    this._check(_pn_data_put_uuid(this._data, allocate(u['uuid'], 'i8', ALLOC_STACK)));
-    Runtime.stackRestore(sp);
-};
-
-/**
- * Puts a binary value consuming the underlying raw data in the process.
- * @method putBINARY
- * @memberof! proton.Data#
- * @param {proton.Data.Binary} b a binary value.
- */
-_Data_['putBINARY'] = function(b) {
-    var sp = Runtime.stackSave();
-    // The implementation here is a bit "quirky" due to some low-level details
-    // of the interaction between emscripten and LLVM and the use of pn_bytes.
-    // The JavaScript code below is basically a binding to:
-    //
-    // pn_data_put_binary(data, pn_bytes(b.size, b.start));
-
-    // Here's the quirky bit, pn_bytes actually returns pn_bytes_t *by value* but
-    // the low-level code handles this *by pointer* so we first need to allocate
-    // 8 bytes storage for {size, start} on the emscripten stack and then we
-    // pass the pointer to that storage as the first parameter to the pn_bytes.
-    var bytes = allocate(8, 'i8', ALLOC_STACK);
-    _pn_bytes(bytes, b.size, b.start);
-
-    // The compiled pn_data_put_binary takes the pn_bytes_t by reference not value.
-    this._check(_pn_data_put_binary(this._data, bytes));
-
-    // After calling _pn_data_put_binary the underlying Data object "owns" the
-    // binary data, so we can call free on the proton.Data.Binary instance to
-    // release any storage it has acquired back to the emscripten heap.
-    b['free']();
-    Runtime.stackRestore(sp);
-};
-
-/**
- * Puts a unicode string value.
- * @method putSTRING
- * @memberof! proton.Data#
- * @param {string} s a unicode string value.
- */
-_Data_['putSTRING'] = function(s) {
-    var sp = Runtime.stackSave();
-    // The implementation here is a bit "quirky" due to some low-level details
-    // of the interaction between emscripten and LLVM and the use of pn_bytes.
-    // The JavaScript code below is basically a binding to:
-    //
-    // pn_data_put_string(data, pn_bytes(strlen(text), text));
-
-    // First create an array from the JavaScript String using the intArrayFromString
-    // helper function (from emscripten/src/preamble.js). We use this idiom in a
-    // few places but here we create array as a separate var as we need its length.
-    var array = intArrayFromString(s, true); // The true means don't add NULL.
-    // Allocate temporary storage for the array on the emscripten stack.
-    var str = allocate(array, 'i8', ALLOC_STACK);
-
-    // Here's the quirky bit, pn_bytes actually returns pn_bytes_t *by value* but
-    // the low-level code handles this *by pointer* so we first need to allocate
-    // 8 bytes storage for {size, start} on the emscripten stack and then we
-    // pass the pointer to that storage as the first parameter to the pn_bytes.
-    var bytes = allocate(8, 'i8', ALLOC_STACK);
-    _pn_bytes(bytes, array.length, str);
-
-    // The compiled pn_data_put_string takes the pn_bytes_t by reference not value.
-    this._check(_pn_data_put_string(this._data, bytes));
-    Runtime.stackRestore(sp);
-};
-
-/**
- * Puts a symbolic value. According to the AMQP 1.0 Specification Symbols are
- * values from a constrained domain. Although the set of possible domains is
- * open-ended, typically the both number and size of symbols in use for any
- * given application will be small, e.g. small enough that it is reasonable to
- * cache all the distinct values. Symbols are encoded as ASCII characters.
- * @method putSYMBOL
- * @memberof! proton.Data#
- * @param {proton.Data.Symbol|string} s the symbol name.
- */
-_Data_['putSYMBOL'] = function(s) {
-    var sp = Runtime.stackSave();
-    // The implementation here is a bit "quirky" due to some low-level details
-    // of the interaction between emscripten and LLVM and the use of pn_bytes.
-    // The JavaScript code below is basically a binding to:
-    //
-    // pn_data_put_symbol(data, pn_bytes(strlen(text), text));
-
-    // First create an array from the JavaScript String using the intArrayFromString
-    // helper function (from emscripten/src/preamble.js). We use this idiom in a
-    // few places but here we create array as a separate var as we need its length.
-    var array = intArrayFromString(s, true); // The true means don't add NULL.
-    // Allocate temporary storage for the array on the emscripten stack.
-    var str = allocate(array, 'i8', ALLOC_STACK);
-
-    // Here's the quirky bit, pn_bytes actually returns pn_bytes_t *by value* but
-    // the low-level code handles this *by pointer* so we first need to allocate
-    // 8 bytes storage for {size, start} on the emscripten stack and then we
-    // pass the pointer to that storage as the first parameter to the pn_bytes.
-    var bytes = allocate(8, 'i8', ALLOC_STACK);
-    _pn_bytes(bytes, array.length, str);
-
-    // The compiled pn_data_put_symbol takes the pn_bytes_t by reference not value.
-    this._check(_pn_data_put_symbol(this._data, bytes));
-    Runtime.stackRestore(sp);
-};
-
-/**
- * If the current node is a list node, return the number of elements,
- * otherwise return zero. List elements can be accessed by entering
- * the list.
- * <pre>
- *  var count = data.getLISTNODE();
- *  data.enter();
- *  for (var i = 0; i < count; i++) {
- *      var type = data.next();
- *      if (type === proton.Data.STRING) {
- *          console.log(data.getSTRING());
- *      }
- *  }
- *  data.exit();
- * </pre>
- * @method getLISTNODE
- * @memberof! proton.Data#
- * @returns {number} the number of elements if the current node is a list,
- *          zero otherwise.
- */
-_Data_['getLISTNODE'] = function() {
-    return _pn_data_get_list(this._data);
-};
-
-/**
- * If the current node is a map, return the number of child elements,
- * otherwise return zero. Key value pairs can be accessed by entering
- * the map.
- * <pre>
- *  var count = data.getMAPNODE();
- *  data.enter();
- *  for (var i = 0; i < count/2; i++) {
- *      var type = data.next();
- *      if (type === proton.Data.STRING) {
- *          console.log(data.getSTRING());
- *      }
- *  }
- *  data.exit();
- * </pre>
- * @method getMAPNODE
- * @memberof! proton.Data#
- * @returns {number} the number of elements if the current node is a list,
- *          zero otherwise.
- */
-_Data_['getMAPNODE'] = function() {
-    return _pn_data_get_map(this._data);
-};
-
-/**
- * If the current node is an array, return an object containing the tuple of the
- * element count, a boolean indicating whether the array is described, and the
- * type of each element, otherwise return {count: 0, described: false, type: null).
- * Array data can be accessed by entering the array.
- * <pre>
- *  // Read an array of strings with a symbolic descriptor
- *  var metadata = data.getARRAYNODE();
- *  var count = metadata.count;
- *  data.enter();
- *  data.next();
- *  console.log("Descriptor:" + data.getSYMBOL());
- *  for (var i = 0; i < count; i++) {
- *      var type = data.next();
- *      console.log("Element:" + data.getSTRING());
- *  }
- *  data.exit();
- * </pre>
- * @method getARRAYNODE
- * @memberof! proton.Data#
- * @returns {object} the tuple of the element count, a boolean indicating whether
- *          the array is described, and the type of each element.
- */
-_Data_['getARRAYNODE'] = function() {
-    var count = _pn_data_get_array(this._data);
-    var described = (_pn_data_is_array_described(this._data) > 0);
-    var type = _pn_data_get_array_type(this._data);
-    type = (type == -1) ? null : type;
-    return {'count': count, 'described': described, 'type': type};
-};
-
-/**
- * Checks if the current node is a described node. The descriptor and value may
- * be accessed by entering the described node.
- * <pre>
- *  // read a symbolically described string
- *  assert(data.isDESCRIBEDNODE()); // will error if the current node is not described
- *  data.enter();
- *  console.log(data.getSYMBOL());
- *  console.log(data.getSTRING());
- *  data.exit();
- * </pre>
- * @method isDESCRIBEDNODE
- * @memberof! proton.Data#
- * @returns {boolean} true iff the current node is a described, false otherwise.
- */
-_Data_['isDESCRIBEDNODE'] = function() {
-    return _pn_data_is_described(this._data);
-};
-
-/**
- * @method getNULL
- * @memberof! proton.Data#
- * @returns a null value.
- */
-_Data_['getNULL'] = function() {
-    return null;
-};
-
-/**
- * Checks if the current node is a null.
- * @method isNULL
- * @memberof! proton.Data#
- * @returns {boolean} true iff the current node is null.
- */
-_Data_['isNULL'] = function() {
-    return (_pn_data_is_null(this._data) > 0);
-};
-
-/**
- * @method getBOOL
- * @memberof! proton.Data#
- * @returns {boolean} a boolean value if the current node is a boolean, returns
- *          false otherwise.
- */
-_Data_['getBOOL'] = function() {
-    return (_pn_data_get_bool(this._data) > 0);
-};
-
-/**
- * @method getUBYTE
- * @memberof! proton.Data#
- * @returns {number} value if the current node is an unsigned byte, returns 0 otherwise.
- */
-_Data_['getUBYTE'] = function() {
-    return _pn_data_get_ubyte(this._data) & 0xFF; // & 0xFF converts to unsigned;
-};
-
-/**
- * @method getBYTE
- * @memberof! proton.Data#
- * @returns {number} value if the current node is a signed byte, returns 0 otherwise.
- */
-_Data_['getBYTE'] = function() {
-    return _pn_data_get_byte(this._data);
-};
-
-/**
- * @method getUSHORT
- * @memberof! proton.Data#
- * @returns {number} value if the current node is an unsigned short, returns 0 otherwise.
- */
-_Data_['getUSHORT'] = function() {
-    return _pn_data_get_ushort(this._data) & 0xFFFF; // & 0xFFFF converts to unsigned;
-};
-
-/**
- * @method getSHORT
- * @memberof! proton.Data#
- * @returns {number} value if the current node is a signed short, returns 0 otherwise.
- */
-_Data_['getSHORT'] = function() {
-    return _pn_data_get_short(this._data);
-};
-
-/**
- * @method getUINT
- * @memberof! proton.Data#
- * @returns {number} value if the current node is an unsigned int, returns 0 otherwise.
- */
-_Data_['getUINT'] = function() {
-    var value = _pn_data_get_uint(this._data);
-    return (value > 0) ? value : 4294967296 + value; // 4294967296 == 2^32
-};
-
-/**
- * @method getINT
- * @memberof! proton.Data#
- * @returns {number} value if the current node is a signed int, returns 0 otherwise.
- */
-_Data_['getINT'] = function() {
-    return _pn_data_get_int(this._data);
-};
-
-/**
- * @method getCHAR
- * @memberof! proton.Data#
- * @returns {string} the character represented by the unicode value of the current node.
- */
-_Data_['getCHAR'] = function() {
-    return String.fromCharCode(_pn_data_get_char(this._data));
-};
-
-/**
- * Retrieve an unsigned long value. N.B. large values can suffer from a loss of
- * precision as JavaScript numbers are restricted to 64 bit double values.
- * @method getULONG
- * @memberof! proton.Data#
- * @returns {proton.Data.Long} value if the current node is an unsigned long, returns 0 otherwise.
- */
-_Data_['getULONG'] = function() {
-    var low = _pn_data_get_ulong(this._data);
-    var high = Runtime.getTempRet0();
-    var long = new Data.Long(low, high);
-    long = long.toNumber();
-    return (long >= 0) ? long : Data.Long.TWO_PWR_64_DBL_ + long;
-};
-
-/**
- * Retrieve a signed long value. N.B. large values can suffer from a loss of
- * precision as JavaScript numbers are restricted to 64 bit double values.
- * @method getLONG
- * @memberof! proton.Data#
- * @returns {proton.Data.Long} value if the current node is a signed long, returns 0 otherwise.
- */
-_Data_['getLONG'] = function() {
-    // Getting the long is a little tricky as it is a 64 bit number. The way
-    // emscripten handles this is to return the low 32 bits directly and pass
-    // the high 32 bits via the tempRet0 variable. We use Data.Long to hold
-    // the 64 bit number and Data.Long.toNumber() to convert it back into a
-    // JavaScript number.
-    var low = _pn_data_get_long(this._data);
-    var high = Runtime.getTempRet0();
-    var long = new Data.Long(low, high);
-    long = long.toNumber();
-    return long;
-};
-
-/**
- * @method getTIMESTAMP
- * @memberof! proton.Data#
- * @returns {Date} a native JavaScript Date instance representing the timestamp.
- */
-_Data_['getTIMESTAMP'] = function() {
-    // Getting the timestamp is a little tricky as it is a 64 bit number. The way
-    // emscripten handles this is to return the low 32 bits directly and pass
-    // the high 32 bits via the tempRet0 variable. We use Data.Long to hold
-    // the 64 bit number and Data.Long.toNumber() to convert it back into a
-    // JavaScript number.
-    var low =  _pn_data_get_timestamp(this._data);
-    var high = Runtime.getTempRet0();
-    var long = new Data.Long(low, high);
-    long = long.toNumber();
-    return new Date(long);
-};
-
-/**
- * Retrieves a  float value. N.B. converting between floats and doubles is imprecise
- * so the resulting value might not quite be what you expect.
- * @method getFLOAT
- * @memberof! proton.Data#
- * @returns {number} value if the current node is a float, returns 0 otherwise.
- */
-_Data_['getFLOAT'] = function() {
-    return _pn_data_get_float(this._data);
-};
-
-/**
- * @method getDOUBLE
- * @memberof! proton.Data#
- * @returns {number} value if the current node is a double, returns 0 otherwise.
- */
-_Data_['getDOUBLE'] = function() {
-    return _pn_data_get_double(this._data);
-};
-
-/**
- * @method getDECIMAL32
- * @memberof! proton.Data#
- * @returns {number} value if the current node is a decimal32, returns 0 otherwise.
- */
-_Data_['getDECIMAL32'] = function() {
-console.log("getDECIMAL32 not properly implemented yet");
-    return _pn_data_get_decimal32(this._data);
-};
-
-/**
- * @method getDECIMAL64
- * @memberof! proton.Data#
- * @returns {number} value if the current node is a decimal64, returns 0 otherwise.
- */
-_Data_['getDECIMAL64'] = function() {
-console.log("getDECIMAL64 not properly implemented yet");
-    return _pn_data_get_decimal64(this._data);
-};
-
-/**
- * @method getDECIMAL128
- * @memberof! proton.Data#
- * @returns {number} value if the current node is a decimal128, returns 0 otherwise.
- */
-_Data_['getDECIMAL128'] = function() {
-console.log("getDECIMAL128 not properly implemented yet");
-    return _pn_data_get_decimal128(this._data);
-};
-
-/**
- * @method getUUID
- * @memberof! proton.Data#
- * @returns {proton.Data.Uuid} value if the current node is a UUID, returns null otherwise.
- */
-_Data_['getUUID'] = function() {
-    var sp = Runtime.stackSave();
-
-    // Here's the quirky bit, pn_data_get_uuid actually returns pn_uuid_t
-    // *by value* but the low-level code handles this *by pointer* so we first
-    // need to allocate 16 bytes storage for pn_uuid_t on the emscripten stack
-    // and then we pass the pointer to that storage as the first parameter to the
-    // compiled pn_data_get_uuid.
-    var bytes = allocate(16, 'i8', ALLOC_STACK); // pn_uuid_t is 16 bytes.
-    _pn_data_get_uuid(bytes, this._data);
-
-    // Create a new UUID from the bytes
-    var uuid = new Data['Uuid'](bytes);
-
-    // Tidy up the memory that we allocated on emscripten's stack.
-    Runtime.stackRestore(sp);
-
-    return uuid;
-};
-
-/**
- * @method getBINARY
- * @memberof! proton.Data#
- * @returns {proton.Data.Binary} value if the current node is a Binary, returns null otherwise.
- */
-_Data_['getBINARY'] = function() {
-    var sp = Runtime.stackSave();
-    // The implementation here is a bit "quirky" due to some low-level details
-    // of the interaction between emscripten and LLVM and the use of pn_bytes.
-    // The JavaScript code below is basically a binding to:
-    //
-    // pn_bytes bytes = pn_data_get_binary(data);
-
-    // Here's the quirky bit, pn_data_get_binary actually returns pn_bytes_t 
-    // *by value* but the low-level code handles this *by pointer* so we first
-    // need to allocate 8 bytes storage for {size, start} on the emscripten stack
-    // and then we pass the pointer to that storage as the first parameter to the
-    // compiled pn_data_get_binary.
-    var bytes = allocate(8, 'i8', ALLOC_STACK);
-    _pn_data_get_binary(bytes, this._data);
-
-    // The bytes variable is really of type pn_bytes_t* so we use emscripten's
-    // getValue() call to retrieve the size and then the start pointer.
-    var size  = getValue(bytes, 'i32');
-    var start = getValue(bytes + 4, '*');
-
-    // Create a proton.Data.Binary from the pn_bytes_t information.
-    var binary = new Data['Binary'](size, start);
-
-    // Tidy up the memory that we allocated on emscripten's stack.
-    Runtime.stackRestore(sp);
-
-    // If _decodeBinaryAsString is set return the stringified form of the Binary.
-    if (this._decodeBinaryAsString) {
-        return binary.toString();
-    } else {
-        return binary;
-    }
-};
-
-/**
- * Gets a unicode String value from the current node.
- * @method getSTRING
- * @memberof! proton.Data#
- * @returns {string} value if the current node is a String, returns "" otherwise.
- */
-_Data_['getSTRING'] = function() {
-    var sp = Runtime.stackSave();
-    // The implementation here is a bit "quirky" due to some low-level details
-    // of the interaction between emscripten and LLVM and the use of pn_bytes.
-    // The JavaScript code below is basically a binding to:
-    //
-    // pn_bytes bytes = pn_data_get_string(data);
-
-    // Here's the quirky bit, pn_data_get_string actually returns pn_bytes_t 
-    // *by value* but the low-level code handles this *by pointer* so we first
-    // need to allocate 8 bytes storage for {size, start} on the emscripten stack
-    // and then we pass the pointer to that storage as the first parameter to the
-    // compiled pn_data_get_string.
-    var bytes = allocate(8, 'i8', ALLOC_STACK);
-    _pn_data_get_string(bytes, this._data);
-
-    // The bytes variable is really of type pn_bytes_t* so we use emscripten's
-    // getValue() call to retrieve the size and then the start pointer.
-    var size  = getValue(bytes, 'i32');
-    var start = getValue(bytes + 4, '*');
-
-    // Create a native JavaScript String from the pn_bytes_t information.
-    var string = Pointer_stringify(start, size);
-
-    // Tidy up the memory that we allocated on emscripten's stack.
-    Runtime.stackRestore(sp);
-
-    return string;
-};
-
-/**
- * Gets a symbolic value. According to the AMQP 1.0 Specification Symbols are
- * values from a constrained domain. Although the set of possible domains is
- * open-ended, typically the both number and size of symbols in use for any
- * given application will be small, e.g. small enough that it is reasonable to
- * cache all the distinct values. Symbols are encoded as ASCII characters.
- * @method getSYMBOL
- * @memberof! proton.Data#
- * @returns {proton.Data.Symbol} value if the current node is a Symbol, returns "" otherwise.
- */
-_Data_['getSYMBOL'] = function() {
-    var sp = Runtime.stackSave();
-    // The implementation here is a bit "quirky" due to some low-level details
-    // of the interaction between emscripten and LLVM and the use of pn_bytes.
-    // The JavaScript code below is basically a binding to:
-    //
-    // pn_bytes bytes = pn_data_get_symbol(data);
-
-    // Here's the quirky bit, pn_data_get_symbol actually returns pn_bytes_t 
-    // *by value* but the low-level code handles this *by pointer* so we first
-    // need to allocate 8 bytes storage for {size, start} on the emscripten stack
-    // and then we pass the pointer to that storage as the first parameter to the
-    // compiled pn_data_get_symbol.
-    var bytes = allocate(8, 'i8', ALLOC_STACK);
-    _pn_data_get_symbol(bytes, this._data);
-
-    // The bytes variable is really of type pn_bytes_t* so we use emscripten's
-    // getValue() call to retrieve the size and then the start pointer.
-    var size  = getValue(bytes, 'i32');
-    var start = getValue(bytes + 4, '*');
-
-    // Create a native JavaScript String from the pn_bytes_t information.
-    var string = Pointer_stringify(start, size);
-
-    // Tidy up the memory that we allocated on emscripten's stack.
-    Runtime.stackRestore(sp);
-
-    return new Data['Symbol'](string);
-};
-
-/**
- * Performs a deep copy of the current {@link proton.Data} instance and returns it
- * @method copy
- * @memberof! proton.Data#
- * @returns {proton.Data} a copy of the current {@link proton.Data} instance.
- */
-_Data_['copy'] = function() {
-    var copy = new Data();
-    this._check(_pn_data_copy(copy._data, this._data));
-    return copy;
-};
-
-/**
- * Format the encoded AMQP Data into a string representation and return it.
- * @method format
- * @memberof! proton.Data#
- * @returns {string} a formatted string representation of the encoded Data.
- */
-_Data_['format'] = function() {
-    var sp = Runtime.stackSave();
-    var sizeptr = allocate(4, 'i32', ALLOC_STACK);
-
-    var size = 1024; // Pass by reference variable - need to use setValue to initialise it.
-    while (true) {
-        setValue(sizeptr, size, 'i32'); // Set pass by reference variable.
-        var bytes = _malloc(size);   // Allocate storage from emscripten heap.
-        var err = _pn_data_format(this._data, bytes, sizeptr);
-        var size = getValue(sizeptr, 'i32'); // Dereference the real size value;
-
-        if (err === Module['Error']['OVERFLOW']) {
-            _free(bytes);
-            size *= 2;
-        } else {
-            var string = Pointer_stringify(bytes, size);
-            _free(bytes);
-            // Tidy up the memory that we allocated on emscripten's stack.
-            Runtime.stackRestore(sp);
-            this._check(err)
-            return string;
-        }
-    }
-};
-
-/**
- * Print the internal state of the {@link proton.Data} in human readable form.
- * TODO. This seems to "crash" if compound nodes such as DESCRIBED, MAP or LIST
- * are present in the tree, this is most likely a problem with the underlying C
- * implementation as all the other navigation and format methods work - need to
- * check by testing with some native C code.
- * @method dump
- * @memberof! proton.Data#
- */
-_Data_['dump'] = function() {
-    _pn_data_dump(this._data);
-};
-
-/**
- * Serialise a Native JavaScript Object into an AMQP Map.
- * @method putMAP
- * @memberof! proton.Data#
- * @param {object} object the Native JavaScript Object that we wish to serialise.
- */
-_Data_['putMAP'] = function(object) {
-    this['putMAPNODE']();
-    this['enter']();
-    for (var key in object) {
-        if (object.hasOwnProperty(key)) {
-            this['putObject'](key);
-            this['putObject'](object[key]);
-        }
-    }
-    this['exit']();
-};
-
-/**
- * Deserialise from an AMQP Map into a Native JavaScript Object.
- * @method getMAP
- * @memberof! proton.Data#
- * @returns {object} the deserialised Native JavaScript Object.
- */
-_Data_['getMAP'] = function() {
-    if (this['enter']()) {
-        var result = {};
-        while (this['next']()) {
-            var key = this['getObject']();
-            var value = null;
-            if (this['next']()) {
-                value = this['getObject']();
-            }
-            result[key] = value;
-        }
-        this['exit']();
-        return result;
-    }
-};
-
-/**
- * Serialise a Native JavaScript Array into an AMQP List.
- * @method putLIST
- * @memberof! proton.Data#
- * @param {Array} array the Native JavaScript Array that we wish to serialise.
- */
-_Data_['putLIST'] = function(array) {
-    this['putLISTNODE']();
-    this['enter']();
-    for (var i = 0, len = array.length; i < len; i++) {
-        this['putObject'](array[i]);
-    }
-    this['exit']();
-};
-
-/**
- * Deserialise from an AMQP List into a Native JavaScript Array.
- * @method getLIST
- * @memberof! proton.Data#
- * @returns {Array} the deserialised Native JavaScript Array.
- */
-_Data_['getLIST'] = function() {
-    if (this['enter']()) {
-        var result = [];
-        while (this['next']()) {
-            result.push(this['getObject']());
-        }
-        this['exit']();
-        return result;
-    }
-};
-
-/**
- * Serialise a proton.Data.Described into an AMQP Described.
- * @method putDESCRIBED
- * @memberof! proton.Data#
- * @param {proton.Data.Described} d the proton.Data.Described that we wish to serialise.
- */
-_Data_['putDESCRIBED'] = function(d) {
-    this['putDESCRIBEDNODE']();
-    this['enter']();
-    this['putObject'](d['descriptor']);
-    this['putObject'](d['value']);
-    this['exit']();
-};
-
-/**
- * Deserialise from an AMQP Described into a proton.Data.Described.
- * @method getDESCRIBED
- * @memberof! proton.Data#
- * @returns {proton.Data.Described} the deserialised proton.Data.Described.
- */
-_Data_['getDESCRIBED'] = function() {
-    if (this['enter']()) {
-        this['next']();
-        var descriptor = this['getObject']();
-        this['next']();
-        var value = this['getObject']();
-        this['exit']();
-        return new Data['Described'](value, descriptor);
-    }
-};
-
-/**
- * Serialise a proton.Data.Array or JavaScript TypedArray into an AMQP Array.
- * @method putARRAY
- * @memberof! proton.Data#
- * @param {object} a the proton.Data.Array or TypedArray that we wish to serialise.
- */
-_Data_['putARRAY'] = function(a) {
-    var type = 1;
-    var descriptor = 'TypedArray';
-    var array = a;
-
-    if (a instanceof Data['Array']) { // Array is a proton.Data.Array
-        type = Data[a['type']]; // Find the integer type from its name string.
-        descriptor = a['descriptor'];
-        array = a['elements'];
-    } else { // Array is a Native JavaScript TypedArray so work out the right type.
-        if (a instanceof Int8Array) {
-            type = Data['BYTE'];
-        } else if (a instanceof Uint8Array || a instanceof Uint8ClampedArray) {
-            type = Data['UBYTE'];
-        } else if (a instanceof Int16Array) {
-            type = Data['SHORT'];
-        } else if (a instanceof Uint16Array) {
-            type = Data['USHORT'];
-        } else if (a instanceof Int32Array) {
-            type = Data['INT'];
-        } else if (a instanceof Uint32Array) {
-            type = Data['UINT'];
-        } else if (a instanceof Float32Array) {
-            type = Data['FLOAT'];
-        } else if (a instanceof Float64Array) {
-            type = Data['DOUBLE'];
-        }
-    }
-
-    var described = descriptor != null;
-
-    this['putARRAYNODE'](described, type);
-    this['enter']();
-    if (described) {
-        this['putObject'](descriptor);
-    }
-    var putter = 'put' + Data['TypeNames'][type];
-    for (var i = 0, len = array.length; i < len; i++) {
-        var value = array[i];
-        value = (value instanceof Data.TypedNumber) ? value.value : value;
-        this[putter](value);
-    }
-    this['exit']();
-};
-
-/**
- * Deserialise from an AMQP Array into a proton.Data.Array.
- * @method getARRAY
- * @memberof! proton.Data#
- * @returns {proton.Data.Array} the deserialised proton.Data.Array.
- */
-_Data_['getARRAY'] = function() {
-    var metadata = this['getARRAYNODE']();
-    var count = metadata['count'];
-    var described = metadata['described'];
-    var type = metadata['type'];
-
-    if (type === null) {
-        return null;
-    }
-
-    var elements = null;
-    if (typeof ArrayBuffer === 'function') {
-        if (type === Data['BYTE']) {
-            elements = new Int8Array(count);
-        } else if (type === Data['UBYTE']) {
-            elements = new Uint8Array(count);
-        } else if (type === Data['SHORT']) {
-            elements = new Int16Array(count);
-        } else if (type === Data['USHORT']) {
-            elements = new Uint16Array(count);
-        } else if (type === Data['INT']) {
-            elements = new Int32Array(count);
-        } else if (type === Data['UINT']) {
-            elements = new Uint32Array(count);
-        } else if (type === Data['FLOAT']) {
-            elements = new Float32Array(count);
-        } else if (type === Data['DOUBLE']) {
-            elements = new Float64Array(count);
-        } else {
-            elements = new Array(count);
-        }
-    } else {
-        elements = new Array(count);
-    }
-
-    if (this['enter']()) {
-        var descriptor; // Deliberately initialised as undefined not null.
-        if (described) {
-            this['next']();
-            descriptor = this['getObject']();
-        }
-
-        for (var i = 0; i < count; i++) {
-            this['next']();
-            elements[i] = this['getObject']();
-        }
-
-        this['exit']();
-        if (descriptor === 'TypedArray') {
-            return elements;
-        } else {
-            return new Data['Array'](type, elements, descriptor);
-        }
-    }
-};
-
-/**
- * This method is the entry point for serialising native JavaScript types into
- * AMQP types. In an ideal world there would be a nice clean one to one mapping
- * and we could employ a look-up table but in practice the JavaScript type system
- * doesn't really lend itself to that and we have to employ extra checks,
- * heuristics and inferences.
- * @method putObject
- * @memberof! proton.Data#
- * @param {object} obj the JavaScript Object or primitive to be serialised.
- */
-_Data_['putObject'] = function(obj) {
-//console.log("Data.putObject " + obj);
-
-    if (obj == null) { // == Checks for null and undefined.
-        this['putNULL']();
-    } else if (Data.isString(obj)) {
-        var quoted = obj.match(/(['"])[^'"]*\1/);
-        if (quoted) { // If a quoted string extract the string inside the quotes.
-            obj = quoted[0].slice(1, -1);
-        }
-        this['putSTRING'](obj);
-    } else if (obj instanceof Date) {
-        this['putTIMESTAMP'](obj);
-    } else if (obj instanceof Data['Uuid']) {
-        this['putUUID'](obj);
-    } else if (obj instanceof Data['Binary']) {
-        this['putBINARY'](obj);
-    } else if (obj instanceof Data['Symbol']) {
-        this['putSYMBOL'](obj);
-    } else if (obj instanceof Data['Described']) {
-        this['putDESCRIBED'](obj);
-    } else if (obj instanceof Data['Array']) {
-        this['putARRAY'](obj);
-    } else if (obj.buffer && (typeof ArrayBuffer === 'function') && 
-               obj.buffer instanceof ArrayBuffer) {
-        this['putARRAY'](obj);
-    } else if (obj instanceof Data.TypedNumber) { // Dot notation used for "protected" inner class.
-        // Call the appropriate serialisation method based upon the numerical type.
-        this['put' + obj.type](obj.value);
-    } else if (Data.isNumber(obj)) {
-        /**
-         * This block encodes standard JavaScript numbers by making some inferences.
-         * Encoding JavaScript numbers is surprisingly complex and has several
-         * gotchas. The code here tries to do what the author believes is the
-         * most "intuitive" encoding of the native JavaScript Number. It first
-         * tries to identify if the number is an integer or floating point type
-         * by checking if the number modulo 1 is zero (i.e. if it has a remainder
-         * then it's a floating point type, which is encoded here as a double).
-         * If the number is an integer type a test is made to check if it is a
-         * 32 bit Int value. N.B. gotcha - JavaScript automagically coerces floating
-         * point numbers with a zero Fractional Part into an *exact* integer so
-         * numbers like 1.0, 100.0 etc. will be encoded as int or long here,
-         * which is unlikely to be what is wanted. There's no easy "transparent"
-         * way around this. The TypedNumber approach above allows applications
-         * to express more explicitly what is required, for example (1.0).float()
-         * (1).ubyte(), (5).long() etc.
-         */
-        if (obj % 1 === 0) {
-            if (obj === (obj|0)) { // the |0 coerces to a 32 bit value.
-                // 32 bit integer - encode as an INT.
-                this['putINT'](obj);
-            } else { // Longer than 32 bit - encode as a Long.
-                this['putLONG'](obj);
-            }
-        } else { // Floating point type - encode as a Double
-            this['putDOUBLE'](obj);
-        }
-    } else if (Data.isBoolean(obj)) {
-        this['putBOOL'](obj);
-    } else if (Data.isArray(obj)) { // Native JavaScript Array
-        this['putLIST'](obj);
-    } else {
-        this['putMAP'](obj);
-    }
-};
-
-/**
- * @method getObject
- * @memberof! proton.Data#
- * @returns {object} the JavaScript Object or primitive being deserialised.
- */
-_Data_['getObject'] = function() {
-    var type = Data['TypeNames'][this.type()];
-    type = type ? type : 'NULL';
-    var getter = 'get' + type;
-    return this[getter]();
-};
-
diff --git a/proton-c/bindings/javascript/error.js b/proton-c/bindings/javascript/error.js
deleted file mode 100644
index 4069bef..0000000
--- a/proton-c/bindings/javascript/error.js
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*****************************************************************************/
-/*                                                                           */
-/*                                   Status                                  */
-/*                                                                           */
-/*****************************************************************************/
-
-/**
- * Export Status Enum, avoiding minification.
- * @enum
- * @alias Status
- * @memberof proton
- */
-Module['Status'] = {
-    /** PN_STATUS_UNKNOWN */  'UNKNOWN':  0, // The tracker is unknown.
-    /** PN_STATUS_PENDING */  'PENDING':  1, // The message is in flight.
-                                             // For outgoing messages, use messenger.isBuffered()
-                                             // to see if it has been sent or not.
-    /** PN_STATUS_ACCEPTED */ 'ACCEPTED': 2, // The message was accepted.
-    /** PN_STATUS_REJECTED */ 'REJECTED': 3, // The message was rejected.
-    /** PN_STATUS_RELEASED */ 'RELEASED': 4, // The message was released.
-    /** PN_STATUS_MODIFIED */ 'MODIFIED': 5, // The message was modified.
-    /** PN_STATUS_ABORTED */  'ABORTED':  6, // The message was aborted.
-    /** PN_STATUS_SETTLED */  'SETTLED':  7  // The remote party has settled the message.
-};
-
-
-/*****************************************************************************/
-/*                                                                           */
-/*                                   Error                                   */
-/*                                                                           */
-/*****************************************************************************/
-
-/**
- * Export Error Enum, avoiding minification.
- * @enum
- * @alias Error
- * @memberof proton
- */
-Module['Error'] = {
-    /** PN_EOS */        'EOS':        -1,
-    /** PN_ERR */        'ERR':        -2,
-    /** PN_OVERFLOW */   'OVERFLOW':   -3,
-    /** PN_UNDERFLOW */  'UNDERFLOW':  -4,
-    /** PN_STATE_ERR */  'STATE_ERR':  -5,
-    /** PN_ARG_ERR */    'ARG_ERR':    -6,
-    /** PN_TIMEOUT */    'TIMEOUT':    -7,
-    /** PN_INTR */       'INTR':       -8,
-    /** PN_INPROGRESS */ 'INPROGRESS': -9
-};
-
-
-/*****************************************************************************/
-/*                                                                           */
-/*                               MessengerError                              */
-/*                                                                           */
-/*****************************************************************************/
-
-/**
- * Constructs a proton.MessengerError instance.
- * @classdesc This class is a subclass of Error.
- * @constructor proton.MessengerError
- * @param {string} message the error message.
- */
-Module['MessengerError'] = function(message) { // MessengerError constructor.
-    this.name = "MessengerError";
-    this.message = (message || "");
-};
-
-Module['MessengerError'].prototype = new Error();
-Module['MessengerError'].prototype.constructor = Module['MessengerError'];
-
-Module['MessengerError'].prototype.toString = function() {
-    return this.name + ': ' + this.message;
-};
-
-
-/*****************************************************************************/
-/*                                                                           */
-/*                              SubscriptionError                            */
-/*                                                                           */
-/*****************************************************************************/
-
-/**
- * Constructs a proton.SubscriptionError instance.
- * @classdesc This class is a subclass of MessengerError.
- * @constructor proton.SubscriptionError
- * @param {string} source the address that we want to subscribe to.
- * @param {string} message the error message.
- */
-Module['SubscriptionError'] = function(source, message) { // SubscriptionError constructor.
-    this.name = "SubscriptionError";
-    this.source = source;
-    this.message = (message || "");
-};
-
-Module['SubscriptionError'].prototype = new Module['MessengerError']();
-Module['SubscriptionError'].prototype.constructor = Module['SubscriptionError'];
-
-Module['SubscriptionError'].prototype.toString = function() {
-    return this.name + ': ' + this.source + ': ' + this.message;
-};
-
-
-/*****************************************************************************/
-/*                                                                           */
-/*                                MessageError                               */
-/*                                                                           */
-/*****************************************************************************/
-
-/**
- * Constructs a proton.MessageError instance.
- * @classdesc This class is a subclass of Error.
- * @constructor proton.MessageError
- * @param {string} message the error message.
- */
-Module['MessageError'] = function(message) { // MessageError constructor.
-    this.name = "MessageError";
-    this.message = (message || "");
-};
-
-Module['MessageError'].prototype = new Error();
-Module['MessageError'].prototype.constructor = Module['MessageError'];
-
-Module['MessageError'].prototype.toString = function() {
-    return this.name + ': ' + this.message;
-};
-
-
-/*****************************************************************************/
-/*                                                                           */
-/*                                  DataError                                */
-/*                                                                           */
-/*****************************************************************************/
-
-/**
- * Constructs a proton.DataError instance.
- * @classdesc This class is a subclass of Error.
- * @constructor proton.DataError
- * @param {string} message the error message.
- */
-Module['DataError'] = function(message) { // DataError constructor.
-    this.name = "DataError";
-    this.message = (message || "");
-};
-
-Module['DataError'].prototype = new Error();
-Module['DataError'].prototype.constructor = Module['DataError'];
-
-Module['DataError'].prototype.toString = function() {
-    return this.name + ': ' + this.message;
-};
-
diff --git a/proton-c/bindings/javascript/message.js b/proton-c/bindings/javascript/message.js
deleted file mode 100644
index 40b15f2..0000000
--- a/proton-c/bindings/javascript/message.js
+++ /dev/null
@@ -1,840 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*****************************************************************************/
-/*                                                                           */
-/*                                  Message                                  */
-/*                                                                           */
-/*****************************************************************************/
-
-/**
- * Constructs a proton.Message instance.
- * @classdesc This class is a mutable holder of message content that may be used
- * to generate and encode or decode and access AMQP formatted message data.
- * @constructor proton.Message
- * @property {object} instructions delivery instructions for the message.
- * @property {object} annotations infrastructure defined message annotations.
- * @property {object} properties application defined message properties.
- * @property {object} body message body as a native JavaScript Object.
- * @property {object} data message body as a proton.Data Object.
- */
-Module['Message'] = function() { // Message Constructor.
-    this._message = _pn_message();
-    this._id = new Data(_pn_message_id(this._message));
-    this._correlationId = new Data(_pn_message_correlation_id(this._message));
-
-    // ************************* Public properties ****************************
-
-    // Intitialise with an empty Object so we can set properties in a natural way.
-    // message.properties.prop1 = "foo";
-    // message.properties.prop2 = "bar";
-    this['properties'] = {};
-
-    /**
-    // The properties may be used, but are initially undefined.
-    this['instructions'];
-    this['annotations'];
-    this['body'];
-    this['data'];
-     */
-};
-
-// Expose constructor as package scope variable to make internal calls less verbose.
-var Message = Module['Message'];
-
-// Expose prototype as a variable to make method declarations less verbose.
-var _Message_ = Message.prototype;
-
-// ************************** Class properties ********************************
-
-Message['DEFAULT_PRIORITY'] = 4; /** Default priority for messages.*/
-
-// ************************* Protected methods ********************************
-
-// We use the dot notation rather than associative array form for protected
-// methods so they are visible to this "package", but the Closure compiler will
-// minify and obfuscate names, effectively making a defacto "protected" method.
-
-/**
- * This helper method checks the supplied error code, converts it into an
- * exception and throws the exception. This method will try to use the message
- * populated in pn_message_error(), if present, but if not it will fall
- * back to using the basic error code rendering from pn_code().
- * @param code the error code to check.
- */
-_Message_._check = function(code) {
-    if (code < 0) {
-        var errno = this['getErrno']();
-        var message = errno ? this['getError']() : Pointer_stringify(_pn_code(code));
-
-        throw new Module['MessageError'](message);
-    } else {
-        return code;
-    }
-};
-
-/**
- * Encode the Message prior to sending on the wire.
- */
-_Message_._preEncode = function() {
-    // A Message Object may be reused so we create new Data instances and clear
-    // the state for them each time put() gets called.
-    var inst = new Data(_pn_message_instructions(this._message));
-    var ann = new Data(_pn_message_annotations(this._message));
-    var props = new Data(_pn_message_properties(this._message));
-    var body = new Data(_pn_message_body(this._message));
-
-    inst.clear();
-    if (this['instructions'] !== undefined) {
-        inst['putObject'](this['instructions']);
-    }
-
-    ann.clear();
-    if (this['annotations'] !== undefined) {
-        ann['putObject'](this['annotations']);
-    }
-
-    props.clear();
-    if (this['properties'] !== undefined) {
-        props['putObject'](this['properties']);
-    }
-
-    body.clear();
-    if (this['body'] !== undefined) {
-        var contentType = this['getContentType']();
-        if (contentType) {
-            var value = this['body'];
-            if (contentType === 'application/json' && JSON) { // Optionally encode body as JSON.
-                var json = JSON.stringify(value);
-                value = new Data['Binary'](json);
-            } else if (!(value instanceof Data['Binary'])) { // Construct a Binary from the body
-                value = new Data['Binary'](value);
-            }
-            // As content-type is set we send as an opaque AMQP data section.
-            this['setInferred'](true);
-            body['putBINARY'](value);
-        } else { // By default encode body using the native AMQP type system.
-            this['setInferred'](false);
-            body['putObject'](this['body']);
-        }
-    }
-};
-
-/**
- * Decode the Message after receiving off the wire.
- * @param {boolean} decodeBinaryAsString if set decode any AMQP Binary payload
- *        objects as strings. This can be useful as the data in Binary objects
- *        will be overwritten with subsequent calls to get, so they must be
- *        explicitly copied. Needless to say it is only safe to set this flag if
- *        you know that the data you are dealing with is actually a string, for
- *        example C/C++ applications often seem to encode strings as AMQP binary,
- *        a common cause of interoperability problems.
- */
-_Message_._postDecode = function(decodeBinaryAsString) {
-    var inst = new Data(_pn_message_instructions(this._message));
-    var ann = new Data(_pn_message_annotations(this._message));
-    var props = new Data(_pn_message_properties(this._message));
-    var body = new Data(_pn_message_body(this._message), decodeBinaryAsString);
-
-    if (inst.next()) {
-        this['instructions'] = inst['getObject']();
-    } else {
-        delete this['instructions'];
-    }
-
-    if (ann.next()) {
-        this['annotations'] = ann['getObject']();
-    } else {
-        delete this['annotations'];
-    }
-
-    if (props.next()) {
-        this['properties'] = props['getObject']();
-    } else {
-        this['properties'] = {};
-    }
-
-    if (body.next()) {
-        this['data'] = body;
-        this['body'] = body['getObject']();
-        var contentType = this['getContentType']();
-        if (contentType) {
-            if (contentType === 'application/json' && JSON) {
-                var json = this['body'].toString(); // Convert Binary to String.
-                this['body'] = JSON.parse(json);
-            } else if (contentType.indexOf('text/') === 0) { // It's a text/* MIME type
-                this['body'] = this['body'].toString(); // Convert Binary to String.
-            }
-        }
-    } else {
-        // If no body is present ensure that the properties are undefined.
-        delete this['data'];
-        delete this['body'];
-    }
-};
-
-// *************************** Public methods *********************************
-
-/**
- * Free the Message.
- * <p>
- * N.B. This method has to be called explicitly in JavaScript as we can't
- * intercept finalisers, so we need to remember to free before removing refs.
- * @method free
- * @memberof! proton.Message#
- */
-_Message_['free'] = function() {
-    _pn_message_free(this._message);
-};
-
-/**
- * @method getErrno
- * @memberof! proton.Message#
- * @returns {number the most recent error message code.
- */
-_Message_['getErrno'] = function() {
-    return _pn_message_errno(this._message);
-};
-
-/**
- * @method getError
- * @memberof! proton.Message#
- * @returns {string} the most recent error message as a String.
- */
-_Message_['getError'] = function() {
-    return Pointer_stringify(_pn_error_text(_pn_message_error(this._message)));
-};
-
-/**
- * Clears the contents of the Message. All fields will be reset to their default values.
- * @method clear
- * @memberof! proton.Message#
- */
-_Message_['clear'] = function() {
-    _pn_message_clear(this._message);
-    this['properties'] = {};
-    delete this['instructions'];
-    delete this['annotations'];
-    delete this['body'];
-    delete this['data'];
-};
-
-/**
- * Get the inferred flag for a message.
- * <p>
- * The inferred flag for a message indicates how the message content
- * is encoded into AMQP sections. If inferred is true then binary and
- * list values in the body of the message will be encoded as AMQP DATA
- * and AMQP SEQUENCE sections, respectively. If inferred is false,
- * then all values in the body of the message will be encoded as AMQP
- * VALUE sections regardless of their type. Use
- * {@link proton.Message.setInferred} to set the value.
- * @method isInferred
- * @memberof! proton.Message#
- * @returns {boolean} true iff the inferred flag for the message is set.
- */
-_Message_['isInferred'] = function() {
-    return (_pn_message_is_inferred(this._message) > 0);
-};
-
-/**
- * Set the inferred flag for a message. See {@link proton.Message.isInferred} 
- * for a description of what the inferred flag is.
- * @method setInferred
- * @memberof! proton.Message#
- * @param {boolean} inferred the new value of the inferred flag.
- */
-_Message_['setInferred'] = function(inferred) {
-    this._check(_pn_message_set_inferred(this._message, inferred));
-};
-
-/**
- * Get the durable flag for a message.
- * <p>
- * The durable flag indicates that any parties taking responsibility
- * for the message must durably store the content. Use
- * {@link proton.Message.setDurable} to set the value.
- * @method isDurable
- * @memberof! proton.Message#
- * @returns {boolean} true iff the durable flag for the message is set.
- */
-_Message_['isDurable'] = function() {
-    return (_pn_message_is_durable(this._message) > 0);
-};
-
-/**
- * Set the durable flag for a message. See {@link proton.Message.isDurable} 
- * for a description of what the durable flag is.
- * @method setDurable
- * @memberof! proton.Message#
- * @param {boolean} durable the new value of the durable flag.
- */
-_Message_['setDurable'] = function(durable) {
-    this._check(_pn_message_set_durable(this._message, durable));
-};
-
-/**
- * Get the priority for a message.
- * <p>
- * The priority of a message impacts ordering guarantees. Within a
- * given ordered context, higher priority messages may jump ahead of
- * lower priority messages. Priority range is 0..255
- * @method getPriority
- * @memberof! proton.Message#
- * @returns {number} the priority of the Message.
- */
-_Message_['getPriority'] = function() {
-    return _pn_message_get_priority(this._message) & 0xFF; // & 0xFF converts to unsigned.
-};
-
-/**
- * Set the priority of the Message. See {@link proton.Message.getPriority}
- * for details on message priority.
- * @method setPriority
- * @memberof! proton.Message#
- * @param {number} priority the address we want to send the Message to.
- */
-_Message_['setPriority'] = function(priority) {
-    this._check(_pn_message_set_priority(this._message, priority));
-};
-
-/**
- * Get the ttl for a message.
- * <p>
- * The ttl for a message determines how long a message is considered
- * live. When a message is held for retransmit, the ttl is
- * decremented. Once the ttl reaches zero, the message is considered
- * dead. Once a message is considered dead it may be dropped. Use
- * {@link proton.Message.setTTL} to set the ttl for a message.
- * @method getTTL
- * @memberof! proton.Message#
- * @returns {number} the ttl in milliseconds.
- */
-_Message_['getTTL'] = function() {
-    return _pn_message_get_ttl(this._message);
-};
-
-/**
- * Set the ttl for a message. See {@link proton.Message.getTTL}
- * for a detailed description of message ttl.
- * @method setTTL
- * @memberof! proton.Message#
- * @param {number} ttl the new value for the message ttl in milliseconds.
- */
-_Message_['setTTL'] = function(ttl) {
-    this._check(_pn_message_set_ttl(this._message, ttl));
-};
-
-/**
- * Get the first acquirer flag for a message.
- * <p>
- * When set to true, the first acquirer flag for a message indicates
- * that the recipient of the message is the first recipient to acquire
- * the message, i.e. there have been no failed delivery attempts to
- * other acquirers. Note that this does not mean the message has not
- * been delivered to, but not acquired, by other recipients.
- * @method isFirstAcquirer
- * @memberof! proton.Message#
- * @returns {boolean} true iff the first acquirer flag for the message is set.
- */
-_Message_['isFirstAcquirer'] = function() {
-    return (_pn_message_is_first_acquirer(this._message) > 0);
-};
-
-/**
- * Set the first acquirer flag for a message. See {@link proton.Message.isFirstAcquirer} 
- * for details on the first acquirer flag.
- * @method setFirstAcquirer
- * @memberof! proton.Message#
- * @param {boolean} first the new value of the first acquirer flag.
- */
-_Message_['setFirstAcquirer'] = function(first) {
-    this._check(_pn_message_set_first_acquirer(this._message, first));
-};
-
-/**
- * Get the delivery count for a message.
- * <p>
- * The delivery count field tracks how many attempts have been made to
- * deliver a message. Use {@link proton.Message.setDeliveryCount} to set
- * the delivery count for a message.
- * @method getDeliveryCount
- * @memberof! proton.Message#
- * @returns {number} the delivery count for the message.
- */
-_Message_['getDeliveryCount'] = function() {
-    return _pn_message_get_delivery_count(this._message);
-};
-
-/**
- * Set the delivery count for a message. See {@link proton.Message.getDeliveryCount}
- * for details on what the delivery count means.
- * @method setDeliveryCount
- * @memberof! proton.Message#
- * @param {number} count the new delivery count.
- */
-_Message_['setDeliveryCount'] = function(count) {
-    this._check(_pn_message_set_delivery_count(this._message, count));
-};
-
-/**
- * Get the id for a message.
- * <p>
- * The message id provides a globally unique identifier for a message.
- * A message id can be an a string, an unsigned long, a uuid or a binary value.
- * @method getID
- * @memberof! proton.Message#
- * @returns {(number|string|proton.Data.Long|proton.Data.Uuid|proton.Data.Binary)} the message id.
- */
-_Message_['getID'] = function() {
-    return this._id['getObject']();
-};
-
-/**
- * Set the id for a message. See {@link proton.Message.getID}
- * for more details on the meaning of the message id. Note that only string,
- * unsigned long, uuid, or binary values are permitted.
- * @method setID
- * @memberof! proton.Message#
- * @param {(number|string|proton.Data.Long|proton.Data.Uuid|proton.Data.Binary)} id the
- *        new value of the message id.
- */
-_Message_['setID'] = function(id) {
-    this._id['rewind']();
-    if (Data.isNumber(id)) {
-        this._id['putULONG'](id);
-    } else {
-        this._id['putObject'](id);
-    }
-};
-
-/**
- * Get the user id of the message creator.
- * <p>
- * The underlying raw data of the returned {@link proton.Data.Binary} will be
- * valid until any one of the following operations occur:
- * <pre>
- *  - {@link proton.Message.free}
- *  - {@link proton.Message.clear}
- *  - {@link proton.Message.setUserID}
- * </pre>
- * @method getUserID
- * @memberof! proton.Message#
- * @returns {proton.Data.Binary} the message's user id.
- */
-_Message_['getUserID'] = function() {
-    var sp = Runtime.stackSave();
-    // The implementation here is a bit "quirky" due to some low-level details
-    // of the interaction between emscripten and LLVM and the use of pn_bytes.
-    // The JavaScript code below is basically a binding to:
-    //
-    // pn_bytes_t bytes = pn_message_get_user_id(message);
-
-    // Here's the quirky bit, pn_message_get_user_id actually returns pn_bytes_t 
-    // *by value* but the low-level code handles this *by pointer* so we first
-    // need to allocate 8 bytes storage for {size, start} on the emscripten stack
-    // and then we pass the pointer to that storage as the first parameter to the
-    // compiled pn_message_get_user_id.
-    var bytes = allocate(8, 'i8', ALLOC_STACK);
-    _pn_message_get_user_id(bytes, this._message);
-
-    // The bytes variable is really of type pn_bytes_t* so we use emscripten's
-    // getValue() call to retrieve the size and then the start pointer.
-    var size  = getValue(bytes, 'i32');
-    var start = getValue(bytes + 4, '*');
-
-    // Create a proton.Data.Binary from the pn_bytes_t information.
-    var binary = new Data['Binary'](size, start);
-
-    // Tidy up the memory that we allocated on emscripten's stack.
-    Runtime.stackRestore(sp);
-
-    return binary;
-};
-
-/**
- * Set the user id for a message. This method takes a {@link proton.Data.Binary}
- * consuming the underlying raw data in the process. For convenience this method
- * also accepts a {@link proton.Data.Uuid}, number or string, converting them to a
- * Binary internally. N.B. getUserID always returns a {@link proton.Data.Binary}
- * even if a string or {@link proton.Data.Uuid} has been passed to setUserID.
- * @method setUserID
- * @memberof! proton.Message#
- * @param {(string|proton.Data.Uuid)} id the new user id for the message.
- */
-_Message_['setUserID'] = function(id) {
-    // If the id parameter is a proton.Data.Binary use it otherwise create a Binary
-    // using the string form of the parameter that was passed.
-    id = (id instanceof Data['Binary']) ? id : new Data['Binary']('' + id);
-
-    var sp = Runtime.stackSave();
-    // The implementation here is a bit "quirky" due to some low-level details
-    // of the interaction between emscripten and LLVM and the use of pn_bytes.
-    // The JavaScript code below is basically a binding to:
-    //
-    // pn_message_set_user_id(message, pn_bytes(id.size, id.start));
-
-    // Here's the quirky bit, pn_bytes actually returns pn_bytes_t *by value* but
-    // the low-level code handles this *by pointer* so we first need to allocate
-    // 8 bytes storage for {size, start} on the emscripten stack and then we
-    // pass the pointer to that storage as the first parameter to the pn_bytes.
-    var bytes = allocate(8, 'i8', ALLOC_STACK);
-    _pn_bytes(bytes, id.size, id.start);
-
-    // The compiled pn_message_set_user_id takes the pn_bytes_t by reference not value.
-    this._check(_pn_message_set_user_id(this._message, bytes));
-
-    // After calling _pn_message_set_user_id the underlying Message object "owns" the
-    // binary data, so we can call free on the proton.Data.Binary instance to
-    // release any storage it has acquired back to the emscripten heap.
-    id['free']();
-    Runtime.stackRestore(sp);
-};
-
-/**
- * Get the address for a message.
- * @method getAddress
- * @memberof! proton.Message#
- * @returns {string} the address of the Message.
- */
-_Message_['getAddress'] = function() {
-    return Pointer_stringify(_pn_message_get_address(this._message));
-};
-
-/**
- * Set the address of the Message.
- * @method setAddress
- * @memberof! proton.Message#
- * @param {string} address the address we want to send the Message to.
- */
-_Message_['setAddress'] = function(address) {
-    var sp = Runtime.stackSave();
-    this._check(_pn_message_set_address(this._message, allocate(intArrayFromString(address), 'i8', ALLOC_STACK)));
-    Runtime.stackRestore(sp);
-};
-
-/**
- * Get the subject for a message.
- * @method getSubject
- * @memberof! proton.Message#
- * @returns {string} the subject of the Message.
- */
-_Message_['getSubject'] = function() {
-    return Pointer_stringify(_pn_message_get_subject(this._message));
-};
-
-/**
- * Set the subject of the Message.
- * @method setSubject
- * @memberof! proton.Message#
- * @param {string} subject the subject we want to set for the Message.
- */
-_Message_['setSubject'] = function(subject) {
-    var sp = Runtime.stackSave();
-    this._check(_pn_message_set_subject(this._message, allocate(intArrayFromString(subject), 'i8', ALLOC_STACK)));
-    Runtime.stackRestore(sp);
-};
-
-/**
- * Get the reply to for a message.
- * @method getReplyTo
- * @memberof! proton.Message#
- * @returns {string} the reply to of the Message.
- */
-_Message_['getReplyTo'] = function() {
-    return Pointer_stringify(_pn_message_get_reply_to(this._message));
-};
-
-/**
- * Set the reply to for a message.
- * @method setReplyTo
- * @memberof! proton.Message#
- * @param {string} reply the reply to we want to set for the Message.
- */
-_Message_['setReplyTo'] = function(reply) {
-    var sp = Runtime.stackSave();
-    this._check(_pn_message_set_reply_to(this._message, allocate(intArrayFromString(reply), 'i8', ALLOC_STACK)));
-    Runtime.stackRestore(sp);
-};
-
-/**
- * Get the correlation id for a message.
- * <p>
- * A correlation id can be an a string, an unsigned long, a uuid or a binary value.
- * @method getCorrelationID
- * @memberof! proton.Message#
- * @returns {(number|string|proton.Data.Long|proton.Data.Uuid|proton.Data.Binary)} the message id.
- */
-_Message_['getCorrelationID'] = function() {
-    return this._correlationId['getObject']();
-};
-
-/**
- * Set the correlation id for a message. See {@link proton.Message.getCorrelationID}
- * for more details on the meaning of the correlation id. Note that only string,
- * unsigned long, uuid, or binary values are permitted.
- * @method setCorrelationID
- * @memberof! proton.Message#
- * @param {(number|string|proton.Data.Long|proton.Data.Uuid|proton.Data.Binary)} id the
- *        new value of the correlation id.
- */
-_Message_['setCorrelationID'] = function(id) {
-    this._correlationId['rewind']();
-    if (Data.isNumber(id)) {
-        this._correlationId['putULONG'](id);
-    } else {
-        this._correlationId['putObject'](id);
-    }
-};
-
-/**
- * Get the content type for a message.
- * @method getContentType
- * @memberof! proton.Message#
- * @returns {string} the content type of the Message.
- */
-_Message_['getContentType'] = function() {
-    return Pointer_stringify(_pn_message_get_content_type(this._message));
-};
-
-/**
- * Set the content type for a message.
- * @method setContentType
- * @memberof! proton.Message#
- * @param {string} type the content type we want to set for the Message.
- */
-_Message_['setContentType'] = function(type) {
-    var sp = Runtime.stackSave();
-    this._check(_pn_message_set_content_type(this._message, allocate(intArrayFromString(type), 'i8', ALLOC_STACK)));
-    Runtime.stackRestore(sp);
-};
-
-/**
- * Get the content encoding for a message.
- * @method getContentEncoding
- * @memberof! proton.Message#
- * @returns {string} the content encoding of the Message.
- */
-_Message_['getContentEncoding'] = function() {
-    return Pointer_stringify(_pn_message_get_content_encoding(this._message));
-};
-
-/**
- * Set the content encoding for a message.
- * @method setContentEncoding
- * @memberof! proton.Message#
- * @param {string} encoding the content encoding we want to set for the Message.
- */
-_Message_['setContentEncoding'] = function(encoding) {
-    var sp = Runtime.stackSave();
-    this._check(_pn_message_set_content_encoding(this._message, allocate(intArrayFromString(encoding), 'i8', ALLOC_STACK)));
-    Runtime.stackRestore(sp);
-};
-
-/**
- * Get the expiry time for a message.
- * A zero value for the expiry time indicates that the message will
- * never expire. This is the default value.
- * @method getExpiryTime
- * @memberof! proton.Message#
- * @returns {Date} the expiry time for the message.
- */
-_Message_['getExpiryTime'] = function() {
-    // Getting the timestamp is a little tricky as it is a 64 bit number. The way
-    // emscripten handles this is to return the low 32 bits directly and pass
-    // the high 32 bits via the tempRet0 variable. We use Data.Long to hold
-    // the 64 bit number and Data.Long.toNumber() to convert it back into a
-    // JavaScript number.
-    var low =  _pn_message_get_expiry_time(this._message);
-    var high = Runtime.getTempRet0();
-    var long = new Data.Long(low, high);
-    long = long.toNumber();
-    return new Date(long);
-};
-
-/**
- * Set the expiry time for a message.
- * @method setExpiryTime
- * @memberof! proton.Message#
- * @param {(number|Date)} time the new expiry time for the message.
- */
-_Message_['setExpiryTime'] = function(time) {
-    // Note that a timestamp is a 64 bit number so we have to use a proton.Data.Long.
-    var timestamp = Data.Long.fromNumber(time.valueOf());
-    this._check(_pn_message_set_expiry_time(this._message, timestamp.getLowBitsUnsigned(), timestamp.getHighBits()));
-};
-
-/**
- * Get the creation time for a message.
- * A zero value for the creation time indicates that the creation time
- * has not been set. This is the default value.
- * @method getCreationTime
- * @memberof! proton.Message#
- * @returns {Date} the creation time for the message.
- */
-_Message_['getCreationTime'] = function() {
-    // Getting the timestamp is a little tricky as it is a 64 bit number. The way
-    // emscripten handles this is to return the low 32 bits directly and pass
-    // the high 32 bits via the tempRet0 variable. We use Data.Long to hold
-    // the 64 bit number and Data.Long.toNumber() to convert it back into a
-    // JavaScript number.
-    var low =  _pn_message_get_creation_time(this._message);
-    var high = Runtime.getTempRet0();
-    var long = new Data.Long(low, high);
-    long = long.toNumber();
-    return new Date(long);
-};
-
-/**
- * Set the creation time for a message.
- * @method setCreationTime
- * @memberof! proton.Message#
- * @param {(number|Date)} time the new creation time for the message.
- */
-_Message_['setCreationTime'] = function(time) {
-    // Note that a timestamp is a 64 bit number so we have to use a proton.Data.Long.
-    var timestamp = Data.Long.fromNumber(time.valueOf());
-    this._check(_pn_message_set_creation_time(this._message, timestamp.getLowBitsUnsigned(), timestamp.getHighBits()));
-};
-
-/**
- * Get the group id for a message.
- * @method getGroupID
- * @memberof! proton.Message#
- * @returns {string} the group id of the Message.
- */
-_Message_['getGroupID'] = function() {
-    return Pointer_stringify(_pn_message_get_group_id(this._message));
-};
-
-/**
- * Set the group id for a message.
- * @method setGroupID
- * @memberof! proton.Message#
- * @param {string} id the group id we want to set for the Message.
- */
-_Message_['setGroupID'] = function(id) {
-    var sp = Runtime.stackSave();
-    this._check(_pn_message_set_group_id(this._message, allocate(intArrayFromString(id), 'i8', ALLOC_STACK)));
-    Runtime.stackRestore(sp);
-};
-
-/**
- * Get the group sequence for a message.
- * <p>
- * The group sequence of a message identifies the relative ordering of
- * messages within a group. The default value for the group sequence
- * of a message is zero.
- * @method getGroupSequence
- * @memberof! proton.Message#
- * @returns {number} the group sequence for the message.
- */
-_Message_['getGroupSequence'] = function() {
-    return _pn_message_get_group_sequence(this._message);
-};
-
-/**
- * Set the group sequence for a message. See {@link proton.Message.getGroupSequence}
- * for details on what the group sequence means.
- * @method setGroupSequence
- * @memberof! proton.Message#
- * @param {number} n the new group sequence for the message.
- */
-_Message_['setGroupSequence'] = function(n) {
-    this._check(_pn_message_set_group_sequence(this._message, n));
-};
-
-/**
- * Get the reply to group id for a message.
- * @method getReplyToGroupID
- * @memberof! proton.Message#
- * @returns {string} the reply to group id of the Message.
- */
-_Message_['getReplyToGroupID'] = function() {
-    return Pointer_stringify(_pn_message_get_reply_to_group_id(this._message));
-};
-
-/**
- * Set the reply to group id for a message.
- * @method setReplyToGroupID
- * @memberof! proton.Message#
- * @param {string} id the reply to group id we want to set for the Message.
- */
-_Message_['setReplyToGroupID'] = function(id) {
-    var sp = Runtime.stackSave();
-    this._check(_pn_message_set_reply_to_group_id(this._message, allocate(intArrayFromString(id), 'i8', ALLOC_STACK)));
-    Runtime.stackRestore(sp);
-};
-
-/**
- * Return a Binary representation of the message encoded in AMQP format. N.B. the
- * returned {@link proton.Data.Binary} "owns" the underlying raw data and is thus
- * responsible for freeing it or passing it to a method that consumes a Binary
- * such as {@link proton.Message.decode}.
- * @method encode
- * @memberof! proton.Message#
- * @returns {proton.Data.Binary} a representation of the message encoded in AMQP format.
- */
-_Message_['encode'] = function() {
-    this._preEncode();
-    var sp = Runtime.stackSave();
-    var sizeptr = allocate(4, 'i32', ALLOC_STACK);
-    var size = 1024;
-    while (true) {
-        setValue(sizeptr, size, 'i32'); // Set pass by reference variable.
-        var bytes = _malloc(size);   // Allocate storage from emscripten heap.
-        var err = _pn_message_encode(this._message, bytes, sizeptr);
-        var size = getValue(sizeptr, 'i32'); // Dereference the real size value;
-
-        if (err === Module['Error']['OVERFLOW']) {
-            _free(bytes);
-            size *= 2;
-        } else if (err >= 0) {
-            // Tidy up the memory that we allocated on emscripten's stack.
-            Runtime.stackRestore(sp);
-            return new Data['Binary'](size, bytes);
-        } else {
-            // Tidy up the memory that we allocated on emscripten's stack.
-            Runtime.stackRestore(sp);
-            _free(bytes);
-            this._check(err);
-            return;
-        }
-    }
-};
-
-/**
- * Decodes and loads the message content from supplied Binary AMQP data  N.B. 
- * this method "consumes" data from a {@link proton.Data.Binary} in other words
- * it takes responsibility for the underlying data and frees the raw data from
- * the Binary.
- * @method decode
- * @memberof! proton.Message#
- * @param {proton.Data.Binary} encoded the AMQP encoded binary message.
- */
-_Message_['decode'] = function(encoded) {
-    var err = _pn_message_decode(this._message, encoded.start, encoded.size);
-    encoded['free'](); // Free the original Binary.
-    if (err >= 0) {
-        this._postDecode();
-    }
-    this._check(err);
-};
-
diff --git a/proton-c/bindings/javascript/messenger.js b/proton-c/bindings/javascript/messenger.js
deleted file mode 100644
index 5c96cb5..0000000
--- a/proton-c/bindings/javascript/messenger.js
+++ /dev/null
@@ -1,822 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*****************************************************************************/
-/*                                                                           */
-/*                                 Messenger                                 */
-/*                                                                           */
-/*****************************************************************************/
-
-/**
- * Constructs a proton.Messenger instance giving it an (optional) name. If name
- * is supplied that will be used as the name of the Messenger, otherwise a UUID
- * will be used. The Messenger is initialised to non-blocking mode as it makes
- * little sense to have blocking behaviour in a JavaScript implementation.
- * @classdesc The {@link proton.Messenger} class defines a high level interface for sending
- * and receiving {@link proton.Message}. Every {@link proton.Messenger} contains a
- * single logical queue of incoming messages and a single logical queue
- * of outgoing messages. These messages in these queues may be destined
- * for, or originate from, a variety of addresses.
- * <p>
- * The messenger interface is single-threaded.
- * <pre>
- * Address Syntax
- * ==============
- * </pre>
- * An address has the following form:
- * <pre>
- *   [ amqp[s]:// ] [user[:password]@] domain [/[name]]
- * </pre>
- * Where domain can be one of:
- * <pre>
- *   host | host:port | ip | ip:port | name
- * </pre>
- * The following are valid examples of addresses:
- * <pre>
- *  - example.org
- *  - example.org:1234
- *  - amqp://example.org
- *  - amqps://example.org
- *  - example.org/incoming
- *  - amqps://example.org/outgoing
- *  - amqps://fred:trustno1@example.org
- *  - 127.0.0.1:1234
- *  - amqps://127.0.0.1:1234
- *
- * Sending & Receiving Messages
- * ============================
- * </pre>
- * The {@link proton.Messenger} class works in conjuction with the {@link proton.Message} class.
- * The {@link proton.Message} class is a mutable holder of message content.
- * <p>
- * The put method copies its Message to the outgoing queue, and may
- * send queued messages if it can do so without blocking.  
- * <pre>
- *   var message = new proton.Message();
- *   for (var i = 0; i < 3; i++) {
- *      message.setAddress("amqp://host/queue");
- *      message.setSubject = ("Hello World " + i);
- *      messenger.put(message);
- *   }
- * </pre>
- * Similarly, the recv method receives messages into the incoming
- * queue. It may receive fewer than the requested number. The get method pops the
- * eldest Message off the incoming queue and copies it into the Message
- * object that you supply.
- * <pre>
- *   var message = new proton.Message();
- *   messenger.recv(10);
- *   while (messenger.incoming() > 0) {
- *      messenger.get(message);
- *      console.log(message.getSubject());
- *   }
- *   Hello World 0
- *   Hello World 1
- *   Hello World 2
- * </pre>
- *
- * @constructor proton.Messenger
- * @param {string} name the name of this Messenger instance.
- */
-Module['Messenger'] = function(name) { // Messenger Constructor.
-    /**
-     * The emscripten idiom below is used in a number of places in the JavaScript
-     * bindings to map JavaScript Strings to C style strings. ALLOC_STACK will
-     * increase the stack and place the item there. When the stack is next restored
-     * (by calling Runtime.stackRestore()), that memory will be automatically
-     * freed. In C code compiled by emscripten saving and restoring of the stack
-     * is automatic, but if we want to us ALLOC_STACK from native JavaScript we
-     * need to explicitly save and restore the stack using Runtime.stackSave()
-     * and Runtime.stackRestore() or we will leak emscripten heap memory.
-     * See https://github.com/kripken/emscripten/wiki/Interacting-with-code
-     * The _pn_messenger constructor copies the char* passed to it.
-     */
-    var sp = Runtime.stackSave();
-    this._messenger = _pn_messenger(name ? allocate(intArrayFromString(name), 'i8', ALLOC_STACK) : 0);
-    Runtime.stackRestore(sp);
-
-    /**
-     * Initiate Messenger non-blocking mode. For JavaScript we make this the
-     * default behaviour and don't export this method because JavaScript is
-     * fundamentally an asynchronous non-blocking execution environment.
-     */
-    _pn_messenger_set_blocking(this._messenger, false);
-
-    // Set the Messenger "passive" as we are supplying our own event loop here.
-    _pn_messenger_set_passive(this._messenger, true);
-
-    // Subscriptions that haven't yet completed, used for managing subscribe events.
-    this._pendingSubscriptions = [];
-
-    // Used in the Event registration mechanism (in the 'on' and 'emit' methods).
-    this._callbacks = {};
-
-    // This call ensures that the emscripten network callback functions are initialised.
-    Module.EventDispatch.registerMessenger(this);
-};
-
-Module['Messenger'].PN_CUMULATIVE = 0x1; // Protected Class attribute.
-
-// Expose prototype as a variable to make method declarations less verbose.
-var _Messenger_ = Module['Messenger'].prototype;
-
-// ************************* Protected methods ********************************
-
-// We use the dot notation rather than associative array form for protected
-// methods so they are visible to this "package", but the Closure compiler will
-// minify and obfuscate names, effectively making a defacto "protected" method.
-
-/**
- * This helper method checks the supplied error code, converts it into an
- * exception and throws the exception. This method will try to use the message
- * populated in pn_messenger_error(), if present, but if not it will fall
- * back to using the basic error code rendering from pn_code().
- * @param {number} code the error code to check.
- */
-_Messenger_._check = function(code) {
-    if (code < 0 && code !== Module['Error']['INPROGRESS']) {
-        var errno = this['getErrno']();
-        var message = errno ? this['getError']() : Pointer_stringify(_pn_code(code));
-        if (message !== 'PN_TIMEOUT') {
-            if (this._callbacks['error']) {
-console.log("emitting " + message);
-                this._emit('error', new Module['MessengerError'](message));
-            } else {
-console.log("throwing " + message);
-                throw new Module['MessengerError'](message);
-            }
-        }
-    }
-
-    return code;
-};
-
-/**
- * Invokes the callbacks registered for a specified event.
- * @method _emit
- * @memberof! proton.Messenger#
- * @param event {string} the event we want to emit.
- * @param param {object} the parameter we'd like to pass to the event callback.
- */
-_Messenger_._emit = function(event, param) {
-    var callbacks = this._callbacks[event];
-    if (callbacks) {
-        for (var i = 0; i < callbacks.length; i++) {
-            var callback = callbacks[i];
-            if ('function' === typeof callback) {
-                callback.call(this, param);
-            }
-        }
-    }
-};
-
-/**
- * Checks any pending subscriptions and when a source address becomes available
- * emit a subscription event passing the Subscription that triggered the event.
- * Note that this doesn't seem to work for listen/bind style subscriptions,
- * that is to say subscriptions of the form amqp://~0.0.0.0, don't know why?
- * As a workaround the subscribe call emits a subscription event immediately for
- * peer subscriptions to the local Messenger, this *should* be OK.
- */
-_Messenger_._checkSubscriptions = function() {
-    // Check for completed subscriptions, and emit subscribe event.
-    var subscriptions = this._pendingSubscriptions;
-    if (subscriptions.length) {
-        var pending = []; // Array of any subscriptions that remain pending.
-        for (var j = 0; j < subscriptions.length; j++) {
-            subscription = subscriptions[j];
-            if (subscription['getAddress']()) {
-                this._emit('subscription', subscription);
-            } else {
-                pending.push(subscription);
-            }
-        }
-        this._pendingSubscriptions = pending;
-    }
-};
-
-
-// *************************** Public methods *****************************
-
-/**
- * N.B. The following methods are not exported by the JavaScript Messenger
- * binding for reasons described below.
- *
- * For these methods it is expected that security would be implemented via
- * a secure WebSocket. TODO what happens if we decide to implement TCP sockets
- * via Node.js net library. If we do that we may want to compile OpenSSL
- * using emscripten and include these methods.
- * pn_messenger_set_certificate()
- * pn_messenger_get_certificate()
- * pn_messenger_set_private_key()
- * pn_messenger_get_private_key()
- * pn_messenger_set_password()
- * pn_messenger_get_password()
- * pn_messenger_set_trusted_certificates()
- * pn_messenger_get_trusted_certificates()
- *
- * For these methods the implementation is fairly meaningless because JavaScript
- * is a fundamentally asynchronous non-blocking environment.
- * pn_messenger_set_timeout()
- * pn_messenger_set_blocking()
- * pn_messenger_interrupt()
- * pn_messenger_work() - omitted because we have our own JavaScript Event loop.
- */
-
-/**
- * Registers a listener callback for a specified event.
- * @method on
- * @memberof! proton.Messenger#
- * @param {string} event the event we want to listen for.
- * @param {function} callback the callback function to be registered for the specified event.
- */
-_Messenger_['on'] = function(event, callback) {
-    if ('function' === typeof callback) {
-        if (!this._callbacks[event]) {
-            this._callbacks[event] = [];
-        }
-
-        this._callbacks[event].push(callback);
-    }
-};
-
-/**
- * Removes a listener callback for a specified event.
- * @method removeListener
- * @memberof! proton.Messenger#
- * @param {string} event the event we want to detach from.
- * @param {function} callback the callback function to be removed for the specified event.
- *        if no callback is specified all callbacks are removed for the event.
- */
-_Messenger_['removeListener'] = function(event, callback) {
-    if (callback) {
-        var callbacks = this._callbacks[event];
-        if ('function' === typeof callback && callbacks) {
-            // Search for the specified callback.
-            for (var i = 0; i < callbacks.length; i++) {
-                if (callback === callbacks[i]) {
-                    // If we find the specified callback, delete it and return.
-                    callbacks.splice(i, 1);
-                    return;
-                }
-            }
-        }
-    } else {
-        // If we call remove with no callback specified we remove all callbacks.
-        delete this._callbacks[event];
-    }
-};
-
-/**
- * Retrieves the name of a Messenger.
- * @method getName
- * @memberof! proton.Messenger#
- * @returns {string} the name of the messenger.
- */
-_Messenger_['getName'] = function() {
-    return Pointer_stringify(_pn_messenger_name(this._messenger));
-};
-
-/**
- * Retrieves the timeout for a Messenger.
- * @method getTimeout
- * @memberof! proton.Messenger#
- * @returns {number} zero because JavaScript is fundamentally non-blocking.
- */
-_Messenger_['getTimeout'] = function() {
-    return 0;
-};
-
-/**
- * Accessor for messenger blocking mode.
- * @method isBlocking
- * @memberof! proton.Messenger#
- * @returns {boolean} false because JavaScript is fundamentally non-blocking.
- */
-_Messenger_['isBlocking'] = function() {
-    return false;
-};
-
-/**
- * Free the Messenger. This will close all connections that are managed
- * by the Messenger. Call the stop method before destroying the Messenger.
- * <p>
- * N.B. This method has to be called explicitly in JavaScript as we can't
- * intercept finalisers, so we need to remember to free before removing refs.
- * @method free
- * @memberof! proton.Messenger#
- */
-_Messenger_['free'] = function() {
-    // This call ensures that the emscripten network callback functions are removed.
-    Module.EventDispatch.unregisterMessenger(this);
-    _pn_messenger_free(this._messenger);
-};
-
-/**
- * @method getErrno
- * @memberof! proton.Messenger#
- * @returns {number} the most recent error message code.
- */
-_Messenger_['getErrno'] = function() {
-    return _pn_messenger_errno(this._messenger);
-};
-
-/**
- * @method getError
- * @memberof! proton.Messenger#
- * @returns {string} the most recent error message as a String.
- */
-_Messenger_['getError'] = function() {
-    return Pointer_stringify(_pn_error_text(_pn_messenger_error(this._messenger)));
-};
-
-/**
- * Returns the size of the outgoing window that was set with setOutgoingWindow.
- * The default is 0.
- * @method getOutgoingWindow
- * @memberof! proton.Messenger#
- * @returns {number} the outgoing window size.
- */
-_Messenger_['getOutgoingWindow'] = function() {
-    return _pn_messenger_get_outgoing_window(this._messenger);
-};
-
-/**
- * Sets the outgoing tracking window for the Messenger. The Messenger will
- * track the remote status of this many outgoing deliveries after calling
- * send. Defaults to zero.
- * <p>
- * A Message enters this window when you call put() with the Message.
- * If your outgoing window size is n, and you call put() n+1 times, status
- * information will no longer be available for the first Message.
- * @method setOutgoingWindow
- * @memberof! proton.Messenger#
- * @param {number} window the size of the tracking window in messages.
- */
-_Messenger_['setOutgoingWindow'] = function(window) {
-    _pn_messenger_set_outgoing_window(this._messenger, window);
-};
-
-/**
- * Returns the size of the incoming window that was set with setIncomingWindow.
- * The default is 0.
- * @method getIncomingWindow
- * @memberof! proton.Messenger#
- * @returns {number} the incoming window size.
- */
-_Messenger_['getIncomingWindow'] = function() {
-    return _pn_messenger_get_incoming_window(this._messenger);
-};
-
-/**
- * Sets the incoming tracking window for the Messenger. The Messenger will
- * track the remote status of this many incoming deliveries after calling
- * send. Defaults to zero.
- * <p>
- * Messages enter this window only when you take them into your application
- * using get(). If your incoming window size is n, and you get() n+1 messages
- * without explicitly accepting or rejecting the oldest message, then the
- * Message that passes beyond the edge of the incoming window will be assigned
- * the default disposition of its link.
- * @method setIncomingWindow
- * @memberof! proton.Messenger#
- * @param {number} window the size of the tracking window in messages.
- */
-_Messenger_['setIncomingWindow'] = function(window) {
-    _pn_messenger_set_incoming_window(this._messenger, window);
-};
-
-/**
- * Currently a no-op placeholder. For future compatibility, do not send or
- * recv messages before starting the Messenger.
- * @method start
- * @memberof! proton.Messenger#
- */
-_Messenger_['start'] = function() {
-    this._check(_pn_messenger_start(this._messenger));
-};
-
-/**
- * Transitions the Messenger to an inactive state. An inactive Messenger
- * will not send or receive messages from its internal queues. A Messenger
- * should be stopped before being discarded to ensure a clean shutdown
- * handshake occurs on any internally managed connections.
- * <p>
- * The Messenger may require some time to stop if it is busy, so it is
- * necessary to call isStopped to see if it has fully stopped.
- * @method stop
- * @memberof! proton.Messenger#
- */
-_Messenger_['stop'] = function() {
-    _pn_messenger_stop(this._messenger);
-
-    // When we call stop it's quite likely that it will be busy. We call
-    // Module.EventDispatch.pump to flush the Messenger Event loop, but we
-    // wrap the call in a setTimeout to make sure that any Events generated
-    // by the flush occur on the next "tick" of the JavaScript Event loop.
-    setTimeout(Module.EventDispatch.pump, 0);
-};
-
-/**
- * Returns true iff a Messenger is in the stopped state.
- * @method isStopped
- * @memberof! proton.Messenger#
- * @returns {boolean} true iff a Messenger is in the stopped state.
- */
-_Messenger_['isStopped'] = function() {
-    return (_pn_messenger_stopped(this._messenger) > 0);
-};
-
-/**
- * Subscribes the Messenger to messages originating from the
- * specified source. The source is an address as specified in the
- * Messenger introduction with the following addition. If the
- * domain portion of the address begins with the '~' character, the
- * Messenger will interpret the domain as host/port, bind to it,
- * and listen for incoming messages. For example "~0.0.0.0",
- * "amqp://~0.0.0.0", and "amqps://~0.0.0.0" will all bind to any
- * local interface and listen for incoming messages with the last
- * variant only permitting incoming SSL connections.
- * @method subscribe
- * @memberof! proton.Messenger#
- * @param {string} source the source address we're subscribing to.
- * @returns {Subscription} a subscription.
- */
-_Messenger_['subscribe'] = function(source) {
-    if (!source) {
-        this._emit('error', new Module['SubscriptionError'](source, 'CONNECTION ERROR: Address not specified'));
-    } else {
-        return Module.EventDispatch.subscribe(this, source);
-    }
-};
-
-/**
- * Places the content contained in the message onto the outgoing queue
- * of the Messenger. This method will never block, however it will send any
- * unblocked Messages in the outgoing queue immediately and leave any blocked
- * Messages remaining in the outgoing queue. The outgoing property may be
- * used to check the depth of the outgoing queue.
- * <p>
- * When the content in a given Message object is copied to the outgoing
- * message queue, you may then modify or discard the Message object
- * without having any impact on the content in the outgoing queue.
- * <p>
- * This method returns an outgoing tracker for the Message.  The tracker
- * can be used to determine the delivery status of the Message.
- * @method put
- * @memberof! proton.Messenger#
- * @param {proton.Message} message a Message to send.
- * @returns {proton.Data.Long} a tracker.
- */
-_Messenger_['put'] = function(message) {
-    message._preEncode();
-    this._check(_pn_messenger_put(this._messenger, message._message));
-
-    // Getting the tracker is a little tricky as it is a 64 bit number. The way
-    // emscripten handles this is to return the low 32 bits directly and pass
-    // the high 32 bits via the tempRet0 variable. We use Data.Long to pass the
-    // low/high pair around to methods that require a tracker.
-    var low = _pn_messenger_outgoing_tracker(this._messenger);
-    var high = Runtime.getTempRet0();
-    return new Data.Long(low, high);
-};
-
-/**
- * Send messages from a Messenger's outgoing queue. This method forces the Event
- * loop to pump data for as long as the underlying socket remains writeable.
- * Note that after calling send() applications should yield control to the JavaScript
- * Event loop by calling setTimeout() or process.nextTick() so that the underlying
- * network processing can actually take place.
- * @method send
- * @memberof! proton.Messenger#
- */
-_Messenger_['send'] = function(number) {
-    Module.EventDispatch.pump();
-};
-
-/**
- * Gets the aggregate bufferedAmount values from all of the underlying WebSockets.
- * This value represents the amount of data buffered but not yet sent over the
- * network. If it grows too high it is a sign that the application is sending too
- * much data and should be throttled by yielding control to the JavaScript Event loop.
- * @method getBufferedAmount
- * @memberof! proton.Messenger#
- * @returns {number} the total amount of data buffered by the Messenger's sockets.
- */
-_Messenger_['getBufferedAmount'] = function() {
-    return Module.EventDispatch.getBufferedAmount(this);
-};
-
-/**
- * Gets the last known remote state of the delivery associated with the given tracker.
- * @method status
- * @memberof! proton.Messenger#
- * @param {proton.Data.Long} tracker the tracker whose status is to be retrieved.
- * @returns {proton.Status} one of None, PENDING, REJECTED, or ACCEPTED.
- */
-_Messenger_['status'] = function(tracker) {
-    if (tracker == null) { // Use == not === to check for both null and undefined.
-        var low = _pn_messenger_outgoing_tracker(this._messenger);
-        var high = Runtime.getTempRet0();
-        tracker = new Data.Long(low, high);
-    }
-
-    return _pn_messenger_status(this._messenger, tracker.getLowBitsUnsigned(), tracker.getHighBits());
-};
-
-/**
- * Checks if the delivery associated with the given tracker is still waiting to be sent.
- * @method isBuffered
- * @memberof! proton.Messenger#
- * @param {proton.Data.Long} tracker the tracker identifying the delivery.
- * @returns {boolean} true if delivery is still buffered.
- */
-_Messenger_['isBuffered'] = function(tracker) {
-    if (tracker == null) { // Use == not === to check for both null and undefined.
-        var low = _pn_messenger_outgoing_tracker(this._messenger);
-        var high = Runtime.getTempRet0();
-        tracker = new Data.Long(low, high);
-    }
-
-    return (_pn_messenger_buffered(this._messenger, tracker.getLowBitsUnsigned(), tracker.getHighBits()) > 0);
-};
-
-/**
- * Frees a Messenger from tracking the status associated with a given tracker.
- * If you don't supply a tracker, all outgoing messages up to the most recent
- * will be settled.
- * @method settle
- * @memberof! proton.Messenger#
- * @param {proton.Data.Long} tracker the tracker identifying the delivery.
- */
-_Messenger_['settle'] = function(tracker) {
-    // Getting the tracker is a little tricky as it is a 64 bit number. The way
-    // emscripten handles this is to return the low 32 bits directly and pass
-    // the high 32 bits via the tempRet0 variable. We use Data.Long to pass the
-    // low/high pair around to methods that require a tracker.
-    var flags = 0;
-    if (tracker == null) { // Use == not === to check for both null and undefined.
-        var low = _pn_messenger_outgoing_tracker(this._messenger);
-        var high = Runtime.getTempRet0();
-        tracker = new Data.Long(low, high);
-        flags = Module['Messenger'].PN_CUMULATIVE;
-    }
-
-    _pn_messenger_settle(this._messenger, tracker.getLowBitsUnsigned(), tracker.getHighBits(), flags);
-};
-
-/**
- * Receives up to limit messages into the incoming queue.  If no value for limit
- * is supplied, this call will receive as many messages as it can buffer internally.
- * @method recv
- * @memberof! proton.Messenger#
- * @param {number} limit the maximum number of messages to receive. If unspecified
- *        receive as many messages as it can buffer internally.
- */
-_Messenger_['recv'] = function(limit) {
-    _pn_messenger_recv(this._messenger, (limit ? limit : -1));
-};
-
-/**
- * Returns the capacity of the incoming message queue of messenger. Note this
- * count does not include those messages already available on the incoming queue.
- * @method receiving
- * @memberof! proton.Messenger#
- * @returns {number} the message queue capacity.
- */
-_Messenger_['receiving'] = function() {
-    return _pn_messenger_receiving(this._messenger);
-};
-
-/**
- * Moves the message from the head of the incoming message queue into the
- * supplied message object. Any content in the message will be overwritten.
- * <p>
- * A tracker for the incoming Message is returned. The tracker can later be
- * used to communicate your acceptance or rejection of the Message.
- * @method get
- * @memberof! proton.Messenger#
- * @param {proton.Message} message the destination message object. If no Message
- *        object is supplied, the Message popped from the head of the queue is discarded.
- * @param {boolean} decodeBinaryAsString if set decode any AMQP Binary payload
- *        objects as strings. This can be useful as the data in Binary objects
- *        will be overwritten with subsequent calls to get, so they must be
- *        explicitly copied. Needless to say it is only safe to set this flag if
- *        you know that the data you are dealing with is actually a string, for
- *        example C/C++ applications often seem to encode strings as AMQP binary,
- *        a common cause of interoperability problems.
- * @returns {proton.Data.Long} a tracker for the incoming Message.
- */
-_Messenger_['get'] = function(message, decodeBinaryAsString) {
-    var impl = null;
-    if (message) {
-        impl = message._message;
-    }
-
-    _pn_messenger_get(this._messenger, impl);
-
-    if (message) {
-        message._postDecode(decodeBinaryAsString);
-    }
-
-    // Getting the tracker is a little tricky as it is a 64 bit number. The way
-    // emscripten handles this is to return the low 32 bits directly and pass
-    // the high 32 bits via the tempRet0 variable. We use Data.Long to pass the
-    // low/high pair around to methods that require a tracker.
-    var low = _pn_messenger_incoming_tracker(this._messenger);
-    var high = Runtime.getTempRet0();
-    return new Data.Long(low, high);
-};
-
-/**
- * Returns the Subscription of the Message returned by the most recent call
- * to get, or null if pn_messenger_get has not yet been called.
- * @method incomingSubscription
- * @memberof! proton.Messenger#
- * @returns {Subscription} a Subscription or null if get has never been called
- *          for this Messenger.
- */
-_Messenger_['incomingSubscription'] = function() {
-    var subscription = _pn_messenger_incoming_subscription(this._messenger);
-    if (subscription) {
-        return new Subscription(subscription);
-    } else {
-        return null;
-    }
-};
-
-/**
- * Signal the sender that you have acted on the Message pointed to by the tracker.
- * If no tracker is supplied, then all messages that have been returned by the
- * get method are accepted, except those that have already been auto-settled
- * by passing beyond your incoming window size.
- * @method accept
- * @memberof! proton.Messenger#
- * @param {proton.Data.Long} tracker the tracker identifying the delivery.
- */
-_Messenger_['accept'] = function(tracker) {
-    // Getting the tracker is a little tricky as it is a 64 bit number. The way
-    // emscripten handles this is to return the low 32 bits directly and pass
-    // the high 32 bits via the tempRet0 variable. We use Data.Long to pass the
-    // low/high pair around to methods that require a tracker.
-    var flags = 0;
-    if (tracker == null) { // Use == not === to check for both null and undefined.
-        var low = _pn_messenger_incoming_tracker(this._messenger);
-        var high = Runtime.getTempRet0();
-        tracker = new Data.Long(low, high);
-        flags = Module['Messenger'].PN_CUMULATIVE;
-    }
-
-    this._check(_pn_messenger_accept(this._messenger, tracker.getLowBitsUnsigned(), tracker.getHighBits(), flags));
-};
-
-/**
- * Rejects the Message indicated by the tracker.  If no tracker is supplied,
- * all messages that have been returned by the get method are rejected, except
- * those already auto-settled by passing beyond your outgoing window size.
- * @method reject
- * @memberof! proton.Messenger#
- * @param {proton.Data.Long} tracker the tracker identifying the delivery.
- */
-_Messenger_['reject'] = function(tracker) {
-    // Getting the tracker is a little tricky as it is a 64 bit number. The way
-    // emscripten handles this is to return the low 32 bits directly and pass
-    // the high 32 bits via the tempRet0 variable. We use Data.Long to pass the
-    // low/high pair around to methods that require a tracker.
-    var flags = 0;
-    if (tracker == null) { // Use == not === to check for both null and undefined.
-        var low = _pn_messenger_incoming_tracker(this._messenger);
-        var high = Runtime.getTempRet0();
-        tracker = new Data.Long(low, high);
-        flags = Module['Messenger'].PN_CUMULATIVE;
-    }
-
-    this._check(_pn_messenger_reject(this._messenger, tracker.getLowBitsUnsigned(), tracker.getHighBits(), flags));
-};
-
-/**
- * Returns the number of messages in the outgoing message queue of a messenger.
- * @method outgoing
- * @memberof! proton.Messenger#
- * @returns {number} the outgoing queue depth.
- */
-_Messenger_['outgoing'] = function() {
-    return _pn_messenger_outgoing(this._messenger);
-};
-
-/**
- * Returns the number of messages in the incoming message queue of a messenger.
- * @method incoming
- * @memberof! proton.Messenger#
- * @returns {number} the incoming queue depth.
- */
-_Messenger_['incoming'] = function() {
-    return _pn_messenger_incoming(this._messenger);
-};
-
-/**
- * Adds a routing rule to a Messenger's internal routing table.
- * <p>
- * The route method may be used to influence how a messenger will internally treat
- * a given address or class of addresses. Every call to the route method will
- * result in messenger appending a routing rule to its internal routing table.
- * <p>
- * Whenever a message is presented to a messenger for delivery, it will match the
- * address of this message against the set of routing rules in order. The first
- * rule to match will be triggered, and instead of routing based on the address
- * presented in the message, the messenger will route based on the address supplied
- * in the rule.
- * <p>
- * The pattern matching syntax supports two types of matches, a '' will match any
- * character except a '/', and a '*' will match any character including a '/'.
- * <p>
- * A routing address is specified as a normal AMQP address, however it may
- * additionally use substitution variables from the pattern match that triggered
- * the rule.
- * <p>
- * Any message sent to "foo" will be routed to "amqp://foo.com":
- * <pre>
- * route("foo", "amqp://foo.com");
- * </pre>
- * Any message sent to "foobar" will be routed to "amqp://foo.com/bar":
- * <pre>
- * route("foobar", "amqp://foo.com/bar");
- * </pre>
- * Any message sent to bar/<path> will be routed to the corresponding path within
- * the amqp://bar.com domain:
- * <pre>
- * route("bar/*", "amqp://bar.com/$1");
- * </pre>
- * Supply credentials for foo.com:
- * <pre>
- * route("amqp://foo.com/*", "amqp://user:password@foo.com/$1");
- * </pre>
- * Supply credentials for all domains:
- * <pre>
- * route("amqp://*", "amqp://user:password@$1");
- * </pre>
- * Route all addresses through a single proxy while preserving the original destination:
- * <pre>
- * route("amqp://%/*", "amqp://user:password@proxy/$1/$2");
- * </pre>
- * Route any address through a single broker:
- * <pre>
- * route("*", "amqp://user:password@broker/$1");
- * </pre>
- * @method route
- * @memberof! proton.Messenger#
- * @param {string} pattern a glob pattern to select messages.
- * @param {string} address an address indicating outgoing address rewrite.
- */
-_Messenger_['route'] = function(pattern, address) {
-    var sp = Runtime.stackSave();
-    _pn_messenger_route(this._messenger,
-                        allocate(intArrayFromString(pattern), 'i8', ALLOC_STACK),
-                        allocate(intArrayFromString(address), 'i8', ALLOC_STACK));
-    Runtime.stackRestore(sp);
-};
-
-/**
- * Rewrite message addresses prior to transmission.
- * <p>
- * Similar to route(), except that the destination of the Message is determined
- * before the message address is rewritten.
- * <p>
- * The outgoing address is only rewritten after routing has been finalized. If
- * a message has an outgoing address of "amqp://0.0.0.0:5678", and a rewriting
- * rule that changes its outgoing address to "foo", it will still arrive at the
- * peer that is listening on "amqp://0.0.0.0:5678", but when it arrives there,
- * the receiver will see its outgoing address as "foo".
- * <p>
- * The default rewrite rule removes username and password from addresses
- * before they are transmitted.
- * @method rewrite
- * @memberof! proton.Messenger#
- * @param {string} pattern a glob pattern to select messages.
- * @param {string} address an address indicating outgoing address rewrite.
- */
-_Messenger_['rewrite'] = function(pattern, address) {
-    var sp = Runtime.stackSave();
-    _pn_messenger_rewrite(this._messenger,
-                          allocate(intArrayFromString(pattern), 'i8', ALLOC_STACK),
-                          allocate(intArrayFromString(address), 'i8', ALLOC_STACK));
-    Runtime.stackRestore(sp);
-};
-
diff --git a/proton-c/bindings/javascript/module.js b/proton-c/bindings/javascript/module.js
deleted file mode 100644
index 3603de3..0000000
--- a/proton-c/bindings/javascript/module.js
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/**
- * This file defines the Module Object which provides a namespace around the Proton
- * Messenger API. The Module object is used extensively by the emscripten runtime,
- * however for convenience it is exported with the name "proton" and not "Module".
- * <p>
- * The emscripten compiled proton-c code and the JavaScript binding code will be 
- * minified by the Closure compiler, so all comments will be stripped from the
- * actual library.
- * <p>
- * This JavaScript wrapper provides a somewhat more idiomatic object oriented
- * interface which abstracts the low-level emscripten based implementation details
- * from client code. Any similarities to the Proton Python binding are deliberate.
- * @file
- */
-
-/**
- * The Module Object is exported by emscripten for all execution platforms, we
- * use it as a namespace to allow us to selectively export only what we wish to
- * be publicly visible from this package/module, which is wrapped in a closure.
- * <p>
- * Internally the binding code uses the associative array form for declaring
- * exported properties to prevent the Closure compiler from minifying e.g.
- * <pre>Module['Messenger'] = ...</pre>
- * Exported Objects can however be used in client code using a more convenient
- * and obvious proton namespace, e.g.:
- * <pre>
- * var proton = require('qpid-proton');
- * var messenger = new proton.Messenger();
- * var message = new proton.Message();
- * ...
- * </pre>
- * The core part of this library is actually proton-c compiled into JavaScript.
- * In order to provide C style memory management (malloc/free) emscripten uses
- * a "virtual heap", which is actually a pre-allocated ArrayBuffer. The size of
- * this virtual heap is set as part of the runtime initialisation and cannot be
- * changed subsequently (the default size is 16*1024*1024 = 16777216).
- * <p>
- * Applications can specify the size of virtual heap that they require via the
- * global variable PROTON_TOTAL_MEMORY, this must be set <b>before</b> the library is
- * loaded e.g. in Node.js an application would do:
- * <pre>
- * PROTON_TOTAL_MEMORY = 50000000; // Note no var - it needs to be global.
- * var proton = require('qpid-proton');
- * ...
- * </pre>
- * A browser based application would do:
- * <pre>
- * &lt;script type="text/javascript"&gt;PROTON_TOTAL_MEMORY = 50000000;&lt;/script&gt;
- * &lt;script type="text/javascript" src="proton.js">&lt;/script&gt;
- * </pre>
- * If the global variable PROTON_TOTAL_MEMORY has been set by the application this
- * will result in the emscripten heap getting set to the next multiple of
- * 16777216 above PROTON_TOTAL_MEMORY.
- * <p>
- * The global variable PROTON_TOTAL_STACK may be used in a similar way to increase
- * the stack size from its default of 5*1024*1024 = 5242880. It is worth noting
- * that Strings are allocated on the stack, so you may need this if you end up
- * wanting to send very large strings.
- * @namespace proton
- */
-var Module = {};
-
-if (typeof global === 'object') { // If Node.js
-    if (global['PROTON_TOTAL_MEMORY']) {
-        Module['TOTAL_MEMORY'] = global['PROTON_TOTAL_MEMORY'];
-    }
-    if (global['PROTON_TOTAL_STACK']) {
-        Module['TOTAL_STACK'] = global['PROTON_TOTAL_STACK'];
-    }
-} else if (typeof window === 'object') { // If Browser
-    if (window['PROTON_TOTAL_MEMORY']) {
-        Module['TOTAL_MEMORY'] = window['PROTON_TOTAL_MEMORY'];
-    }
-    if (window['PROTON_TOTAL_STACK']) {
-        Module['TOTAL_STACK'] = window['PROTON_TOTAL_STACK'];
-    }
-}
-
-/*****************************************************************************/
-/*                                                                           */
-/*                               EventDispatch                               */
-/*                                                                           */
-/*****************************************************************************/
-
-/**
- * EventDispatch is a Singleton class that allows callbacks to be registered,
- * which will get triggered by the emscripten WebSocket network callbacks.
- * Clients of Messenger will register callbacks by calling:
- * <pre>
- * messenger.on('error', &lt;callback function&gt;);
- * messenger.on('work', &lt;callback function&gt;);
- * messenger.on('subscription', &lt;callback function&gt;);
- * </pre>
- * EventDispatch supports callback registration from multiple Messenger instances.
- * The client callbacks will actually be called when a given messenger has work
- * available or a WebSocket close has been occurred.
- * <p>
- * The approach implemented here allows the registered callbacks to follow a
- * similar pattern to _process_incoming and _process_outgoing in async.py
- * @constructor proton.EventDispatch
- */
-Module.EventDispatch = new function() { // Note the use of new to create a Singleton.
-    var POLLIN  = 0x001;
-    var POLLOUT = 0x004;
-    var _error = null;
-    var _messengers = {};  // Keyed by name.
-    var _selectables = {}; // Keyed by file descriptor.
-
-    var _initialise = function() {
-        /**
-         * Initialises the emscripten network callback functions. This needs
-         * to be done the first time we call registerMessenger rather than
-         * when we create the Singleton because emscripten's socket filesystem
-         * has to be mounted before can listen for any of these events.
-         */
-        Module['websocket']['on']('open', _pump);
-        Module['websocket']['on']('message', _pump);
-        Module['websocket']['on']('connection', _connectionHandler);
-        Module['websocket']['on']('close', _closeHandler);
-        Module['websocket']['on']('error', _errorHandler);
-
-        /**
-         * For Node.js the network code uses the ws WebSocket library, see
-         * https://github.com/einaros/ws. The following is a "Monkey Patch"
-         * that fixes a problem with Receiver.js where it wasn't checking if
-         * an Object was null before accessing its properties, so it was
-         * possible to see errors like:
-         * TypeError: Cannot read property 'fragmentedOperation' of null
-         * at Receiver.endPacket (.....node_modules/ws/lib/Receiver.js:224:18)
-         * This problem is generally seen in Server code after messenger.stop()
-         * I *think* that the underlying issue is actually because ws calls
-         * cleanup directly rather than pushing it onto the event loop so the
-         * this.state stuff gets cleared before the endPacket method is called.
-         * This fix simply interposes a check to avoid calling endPacket if
-         * the state has been cleared (i.e. the WebSocket has been closed).
-         */
-        if (ENVIRONMENT_IS_NODE) {
-            try {
-                var ws = require('ws');
-                // Array notation to stop Closure compiler minifying properties we need.
-                ws['Receiver'].prototype['originalEndPacket'] = ws['Receiver'].prototype['endPacket'];
-                ws['Receiver'].prototype['endPacket'] = function() {
-                    if (this['state']) {
-                        this['originalEndPacket']();
-                    }
-                };
-            } catch (e) {
-                console.error("Failed to apply Monkey Patch to ws WebSocket library");
-            }
-        }
-
-        _initialise = function() {}; // After first call replace with null function.
-    };
-
-    /**
-     * Messenger error handling can be a bit inconsistent and in several places
-     * rather than returning an error code or setting an error it simply writes
-     * to fprintf. This is something of a Monkey Patch that replaces the emscripten
-     * library fprintf call with one that checks the message and sets a variable
-     * if the message is an ERROR. TODO At some point hopefully Dominic Evans'
-     * patch on Jira PROTON-571 will render this code redundant.
-     */
-    _fprintf = function(stream, format, varargs) {
-        var array = __formatString(format, varargs);
-        array.pop(); // Remove the trailing \n
-        var string = intArrayToString(array); // Convert to native JavaScript string.
-        if (string.indexOf('ERROR') === -1) { // If not an ERROR just log the message.
-            console.log(string);
-        } else {
-            _error = string;
-        }
-    };
-
-    /**
-     * This method uses some low-level emscripten internals (stream = FS.getStream(fd),
-     * sock = stream.node.sock, peer = SOCKFS.websocket_sock_ops.getPeer) to find
-     * the underlying WebSocket associated with a given file descriptor value.
-     */
-    var _getWebSocket = function(fd) {
-        var stream = FS.getStream(fd);
-        if (stream) {
-            var sock = stream.node.sock;
-            if (sock.server) {
-                return sock.server;
-            }
-            var peer = SOCKFS.websocket_sock_ops.getPeer(sock, sock.daddr, sock.dport);
-            if (peer) {
-                return peer.socket;
-            }
-        }
-        return null;
-    };
-
-    /**
-     * This method iterates through all registered Messengers and retrieves any
-     * pending selectables, which are stored in a _selectables map keyed by fd.
-     */
-    var _updateSelectables = function() {
-        var sel = 0;
-        var fd = -1;
-        for (var name in _messengers) {
-            var messenger = _messengers[name];
-            while ((sel = _pn_messenger_selectable(messenger._messenger))) {
-                fd = _pn_selectable_get_fd(sel);
-                // Only register valid selectables, otherwise free them.
-                if (fd === -1) {
-                    _pn_selectable_free(sel);
-                } else {
-                    _selectables[fd] = {messenger: messenger, selectable: sel, socket: _getWebSocket(fd)};
-                }
-            }
-        }
-        return fd; // Return the most recently added selector's file descriptor.
-    };
-
-    /**
-     * Continually pump data while there's still work to do.
-     */
-    var _pump = function(fd) {
-        while (_pumpOnce(fd));
-    };
-
-    /**
-     * This method more or less follows the pattern of the pump_once method from
-     * class Pump in tests/python/proton_tests/messenger.py. It looks a little
-     * different because the select/poll implemented here uses some low-level
-     * emscripten internals (stream = FS.getStream(fd), sock = stream.node.sock,
-     * mask = sock.sock_ops.poll(sock)). We use the internals so we don't have
-     * to massage from file descriptors into the C style poll interface.
-     */
-    var _pumpOnce = function(fdin) {
-        _updateSelectables();
-
-        var work = false;
-        for (var fd in _selectables) {
-            var selectable = _selectables[fd];
-            if (selectable.socket) {
-                var messenger = selectable.messenger;
-                var sel = selectable.selectable;
-                var terminal = _pn_selectable_is_terminal(sel);
-                if (terminal) {
-//console.log(fd + " is terminal");
-                    _closeHandler(fd);
-                } else if (!fdin || (fd == fdin)) {
-                    var stream = FS.getStream(fd);
-                    if (stream) {
-                        var sock = stream.node.sock;
-                        if (sock.sock_ops.poll) {
-                            var mask = sock.sock_ops.poll(sock); // Low-level poll call.
-                            if (mask) {
-                                var capacity = _pn_selectable_is_reading(sel);
-                                var pending = _pn_selectable_is_writing(sel);
-
-                                if ((mask & POLLIN) && capacity) {
-//console.log("- readable fd = " + fd + ", capacity = " + _pn_selectable_capacity(sel));
-                                    _error = null; // May get set by _pn_selectable_readable.
-                                    _pn_selectable_readable(sel);
-                                    work = true;
-                                }
-                                if ((mask & POLLOUT) && pending) {
-//console.log("- writable fd = " + fd + ", pending = " + _pn_selectable_pending(sel));
-                                    _pn_selectable_writable(sel);
-                                    work = true;
-                                }
-
-                                var errno = messenger['getErrno']();
-                                _error = errno ? messenger['getError']() : _error;
-                                if (_error) {
-                                    _errorHandler([fd, 0, _error]);
-                                } else {
-                                    // Don't send work Event if it's a listen socket.
-                                    if (work && !sock.server) {
-                                        messenger._checkSubscriptions();
-                                        messenger._emit('work');
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        return work;
-    };
-
-    /**
-     * Handler for the emscripten socket connection event.
-     * The causes _pump to be called with no fd, forcing all fds to be checked.
-     */
-    var _connectionHandler = function(fd) {
-        _pump();
-    };
-
-    /**
-     * Handler for the emscripten socket close event.
-     */
-    var _closeHandler = function(fd) {
-        _updateSelectables();
-
-        var selectable = _selectables[fd];
-        if (selectable && selectable.socket) {
-            selectable.socket = null;
-//console.log("_closeHandler fd = " + fd);
-
-            /**
-             * We use the timeout to ensure that execution of the function to
-             * actually free and remove the selectable is deferred until next
-             * time round the (internal JavaScript) event loop. This turned out
-             * to be necessary because in some cases the ws WebSocket library
-             * calls the onclose callback (concurrently!!) before the onmessage
-             * callback exits, which could result in _pn_selectable_free being
-             * called whilst _pn_selectable_writable is executing, which is bad!!
-             */
-            setTimeout(function() {
-//console.log("deferred _closeHandler fd = " + fd);
-                // Close and remove the selectable.
-                var sel = selectable.selectable;
-                _pn_selectable_free(sel); // This closes the underlying socket too.
-                delete _selectables[fd];
-
-                var messenger = selectable.messenger;
-                messenger._emit('work');
-            }, 0);
-        }
-    };
-
-    /**
-     * Handler for the emscripten socket error event.
-     */
-    var _errorHandler = function(error) {
-        var fd = error[0];
-        var message = error[2];
-
-        _updateSelectables();
-
-        var selectable = _selectables[fd];
-        if (selectable) {
-            // Close and remove the selectable.
-            var sel = selectable.selectable;
-            _pn_selectable_free(sel); // This closes the underlying socket too.
-            delete _selectables[fd];
-
-            var messenger = selectable.messenger;
-
-            // Remove any pending Subscriptions whose fd matches the error fd.
-            var subscriptions = messenger._pendingSubscriptions;
-            for (var i = 0; i < subscriptions.length; i++) {
-                subscription = subscriptions[i];
-                // Use == not === as fd is a number and subscription.fd is a string.
-                if (subscription.fd == fd) {
-                    messenger._pendingSubscriptions.splice(i, 1);
-                    if (message.indexOf('EHOSTUNREACH:') === 0) {
-                        message = 'CONNECTION ERROR (' + subscription.source + '): bind: Address already in use';
-                    }
-                    messenger._emit('error', new Module['SubscriptionError'](subscription.source, message));
-                    return;
-                }
-            }
-
-            messenger._emit('error', new Module['MessengerError'](message));
-        }
-    };
-
-    /**
-     * Flush any data that has been written by the Messenger put() method.
-     * @method pump
-     * @memberof! proton.EventDispatch#
-     */
-    this.pump = function() {
-        _pump();
-    };
-
-    /**
-     * For a given Messenger instance retrieve the bufferedAmount property from
-     * any connected WebSockets and return the aggregate total sum.
-     * @method getBufferedAmount
-     * @memberof! proton.EventDispatch#
-     * @param {proton.Messenger} messenger the Messenger instance that we want
-     *        to find the total buffered amount for.
-     * @returns {number} the total sum of the bufferedAmount property across all
-     *          connected WebSockets.
-     */
-    this.getBufferedAmount = function(messenger) {
-        var total = 0;
-        for (var fd in _selectables) {
-            var selectable = _selectables[fd];
-            if (selectable.messenger === messenger && selectable.socket) {
-                total += selectable.socket.bufferedAmount | 0; 
-            }
-        }
-        return total;
-    };
-
-    /**
-     * Subscribe to a specified source address.
-     * <p>
-     * This method is delegated to by the subscribe method of {@link proton.Messenger}.
-     * We delegate to EventDispatch because we create Subscription objects that
-     * contain some additional information (such as file descriptors) which are
-     * only available to EventDispatch and we don't really want to expose to the
-     * wider API. This low-level information is mainly used for error handling
-     * which is itself encapsulated in EventDispatch.
-     * @method subscribe
-     * @memberof! proton.EventDispatch#
-     * @param {proton.Messenger} messenger the Messenger instance that this
-     *        subscription relates to.
-     * @param {string} source the address that we'd like to subscribe to.
-     */
-    this.subscribe = function(messenger, source) {
-        // First update selectables before subscribing so we can work out the
-        // Subscription fd (which will be the listen file descriptor).
-        _updateSelectables();
-        var sp = Runtime.stackSave();
-        var subscription = _pn_messenger_subscribe(messenger._messenger,
-                                                   allocate(intArrayFromString(source), 'i8', ALLOC_STACK));
-        Runtime.stackRestore(sp);
-        var fd = _updateSelectables();
-
-        subscription = new Subscription(subscription, source, fd);
-        messenger._pendingSubscriptions.push(subscription);
-
-        // For passive subscriptions emit a subscription event (almost) immediately,
-        // otherwise defer until the address has been resolved remotely.
-        if (subscription.passive) {
-            // We briefly delay the call to checkSubscriptions because it is possible
-            // for passive subscriptions to fail if another process is bound to the
-            // port specified in the subscription.
-            var check = function() {messenger._checkSubscriptions();};
-            setTimeout(check, 10);
-        }
-
-        return subscription;
-    };
-
-    /**
-     * Register the specified Messenger as being interested in network events.
-     * @method registerMessenger
-     * @memberof! proton.EventDispatch#
-     * @param {proton.Messenger} messenger the Messenger instance we want to
-     *        register to receive network events.
-     */
-    this.registerMessenger = function(messenger) {
-        _initialise();
-
-        var name = messenger['getName']();
-        _messengers[name] = messenger;
-    };
-
-    /**
-     * Unregister the specified Messenger from interest in network events.
-     * @method unregisterMessenger
-     * @memberof! proton.EventDispatch#
-     * @param {proton.Messenger} messenger the Messenger instance we want to
-     *        unregister from receiving network events.
-     */
-    this.unregisterMessenger = function(messenger) {
-        var name = messenger['getName']();
-        delete _messengers[name];
-    };
-};
-
diff --git a/proton-c/bindings/javascript/qpid-proton-messenger/LICENSE b/proton-c/bindings/javascript/qpid-proton-messenger/LICENSE
deleted file mode 100644
index 6b0b127..0000000
--- a/proton-c/bindings/javascript/qpid-proton-messenger/LICENSE
+++ /dev/null
@@ -1,203 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-
diff --git a/proton-c/bindings/javascript/qpid-proton-messenger/README.md b/proton-c/bindings/javascript/qpid-proton-messenger/README.md
deleted file mode 100644
index 35d1917..0000000
--- a/proton-c/bindings/javascript/qpid-proton-messenger/README.md
+++ /dev/null
@@ -1,94 +0,0 @@
-**qpid-proton-messenger**
----------------------
-Apache qpid proton messenger AMQP 1.0 library
-http://qpid.apache.org/proton/
-https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git
-
-This library provides JavaScript bindings for Apache qpid proton messenger giving AMQP 1.0 support to Node.js and browsers.
-
-**Important Note - Modern Browser Needed**
-The JavaScript binding requires ArrayBuffer/TypedArray and WebSocket support. Both of these are available in most "modern" browser versions. The author has only tried running on FireFox and Chrome, though recent Safari, Opera and IE10+ *should* work too - YMMV. It might be possible to polyfill for older browsers but the author hasn't tried this.
-
-**Important Note - WebSocket Transport!!!**
-Before going any further it is really important to realise that the JavaScript bindings to Proton are somewhat different to the bindings for other languages because of the restrictions of the execution environment. 
-
-In particular it is very important to note that the JavaScript bindings by default use a WebSocket transport and not a TCP transport, so whilst it's possible to create Server style applications that clients can connect to (e.g. recv.js and send.js) note that:
-JavaScript clients cannot *directly* talk to "normal" AMQP applications such as qpidd or (by default) the Java Broker because they use a standard TCP transport.
-
-This is a slightly irksome issue, but there's no getting away from it because it's a security restriction imposed by the browser environment.
-
-**Full README**
-https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;a=blob;f=proton-c/bindings/javascript/README;h=8bfde56632a22bffce4afe791321f4900c5d38d2;hb=HEAD
-
-**Examples**
-The examples in the main Proton repository are the best starting point:
-https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;a=tree;f=examples/messenger/javascript;h=37964f32a6b3d63e802000b0a2a974ed017e4688;hb=HEAD
-
-In practice the examples follow a fairly similar pattern to the Python bindings the most important thing to bear in mind though is that JavaScript is completely asynchronous/non-blocking, which can catch the unwary.
-
-An application follows the following (rough) steps:
-
-(optional) Set the heap size.
-It's important to realise that most of the library code is compiled C code and the runtime uses a "virtual heap" to support the underlying malloc/free. This is implemented internally as an ArrayBuffer with a default size of 16777216.
-
-To allocate a larger heap an application must set the PROTON_TOTAL_MEMORY global. In Node.js this would look like (see send.js):
-
-    PROTON_TOTAL_MEMORY = 50000000; // Note no var - it needs to be global.
-
-In a browser it would look like (see send.html):
-
-    <script type="text/javascript">PROTON_TOTAL_MEMORY = 50000000</script>
-
-Load the library and create a message and messenger.
-In Node.js this would look like (see send.js):
-
-    var proton = require("qpid-proton-messenger");
-    var message = new proton.Message();
-    var messenger = new proton.Messenger();
-
-In a browser it would look like (see send.html):
-
-    <script type="text/javascript" src="../../../node_modules/qpid-proton-messenger/lib/proton-messenger.js"></script>
-    <script type="text/javascript" >
-    var message = new proton.Message();
-    var messenger = new proton.Messenger();
-
-Set up event handlers as necessary.
-
-    messenger.on('error', <error callback>);
-    messenger.on('work', <work callback>);
-    messenger.on('subscription', <subscription callback>);
-
-The work callback is triggered on WebSocket events, so in general you would use this to send and receive messages, for example in recv.js we have:
-
-    var pumpData = function() {
-        while (messenger.incoming()) {
-            var t = messenger.get(message);
-    
-        console.log("Address: " + message.getAddress());
-        console.log("Subject: " + message.getSubject());
-    
-        // body is the body as a native JavaScript Object, useful for most real cases.
-        //console.log("Content: " + message.body);
-    
-        // data is the body as a proton.Data Object, used in this case because
-        // format() returns exactly the same representation as recv.c
-        console.log("Content: " + message.data.format());
-    
-        messenger.accept(t);
-       }
-    };
-    messenger.on('work', pumpData);
-
-
-The subscription callback is triggered when the address provided in a call to
-
-    messenger.subscribe(<address>);
-
-Gets resolved. An example of its usage can be found in qpid-config.js which is
-a fully functioning and complete port of the python qpid-config tool. It also
-illustrates how to do asynchronous request/response based applications.
-
-Aside from the asynchronous aspects the rest of the API is essentially the same
-as the Python binding aside from minor things such as camel casing method names etc.
-
diff --git a/proton-c/bindings/javascript/qpid-proton-messenger/lib/.gitignore b/proton-c/bindings/javascript/qpid-proton-messenger/lib/.gitignore
deleted file mode 100644
index 2b1f291..0000000
--- a/proton-c/bindings/javascript/qpid-proton-messenger/lib/.gitignore
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Currently empty .gitignore
-# Used to ensure git creates the otherwise empty directory
diff --git a/proton-c/bindings/javascript/qpid-proton-messenger/package.json b/proton-c/bindings/javascript/qpid-proton-messenger/package.json
deleted file mode 100644
index 0544e28..0000000
--- a/proton-c/bindings/javascript/qpid-proton-messenger/package.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
-    "name" : "qpid-proton-messenger",
-    "version": "0.9.0",
-    "description": "apache qpid proton messenger AMQP 1.0 library",
-    "homepage": "http://qpid.apache.org/proton",
-    "license": "Apache-2.0",
-    "repository": {
-        "type": "git",
-        "url": "https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git"
-    },
-    "main" : "./lib/proton-messenger.js",
-    "dependencies": {
-        "ws": "0.5.0",
-        "crypto": "latest",
-        "fs": "latest",
-        "path": "latest"
-    }
-}
diff --git a/proton-c/bindings/javascript/subscription.js b/proton-c/bindings/javascript/subscription.js
deleted file mode 100644
index 89fd1a3..0000000
--- a/proton-c/bindings/javascript/subscription.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*****************************************************************************/
-/*                                                                           */
-/*                               Subscription                                */
-/*                                                                           */
-/*****************************************************************************/
-
-/**
- * Constructs a Subscription instance.
- * @classdesc This class is a wrapper for Messenger's subscriptions.
- * Subscriptions should never be *directly* instantiated by client code only via
- * Messenger.subscribe() or Messenger.incomingSubscription(), so we declare the
- * constructor in the scope of the package and don't export it via Module.
- * @constructor Subscription
- * @param {number} subscription a pointer to the underlying subscription object.
- * @param {string} source the address that we want to subscribe to.
- * @param {number} fd the file descriptor associated with the subscription. This
- *                 is used internally to tidy up during error handling.
- */
-var Subscription = function(subscription, source, fd) { // Subscription Constructor.
-    this._subscription = subscription;
-    this.source = source;
-    this.fd = fd;
-    if (source.indexOf('~') !== -1) {
-        this.passive = true;
-    } else {
-        this.passive = false;
-    }
-};
-
-/**
- * TODO Not sure exactly what pn_subscription_get_context does.
- * @method getContext
- * @memberof! Subscription#
- * @returns the Subscription's Context.
- */
-Subscription.prototype['getContext'] = function() {
-    return _pn_subscription_get_context(this._subscription);
-};
-
-/**
- * TODO Not sure exactly what pn_subscription_set_context does.
- * @method setContext
- * @memberof! Subscription#
- * @param context the Subscription's new Context.
- */
-Subscription.prototype['setContext'] = function(context) {
-    _pn_subscription_set_context(this._subscription, context);
-};
-
-/**
- * @method getAddress
- * @memberof! Subscription#
- * @returns the Subscription's Address.
- */
-Subscription.prototype['getAddress'] = function() {
-    if (this.passive) {
-        return this.source;
-    }
-    return Pointer_stringify(_pn_subscription_address(this._subscription));
-};
-
diff --git a/proton-c/bindings/node/CMakeLists.txt b/proton-c/bindings/node/CMakeLists.txt
deleted file mode 100644
index 3bea9f7..0000000
--- a/proton-c/bindings/node/CMakeLists.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-cmake_minimum_required(VERSION 2.6)
-
-if (NOT BUILD_WITH_CXX)
-  message(FATAL_ERROR "ERROR: node bindings require CXX build to be enabled.\n"
-    "Please set BUILD_WITH_CXX before rebuilding.")
-endif()
-
-find_package(SWIG REQUIRED)
-include(${SWIG_USE_FILE})
-
-# NB: *may* require cmake 3.1 or newer to successfully detect swig3.0 binary
-#     ahead of swig2.0 binary (see commit 7400695 in kitware/cmake)
-if (${SWIG_VERSION} VERSION_LESS 3.0)
-  message(FATAL_ERROR "ERROR: swig-${SWIG_VERSION} does not support generation"
-    " of Node.js bindings.\nPlease upgrade to swig-3.0 or newer to build these"
-  )
-endif()
-
-configure_file (
-  "${CMAKE_CURRENT_SOURCE_DIR}/../../include/proton/version.h.in"
-  "${CMAKE_CURRENT_BINARY_DIR}/../../include/proton/version.h"
-)
-configure_file (
-  "${CMAKE_CURRENT_SOURCE_DIR}/binding.gyp.in"
-  "${CMAKE_CURRENT_BINARY_DIR}/binding.gyp"
-)
-
-include_directories("${CMAKE_CURRENT_BINARY_DIR}/../../src")
-include_directories("${CMAKE_CURRENT_BINARY_DIR}/../../include")
-include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../src")
-include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../include")
-
-find_path (NODE_ROOT_DIR "node/node.h" "src/node.h" HINTS /usr/include/nodejs)
-# message("NODE_ROOT_DIR=${NODE_ROOT_DIR}")
-include_directories("${NODE_ROOT_DIR}/src")
-include_directories("${NODE_ROOT_DIR}/deps/v8/include")
-include_directories("${NODE_ROOT_DIR}/deps/uv/include")
-
-set(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
-set(CMAKE_SWIG_FLAGS "-node;-I${CMAKE_CURRENT_SOURCE_DIR}/../../include")
-set_source_files_properties(javascript.i PROPERTIES CPLUSPLUS ON)
-swig_add_module(cproton javascript javascript.i)
-set_target_properties (cproton PROPERTIES LINKER_LANGUAGE CXX)
-list(APPEND SWIG_MODULE_cproton_javascript_EXTRA_DEPS
-  ${CMAKE_CURRENT_SOURCE_DIR}/../../proton-c/include/proton/cproton.i
-  ${PROTON_HEADERS}
-)
-set_target_properties (cproton PROPERTIES
-  COMPILE_FLAGS "${CMAKE_CXX_FLAGS} -DBUILDING_NODE_EXTENSION"
-  PREFIX ""
-  SUFFIX ".node"
-)
-swig_link_libraries(cproton qpid-proton)
diff --git a/proton-c/bindings/node/binding.gyp.in b/proton-c/bindings/node/binding.gyp.in
deleted file mode 100644
index c93cde4..0000000
--- a/proton-c/bindings/node/binding.gyp.in
+++ /dev/null
@@ -1,31 +0,0 @@
-{
-    "targets": [{
-        "target_name": "cproton",
-        "type": "loadable_module",
-        "sources": ["javascriptJAVASCRIPT_wrap.cxx"],
-        "conditions": [
-            ["OS=='win'", {
-                "cflags_cc+": ["/W3", "/Zi"],
-                'msvs_settings': {
-                  'VCCLCompilerTool': {
-                    'AdditionalOptions': [ '/EHsc' ],
-                    'ShowIncludes': 'false',
-                    'PreprocessorDefinitions': [ '_WIN32_WINNT=0x0600', 'PN_NODEFINE_SSIZE_T' ]
-                  }
-                },
-                "include_dirs+": [".", "@Proton_SOURCE_DIR@/proton-c/include"],
-                "libraries": ["qpid-proton"],
-            }],
-            ["OS=='linux'", {
-                "cflags_cc+": ["-Wall", "-Wno-comment", "-g"],
-                "include_dirs+": [".", "@Proton_SOURCE_DIR@/proton-c/include"],
-                "libraries": ["-lqpid-proton", "-L@Proton_BINARY_DIR@/proton-c", "-Wl,-rpath=\'$$ORIGIN\'"],
-            }],
-            ["OS=='mac'", {
-                "cflags_cc+": ["-Wall", "-Wno-comment", "-g"],
-                "include_dirs+": [".", "@Proton_SOURCE_DIR@/proton-c/include"],
-                "libraries": ["-lqpid-proton", "@Proton_BINARY_DIR@/proton-c", "-Wl,-install_name,@rpath/proton.node", "-Wl,-rpath,@loader_path/", "-Wl,-headerpad_max_install_names"],
-            }],
-        ]
-    }]
-}
diff --git a/proton-c/bindings/node/javascript.i b/proton-c/bindings/node/javascript.i
deleted file mode 100644
index d812475..0000000
--- a/proton-c/bindings/node/javascript.i
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-%module cproton
-
-// provided by SWIG development libraries
-%include javascript.swg
-
-%header %{
-/* Include the headers needed by the code in this wrapper file */
-#include <proton/types.h>
-#include <proton/connection.h>
-#include <proton/condition.h>
-#include <proton/delivery.h>
-#include <proton/driver.h>
-#include <proton/driver_extras.h>
-#include <proton/event.h>
-#include <proton/handlers.h>
-#include <proton/message.h>
-#include <proton/messenger.h>
-#include <proton/reactor.h>
-#include <proton/session.h>
-#include <proton/url.h>
-%}
-
-%include "proton/cproton.i"
diff --git a/proton-c/bindings/perl/CMakeLists.txt b/proton-c/bindings/perl/CMakeLists.txt
deleted file mode 100644
index 1356cce..0000000
--- a/proton-c/bindings/perl/CMakeLists.txt
+++ /dev/null
@@ -1,82 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Always need to treat SWIG files as C
-set_source_files_properties(cproton.i perl.i PROPERTIES CPLUSPLUS NO)
-
-# Need to pass in the same compiler flags used to build Perl itself
-execute_process(COMMAND perl -MConfig -e "print \$Config{ccflags}"
-  OUTPUT_VARIABLE PERLCFLAGS)
-
-# Disable harmlesss warnings from the generted perlPERL_wrap.c
-set(PERLCFLAGS "${PERLCFLAGS} -w")
-
-include_directories("${PERL_INCLUDE_PATH}")
-
-if (CHECK_SYSINSTALL_PERL)
-  execute_process(COMMAND perl -V:installvendorarch
-    OUTPUT_VARIABLE PERL_VENDORARCH_OUTPUT_VARIABLE
-    RESULT_VARIABLE PERL_VENDORARCH_RESULT_VARIABLE)
-
-  if (NOT PERL_VENDORARCH_RESULT_VARIABLE)
-    string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORARCH ${PERL_VENDORARCH_OUTPUT_VARIABLE})
-    file(TO_CMAKE_PATH "${PERL_VENDORARCH}" PERL_VENDORARCH_DIR_DEFAULT)
-  else ()
-    set (PERL_VENDORARCH_DIR_DEFAULT ${PERL_VENDORARCH_RESULT_VARIABLE})
-  endif ()
-else (CHECK_SYSINSTALL_PERL)
-  set (PERL_VENDORARCH_DIR_DEFAULT ${BINDINGS_DIR}/perl)
-endif (CHECK_SYSINSTALL_PERL)
-
-if (NOT PERL_VENDORARCH_DIR)
-  set (PERL_VENDORARCH_DIR ${PERL_VENDORARCH_DIR_DEFAULT})
-endif()
-
-set (CMAKE_C_FLAGS ${PERLCFLAGS})
-list(APPEND SWIG_MODULE_cproton_perl_EXTRA_DEPS
-    ${CMAKE_SOURCE_DIR}/proton-c/include/proton/cproton.i
-    ${PROTON_HEADERS}
-)
-swig_add_module(cproton_perl perl perl.i)
-swig_link_libraries(cproton_perl ${BINDING_DEPS} ${PERL_LIBRARY})
-
-if ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
-  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cproton_perl.so
-        DESTINATION ${PERL_VENDORARCH_DIR}/auto/cproton_perl
-        COMPONENT Perl
-        )
-else()
-  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcproton_perl.so
-        RENAME cproton_perl.so
-        DESTINATION ${PERL_VENDORARCH_DIR}/auto/cproton_perl
-        COMPONENT Perl
-        )
-endif ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
-
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cproton_perl.pm
-        DESTINATION ${PERL_VENDORARCH_DIR}
-        COMPONENT Perl)
-
-install(FILES lib/qpid_proton.pm
-        DESTINATION ${PERL_VENDORARCH_DIR}
-        COMPONENT Perl)
-
-INSTALL(DIRECTORY lib/qpid
-        DESTINATION ${PERL_VENDORARCH_DIR}
-        COMPONENT Perl)
diff --git a/proton-c/bindings/perl/LICENSE b/proton-c/bindings/perl/LICENSE
deleted file mode 100644
index 6b0b127..0000000
--- a/proton-c/bindings/perl/LICENSE
+++ /dev/null
@@ -1,203 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-
diff --git a/proton-c/bindings/perl/MANIFEST b/proton-c/bindings/perl/MANIFEST
deleted file mode 100644
index a1e191c..0000000
--- a/proton-c/bindings/perl/MANIFEST
+++ /dev/null
@@ -1,10 +0,0 @@
-CMakeLists.txt
-lib/qpid/proton/Message.pm
-lib/qpid/proton/Messenger.pm
-lib/qpid_proton.pm
-LICENSE
-Makefile.PL
-MANIFEST
-perl.i
-README
-TODO
diff --git a/proton-c/bindings/perl/Makefile.PL b/proton-c/bindings/perl/Makefile.PL
deleted file mode 100644
index e06ccd5..0000000
--- a/proton-c/bindings/perl/Makefile.PL
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/perl -w
-
-use ExtUtils::MakeMaker;
-
-WriteMakefile(
-    NAME         => 'cproton_perl',
-    DISTNAME     => 'perl-qpid_proton',
-    VERSION      => '0.3',
-    PREREQ_PM    => {},
-    LIBS         => ["-lqpid-proton"],
-    C            => ['cproton_perl.c'],
-);
diff --git a/proton-c/bindings/perl/README b/proton-c/bindings/perl/README
deleted file mode 100644
index 7dda9a4..0000000
--- a/proton-c/bindings/perl/README
+++ /dev/null
@@ -1,17 +0,0 @@
-Qpid Proton Perl Language Bindings
-==================================
-
-KNOWN ISSUES
-============
-
-
-SUPPORT
-=======
-
-To report bugs in the bindings, or to request an enhancement, please file
-a tracker request:
-
-    https://issues.apache.org/jira/browse/PROTON
-
-You can also directly interact with the development team and other users
-in the #qpid channel on irc.freenode.net.
diff --git a/proton-c/bindings/perl/TODO b/proton-c/bindings/perl/TODO
deleted file mode 100644
index c007a5b..0000000
--- a/proton-c/bindings/perl/TODO
+++ /dev/null
@@ -1,2 +0,0 @@
-Qpid Proton Perl Language Bindings TODO List
-============================================
diff --git a/proton-c/bindings/perl/lib/qpid/proton.pm b/proton-c/bindings/perl/lib/qpid/proton.pm
deleted file mode 100644
index b50092b..0000000
--- a/proton-c/bindings/perl/lib/qpid/proton.pm
+++ /dev/null
@@ -1,75 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-=pod
-
-=head1 NAME
-
-qpid::proton;
-
-=head1 DESCRIPTION
-
-=cut
-
-package qpid::proton;
-
-
-=pod
-
-=head2 MAPS
-
-Moving values from a map within a B<qpid::proton::Data> object into a
-Perl B<Hash> object is done using the following:
-
-=over
-
-=item %hash = qpid::proton::get_map_from( [DATA] );
-
-=back
-
-=cut
-
-sub get_map_from {
-    my $data = $_[0];
-
-    die "data cannot be nil" unless defined($data);
-
-    my $type = $data->get_type;
-
-    die "current node is not a map" if !($type == qpid::proton::MAP);
-
-    my $result;
-    my $count = $data->get_map;
-
-    $data->enter;
-    for($i = 0; $i < $count/2; $i++) {
-        $data->next;
-        my $type = $data->get_type;
-        my $key = $type->get($data);
-        $data->next;
-        $type = $data->get_type;
-        my $value = $type->get($data);
-        $result{$key} = $value;
-    }
-    $data->exit;
-
-    return $result;
-}
-
-1;
diff --git a/proton-c/bindings/perl/lib/qpid/proton/Constants.pm b/proton-c/bindings/perl/lib/qpid/proton/Constants.pm
deleted file mode 100644
index 2cb93e7..0000000
--- a/proton-c/bindings/perl/lib/qpid/proton/Constants.pm
+++ /dev/null
@@ -1,172 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-package qpid::proton;
-
-use constant {
-    VERSION_MAJOR => $cproton_perl::PN_VERSION_MAJOR,
-    VERSION_MINOR => $cproton_perl::PN_VERSION_MINOR,
-
-    NULL       => $cproton_perl::PN_NULL,
-    BOOL       => qpid::proton::Mapping->new(
-        "bool",
-        $cproton_perl::PN_BOOL,
-        "put_bool",
-        "get_bool"),
-    UBYTE      => qpid::proton::Mapping->new(
-        "ubyte",
-        $cproton_perl::PN_UBYTE,
-        "put_ubyte",
-        "get_ubyte"),
-    BYTE       => qpid::proton::Mapping->new(
-        "byte",
-        $cproton_perl::PN_BYTE,
-        "put_byte",
-        "get_byte"),
-    USHORT     => qpid::proton::Mapping->new(
-        "ushort",
-        $cproton_perl::PN_USHORT,
-        "put_ushort",
-        "get_ushort"),
-    SHORT      => qpid::proton::Mapping->new(
-        "short",
-        $cproton_perl::PN_SHORT,
-        "put_short",
-        "get_short"),
-    UINT       => qpid::proton::Mapping->new(
-        "uint",
-        $cproton_perl::PN_UINT,
-        "put_uint",
-        "get_uint"),
-    INT        => qpid::proton::Mapping->new(
-        "int",
-        $cproton_perl::PN_INT,
-        "put_int",
-        "get_int"),
-    CHAR       => qpid::proton::Mapping->new(
-        "char",
-        $cproton_perl::PN_CHAR,
-        "put_char",
-        "get_char"),
-    ULONG      => qpid::proton::Mapping->new(
-        "ulong",
-        $cproton_perl::PN_ULONG,
-        "put_ulong",
-        "get_ulong"),
-    LONG       => qpid::proton::Mapping->new(
-        "long",
-        $cproton_perl::PN_LONG,
-        "put_long",
-        "get_long"),
-    TIMESTAMP  => qpid::proton::Mapping->new(
-        "timestamp",
-        $cproton_perl::PN_TIMESTAMP,
-        "put_timestamp",
-        "get_timestamp"),
-    FLOAT      => qpid::proton::Mapping->new(
-        "float",
-        $cproton_perl::PN_FLOAT,
-        "put_float",
-        "get_float"),
-    DOUBLE     => qpid::proton::Mapping->new(
-        "double",
-        $cproton_perl::PN_DOUBLE,
-        "put_double",
-        "get_double"),
-    DECIMAL32  => qpid::proton::Mapping->new(
-        "decimal32",
-        $cproton_perl::PN_DECIMAL32,
-        "put_decimal32",
-        "get_decimal32"),
-    DECIMAL64  => qpid::proton::Mapping->new(
-        "decimal64",
-        $cproton_perl::PN_DECIMAL64,
-        "put_decimal64",
-        "get_decimal64"),
-    DECIMAL128 => qpid::proton::Mapping->new(
-        "decimal128",
-        $cproton_perl::PN_DECIMAL128,
-        "put_decimal128",
-        "get_decimal128"),
-    UUID       => qpid::proton::Mapping->new(
-        "uuid",
-        $cproton_perl::PN_UUID,
-        "put_uuid",
-        "get_uuid"),
-    BINARY     => qpid::proton::Mapping->new(
-        "binary",
-        $cproton_perl::PN_BINARY,
-        "put_binary",
-        "get_binary"),
-    STRING     => qpid::proton::Mapping->new(
-        "string",
-        $cproton_perl::PN_STRING,
-        "put_string",
-        "get_string"),
-    SYMBOL     => qpid::proton::Mapping->new(
-        "symbol",
-        $cproton_perl::PN_SYMBOL,
-        "put_symbol",
-        "get_symbol"),
-    ARRAY     => qpid::proton::Mapping->new(
-        "array",
-        $cproton_perl::PN_ARRAY,
-        "put_array",
-        "get_array"),
-    LIST      => qpid::proton::Mapping->new(
-        "list",
-        $cproton_perl::PN_LIST,
-        "put_list_helper",
-        "get_list_helper"),
-    MAP      => qpid::proton::Mapping->new(
-        "map",
-        $cproton_perl::PN_MAP,
-        "put_map_helper",
-        "get_map_helper"),
-};
-
-package qpid::proton::Errors;
-
-use constant {
-    NONE => 0,
-    EOS => $cproton_perl::PN_EOS,
-    ERROR => $cproton_perl::PN_ERR,
-    OVERFLOW => $cproton_perl::PN_OVERFLOW,
-    UNDERFLOW => $cproton_perl::PN_UNDERFLOW,
-    STATE => $cproton_perl::PN_STATE_ERR,
-    ARGUMENT => $cproton_perl::PN_ARG_ERR,
-    TIMEOUT => $cproton_perl::PN_TIMEOUT,
-    INTERRUPTED => $cproton_perl::PN_INTR,
-    INPROGRESS => $cproton_perl::PN_INPROGRESS,
-};
-
-package qpid::proton::Tracker;
-
-use constant {
-    ABORTED => $cproton_perl::PN_STATUS_ABORTED,
-    ACCEPTED => $cproton_perl::PN_STATUS_ACCEPTED,
-    REJECTED => $cproton_perl::PN_STATUS_REJECTED,
-    PENDING => $cproton_perl::PN_STATUS_PENDING,
-    SETTLED => $cproton_perl::PN_STATUS_SETTLED,
-    UNKNOWN => undef,
-};
-
-package qpid::proton::Constants;
-
-1;
diff --git a/proton-c/bindings/perl/lib/qpid/proton/Data.pm b/proton-c/bindings/perl/lib/qpid/proton/Data.pm
deleted file mode 100644
index 494a8f3..0000000
--- a/proton-c/bindings/perl/lib/qpid/proton/Data.pm
+++ /dev/null
@@ -1,1276 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-use Scalar::Util qw(reftype looks_like_number);
-
-=pod
-
-=head1 NAME
-
-qpid::proton::Data
-
-=head1 DESCRIPTION
-
-The B<Data> class provides an interface for decoding, extract, creating and
-encoding arbitrary AMQP data. A B<Data> object contains a tree of AMQP values.
-Leaf nodes in this tree correspond to scalars in the AMQP type system such as
-B<INT> or B<STRING>. Integerior nodes in this tree correspond to compound values
-in the AMQP type system such as B<LIST>, B<MAP>, B<ARRAY> or B<DESCRIBED>. The
-root node of the tree is the B<Data> object itself and can have an arbitrary
-number of children.
-
-A B<Data> object maintains the notion of the current sibling node and a current
-parent node. Siblings are ordered within their parent. Values are accessed
-and/or added by using the B<next>, B<prev>, B<enter> and B<exit> methods to
-navigate to the desired location in the tree and using the supplied variety of
-mutator and accessor methods to access or add a value of the desired type.
-
-The mutator methods will always add a vlaue I<after> the current node in the
-tree. If the current node has a next sibling the mutaor method will overwrite
-the value on this node. If there is no current node or the current node has no
-next sibling then one will be added. The accessor methods always set the
-add/modified node to the current node. The accessor methods read the value of
-the current node and do not change which node is current.
-
-=cut
-
-package qpid::proton::Data;
-
-=pod
-
-=head1 CONSTRUCTOR
-
-Creates a new instance with the specified capacity.
-
-=over
-
-=item my $data = qpid::proton::Data->new( CAPACITY );
-
-=back
-
-=cut
-
-sub new {
-    my ($class) = @_;
-    my ($self) = {};
-    my $capacity = $_[1] || 16;
-    my $impl = $capacity;
-    $self->{_free} = 0;
-
-    if($capacity) {
-        if (::looks_like_number($capacity)) {
-            $impl = cproton_perl::pn_data($capacity);
-            $self->{_free} = 1;
-        }
-    }
-
-    $self->{_impl} = $impl;
-
-    bless $self, $class;
-    return $self;
-}
-
-sub DESTROY {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_free($impl) if $self->{_free};
-}
-
-=pod
-
-=head1 ACTIONS
-
-Clear all content for the data object.
-
-=over
-
-=item my $data->clear();
-
-=back
-
-=cut
-
-sub clear {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_clear($impl);
-}
-
-
-=pod
-
-=head1 NAVIGATION
-
-The following methods allow for navigating through the nodes in the tree.
-
-=cut
-
-
-=pod
-
-=over
-
-=item $doc->enter;
-
-=item if ($doc->enter()) { do_something_with_children; }
-
-Sets the parent node to the current node and clears the current node.
-
-Clearing the current node sets it I<before> the first child.
-
-=item $doc->exit;
-
-=item if ($doc->exit()) { do_something_with_parent; }
-
-Sets the current node to the parent node, and the parent node to its own parent.
-
-=item $doc->next;
-
-=item $doc->prev;
-
-Moves to the next/previous sibling and returns its type. If there is no next or
-previous sibling then the current node remains unchanged.
-
-=item $doc->rewind;
-
-Clears the current node and sets the parent to the root node.
-
-=back
-
-=cut
-
-sub enter {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_enter($impl);
-}
-
-sub exit {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_exit($impl);
-}
-
-sub rewind {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_rewind($impl);
-}
-
-
-=pod
-
-=over
-
-=item $doc->next;
-
-=item if ($doc->next()) { do_something; }
-
-Advances the current node to its next sibling and returns its type.
-
-If there is no next sibling then the current node remains unchanged and
-B<undef> is returned.
-
-=item $doc->prev;
-
-=item if ($doc->prev()) { do_something; }
-
-Advances the current node to its previous sibling and returns its type.
-
-If there is no previous sibling then the current node remains unchanged and
-undef is returned.
-
-=back
-
-=cut
-
-sub next {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    return cproton_perl::pn_data_next($impl);
-}
-
-sub prev {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    return cproton_perl::pn_data_prev($impl);
-}
-
-
-=pod
-
-=head1 SUPPORTED TYPES
-
-The following methods allow for inserting the various node types into the
-tree.
-
-=head2 NODE TYPE
-
-You can retrieve the type of the current node.
-
-=over
-
-=item $type = $doc->get_type;
-
-=back
-
-=cut
-
-
-sub get_type {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $type = cproton_perl::pn_data_type($impl);
-
-    return qpid::proton::Mapping->find_by_type_value($type);
-}
-
-
-=pod
-
-=head2 SCALAR TYPES
-
-=cut
-
-=pod
-
-=head3 NULL
-
-=over
-
-=item $doc->put_null;
-
-Inserts a null node.
-
-=item $doc->is_null;
-
-Returns true if the current node is null.
-
-=back
-
-=cut
-
-sub put_null() {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_put_null($impl);
-}
-
-sub is_null {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_is_null($impl);
-}
-
-sub check {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $err = $_[1];
-
-    # if we got a null then just exit
-    return $err if !defined($err);
-
-    if($err < 0) {
-        die DataException->new("[$err]: " . cproton_perl::pn_data_error($impl));
-    } else {
-        return $err;
-    }
-}
-
-=pod
-
-=head3 BOOL
-
-Handles a boolean (B<true>/B<false>) node.
-
-=over
-
-=item $doc->put_bool( VALUE );
-
-=item $doc->get_bool;
-
-=back
-
-=cut
-
-sub put_bool {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value = $_[1] || 0;
-
-    cproton_perl::pn_data_put_bool($impl, $value);
-}
-
-sub get_bool {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_bool($impl);
-}
-
-=pod
-
-=head3 UBYTE
-
-Handles an unsigned byte node.
-
-=over
-
-=item $data->put_ubyte( VALUE );
-
-=item $data->get_ubyte;
-
-=back
-
-=cut
-
-sub put_ubyte {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value  = $_[1];
-
-    die "ubyte must be defined" if !defined($value);
-    die "ubyte must be non-negative" if $value < 0;
-
-    check(cproton_perl::pn_data_put_ubyte($impl, int($value)));
-}
-
-sub get_ubyte {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_ubyte($impl);
-}
-
-=pod
-
-=head3 BYTE
-
-Handles a signed byte node.
-
-=over
-
-=item $data->put_byte( VALUE );
-
-=item $data->get_byte;
-
-=back
-
-=cut
-
-sub put_byte {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value = $_[1];
-
-    die "byte must be defined" if !defined($value);
-
-    check(cproton_perl::pn_data_put_byte($impl, int($value)));
-}
-
-sub get_byte {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_byte($impl);
-}
-
-=pod
-
-=head3 USHORT
-
-Handles an unsigned short node.
-
-=over
-
-=item $data->put_ushort( VALUE );
-
-=item $data->get_ushort;
-
-=back
-
-=cut
-
-sub put_ushort {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value = $_[1];
-
-    die "ushort must be defined" if !defined($value);
-
-    check(cproton_perl::pn_data_put_ushort($impl, int($value)));
-}
-
-sub get_ushort {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_ushort($impl);
-}
-
-=pod
-
-=head3 SHORT
-
-Handles a signed short node.
-
-=over
-
-=item $data->put_short( VALUE );
-
-=item $data->get_short;
-
-=back
-
-=cut
-
-sub put_short {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value = $_[1];
-
-    die "short must be defined" if !defined($value);
-
-    check(cproton_perl::pn_data_put_short($impl, int($value)));
-}
-
-sub get_short {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_short($impl);
-}
-
-=pod
-
-=head3 UINT
-
-Handles an unsigned integer node.
-
-=over
-
-=item $data->put_uint( VALUE );
-
-=item $data->get_uint;
-
-=back
-
-=cut
-
-sub put_uint {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value = $_[1];
-
-    die "uint must be defined" if !defined($value);
-
-    check(cproton_perl::pn_data_put_uint($impl, int($value)));
-}
-
-sub get_uint {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_uint($impl);
-}
-
-=pod
-
-=head3 INT
-
-Handles an integer node.
-
-=over
-
-=item $data->put_int( VALUE );
-
-=item $data->get_int;
-
-=back
-
-=cut
-
-sub put_int {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value = $_[1];
-
-    die "int must be defined" if !defined($value);
-
-    check(cproton_perl::pn_data_put_int($impl, int($value)));
-}
-
-sub get_int {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_int($impl);
-}
-
-=pod
-
-=head3 CHAR
-
-Handles a character node.
-
-=over
-
-=item $data->put_char( VALUE );
-
-=item $data->get_char;
-
-=back
-
-=cut
-
-sub put_char {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value = $_[1];
-
-    die "char must be defined" if !defined($value);
-
-    check(cproton_perl::pn_data_put_char($impl, int($value)));
-}
-
-sub get_char {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_char($impl);
-}
-
-=pod
-
-=head3 ULONG
-
-Handles an unsigned long node.
-
-=over
-
-=item $data->set_ulong( VALUE );
-
-=item $data->get_ulong;
-
-=back
-
-=cut
-
-sub put_ulong {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value = $_[1];
-
-    die "ulong must be defined" if !defined($value);
-
-    check(cproton_perl::pn_data_put_ulong($impl, $value));
-}
-
-sub get_ulong {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_ulong($impl);
-}
-
-=pod
-
-=head3 LONG
-
-Handles a signed long node.
-
-=over
-
-=item $data->put_long( VALUE );
-
-=item $data->get_long;
-
-=back
-
-=cut
-
-sub put_long {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value = $_[1];
-
-    die "long must be defined" if !defined($value);
-
-    cproton_perl::pn_data_put_long($impl, int($value));
-}
-
-sub get_long {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_long($impl);
-}
-
-=pod
-
-=head3 TIMESTAMP
-
-Handles a timestamp node.
-
-=over
-
-=item $data->put_timestamp( VALUE );
-
-=item $data->get_timestamp;
-
-=back
-
-=cut
-
-sub put_timestamp {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value = $_[1];
-
-    die "timestamp must be defined" if !defined($value);
-
-    check(cproton_perl::pn_data_put_timestamp($impl, int($value)));
-}
-
-sub get_timestamp {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_timestamp($impl);
-}
-
-=pod
-
-=head3 FLOAT
-
-Handles a floating point node.
-
-=over
-
-=item $data->put_float( VALUE );
-
-=item $data->get_float;
-
-=back
-
-=cut
-
-sub put_float {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value = $_[1];
-
-    die "float must be defined" if !defined($value);
-
-    check(cproton_perl::pn_data_put_float($impl, $value));
-}
-
-sub get_float {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    my $value = cproton_perl::pn_data_get_float($impl);
-
-    cproton_perl::pn_data_get_float($impl);
-}
-
-=pod
-
-=head3 DOUBLE
-
-Handles a double node.
-
-=over
-
-=item $data->put_double( VALUE );
-
-=item $data->get_double;
-
-=back
-
-=cut
-
-sub put_double {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value = $_[1];
-
-    die "double must be defined" if !defined($value);
-
-    check(cproton_perl::pn_data_put_double($impl, $value));
-}
-
-sub get_double {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_double($impl);
-}
-
-=pod
-
-=head3 DECIMAL32
-
-Handles a decimal32 node.
-
-=over
-
-=item $data->put_decimal32( VALUE );
-
-=item $data->get_decimal32;
-
-=back
-
-=cut
-
-sub put_decimal32 {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value = $_[1];
-
-    die "decimal32 must be defined" if !defined($value);
-
-    check(cproton_perl::pn_data_put_decimal32($impl, $value));
-}
-
-sub get_decimal32 {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_decimal32($impl);
-}
-
-=pod
-
-=head3 DECIMAL64
-
-Handles a decimal64 node.
-
-=over
-
-=item $data->put_decimal64( VALUE );
-
-=item $data->get_decimal64;
-
-=back
-
-=cut
-
-sub put_decimal64 {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value = $_[1];
-
-    die "decimal64 must be defined" if !defined($value);
-
-    check(cproton_perl::pn_data_put_decimal64($impl, $value));
-}
-
-sub get_decimal64 {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_decimal64($impl);
-}
-
-=pod
-
-=head3 DECIMAL128
-
-Handles a decimal128 node.
-
-=over
-
-=item $data->put_decimal128( VALUE );
-
-=item $data->get_decimal128;
-
-=back
-
-=cut
-
-sub put_decimal128 {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value = $_[1];
-
-    die "decimal128 must be defined" if !defined($value);
-
-    my @binary = split //, pack("H[32]", sprintf("%032x", $value));
-    my @bytes = ();
-
-    foreach $char (@binary) {
-        push(@bytes, ord($char));
-    }
-    check(cproton_perl::pn_data_put_decimal128($impl, \@bytes));
-}
-
-sub get_decimal128 {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    my $bytes = cproton_perl::pn_data_get_decimal128($impl);
-    my $value = hex(unpack("H[32]", $bytes));
-
-    return $value;
-}
-
-=pod
-
-=head3 UUID
-
-Handles setting a UUID value. UUID values can be set using a 128-bit integer
-value or else a well-formed string.
-
-=over
-
-=item $data->put_uuid( VALUE );
-
-=item $data->get_uuid;
-
-=back
-
-=cut
-
-use Data::Dumper;
-
-sub put_uuid {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value = $_[1];
-
-    die "uuid must be defined" if !defined($value);
-
-    if($value =~ /[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/) {
-        $value =~ s/-//g;
-        my @binary = split //, pack("H[32]", $value);
-        my @bytes = ();
-
-        foreach $char (@binary) {
-            push(@bytes, ord($char));
-         }
-
-        check(cproton_perl::pn_data_put_uuid($impl, \@bytes));
-    } else {
-        die "uuid is malformed: $value";
-    }
-}
-
-sub get_uuid {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    my $bytes = cproton_perl::pn_data_get_uuid($impl);
-
-    my $value = unpack("H[32]", $bytes);
-    $value = substr($value, 0, 8) . "-" .
-        substr($value, 8, 4) . "-" .
-        substr($value, 12, 4) . "-" .
-        substr($value, 16, 4) . "-" .
-        substr($value, 20);
-
-    return $value;
-}
-
-=pod
-
-=head3 BINARY
-
-Handles a binary data node.
-
-=over
-
-=item $data->put_binary( VALUE );
-
-=item $data->get_binary;
-
-=back
-
-=cut
-
-sub put_binary {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value = $_[1];
-
-    die "binary must be defined" if !defined($value);
-
-    check(cproton_perl::pn_data_put_binary($impl, $value)) if defined($value);
-}
-
-sub get_binary {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_binary($impl);
-}
-
-=pod
-
-=head3 STRING
-
-Handles a string node.
-
-=over
-
-=item $data->put_string( VALUE );
-
-=item $data->get_string;
-
-=back
-
-=cut
-
-sub put_string {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value = $_[1];
-
-    die "string must be defined" if !defined($value);
-
-    check(cproton_perl::pn_data_put_string($impl, $value));
-}
-
-sub get_string {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_string($impl);
-}
-
-=pod
-
-=head3 SYMBOL
-
-Handles a symbol value.
-
-=over
-
-=item $data->put_symbol( VALUE );
-
-=item $data->get_symbol;
-
-=back
-
-=cut
-
-sub put_symbol {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $value = $_[1];
-
-    die "symbol must be defined" if !defined($value);
-
-    check(cproton_perl::pn_data_put_symbol($impl, $value));
-}
-
-sub get_symbol {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_symbol($impl);
-}
-
-=pod
-
-=head3 DESCRIBED VALUE
-
-A described node has two children: the descriptor and the value.
-
-These are specified by entering the node and putting the
-described values.
-
-=over
-
-=item $data->put_described;
-
-=item $data->is_described;
-
-=back
-
-=cut
-
-sub put_described {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_put_described($impl);
-}
-
-sub is_described {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_is_described($impl);
-}
-
-=pod
-
-=head3 ARRAYS
-
-Puts an array value.
-
-Elements may be filled by entering the array node and putting the element values.
-The values must all be of the specified array element type.
-
-If an array is B<described> then the first child value of the array is the
-descriptor and may be of any type.
-
-=over
-
-B<DESCRIBED> specifies whether the array is described or not.
-
-B<TYPE> specifies the type of elements in the array.
-
-=back
-
-=over
-
-=item $data->put_array( DESCRIBED, TYPE )
-
-=item my ($count, $described, $array_type) = item $data->get_array
-
-=back
-
-=cut
-
-sub put_array {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $described = $_[1] || 0;
-    my $array_type = $_[2];
-
-    die "array type must be defined" if !defined($array_type);
-
-    check(cproton_perl::pn_data_put_array($impl,
-                                          $described,
-                                          $array_type->get_type_value));
-}
-
-sub get_array {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    my $count = cproton_perl::pn_data_get_array($impl);
-    my $described = cproton_perl::pn_data_is_array_described($impl);
-    my $type_value = cproton_perl::pn_data_get_array_type($impl);
-
-    $type_value = qpid::proton::Mapping->find_by_type_value($type_value);
-
-    return ($count, $described, $type_value);
-}
-
-sub get_array_type {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_array_type($impl);
-}
-
-=pod
-
-=head3 LIST
-
-Puts a list value.
-
-Elements may be filled in by entering the list and putting element values.
-
-=over
-
-=item $data->put_list;
-
-=item my $count = $data->get_list
-
-=back
-
-=cut
-
-sub put_list {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    check(cproton_perl::pn_data_put_list($impl));
-}
-
-sub get_list {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_list($impl);
-}
-
-=pod
-
-head3 MAP
-
-Puts a map value.
-
-Elements may be filled by entering the map node and putting alternating
-key/value pairs.
-
-=over
-
-=item $data->put_map;
-
-=item my $count = $data->get_map;
-
-=back
-
-=cut
-
-sub put_map {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    check(cproton_perl::pn_data_put_map($impl));
-}
-
-sub get_map {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_data_get_map($impl);
-}
-
-sub put_list_helper {
-    my ($self) = @_;
-    my ($array) = $_[1];
-
-    $self->put_list;
-    $self->enter;
-
-    for my $value (@{$array}) {
-        if (qpid::proton::utils::is_num($value)) {
-            if (qpid::proton::utils::is_float($value)) {
-                $self->put_float($value);
-            } else {
-                $self->put_int($value);
-            }
-        } elsif (!defined($value)) {
-            $self->put_null;
-        } elsif ($value eq '') {
-            $self->put_string($value);
-        } elsif (ref($value) eq 'HASH') {
-            $self->put_map_helper($value);
-        } elsif (ref($value) eq 'ARRAY') {
-            $self->put_list_helper($value);
-        } else {
-            $self->put_string($value);
-        }
-    }
-
-    $self->exit;
-}
-
-sub get_list_helper {
-    my ($self) = @_;
-    my $result = [];
-    my $type = $self->get_type;
-
-    if ($cproton_perl::PN_LIST == $type->get_type_value) {
-        my $size = $self->get_list;
-
-        $self->enter;
-
-        for(my $count = 0; $count < $size; $count++) {
-            if ($self->next) {
-                my $value_type = $self->get_type;
-                my $value = $value_type->get($self);
-
-                push(@{$result}, $value);
-            }
-        }
-
-        $self->exit;
-    }
-
-    return $result;
-}
-
-sub put_map_helper {
-    my ($self) = @_;
-    my $hash = $_[1];
-
-    $self->put_map;
-    $self->enter;
-
-    foreach(keys %{$hash}) {
-        my $key = $_;
-        my $value = $hash->{$key};
-
-        my $keytype = ::reftype($key);
-        my $valtype = ::reftype($value);
-
-        if ($keytype eq ARRAY) {
-            $self->put_list_helper($key);
-        } elsif ($keytype eq "HASH") {
-            $self->put_map_helper($key);
-        } else {
-            $self->put_string("$key");
-        }
-
-        if (::reftype($value) eq HASH) {
-            $self->put_map_helper($value);
-        } elsif (::reftype($value) eq ARRAY) {
-            $self->put_list_helper($value);
-        } else {
-            $self->put_string("$value");
-        }
-    }
-
-    $self->exit;
-}
-
-sub get_map_helper {
-    my ($self) = @_;
-    my $result = {};
-    my $type = $self->get_type;
-
-    if ($cproton_perl::PN_MAP == $type->get_type_value) {
-        my $size = $self->get_map;
-
-        $self->enter;
-
-        for($count = 0; $count < $size; $count++) {
-            if($self->next) {
-                my $key = $self->get_type->get($self);
-                if($self->next) {
-                    my $value = $self->get_type->get($self);
-                    $result->{$key} = $value;
-                }
-            }
-        }
-
-        $self->exit;
-
-    }
-
-    return $result;
-}
-
-1;
diff --git a/proton-c/bindings/perl/lib/qpid/proton/Errors.pm b/proton-c/bindings/perl/lib/qpid/proton/Errors.pm
deleted file mode 100644
index 29f334b..0000000
--- a/proton-c/bindings/perl/lib/qpid/proton/Errors.pm
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-use strict;
-use warnings;
-use cproton_perl;
-
-package qpid::proton::Errors;
-
-
diff --git a/proton-c/bindings/perl/lib/qpid/proton/ExceptionHandling.pm b/proton-c/bindings/perl/lib/qpid/proton/ExceptionHandling.pm
deleted file mode 100644
index 00cdab1..0000000
--- a/proton-c/bindings/perl/lib/qpid/proton/ExceptionHandling.pm
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-use strict;
-use warnings;
-use cproton_perl;
-use Switch;
-
-use feature qw(switch);
-
-package qpid::proton;
-
-sub check_for_error {
-    my $rc = $_[0];
-
-    switch($rc) {
-            case 'qpid::proton::Errors::NONE' {next;}
-            case 'qpid::proton::Errors::EOS' {next;}
-            case 'qpid::proton::Errors::ERROR' {next;}
-            case 'qpid::proton::Errors::OVERFLOW' {next;}
-            case 'qpid::proton::Errors::UNDERFLOW' {next;}
-            case 'qpid::proton::Errors::STATE' {next;}
-            case 'qpid::proton::Errors::ARGUMENT' {next;}
-            case 'qpid::proton::Errors::TIMEOUT' {next;}
-            case 'qpid::proton::Errors::INTERRUPTED' {
-                my $source = $_[1];
-                my $trace = Devel::StackTrace->new;
-
-                print $trace->as_string;
-                die "ERROR[$rc]" . $source->get_error() . "\n";
-            }
-    }
-}
-
-package qpid::proton::ExceptionHandling;
-
-1;
diff --git a/proton-c/bindings/perl/lib/qpid/proton/Mapping.pm b/proton-c/bindings/perl/lib/qpid/proton/Mapping.pm
deleted file mode 100644
index 924774e..0000000
--- a/proton-c/bindings/perl/lib/qpid/proton/Mapping.pm
+++ /dev/null
@@ -1,121 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-use qpid_proton;
-
-package qpid::proton::Mapping;
-
-our %by_type_value = ();
-
-sub new {
-    my ($class) = @_;
-    my ($self) = {};
-
-    my $name       = $_[1];
-    my $type_value = $_[2];
-    my $set_method = $_[3];
-    my $get_method = $_[4];
-
-    $self->{_name}       = $name;
-    $self->{_type_value} = $type_value;
-    $self->{_set_method} = $set_method;
-    $self->{_get_method} = $get_method;
-
-    bless $self, $class;
-
-    $qpid::proton::Mapping::by_type_value{$type_value} = $self;
-
-    return $self;
-}
-
-use overload (
-    '""' => \& stringify,
-    '==' => \& equals,
-    );
-
-sub stringify {
-    my ($self) = @_;
-    return $self->{_name};
-}
-
-sub equals {
-    my ($self) = @_;
-    my $that = $_[1];
-
-    return ($self->get_type_value == $that->get_type_value);
-}
-
-sub getter_method {
-    my ($self) = @_;
-
-    return $self->{_get_method};
-}
-
-sub get_type_value {
-    my ($self) = @_;
-    my $type_value = $self->{_type_value};
-
-    return $self->{_type_value};
-}
-
-=pod
-
-=head1 MARSHALLING DATA
-
-I<Mapping> can move data automatically into and out of a I<Data> object.
-
-=over
-
-=item $mapping->put( [DATA], [VALUE] );
-
-=item $mapping->get( [DATA] );
-
-=back
-
-=cut
-
-sub put {
-    my ($self) = @_;
-    my $data = $_[1];
-    my $value = $_[2];
-    my $setter_method = $self->{_set_method};
-
-    $data->$setter_method($value);
-}
-
-sub get {
-    my ($self) = @_;
-    my $data = $_[1];
-    my $getter_method = $self->{_get_method};
-
-    my $result = $data->$getter_method;
-
-    return $result;
-}
-
-sub find_by_type_value {
-    my $type_value = $_[1];
-
-    return undef if !defined($type_value);
-
-    return $qpid::proton::Mapping::by_type_value{$type_value};
-}
-
-1;
-
diff --git a/proton-c/bindings/perl/lib/qpid/proton/Message.pm b/proton-c/bindings/perl/lib/qpid/proton/Message.pm
deleted file mode 100644
index 0251b89..0000000
--- a/proton-c/bindings/perl/lib/qpid/proton/Message.pm
+++ /dev/null
@@ -1,538 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-package qpid::proton::Message;
-
-our $DATA_FORMAT = $cproton_perl::PN_DATA;
-our $TEXT_FORMAT = $cproton_perl::PN_TEXT;
-our $AMQP_FORMAT = $cproton_perl::PN_AMQP;
-our $JSON_FORMAT = $cproton_perl::PN_JSON;
-
-sub new {
-    my ($class) = @_;
-    my ($self) = {};
-
-    my $impl = cproton_perl::pn_message();
-    $self->{_impl} = $impl;
-    $self->{_properties} = {};
-    $self->{_instructions} = {};
-    $self->{_annotations} = {};
-    $self->{_body} = undef;
-    $self->{_body_type} = undef;
-
-    bless $self, $class;
-    return $self;
-}
-
-use overload fallback => 1,
-    '""' => sub {
-        my ($self) = @_;
-        my $tmp = cproton_perl::pn_string("");
-        cproton_perl::pn_inspect($self->{_impl}, $tmp);
-        my $result = cproton_perl::pn_string_get($tmp);
-        cproton_perl::pn_free($tmp);
-        return $result;
-};
-
-sub DESTROY {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_message_free($impl);
-}
-
-sub get_impl {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    return $impl;
-}
-
-sub clear {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    cproton_perl::pn_message_clear($impl);
-
-    $self->{_body} = undef;
-    $self->{_properties} = {};
-    $self->{_instructions} = {};
-    $self->{_annotations} = {};
-}
-
-sub errno {
-    my ($self) = @_;
-    return cproton_perl::pn_message_errno($self->{_impl});
-}
-
-sub error {
-    my ($self) = @_;
-    return cproton_perl::pn_message_error($self->{_impl});
-}
-
-sub set_durable {
-    my ($self) = @_;
-    cproton_perl::pn_message_set_durable($self->{_impl}, $_[1]);
-}
-
-sub get_durable {
-    my ($self) = @_;
-    return cproton_perl::pn_message_is_durable($self->{_impl});
-}
-
-sub set_priority {
-    my ($self) = @_;
-    cproton_perl::pn_message_set_priority($self->{_impl}, $_[1]);
-}
-
-sub get_priority {
-    my ($self) = @_;
-    return cproton_perl::pn_message_get_priority($self->{_impl});
-}
-
-sub set_ttl {
-    my ($self) = @_;
-    cproton_perl::pn_message_set_ttl($self->{_impl}, $_[1]);
-}
-
-sub get_ttl {
-    my ($self) = @_;
-    return cproton_perl::pn_message_get_ttl($self->{_impl});
-}
-
-sub set_first_acquirer {
-    my ($self) = @_;
-    cproton_perl::pn_message_set_first_acquirer($self->{_impl}, $_[1]);
-}
-
-sub get_first_acquirer {
-    my ($self) = @_;
-    return cproton_perl::pn_message_is_first_acquirer($self->{_impl});
-}
-
-sub set_delivery_count {
-    my ($self) = @_;
-    cproton_perl::pn_message_set_delivery_count($self->{_impl}, $_[1]);
-}
-
-sub get_delivery_count {
-    my ($self) = @_;
-    return cproton_perl::pn_message_get_delivery_count($self->{_impl});
-}
-
-sub set_id {
-    my ($self) = @_;
-    my $id = $_[1];
-
-    die "Message id must be defined" if !defined($id);
-
-    cproton_perl::pn_message_set_id($self->{_impl}, $id);
-}
-
-sub get_id {
-    my ($self) = @_;
-    my $id = cproton_perl::pn_message_get_id($self->{_impl});
-
-    return $id;
-}
-
-sub set_user_id {
-    my ($self) = @_;
-    my $user_id = $_[1];
-
-    die "User id must be defined" if !defined($user_id);
-
-    cproton_perl::pn_message_set_user_id($self->{_impl}, $user_id);
-}
-
-sub get_user_id {
-    my ($self) = @_;
-    my $user_id = cproton_perl::pn_message_get_user_id($self->{_impl});
-
-    return $user_id;
-}
-
-sub set_address {
-    my ($self) = @_;
-    cproton_perl::pn_message_set_address($self->{_impl}, $_[1]);
-}
-
-sub get_address {
-    my ($self) = @_;
-    return cproton_perl::pn_message_get_address($self->{_impl});
-}
-
-sub set_subject {
-    my ($self) = @_;
-    cproton_perl::pn_message_set_subject($self->{_impl}, $_[1]);
-}
-
-sub get_subject {
-    my ($self) = @_;
-    return cproton_perl::pn_message_get_subject($self->{_impl});
-}
-
-sub set_reply_to {
-    my ($self) = @_;
-    cproton_perl::pn_message_set_reply_to($self->{_impl}, $_[1]);
-}
-
-sub get_reply_to {
-    my ($self) = @_;
-    return cproton_perl::pn_message_get_reply_to($self->{_impl});
-}
-
-sub set_correlation_id {
-    my ($self) = @_;
-    cproton_perl::pn_message_set_correlation_id($self->{_impl}, $_[1]);
-}
-
-sub get_correlation_id {
-    my ($self) = @_;
-    return cproton_perl::pn_message_get_correlation_id($self->{_impl});
-}
-
-sub set_format {
-    my ($self) = @_;
-    my $format = $_[1];
-
-    die "Format must be defined" if !defined($format);
-
-    cproton_perl::pn_message_set_format($self->{_impl}, $format);
-}
-
-sub get_format {
-    my ($self) = @_;
-    return cproton_perl::pn_message_get_format($self->{_impl});
-}
-
-sub set_content_type {
-    my ($self) = @_;
-    cproton_perl::pn_message_set_content_type($self->{_impl}, $_[1]);
-}
-
-sub get_content_type {
-    my ($self) = @_;
-    return cproton_perl::pn_message_get_content_type($self->{_impl});
-}
-
-sub set_content_encoding {
-    my ($self) = @_;
-    cproton_perl::pn_message_set_content_encoding($self->{_impl}, $_[1]);
-}
-
-sub get_content_encoding {
-    my ($self) = @_;
-    return cproton_perl::pn_message_get_content_encoding($self->{_impl});
-}
-
-sub set_expiry_time {
-    my ($self) = @_;
-    my $expiry_time = $_[1];
-
-    die "Expiry time must be defined" if !defined($expiry_time);
-
-    $expiry_time = int($expiry_time);
-
-    die "Expiry time must be non-negative" if $expiry_time < 0;
-
-    cproton_perl::pn_message_set_expiry_time($self->{_impl}, $expiry_time);
-}
-
-sub get_expiry_time {
-    my ($self) = @_;
-    return cproton_perl::pn_message_get_expiry_time($self->{_impl});
-}
-
-sub set_creation_time {
-    my ($self) = @_;
-    my $creation_time = $_[1];
-
-    die "Creation time must be defined" if !defined($creation_time);
-
-    $creation_time = int($creation_time);
-
-    die "Creation time must be non-negative" if $creation_time < 0;
-
-    cproton_perl::pn_message_set_creation_time($self->{_impl}, $creation_time);
-}
-
-sub get_creation_time {
-    my ($self) = @_;
-    return cproton_perl::pn_message_get_creation_time($self->{_impl});
-}
-
-sub set_group_id {
-    my ($self) = @_;
-    cproton_perl::pn_message_set_group_id($self->{_impl}, $_[1]);
-}
-
-sub get_group_id {
-    my ($self) = @_;
-    return cproton_perl::pn_message_get_group_id($self->{_impl});
-}
-
-sub set_group_sequence {
-    my ($self) = @_;
-    my $group_sequence = $_[1];
-
-    die "Group sequence must be defined" if !defined($group_sequence);
-
-    cproton_perl::pn_message_set_group_sequence($self->{_impl}, int($_[1]));
-}
-
-sub get_group_sequence {
-    my ($self) = @_;
-    return cproton_perl::pn_message_get_group_sequence($self->{_impl});
-}
-
-sub set_reply_to_group_id {
-    my ($self) = @_;
-    cproton_perl::pn_message_set_reply_to_group_id($self->{_impl}, $_[1]);
-}
-
-sub get_reply_to_group_id {
-    my ($self) = @_;
-    return cproton_perl::pn_message_get_reply_to_group_id($self->{_impl});
-}
-
-=pod
-
-=head2 PROPERTIES
-
-Allows for accessing and updating the set of properties associated with the
-message.
-
-=over
-
-=item my $props = $msg->get_properties;
-
-=item $msg->set_properties( [VAL] );
-
-=item my $value = $msg->get_property( [KEY] );
-
-=item $msg->set_propert( [KEY], [VALUE] );
-
-=back
-
-=cut
-
-sub get_properties {
-    my ($self) = @_;
-
-    return $self->{_properties};
-}
-
-sub set_properties {
-    my ($self) = @_;
-    my ($properties) = $_[1];
-
-    $self->{_properties} = $properties;
-}
-
-sub get_property {
-    my ($self) = @_;
-    my $name = $_[1];
-    my $properties = $self->{_properties};
-
-    return $properties{$name};
-}
-
-sub set_property {
-    my ($self) = @_;
-    my $name = $_[1];
-    my $value = $_[2];
-    my $properties = $self->{_properties};
-
-    $properties->{"$name"} = $value;
-}
-
-=pod
-
-=head2 ANNOTATIONS
-
-Allows for accessing and updatin ghte set of annotations associated with the
-message.
-
-=over
-
-=item my $annotations = $msg->get_annotations;
-
-=item $msg->get_annotations->{ [KEY] } = [VALUE];
-
-=item $msg->set_annotations( [VALUE ]);
-
-=back
-
-=cut
-
-sub get_annotations {
-    my ($self) = @_;
-    return $self->{_annotations};
-}
-
-sub set_annotations {
-    my ($self) = @_;
-    my $annotations = $_[1];
-
-    $self->{_annotations} = $annotations;
-}
-
-=pod
-
-=cut
-
-sub get_instructions {
-    my ($self) = @_;
-    return $self->{_instructions};
-}
-
-sub set_instructions {
-    my ($self) = @_;
-    my $instructions = $_[1];
-
-    $self->{_instructions} = $instructions;
-}
-
-=pod
-
-=head2 BODY
-
-The body of the message. When setting the body value a type must be specified,
-such as I<qpid::proton::INT>. If unspecified, the body type will default to
-B<qpid::proton::STRING>.
-
-=over
-
-=item $msg->set_body( [VALUE], [TYPE] );
-
-=item $msg->get_body();
-
-=item $msg->get_body_type();
-
-=back
-
-=cut
-
-sub set_body {
-    my ($self) = @_;
-    my $body = $_[1];
-    my $body_type = $_[2] || undef;
-
-    # if no body type was defined, then attempt to infer what it should
-    # be, which is going to be a best guess
-    if (!defined($body_type)) {
-        if (qpid::proton::utils::is_num($body)) {
-            if (qpid::proton::utils::is_float($body)) {
-                $body_type = qpid::proton::FLOAT;
-            } else {
-                $body_type = qpid::proton::INT;
-            }
-        } elsif (!defined($body)) {
-            $body_type =  qpid::proton::NULL;
-        } elsif ($body eq '') {
-            $body_type =  qpid::proton::STRING;
-        } elsif (ref($body) eq 'HASH') {
-            $body_type =  qpid::proton::MAP;
-        } elsif (ref($body) eq 'ARRAY') {
-            $body_type =  qpid::proton::LIST;
-        } else {
-            $body_type =  qpid::proton::STRING;
-        }
-    }
-
-    $self->{_body} = $body;
-    $self->{_body_type} = $body_type;
-}
-
-sub get_body {
-    my ($self) = @_;
-    my $body = $self->{_body};
-
-    return $body;
-}
-
-sub get_body_type {
-    my ($self) = @_;
-
-    return $self->{_body_type};
-}
-
-sub preencode() {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $my_body = $self->{_body};
-    my $body_type = $self->{_body_type};
-    my $body = new qpid::proton::Data(cproton_perl::pn_message_body($impl));
-
-    $body->clear();
-    $body_type->put($body, $my_body) if(defined($my_body) && $body_type);
-
-    my $my_props = $self->{_properties};
-    my $props = new qpid::proton::Data(cproton_perl::pn_message_properties($impl));
-    $props->clear();
-    qpid::proton::MAP->put($props, $my_props) if $my_props;
-
-    my $my_insts = $self->{_instructions};
-    my $insts = new qpid::proton::Data(cproton_perl::pn_message_instructions($impl));
-    $insts->clear;
-    qpid::proton::MAP->put($insts, $my_insts) if $my_insts;
-
-    my $my_annots = $self->{_annotations};
-    my $annotations = new qpid::proton::Data(cproton_perl::pn_message_annotations($impl));
-    $annotations->clear();
-    qpid::proton::MAP->put($annotations, $my_annots);
-}
-
-sub postdecode() {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    $self->{_body} = undef;
-    $self->{_body_type} = undef;
-    my $body = new qpid::proton::Data(cproton_perl::pn_message_body($impl));
-    if ($body->next()) {
-        $self->{_body_type} = $body->get_type();
-        $self->{_body} = $body->get_type()->get($body);
-    }
-
-    my $props = new qpid::proton::Data(cproton_perl::pn_message_properties($impl));
-    $props->rewind;
-    if ($props->next) {
-        my $properties = $props->get_type->get($props);
-        $self->{_properties} = $props->get_type->get($props);
-    }
-
-    my $insts = new qpid::proton::Data(cproton_perl::pn_message_instructions($impl));
-    $insts->rewind;
-    if ($insts->next) {
-        $self->{_instructions} = $insts->get_type->get($insts);
-    }
-
-    my $annotations = new qpid::proton::Data(cproton_perl::pn_message_annotations($impl));
-    $annotations->rewind;
-    if ($annotations->next) {
-        my $annots = $annotations->get_type->get($annotations);
-        $self->{_annotations} = $annots;
-    } else {
-        $self->{_annotations} = {};
-    }
-}
-
-1;
-
diff --git a/proton-c/bindings/perl/lib/qpid/proton/Messenger.pm b/proton-c/bindings/perl/lib/qpid/proton/Messenger.pm
deleted file mode 100644
index c60bfb6..0000000
--- a/proton-c/bindings/perl/lib/qpid/proton/Messenger.pm
+++ /dev/null
@@ -1,353 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-use strict;
-use warnings;
-use cproton_perl;
-
-package qpid::proton::Messenger;
-
-sub new {
-    my ($class) = @_;
-    my ($self) = {};
-
-    my $impl = cproton_perl::pn_messenger($_[1]);
-    $self->{_impl} = $impl;
-
-    bless $self, $class;
-    return $self;
-}
-
-sub DESTROY {
-    my ($self) = @_;
-    cproton_perl::pn_messenger_stop($self->{_impl});
-    cproton_perl::pn_messenger_free($self->{_impl});
-}
-
-sub get_name {
-    my ($self) = @_;
-    return cproton_perl::pn_messenger_name($self->{_impl});
-}
-
-sub set_timeout {
-    my ($self) = @_;
-    my $timeout = $_[1];
-
-    $timeout = 0 if !defined($timeout);
-    $timeout = int($timeout);
-
-    cproton_perl::pn_messenger_set_timeout($self->{_impl}, $timeout);
-}
-
-sub get_timeout {
-    my ($self) = @_;
-    return cproton_perl::pn_messenger_get_timeout($self->{_impl});
-}
-
-sub set_outgoing_window {
-    my ($self) = @_;
-    my $window = $_[1];
-
-    $window = 0 if !defined($window);
-    $window = int($window);
-
-    qpid::proton::check_for_error(cproton_perl::pn_messenger_set_outgoing_window($self->{_impl}, $window), $self);
-}
-
-sub get_outgoing_window {
-    my ($self) = @_;
-    return cproton_perl::pn_messenger_get_outgoing_window($self->{_impl});
-}
-
-sub set_incoming_window{
-    my ($self) = @_;
-    my $window = $_[1];
-
-    $window = 0 if !defined($window);
-    $window = int($window);
-
-    qpid::proton::check_for_error(cproton_perl::pn_messenger_set_incoming_window($self->{_impl}, $window), $self);
-}
-
-sub get_incoming_window {
-    my ($self) = @_;
-    return cproton_perl::pn_messenger_get_incoming_window($self->{_impl});
-}
-
-sub get_error {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $text = cproton_perl::pn_error_text(cproton_perl::pn_messenger_error($impl));
-
-    return $text || "";
-}
-
-sub get_errno {
-    my ($self) = @_;
-    return cproton_perl::pn_messenger_errno($self->{_impl});
-}
-
-sub start {
-    my ($self) = @_;
-    qpid::proton::check_for_error(cproton_perl::pn_messenger_start($self->{_impl}), $self);
-}
-
-sub stop {
-    my ($self) = @_;
-    qpid::proton::check_for_error(cproton_perl::pn_messenger_stop($self->{_impl}), $self);
-}
-
-sub stopped {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    return cproton_perl::pn_messenger_stopped($impl);
-}
-
-sub subscribe {
-    my ($self) = @_;
-    cproton_perl::pn_messenger_subscribe($self->{_impl}, $_[1]);
-}
-
-sub set_certificate {
-    my ($self) = @_;
-    cproton_perl::pn_messenger_set_certificate($self->{_impl}, $_[1]);
-}
-
-sub get_certificate {
-    my ($self) = @_;
-    return cproton_perl::pn_messenger_get_certificate($self->{_impl});
-}
-
-sub set_private_key {
-    my ($self) = @_;
-    cproton_perl::pn_messenger_set_private_key($self->{_impl}, $_[1]);
-}
-
-sub get_private_key {
-    my ($self) = @_;
-    return cproton_perl::pn_messenger_get_private_key($self->{_impl});
-}
-
-sub set_password {
-    my ($self) = @_;
-
-    qpid::proton::check_for_error(cproton_perl::pn_messenger_set_password($self->{_impl}, $_[1]), $self);
-}
-
-sub get_password {
-    my ($self) = @_;
-    return cproton_perl::pn_messenger_get_password($self->{_impl});
-}
-
-sub set_trusted_certificates {
-    my ($self) = @_;
-    cproton_perl::pn_messenger_set_trusted_certificates($self->{_impl}, $_[1]);
-}
-
-sub get_trusted_certificates {
-    my ($self) = @_;
-    return cproton_perl::pn_messenger_get_trusted_certificates($self->{_impl});
-}
-
-sub put {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $message = $_[1];
-
-    $message->preencode();
-    my $msgimpl = $message->get_impl();
-    qpid::proton::check_for_error(cproton_perl::pn_messenger_put($impl, $msgimpl), $self);
-
-    my $tracker = $self->get_outgoing_tracker();
-    return $tracker;
-}
-
-sub get_outgoing_tracker {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    my $tracker = cproton_perl::pn_messenger_outgoing_tracker($impl);
-    if ($tracker != -1) {
-        return qpid::proton::Tracker->new($tracker);
-    } else {
-        return undef;
-    }
-}
-
-sub send {
-    my ($self) = @_;
-    my $n = $_[1];
-    $n = -1 if !defined $n;
-    qpid::proton::check_for_error(cproton_perl::pn_messenger_send($self->{_impl}, $n), $self);
-}
-
-sub get {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $message = $_[1] || new proton::Message();
-
-    qpid::proton::check_for_error(cproton_perl::pn_messenger_get($impl, $message->get_impl()), $self);
-    $message->postdecode();
-
-    my $tracker = $self->get_incoming_tracker();
-    return $tracker;
-}
-
-sub get_incoming_tracker {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $result = undef;
-
-    my $tracker = cproton_perl::pn_messenger_incoming_tracker($impl);
-    if ($tracker != -1) {
-        $result = new qpid::proton::Tracker($tracker);
-    }
-
-    return $result;
-}
-
-sub receive {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $n = $_[1] || -1;
-
-    qpid::proton::check_for_error(cproton_perl::pn_messenger_recv($impl, $n), $self);
-}
-
-sub set_blocking {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $blocking = int($_[1] || 0);
-
-    qpid::proton::check_for_error(cproton_perl::pn_messenger_set_blocking($impl, $blocking));
-}
-
-sub get_blocking {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-
-    return cproton_perl::pn_messenger_is_blocking($impl);
-}
-
-sub work {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $timeout = $_[1];
-
-    if (!defined($timeout)) {
-        $timeout = -1;
-    } else {
-        $timeout = int($timeout * 1000);
-    }
-    my $err = cproton_perl::pn_messenger_work($impl, $timeout);
-    if ($err == qpid::proton::Errors::TIMEOUT) {
-        return 0;
-    } else {
-        qpid::proton::check_for_error($err);
-        return 1;
-    }
-}
-
-sub interrupt {
-    my ($self) = @_;
-
-    qpid::proton::check_for_error(cproton_perl::pn_messenger_interrupt($self->{_impl}), $self);
-}
-
-sub outgoing {
-    my ($self) = @_;
-    return cproton_perl::pn_messenger_outgoing($self->{_impl});
-}
-
-sub incoming {
-    my ($self) = @_;
-    return cproton_perl::pn_messenger_incoming($self->{_impl});
-}
-
-sub route {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $pattern = $_[1];
-    my $address = $_[2];
-
-    qpid::proton::check_for_error(cproton_perl::pn_messenger_route($impl, $pattern, $address));
-}
-
-sub rewrite {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $pattern = $_[1];
-    my $address = $_[2];
-
-    qpid::proton::check_for_error(cproton_perl::pn_messenger_rewrite($impl, $pattern, $address));
-}
-
-sub accept {
-    my ($self) = @_;
-    my $tracker = $_[1];
-    my $flags = 0;
-    if (!defined $tracker) {
-        $tracker = cproton_perl::pn_messenger_incoming_tracker($self->{_impl});
-        $flags = $cproton_perl::PN_CUMULATIVE;
-    } else {
-        $tracker = $tracker->get_impl;
-    }
-
-    qpid::proton::check_for_error(cproton_perl::pn_messenger_accept($self->{_impl}, $tracker, $flags), $self);
-}
-
-sub reject {
-    my ($self) = @_;
-    my $tracker = $_[1];
-    my $flags = 0;
-    if (!defined $tracker) {
-        $tracker = cproton_perl::pn_messenger_incoming_tracker($self->{_impl});
-        $flags = $cproton_perl::PN_CUMULATIVE;
-    }
-    qpid::proton::check_for_error(cproton_perl::pn_messenger_reject($self->{_impl}, $tracker, $flags), $self);
-}
-
-sub status {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $tracker = $_[1];
-
-    if (!defined($tracker)) {
-        $tracker = $self->get_incoming_tracker();
-    }
-
-    return cproton_perl::pn_messenger_status($impl, $tracker->get_impl);
-}
-
-sub settle {
-    my ($self) = @_;
-    my $impl = $self->{_impl};
-    my $tracker = $_[1];
-    my $flag = 0;
-
-    if (!defined($tracker)) {
-        $tracker = $self->get_incoming_tracker();
-        $flag = $cproton_perl::PN_CUMULATIVE;
-    }
-
-    cproton_perl::pn_messenger_settle($impl, $tracker->get_impl, $flag);
-}
-
-1;
diff --git a/proton-c/bindings/perl/lib/qpid/proton/Tracker.pm b/proton-c/bindings/perl/lib/qpid/proton/Tracker.pm
deleted file mode 100644
index 82046e7..0000000
--- a/proton-c/bindings/perl/lib/qpid/proton/Tracker.pm
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-package qpid::proton::Tracker;
-
-sub new {
-    my ($class) = @_;
-    my ($self) = {};
-
-    $self->{_impl} = $_[1];
-
-    bless $self, $class;
-
-    return $self;
-}
-
-sub get_impl {
-    my ($self) = @_;
-
-    return $self->{_impl};
-}
-
-1;
diff --git a/proton-c/bindings/perl/lib/qpid/proton/array_helper.pm b/proton-c/bindings/perl/lib/qpid/proton/array_helper.pm
deleted file mode 100644
index 40b4b80..0000000
--- a/proton-c/bindings/perl/lib/qpid/proton/array_helper.pm
+++ /dev/null
@@ -1,147 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-=pod
-
-=head1 NAME
-
-qpid::proton;
-
-=head1 DESCRIPTION
-
-=cut
-
-package qpid::proton;
-
-=pod
-
-=head1 MOVING DATA OUT OF A DATA OBJECT
-
-=over
-
-=item qpid::proton::put_array_into( [DATA], [TYPE], [ELEMENTS], [DESCRIBED], [DESCRIPTOR] );
-
-Puts the specified elements into the I<qpid::proton::Data> object specified
-using the specified B<type> value. If the array is described (def. undescribed)
-then the supplied B<descriptor> is used.
-
-=item ($described, $type, @elements) = qpid::proton::get_array_from( [DATA] );
-
-=item ($described, $descriptor, $type, @elements) = qpid::proton::get_array_from( [DATA] );
-
-Retrieves the descriptor, size, type and elements for an array from the
-specified instance of I<qpid::proton::Data>.
-
-If the array is B<described> then the I<descriptor> for the array is returned as well.
-
-=item @elements = qpid::proton::get_list_from( [DATA] );
-
-Retrieves the elements for a list from the specified instance of
-I<qpid::proton::Data>.
-
-=back
-
-=cut
-
-sub put_array_into {
-    my $data = $_[0];
-    my $type = $_[1];
-    my ($values) = $_[2];
-    my $described = $_[3] || 0;
-    my $descriptor = $_[4];
-
-    die "data cannot be nil" if !defined($data);
-    die "type cannot be nil" if !defined($type);
-    die "values cannot be nil" if !defined($values);
-    die "descriptor cannot be nil" if $described && !defined($descriptor);
-
-    $data->put_array($described, $type);
-    $data->enter;
-
-    if ($described && defined($descriptor)) {
-        $data->put_symbol($descriptor);
-    }
-
-    foreach $value (@{$values}) {
-        $type->put($data, $value);
-    }
-    $data->exit;
-}
-
-sub get_array_from {
-    my $data = $_[0];
-
-    die "data cannot be nil" if !defined($data);
-
-    # ensure we're actually on an array
-    my $type = $data->get_type;
-
-    die "current node is not an array" if !defined($type) ||
-        !($type == qpid::proton::ARRAY);
-
-    my ($count, $described, $rtype) = $data->get_array;
-    my @elements = ();
-
-    $data->enter;
-
-    if (defined($described) && $described) {
-        $data->next;
-        $descriptor = $data->get_symbol;
-    }
-
-    for ($i = 0; $i < $count; $i++) {
-        $data->next;
-        my $type    = $data->get_type;
-        my $element = $type->get($data);
-        push(@elements, $element);
-    }
-
-    $data->exit;
-
-    if (defined($described) && $described) {
-        return ($described, $descriptor, $rtype, @elements) if $described;
-    } else {
-        return ($described, $rtype, @elements);
-    }
-}
-
-sub get_list_from {
-    my $data = $_[0];
-
-    die "data can not be nil" if !defined($data);
-
-    # ensure we're actually on a list
-    my $type = $data->get_type;
-
-    die "current node is not a list" if !defined($type) ||
-        !($type == qpid::proton::LIST);
-
-    my $count = $data->get_list;
-    $data->enter;
-    for($i = 0; $i < $count; $i++) {
-        $data->next;
-        my $type = $data->get_type;
-        my $element = $type->get($data);
-        push(@elements, $element);
-    }
-
-    return @elements;
-}
-
-1;
diff --git a/proton-c/bindings/perl/lib/qpid/proton/utils.pm b/proton-c/bindings/perl/lib/qpid/proton/utils.pm
deleted file mode 100644
index 0ab4e3e..0000000
--- a/proton-c/bindings/perl/lib/qpid/proton/utils.pm
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-package qpid::proton::utils;
-
-sub is_num {
-    my $val = $_[0];
-
-    return 0 if !defined($val);
-    return 0 if $val eq '';
-
-    $_[0] ^ $_[0] ? 0 : 1
-}
-
-sub is_float {
-    my $val = $_[0];
-
-    return 1 if ($val - int($val));
-    return 0;
-}
-
-1;
diff --git a/proton-c/bindings/perl/lib/qpid_proton.pm b/proton-c/bindings/perl/lib/qpid_proton.pm
deleted file mode 100644
index 7e43218..0000000
--- a/proton-c/bindings/perl/lib/qpid_proton.pm
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-use strict;
-use warnings;
-use cproton_perl;
-
-use qpid::proton;
-
-use qpid::proton::utils;
-use qpid::proton::ExceptionHandling;
-use qpid::proton::Data;
-use qpid::proton::Mapping;
-use qpid::proton::Constants;
-use qpid::proton::Tracker;
-use qpid::proton::Messenger;
-use qpid::proton::Message;
-
-package qpid_proton;
-
-1;
-
diff --git a/proton-c/bindings/perl/perl.i b/proton-c/bindings/perl/perl.i
deleted file mode 100644
index ebc6915..0000000
--- a/proton-c/bindings/perl/perl.i
+++ /dev/null
@@ -1,216 +0,0 @@
-%module cproton_perl
-
-%{
-#include <proton/engine.h>
-#include <proton/message.h>
-#include <proton/sasl.h>
-#include <proton/messenger.h>
-#include <proton/ssl.h>
-#include <proton/url.h>
-#include <proton/reactor.h>
-#include <proton/handlers.h>
-%}
-
-%include <cstring.i>
-
-%typemap(in) pn_atom_t
-{
-  if(!$input)
-    {
-      $1.type = PN_NULL;
-    }
-  else
-    {
-      if(SvIOK($input)) // an integer value
-        {
-          $1.type = PN_LONG;
-          $1.u.as_long = SvIV($input);
-        }
-      else if(SvNOK($input)) // a floating point value
-        {
-          $1.type = PN_FLOAT;
-          $1.u.as_float = SvNV($input);
-        }
-      else if(SvPOK($input)) // a string type
-        {
-          STRLEN len;
-          char* ptr;
-
-          ptr = SvPV($input, len);
-          $1.type = PN_STRING;
-          $1.u.as_bytes.start = ptr;
-          $1.u.as_bytes.size = strlen(ptr); // len;
-        }
-    }
-}
-
-%typemap(out) pn_atom_t
-{
-  SV* obj = sv_newmortal();
-
-  switch($1.type)
-    {
-    case PN_NULL:
-      sv_setsv(obj, &PL_sv_undef);
-      break;
-
-    case PN_BYTE:
-      sv_setiv(obj, (IV)$1.u.as_byte);
-      break;
-
-    case PN_INT:
-      sv_setiv(obj, (IV)$1.u.as_int);
-      break;
-
-    case PN_LONG:
-      sv_setiv(obj, (IV)$1.u.as_long);
-      break;
-
-    case PN_STRING:
-      {
-        if($1.u.as_bytes.size > 0)
-          {
-            sv_setpvn(obj, $1.u.as_bytes.start, $1.u.as_bytes.size);
-          }
-        else
-          {
-            sv_setsv(obj, &PL_sv_undef);
-          }
-      }
-      break;
-
-    default:
-      break;
-    }
-
-  $result = obj;
-  // increment the hidden stack reference before returning
-  argvi++;
-}
-
-%typemap(in) pn_bytes_t
-{
-  STRLEN len;
-  char* ptr;
-
-  ptr = SvPV($input, len);
-  $1.start = ptr;
-  $1.size = strlen(ptr);
-}
-
-%typemap(out) pn_bytes_t
-{
-  SV* obj = sv_newmortal();
-
-  if($1.start != NULL)
-    {
-      $result = newSVpvn($1.start, $1.size);
-    }
-  else
-    {
-      $result = &PL_sv_undef;
-    }
-
-  argvi++;
-}
-
-%typemap(in) pn_decimal128_t
-{
-  AV *tmpav = (AV*)SvRV($input);
-  int index = 0;
-
-  for(index = 0; index < 16; index++)
-    {
-      $1.bytes[index] = SvIV(*av_fetch(tmpav, index, 0));
-      $1.bytes[index] = $1.bytes[index] & 0xff;
-    }
-}
-
-%typemap(out) pn_decimal128_t
-{
-  $result = newSVpvn($1.bytes, 16);
-  argvi++;
-}
-
-%typemap(in) pn_uuid_t
-{
-  // XXX: I believe there is a typemap or something similar for
-  // typechecking the input. We should probably use it.
-  AV* tmpav = (AV *) SvRV($input);
-  int index = 0;
-
-  for(index = 0; index < 16; index++)
-    {
-      $1.bytes[index] = SvIV(*av_fetch(tmpav, index, 0));
-      $1.bytes[index] = $1.bytes[index] & 0xff;
-    }
-}
-
-%typemap(out) pn_uuid_t
-{
-  $result = newSVpvn($1.bytes, 16);
-  argvi++;
-}
-
-%cstring_output_withsize(char *OUTPUT, size_t *OUTPUT_SIZE)
-%cstring_output_allocate_size(char **ALLOC_OUTPUT, size_t *ALLOC_SIZE, free(*$1));
-
-int pn_message_encode(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_message_encode;
-
-ssize_t pn_link_send(pn_link_t *transport, char *STRING, size_t LENGTH);
-%ignore pn_link_send;
-
-%rename(pn_link_recv) wrap_pn_link_recv;
-%inline %{
-  int wrap_pn_link_recv(pn_link_t *link, char *OUTPUT, size_t *OUTPUT_SIZE) {
-    ssize_t sz = pn_link_recv(link, OUTPUT, *OUTPUT_SIZE);
-    if (sz >= 0) {
-      *OUTPUT_SIZE = sz;
-    } else {
-      *OUTPUT_SIZE = 0;
-    }
-    return sz;
-  }
-%}
-%ignore pn_link_recv;
-
-ssize_t pn_transport_input(pn_transport_t *transport, char *STRING, size_t LENGTH);
-%ignore pn_transport_input;
-
-%rename(pn_transport_output) wrap_pn_transport_output;
-%inline %{
-  int wrap_pn_transport_output(pn_transport_t *transport, char *OUTPUT, size_t *OUTPUT_SIZE) {
-    ssize_t sz = pn_transport_output(transport, OUTPUT, *OUTPUT_SIZE);
-    if (sz >= 0) {
-      *OUTPUT_SIZE = sz;
-    } else {
-      *OUTPUT_SIZE = 0;
-    }
-    return sz;
-  }
-%}
-%ignore pn_transport_output;
-
-%rename(pn_delivery) wrap_pn_delivery;
-%inline %{
-  pn_delivery_t *wrap_pn_delivery(pn_link_t *link, char *STRING, size_t LENGTH) {
-    return pn_delivery(link, pn_dtag(STRING, LENGTH));
-  }
-%}
-%ignore pn_delivery;
-
-// Suppress "Warning(451): Setting a const char * variable may leak memory." on pn_delivery_tag_t
-%warnfilter(451) pn_delivery_tag_t;
-%rename(pn_delivery_tag) wrap_pn_delivery_tag;
-%inline %{
-  void wrap_pn_delivery_tag(pn_delivery_t *delivery, char **ALLOC_OUTPUT, size_t *ALLOC_SIZE) {
-    pn_delivery_tag_t tag = pn_delivery_tag(delivery);
-    *ALLOC_OUTPUT = (char *)malloc(tag.size);
-    *ALLOC_SIZE = tag.size;
-    memcpy(*ALLOC_OUTPUT, tag.start, tag.size);
-  }
-%}
-%ignore pn_delivery_tag;
-
-%include "proton/cproton.i"
diff --git a/proton-c/bindings/perl/tests/array_helper.t b/proton-c/bindings/perl/tests/array_helper.t
deleted file mode 100644
index 2273085..0000000
--- a/proton-c/bindings/perl/tests/array_helper.t
+++ /dev/null
@@ -1,232 +0,0 @@
-#!/bin/env perl -w
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-use Test::More qw(no_plan);
-use Test::Exception;
-
-require 'utils.pm';
-
-BEGIN {use_ok('qpid_proton');}
-require_ok('qpid_proton');
-
-my $data;
-my @values;
-my $result;
-my $length;
-my $descriptor;
-
-#=============================================================================
-# Getting an array from a nil Data instance raises an error.
-#=============================================================================
-$data = qpid::proton::Data->new;
-dies_ok(sub {qpid::proton::get_array_from(undef);},
-        "Raise an exception when getting from a nil Data object");
-
-
-#=============================================================================
-# Getting an array fails if the current node is not an array or a list.
-#=============================================================================
-$data = qpid::proton::Data->new;
-$data->put_string("foo");
-$data->rewind;
-$data->next;
-dies_ok(sub {qpid::proton::proton_get_array_from($data, undef);},
-        "Raise an exception when getting from a non-list and non-array");
-
-
-#=============================================================================
-# Can get an undescribed array.
-#=============================================================================
-$length = int(rand(256) + 64);
-$data = qpid::proton::Data->new;
-@values= random_integers($length);
-$data->put_array(0, qpid::proton::INT);
-$data->enter;
-foreach $value (@values) {
-    $data->put_int($value);
-}
-$data->exit;
-$data->rewind;
-
-{
-    $data->next;
-    my ($described, $type, @results) = qpid::proton::get_array_from($data);
-
-    ok(!$described, "Returned an undescribed array");
-    ok($type == qpid::proton::INT, "Returned the correct array type");
-    ok(scalar(@results) == $length, "Returns the correct number of elements");
-
-    is_deeply([sort @results], [sort @values],
-              "Returned the correct set of values");
-}
-
-
-#=============================================================================
-# Raises an error when putting into a null Data object.
-#=============================================================================
-dies_ok(sub {qpid::proton::put_array_into(undef, qpid::proton::INT,  @values);},
-        "Raises an error when putting into a null Data object");
-
-
-#=============================================================================
-# Raises an error when putting a null type into a Data object.
-#=============================================================================
-$data = qpid::proton::Data->new;
-dies_ok(sub {qpid::proton::put_array_into($data, undef,  @values);},
-        "Raises an error when putting into a null Data object");
-
-
-#=============================================================================
-# Raises an error when putting a null array into a Data object.
-#=============================================================================
-$data = qpid::proton::Data->new;
-dies_ok(sub {qpid::proton::put_array_into($data, qpid::proton::INT);},
-        "Raises an error when putting into a null Data object");
-
-
-#=============================================================================
-# Raises an error when putting a described array with no descriptor.
-#=============================================================================
-$data = qpid::proton::Data->new;
-dies_ok(sub {qpid::proton::put_array_into($data, qpid::proton::INT, \@values, 1);},
-        "Raises an error when putting a described array with no descriptor");
-
-
-#=============================================================================
-# Can put an undescribed array into a Data object.
-#=============================================================================
-$length = int(rand(256) + 64);
-$data = qpid::proton::Data->new;
-@values= random_integers($length);
-qpid::proton::put_array_into($data, qpid::proton::INT, \@values, 0);
-$data->rewind;
-
-{
-    $data->next;
-    my ($described, $type, @results) = qpid::proton::get_array_from($data);
-
-    ok(!$described, "Put an undescribed array");
-    ok($type == qpid::proton::INT, "Put the correct array type");
-    ok(scalar(@results) == $length, "Put the correct number of elements");
-
-    is_deeply([sort @results], [sort @values],
-              "Returned the correct set of values");
-}
-
-
-#=============================================================================
-# Can get an described array.
-#=============================================================================
-$length = int(rand(256) + 64);
-$data = qpid::proton::Data->new;
-@values= random_strings($length);
-$descriptor = random_string(64);
-$data->put_array(1, qpid::proton::STRING);
-$data->enter;
-$data->put_symbol($descriptor);
-foreach $value (@values) {
-    $data->put_string($value);
-}
-
-$data->exit;
-$data->rewind;
-
-{
-    $data->next;
-    my ($described, $dtor, $type, @results) = qpid::proton::get_array_from($data);
-
-    ok($described, "Returned a described array");
-    ok($dtor eq $descriptor, "Returned the correct descriptor");
-    ok($type == qpid::proton::STRING, "Returned the correct array type");
-    ok(scalar(@results) == $length, "Returns the correct number of elements");
-
-    is_deeply([sort @results], [sort @values],
-              "Returned the correct set of values");
-}
-
-
-#=============================================================================
-# Can put a described array into a Data object.
-#=============================================================================
-$length = int(rand(256) + 64);
-$data = qpid::proton::Data->new;
-@values= random_integers($length);
-$descriptor = random_string(128);
-qpid::proton::put_array_into($data, qpid::proton::INT, \@values, 1, $descriptor);
-$data->rewind;
-
-{
-    $data->next;
-    my ($described, $dtor, $type, @results) = qpid::proton::get_array_from($data);
-
-    ok($described, "Put a described array");
-    ok($dtor eq $descriptor, "Put the correct descriptor");
-    ok($type == qpid::proton::INT, "Put the correct array type");
-    ok(scalar(@results) == $length, "Put the correct number of elements");
-
-    is_deeply([sort @results], [sort @values],
-              "Returned the correct set of values");
-}
-
-
-#=============================================================================
-# Raises an error when getting a list from a null Data instance
-#=============================================================================
-$data = qpid::proton::Data->new;
-dies_ok(sub {qpid::proton::get_list_from(undef);},
-        "Raises error when getting list from null Data object");
-
-
-#=============================================================================
-# Raises an error when the current node is not a list.
-#=============================================================================
-$data = qpid::proton::Data->new;
-$data->put_string(random_string(64));
-$data->rewind;
-$data->next;
-
-dies_ok(sub {qpid::proton::get_list_from($data);},
-        "Raises an error when getting a list and it's not currently a list.");
-
-
-#=============================================================================
-# Can get an array
-#=============================================================================
-$length = int(rand(256) + 64);
-$data = qpid::proton::Data->new;
-@values = random_strings($length);
-$data->put_list;
-$data->enter;
-foreach $value (@values) {
-    $data->put_string($value);
-}
-$data->exit;
-$data->rewind;
-
-{
-    my $result = $data->next;
-
-    my @results = qpid::proton::get_list_from($data);
-
-    ok(scalar(@results) == $length, "Returned the correct number of elements");
-
-    is_deeply([sort @results], [sort @values],
-              "Returned the correct list of values");
-}
diff --git a/proton-c/bindings/perl/tests/data.t b/proton-c/bindings/perl/tests/data.t
deleted file mode 100644
index 2bfdead..0000000
--- a/proton-c/bindings/perl/tests/data.t
+++ /dev/null
@@ -1,536 +0,0 @@
-#!/bin/env perl -w
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-use Test::More qw(no_plan);
-use Test::Number::Delta within => 1e-3;
-use Test::Exception;
-
-require 'utils.pm';
-
-BEGIN {use_ok('qpid_proton');}
-require_ok('qpid_proton');
-
-my $data;
-my $value;
-
-# Create without capacity
-$data = qpid::proton::Data->new();
-isa_ok($data, 'qpid::proton::Data');
-
-# Create with capacity
-$data = qpid::proton::Data->new(24);
-isa_ok($data, 'qpid::proton::Data');
-
-# can put a null
-$data = qpid::proton::Data->new();
-$data->put_null();
-ok($data->is_null(), "Data can put a null");
-
-# raises an error on a null boolean
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_bool;}, "Cannot put a null bool");
-
-# can put a true boolean
-$data = qpid::proton::Data->new();
-$data->put_bool(1);
-ok($data->get_bool(), "Data can put a true bool");
-
-# can put a false boolean
-$data = qpid::proton::Data->new();
-$data->put_bool(0);
-ok(!$data->get_bool(), "Data can put a false bool");
-
-# raises an error on a negative ubyte
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_ubyte(0 - (rand(2**7) + 1));},
-        "Cannot have a negative ubyte");
-
-# raises an error on a null ubyte
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_ubyte;}, "Cannot put a null ubyte");
-
-# can put a zero ubyte
-$data = qpid::proton::Data->new();
-$data->put_ubyte(0);
-ok($data->get_ubyte() == 0, "Can put a zero ubyte");
-
-# will convert a float to an int ubyte
-$data = qpid::proton::Data->new();
-$value = rand(2**7) + 1;
-$data->put_ubyte($value);
-ok ($data->get_ubyte() == int($value), "Can put a float ubyte");
-
-# can put a ubyte
-$data = qpid::proton::Data->new();
-$value = int(rand(2**7) + 1);
-$data->put_ubyte($value);
-ok($data->get_ubyte() == $value, "Can put a ubyte");
-
-# raises an error on a null byte
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_byte;}, "Cannot put a null byte");
-
-# can put a negative byte
-$data = qpid::proton::Data->new();
-$value = int(0 - (1 + rand(2**7)));
-$data->put_byte($value);
-ok($data->get_byte() == $value, "Can put a negative byte");
-
-# can put a zero byte
-$data = qpid::proton::Data->new();
-$data->put_byte(0);
-ok($data->get_byte() == 0, "Can put a zero byte");
-
-# can put a float as a byte
-$data = qpid::proton::Data->new();
-$value = rand(2**7) + 1;
-$data->put_byte($value);
-ok($data->get_byte() == int($value), "Can put a float as a byte");
-
-# can put a byte
-$data = qpid::proton::Data->new();
-$value = int(1 + rand(2**7));
-$data->put_byte($value);
-ok($data->get_byte() == $value, "Can put a byte");
-
-# raise an error on a null ushort
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_ushort;}, "Cannot put a null ushort");
-
-# raises an error on a negative ushort
-$data = qpid::proton::Data->new();
-$value = 0 - (1 + rand((2**15)));
-dies_ok(sub {$data->put_ushort($value);}, "Cannot put a negative ushort");
-
-# can put a zero ushort
-$data = qpid::proton::Data->new();
-$data->put_ushort(0);
-ok($data->get_ushort() == 0, "Can put a zero ushort");
-
-# can handle a float ushort value
-$data = qpid::proton::Data->new();
-$value = 1 + rand((2**15));
-$data->put_ushort($value);
-ok($data->get_ushort() == int($value), "Can put a float ushort");
-
-# can put a ushort
-$data = qpid::proton::Data->new();
-$value = int(1 + rand((2**15)));
-$data->put_ushort($value);
-ok($data->get_ushort() == $value, "Can put a ushort");
-
-# raises an error on a null short
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_short;}, "Cannot put a null short");
-
-# can put a negative short
-$data = qpid::proton::Data->new();
-$value = int(0 - (1 + rand((2**15))));
-$data->put_short($value);
-ok($data->get_short() == $value, "Can put a negative short");
-
-# can put a zero short
-$data = qpid::proton::Data->new();
-$data->put_short(0);
-ok($data->get_short() == 0, "Can put a zero short");
-
-# can put a float as a short
-$data = qpid::proton::Data->new();
-$value = 1 + rand(2**15);
-$data->put_short($value);
-ok($data->get_short() == int($value), "Can put a float as a short");
-
-# can put a short
-$data = qpid::proton::Data->new();
-$value = int(1 + rand(2**15));
-$data->put_short($value);
-ok($data->get_short() == $value, "Can put a short");
-
-# raises an error on a null uint
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_uint;}, "Cannot set a null uint");
-
-# raises an error on a negative uint
-$data = qpid::proton::Data->new();
-$value = 0 - (1 + rand(2**31));
-dies_ok(sub {$data->put_uint($value);}, "Cannot set a negative uint");
-
-# can put a zero uint
-$data = qpid::proton::Data->new();
-$data->put_uint(0);
-ok($data->get_uint() == 0, "Can put a zero uint");
-
-# can put a float as a uint
-$data = qpid::proton::Data->new();
-$value = 1 + rand(2**31);
-$data->put_uint($value);
-ok($data->get_uint() == int($value), "Can put a float as a uint");
-
-# can put a uint
-$data = qpid::proton::Data->new();
-$value = int(1 + rand(2**31));
-$data->put_uint($value);
-ok($data->get_uint() == $value, "Can put a uint");
-
-# raise an error on a null integer
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_int;}, "Cannot put a null int");
-
-# can put a negative integer
-$data = qpid::proton::Data->new();
-$value = int(0 - (1 + rand(2**31)));
-$data->put_int($value);
-ok($data->get_int() == $value, "Can put a negative int");
-
-# can put a zero integer
-$data = qpid::proton::Data->new();
-$data->put_int(0);
-ok($data->get_int() == 0, "Can put a zero int");
-
-# can put a float as an integer
-$data = qpid::proton::Data->new();
-$value = 1 + (rand(2**31));
-$data->put_int($value);
-ok($data->get_int() == int($value), "Can put a float as an int");
-
-# can put an integer
-$data = qpid::proton::Data->new();
-$value = int(1 + rand(2**31));
-$data->put_int($value);
-ok($data->get_int() == $value, "Can put an int");
-
-# raises an error on a null character
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_char;}, "Cannot put a null char");
-
-# can put a float as a char
-$data = qpid::proton::Data->new();
-$value = 1 + rand(255);
-$data->put_char($value);
-ok($data->get_char() == int($value), "Can put a float as a char");
-
-# can put a character
-$data = qpid::proton::Data->new();
-$value = int(1 + rand(255));
-$data->put_char($value);
-ok($data->get_char() == $value, "Can put a char");
-
-# raise an error on a null ulong
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_ulong;}, "Cannot put a null ulong");
-
-# raises an error on a negative ulong
-$data = qpid::proton::Data->new();
-$value = 0 - (1 + rand(2**63));
-dies_ok(sub {$data->put_ulong($value);}, "Cannot put a negative ulong");
-
-# can put a zero ulong
-$data = qpid::proton::Data->new();
-$data->put_ulong(0);
-ok($data->get_ulong() == 0, "Can put a zero ulong");
-
-# can put a float as a ulong
-$data = qpid::proton::Data->new();
-$value = 1 + rand(2**63);
-$data->put_ulong($value);
-ok($data->get_ulong() == int($value), "Can put a float as a ulong");
-
-# can put a ulong
-$data = qpid::proton::Data->new();
-$value = int(1 + rand(2**63));
-$data->put_ulong($value);
-ok($data->get_ulong() == $value, "Can put a ulong");
-
-# raises an error on a null long
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_long;}, "Cannot put a null long");
-
-# can put a negative long
-$data = qpid::proton::Data->new();
-$value = int(0 - (1 + rand(2**63)));
-$data->put_long($value);
-ok($data->get_long() == $value, "Can put a negative long");
-
-# can put a zero long
-$data = qpid::proton::Data->new();
-$data->put_long(0);
-ok($data->get_long() == 0, "Can put a zero long");
-
-# can put a float as a long
-$data = qpid::proton::Data->new();
-$value = 1 + rand(2**63);
-$data->put_long($value);
-ok($data->get_long() == int($value), "Can put a float as a long");
-
-# can put a long
-$data = qpid::proton::Data->new();
-$value = int(1 + rand(2**63));
-$data->put_long($value);
-ok($data->get_long() == $value, "Can put a long value");
-
-# raises an error on a null timestamp
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_timestamp;}, "Cannot put a null timestamp");
-
-# can put a negative timestamp
-$data = qpid::proton::Data->new();
-$value = int(0 - (1 + rand(2**32)));
-$data->put_timestamp($value);
-ok($data->get_timestamp() == $value, "Can put a negative timestamp");
-
-# can put a zero timestamp
-$data = qpid::proton::Data->new();
-$data->put_timestamp(0);
-ok($data->get_timestamp() == 0, "Can put a zero timestamp");
-
-# can put a float as a timestamp
-$data = qpid::proton::Data->new();
-$value = 1 + (rand(2**32));
-$data->put_timestamp($value);
-ok($data->get_timestamp() == int($value), "Can put a float as a timestamp");
-
-# can put a timestamp
-$data = qpid::proton::Data->new();
-$value = int(1 + rand(2**32));
-$data->put_timestamp($value);
-ok($data->get_timestamp() == $value, "Can put a timestamp");
-
-# raises an error on a null float
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_float;}, "Cannot put a null float");
-
-# can put a negative float
-$data = qpid::proton::Data->new();
-$value = 0 - (1 + rand(2**15));
-$data->put_float($value);
-delta_ok($data->get_float(), $value, "Can put a negative float");
-
-# can put a zero float
-$data = qpid::proton::Data->new();
-$data->put_float(0.0);
-delta_ok($data->get_float(), 0.0, "Can put a zero float");
-
-# can put a float
-$data = qpid::proton::Data->new();
-$value = 1.0 + rand(2**15);
-$data->put_float($value);
-delta_ok($data->get_float(), $value, "Can put a float");
-
-# raises an error on a null double
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_double;}, "Cannot set a null double");
-
-# can put a negative double
-$data = qpid::proton::Data->new();
-$value = 0 - (1 + rand(2**31));
-$data->put_double($value);
-delta_ok($data->get_double(), $value, "Can put a double value");
-
-# can put a zero double
-$data = qpid::proton::Data->new();
-$data->put_double(0.0);
-delta_ok($data->get_double(), 0.0, "Can put a zero double");
-
-# can put a double
-$data = qpid::proton::Data->new();
-$value = 1.0 + rand(2**15);
-$data->put_double($value);
-delta_ok($data->get_double(), $value, "Can put a double");
-
-# raises an error on a null decimal32
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_decimal32;}, "Cannot put a null decimal32");
-
-# can put a decimal32
-$data = qpid::proton::Data->new();
-$value = int(rand(2**32));
-$data->put_decimal32($value);
-ok($data->get_decimal32() == $value, "Can put a decimal32 value");
-
-# raises an error on a null decimal64
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_decimal64();}, "Cannot put a null decimal64");
-
-# can put a decimal64
-$data = qpid::proton::Data->new();
-$value = int(rand(2**64));
-$data->put_decimal64($value);
-ok($data->get_decimal64() == $value, "Can put a decimal64 value");
-
-# raises an error on a null decimal128
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_decimal128;}, "Cannot put a null decimal128");
-
-# can put a decimal128
-$data = qpid::proton::Data->new();
-$value = int(rand(2**31));
-$data->put_decimal128($value);
-ok($data->get_decimal128() == $value, "Can put a decimal128 value");
-
-# raises an error on a null UUID
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_uuid;}, "Cannot put a null UUID");
-
-# raises an error on a malformed UUID
-$data = qpid::proton::Data->new();
-$value = random_string(36);
-dies_ok(sub {$data->put_uuid($value);}, "Cannot put a malformed UUID");
-
-# can put a UUID
-$data = qpid::proton::Data->new();
-$data->put_uuid("fd0289a5-8eec-4a08-9283-81d02c9d2fff");
-ok($data->get_uuid() eq "fd0289a5-8eec-4a08-9283-81d02c9d2fff",
-   "Can store a string UUID");
-
-# cannot put a null binary
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_binary;}, "Cannot put a null binary");
-
-# can put an empty binary string
-$data = qpid::proton::Data->new();
-$data->put_binary("");
-ok($data->get_binary() eq "", "Can put an empty binary");
-
-# can put a binary
-$data = qpid::proton::Data->new();
-$value = random_string(128);
-$data->put_binary($value);
-ok($data->get_binary() eq $value, "Can put a binary value");
-
-# cannot put a null string
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_string;}, "Cannot put a null string");
-
-# can put an empty string
-$data = qpid::proton::Data->new();
-$data->put_string("");
-ok($data->get_string() eq "", "Can put an empty string");
-
-# can put a string
-$data = qpid::proton::Data->new();
-$value = random_string(128);
-$data->put_string($value);
-ok($data->get_string() eq $value, "Can put an arbitrary string");
-
-# cannot put a null symbol
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_symbol;}, "Cannot put a null symbol");
-
-# can put a symbol
-$data = qpid::proton::Data->new();
-$value = random_string(64);
-$data->put_symbol($value);
-ok($data->get_symbol eq $value, "Can put a symbol");
-
-# can hold a described value
-$data = qpid::proton::Data->new();
-$data->put_described;
-ok($data->is_described, "Can hold a described value");
-
-# can put an array with undef as described flag
-$data = qpid::proton::Data->new();
-my @values = map { rand } (1..100, );
-lives_ok(sub {$data->put_array(undef, qpid::proton::INT);},
-         "Array can have null for described flag");
-
-# arrays must have a specified type
-$data = qpid::proton::Data->new();
-dies_ok(sub {$data->put_array;},
-        "Array type cannot be null");
-
-# can put an array
-$data = qpid::proton::Data->new();
-@values = random_integers(100);
-$data->put_array(0, qpid::proton::INT);
-$data->enter;
-foreach $value (@values) {
-    $data->put_int($value);
-}
-$data->exit;
-
-@result = ();
-$data->enter;
-foreach $value (@values) {
-    $data->next;
-    push @result, $data->get_int;
-}
-$data->exit;
-is_deeply((\@result, \@values), "Array was populated correctly");
-
-# can put a described array
-$data = qpid::proton::Data->new();
-@values = random_integers(100);
-$data->put_array(1, qpid::proton::INT);
-$data->enter;
-foreach $value (@values) {
-    $data->put_int($value);
-}
-$data->exit;
-
-@result = ();
-$data->enter;
-foreach $value (@values) {
-    $data->next;
-    push @result, $data->get_int;
-}
-is_deeply((\@result, \@values), "Array was populated correctly");
-
-# can put a list
-$data = qpid::proton::Data->new();
-@values = random_integers(100);
-$data->put_list;
-$data->enter;
-foreach $value (@values) {
-    $data->put_int($value);
-}
-$data->exit;
-
-@result = ();
-$data->enter;
-foreach $value (@values) {
-    $data->next;
-    push @result, $data->get_int;
-}
-$data->exit;
-is_deeply((\@result, \@values), "List was populated correctly");
-
-
-# can put a map
-$data = qpid::proton::Data->new();
-my $map = random_hash(100);
-$data->put_map;
-$data->enter;
-foreach my $key (keys %{$map}) {
-    $data->put_string($key);
-    $data->put_string($map->{$key});
-}
-$data->exit;
-
-my $result = {};
-$data->enter;
-foreach my $key (keys %{$map}) {
-    $data->next;
-    my $rkey = $data->get_string;
-    $data->next;
-    my $rval = $data->get_string;
-    $result{$rkey} = $rval;
-}
-$data->exit;
-ok(eq_hash(\%result, \%{$map}), "Map was populated correctly");
diff --git a/proton-c/bindings/perl/tests/hash_helper.t b/proton-c/bindings/perl/tests/hash_helper.t
deleted file mode 100644
index 8f1ea3d..0000000
--- a/proton-c/bindings/perl/tests/hash_helper.t
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/env perl -w
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-use Test::More qw(no_plan);
-use Test::Exception;
-
-require 'utils.pm';
-
-BEGIN {use_ok('qpid_proton');}
-require_ok('qpid_proton');
-
-my $data;
-my $hash;
-my $result;
-
-#=============================================================================
-# raises an error when getting a hash from a null data object
-#=============================================================================
-dies_ok(sub {qpid::proton::get_map_from(undef);},
-        "Raises an error when getting a hash froma  null data object");
-
-
-#=============================================================================
-# raises an error if the current node is not a map
-#=============================================================================
-$data = qpid::proton::Data->new;
-$data->put_string(random_string(16));
-$data->rewind;
-$data->next;
-
-dies_ok(sub {qpid::proton::get_map_from($data);},
-        "Raises an error if the current node is not a map");
-
-
-#=============================================================================
-# returns a hash from a Data object
-#=============================================================================
-$data = qpid::proton::Data->new;
-$hash = random_hash(rand(128) + 64);
-$data->put_map;
-$data->enter;
-foreach my $key (keys \%{$hash}) {
-    $data->put_string($key);
-    $data->put_string($hash->{$key});
-}
-$data->exit;
-$data->rewind;
-$data->next;
-
-{
-    $result = qpid::proton::get_map_from($data);
-
-    ok(defined($result), "Getting a hash returns a value");
-    ok(scalar(keys %{$result}) == scalar(keys %{$hash}),
-       "Returned the same number of keys");
-    is_deeply(\%{$result}, \%{$hash}, "Returned the same hash values");
-}
diff --git a/proton-c/bindings/perl/tests/message.t b/proton-c/bindings/perl/tests/message.t
deleted file mode 100644
index ee55361..0000000
--- a/proton-c/bindings/perl/tests/message.t
+++ /dev/null
@@ -1,254 +0,0 @@
-#!/usr/bin/env perl -w
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-use Test::More qw(no_plan);
-use Test::Exception;
-
-require 'utils.pm';
-
-BEGIN {use_ok('qpid_proton');}
-require_ok('qpid_proton');
-
-# Create a new message.
-my $message = qpid::proton::Message->new();
-isa_ok($message, 'qpid::proton::Message');
-
-# Verify the message mutators.
-
-# durable
-$message->set_durable(1);
-ok($message->get_durable(), 'Durable can be set');
-$message->set_durable(0);
-ok(!$message->get_durable(), 'Durable can be unset');
-
-# priority
-my $priority = int(rand(256) + 1);
-
-dies_ok(sub {$message->set_priority('abc')}, 'Priority must be numeric');
-dies_ok(sub {$message->set_priority(0 - $priority)}, 'Priority cannot be negative');
-
-$message->set_priority(0);
-ok($message->get_priority() == 0, 'Priority can be zero');
-$message->set_priority($priority);
-ok($message->get_priority() == $priority, 'Priority can be positive');
-
-# Time to live
-my $ttl = int(rand(65535) + 1);
-
-dies_ok(sub {$message->set_ttl('def')}, 'TTL must be numeric');
-dies_ok(sub {$message->set_ttl(0 - $ttl)}, 'TTL cannot be negative');
-
-$message->set_ttl(0);
-ok($message->get_ttl() == 0, 'TTL can be zero');
-$message->set_ttl($ttl);
-ok($message->get_ttl() == $ttl, 'TTL can be postive');
-
-# first acquirer
-$message->set_first_acquirer(1);
-ok($message->get_first_acquirer(), 'First acquirer can be set');
-$message->set_first_acquirer(0);
-ok(!$message->get_first_acquirer(), 'First acquirer can be unset');
-
-# delivery count
-my $delivery_count = int(rand(65535) + 1);
-
-dies_ok(sub {$message->set_delivery_count("abc");},
-         'Messages cannot have non-numeric delivery counts');
-dies_ok(sub {$message->set_delivery_count(0 - $delivery_count)},
-         'Messages cannot have negative delivery counts');
-$message->set_delivery_count(0);
-ok($message->get_delivery_count() == 0, 'Delivery count can be zero');
-$message->set_delivery_count($delivery_count);
-ok ($message->get_delivery_count() == $delivery_count, 'Delivery count can be postiive');
-
-# message id
-my $message_id = random_string(16);
-
-dies_ok (sub {$message->set_id(undef);},
-         'Message id cannot be null');
-$message->set_id($message_id);
-ok($message->get_id(), 'Message id was set');
-ok($message->get_id() eq $message_id, 'Message id was set correctly');
-
-# user id
-my $user_id = random_string(16);
-
-dies_ok (sub {$message->set_user_id(undef);},
-         'User id cannot be null');
-$message->set_user_id($user_id);
-ok($message->get_user_id(), 'User id was set');
-ok($message->get_user_id() eq $user_id, 'User id was set correctly');
-
-# address
-my $address = "amqp://0.0.0.0";
-
-$message->set_address(undef);
-ok(!$message->get_address(), 'Address can be null');
-
-$message->set_address($address);
-ok($message->get_address() eq $address, 'Address is set correctly');
-
-# subject
-my $subject = random_string(25);
-
-$message->set_subject(undef);
-ok(!$message->get_subject(), 'Subject can be null');
-
-$message->set_subject($subject);
-ok($message->get_subject() eq $subject, 'Subject was set correctly');
-
-# reply to
-$reply_to = "amqp://0.0.0.0";
-
-$message->set_reply_to(undef);
-ok(!$message->get_reply_to(), "Reply to can be null");
-
-$message->set_reply_to($reply_to);
-ok($message->get_reply_to() eq $reply_to, 'Reply to was set correctly');
-
-# correlation id
-my $correlation_id = random_string(16);
-
-$message->set_correlation_id(undef);
-ok(!$message->get_correlation_id(), 'Correlation id can be null');
-
-$message->set_correlation_id($correlation_id);
-ok($message->get_correlation_id() eq $correlation_id,
-   'Correlation id was set correctly');
-
-# content type
-my $content_type = "text/" . random_string(12);
-
-$message->set_content_type(undef);
-ok(!$message->get_content_type(), 'Content type can be null');
-
-$message->set_content_type($content_type);
-ok($message->get_content_type() eq $content_type,
-   'Content type was set correctly');
-
-# content encoding
-my $content_encoding = random_string(16);
-
-$message->set_content_encoding(undef);
-ok(!$message->get_content_encoding(), 'Content encoding can be null');
-
-$message->set_content_encoding($content_encoding);
-ok($message->get_content_encoding() eq $content_encoding,
-   'Content encoding was set correctly');
-
-# expiry time
-my $expiry_time = random_timestamp();
-
-dies_ok(sub {$message->set_expiry_time(undef);},
-        'Expiry cannot be null');
-
-dies_ok(sub {$message->set_expiry_time(0 - $expiry_time);},
-        'Expiry cannot be negative');
-
-$message->set_expiry_time(0);
-ok($message->get_expiry_time() == 0,
-   'Expiry time can be zero');
-
-$message->set_expiry_time($expiry_time);
-ok($message->get_expiry_time() == int($expiry_time),
-   'Expiry time was set correctly');
-
-# creation time
-my $creation_time = random_timestamp();
-
-dies_ok(sub {$message->set_creation_time(undef);},
-        'Creation time cannot be null');
-
-dies_ok(sub {$message->set_creation_time(0 - $creation_time);},
-        'Creation time cannot be negative');
-
-$message->set_creation_time($creation_time);
-ok($message->get_creation_time() == $creation_time,
-   'Creation time was set correctly');
-
-# group id
-my $group_id = random_string(16);
-
-$message->set_group_id(undef);
-ok(!$message->get_group_id(), 'Group id can be null');
-
-$message->set_group_id($group_id);
-ok($message->get_group_id() eq $group_id,
-   'Group id was set correctly');
-
-# group sequence
-my $group_sequence = rand(2**31) + 1;
-
-dies_ok(sub {$message->set_group_sequence(undef);},
-        'Sequence id cannot be null');
-
-$message->set_group_sequence(0 - $group_sequence);
-ok($message->get_group_sequence() == int(0 - $group_sequence),
-   'Group sequence can be negative');
-
-$message->set_group_sequence(0);
-ok($message->get_group_sequence() == 0,
-   'Group sequence can be zero');
-
-$message->set_group_sequence($group_sequence);
-ok($message->get_group_sequence() == int($group_sequence),
-   'Group sequence can be positive');
-
-# reply to group id
-my $reply_to_group_id = random_string(16);
-
-$message->set_reply_to_group_id(undef);
-ok(!$message->get_reply_to_group_id(), 'Reply-to group id can be null');
-
-$message->set_reply_to_group_id($reply_to_group_id);
-ok($message->get_reply_to_group_id() eq $reply_to_group_id,
-   'Reply-to group id was set correctly');
-
-# format
-my @formats = ($qpid::proton::Message::DATA_FORMAT,
-               $qpid::proton::Message::TEXT_FORMAT,
-               $qpid::proton::Message::AMQP_FORMAT,
-               $qpid::proton::Message::JSON_FORMAT);
-
-dies_ok(sub {$message->set_format(undef);}, 'Format cannot be null');
-
-foreach (@formats)
-{
-    my $format = $_;
-
-    $message->set_format($format);
-    ok($message->get_format() == $format,
-       'Format was set correctly');
-}
-
-# reset the format
-$message->set_format($qpid::proton::Message::TEXT_FORMAT);
-
-# content
-my $content_size = rand(512);
-my $content = random_string($content_size);
-
-$message->set_content(undef);
-ok(!$message->get_content(), 'Content can be null');
-
-$message->set_content($content);
-ok($message->get_content() eq $content,
-   'Content was saved correctly');
-
diff --git a/proton-c/bindings/perl/tests/messenger.t b/proton-c/bindings/perl/tests/messenger.t
deleted file mode 100644
index 7c3ca21..0000000
--- a/proton-c/bindings/perl/tests/messenger.t
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/usr/bin/env perl -w
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-use Test::More qw(no_plan);
-use Test::Exception;
-
-require 'utils.pm';
-
-BEGIN {use_ok('qpid_proton');}
-require_ok('qpid_proton');
-
-# Create a new message.
-my $messenger = qpid::proton::Messenger->new();
-isa_ok($messenger, 'qpid::proton::Messenger');
-
-# name
-ok($messenger->get_name(), 'Messenger has a default name');
-
-{
-    my $name = random_string(16);
-    my $messenger1 = qpid::proton::Messenger->new($name);
-
-    ok($messenger1->get_name() eq $name, 'Messenger saves name correctly');
-}
-
-# certificate
-my $certificate = random_string(255);
-
-$messenger->set_certificate(undef);
-ok(!$messenger->get_certificate(), 'Certificate can be null');
-
-$messenger->set_certificate($certificate);
-ok($messenger->get_certificate() eq $certificate,
-   'Certificate was set correctly');
-
-# private key
-my $key = random_string(255);
-
-$messenger->set_private_key(undef);
-ok(!$messenger->get_private_key(), 'Private key can be null');
-
-$messenger->set_private_key($key);
-ok($messenger->get_private_key() eq $key, 'Private key was set correctly');
-
-# password
-my $password = random_string(64);
-
-$messenger->set_password(undef);
-ok(!$messenger->get_password(), 'Password can be null');
-
-$messenger->set_password($password);
-ok($messenger->get_password() eq $password, 'Password set correctly');
-
-# trusted certificates
-my $trusted_certificate = random_string(255);
-
-$messenger->set_trusted_certificates(undef);
-ok(!$messenger->get_trusted_certificates(), 'Trusted certificates can be null');
-
-$messenger->set_trusted_certificates($trusted_certificate);
-ok($messenger->get_trusted_certificates() eq $trusted_certificate,
-   'Trusted certificates was set correctly');
-
-# timeout
-my $timeout = rand(2**31) + 1;
-
-$messenger->set_timeout(undef);
-ok($messenger->get_timeout() == 0, 'Null timeout is treated as 0');
-
-$messenger->set_timeout(0 - $timeout);
-ok($messenger->get_timeout() == int(0 - $timeout), 'Timeout can be negative');
-
-$messenger->set_timeout(0);
-ok($messenger->get_timeout() == 0, 'Timeout can be zero');
-
-$messenger->set_timeout($timeout);
-ok($messenger->get_timeout() == int($timeout), 'Timeout can be positive');
-
-# outgoing window
-my $outgoing_window = rand(2**9);
-
-$messenger->set_outgoing_window(undef);
-ok($messenger->get_outgoing_window() == 0, 'Null outgoing window is treated as zero');
-
-$messenger->set_outgoing_window(0);
-ok($messenger->get_outgoing_window() == 0, 'Outgoing window can be zero');
-
-$messenger->set_outgoing_window(0 - $outgoing_window);
-ok($messenger->get_outgoing_window() == int(0 - $outgoing_window),
-   'Outgoing window can be negative');
-
-$messenger->set_outgoing_window($outgoing_window);
-ok($messenger->get_outgoing_window() == int($outgoing_window),
-   'Outgoing window can be positive');
-
-# incoming window
-my $incoming_window = rand(2**9);
-
-$messenger->set_incoming_window(undef);
-ok($messenger->get_incoming_window() == 0, 'Null incoming window is treated as zero');
-
-$messenger->set_incoming_window(0);
-ok($messenger->get_incoming_window() == 0, 'Incoming window can be zero');
-
-$messenger->set_incoming_window(0 - $incoming_window);
-ok($messenger->get_incoming_window() == int(0 - $incoming_window),
-   'Incoming window can be negative');
-
-$messenger->set_incoming_window($incoming_window);
-ok($messenger->get_incoming_window() == int($incoming_window),
-   'Incoming window can be positive');
-
diff --git a/proton-c/bindings/perl/tests/utils.pm b/proton-c/bindings/perl/tests/utils.pm
deleted file mode 100644
index 3f36126..0000000
--- a/proton-c/bindings/perl/tests/utils.pm
+++ /dev/null
@@ -1,60 +0,0 @@
-sub random_integers
-{
-    my $len = shift;
-    my @result;
-
-    foreach (1..$len) {
-        my $value = int(rand(100));
-        push @result, $value;
-    }
-
-    return @result;
-}
-
-sub random_hash
-{
-    my $len = shift;
-    my %result;
-
-    foreach (1..$len) {
-        my $key = random_string(32);
-        my $val = random_string(128);
-        $result{$key} = $val;
-    }
-
-    return \%result;
-}
-
-sub random_string
-{
-    my $len=$_[0];
-
-    my @chars=('a'..'z','A'..'Z','0'..'9','_');
-    my $result;
-    foreach (1..$len) {
-        $result .= $chars[rand @chars];
-    }
-    return $result;
-}
-
-sub random_strings
-{
-    my $len = $_[0];
-    my @result = ();
-
-    foreach (1..$len) {
-        my $strlen = rand(64) + 32;
-        push(@result, random_string($strlen));
-    }
-
-    return @result;
-}
-
-sub random_timestamp
-{
-    my $result = rand(2**63) + 1;
-
-    return $result;
-}
-
-1;
diff --git a/proton-c/bindings/php/.gitignore b/proton-c/bindings/php/.gitignore
deleted file mode 100644
index 59854a6..0000000
--- a/proton-c/bindings/php/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/php.ini
diff --git a/proton-c/bindings/php/CMakeLists.txt b/proton-c/bindings/php/CMakeLists.txt
deleted file mode 100644
index 558269d..0000000
--- a/proton-c/bindings/php/CMakeLists.txt
+++ /dev/null
@@ -1,117 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-##------------------------------------------------------
-## Use Swig to generate a PHP binding to the Proton API
-##------------------------------------------------------
-
-# Uses the php-config command line tool from PHP to extract the location of the PHP header
-# files
-execute_process(COMMAND ${PHP_CONFIG_EXE} --includes
-                OUTPUT_VARIABLE PHP_INCLUDES
-                RESULT_VARIABLE retval
-                ERROR_VARIABLE  errmsg
-                OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/php.i PROPERTIES SWIG_FLAGS "-I${PROJECT_SOURCE_DIR}/include")
-list(APPEND SWIG_MODULE_cproton_EXTRA_DEPS
-    ${CMAKE_SOURCE_DIR}/proton-c/include/proton/cproton.i
-    ${PROTON_HEADERS}
-)
-swig_add_module(cproton php ${CMAKE_CURRENT_SOURCE_DIR}/php.i)
-set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "${PHP_INCLUDES}")
-swig_link_libraries(cproton ${BINDING_DEPS})
-# PHP modules must be linked with unresolved symbols as they are presumably satisfied only when loaded by php itself
-set_target_properties(cproton
-    PROPERTIES
-    PREFIX ""
-    LINK_FLAGS "${ALLOW_UNDEFINED}")
-
-if (CHECK_SYSINSTALL_PHP)
-  execute_process(COMMAND ${PHP_CONFIG_EXE} --extension-dir
-    OUTPUT_VARIABLE PHP_EXT_DIR_DEFAULT
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
-  execute_process(COMMAND ${PHP_CONFIG_EXE} --prefix
-    OUTPUT_VARIABLE QPHP_PREFIX
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
-  execute_process(COMMAND ${PHP_CONFIG_EXE} --config-options
-    OUTPUT_VARIABLE PHP_OPTS
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-  set(GET_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/get_include_dir.php)
-  execute_process(COMMAND ${PHP_EXE} -n ${GET_INCLUDE_DIR} ${QPHP_PREFIX}
-    OUTPUT_VARIABLE PHP_INCLUDE_DIR_DEFAULT
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-  if ("${PHP_INCLUDE_DIR_DEFAULT}" STREQUAL "")
-    set(PHP_INCLUDE_DIR_DEFAULT "/usr/share/php")
-  endif()
-
-  string(REGEX MATCH "--with-config-file-scan-dir=([^ ]*)" PHP_OPT_MATCH ${PHP_OPTS})
-  set (PHP_INI_DIR_DEFAULT ${CMAKE_MATCH_1})
-
-  if ("${PHP_INI_DIR_DEFAULT}" STREQUAL "")
-    set(PHP_INI_DIR_DEFAULT "/etc/php.d")
-  endif()
-else (CHECK_SYSINSTALL_PHP)
-  set (PHP_EXT_DIR_DEFAULT ${BINDINGS_DIR}/php)
-  set (PHP_INI_DIR_DEFAULT ${BINDINGS_DIR}/php)
-  set (PHP_INCLUDE_DIR_DEFAULT ${BINDINGS_DIR}/php)
-endif (CHECK_SYSINSTALL_PHP)
-
-# PHP extensions directory
-if (NOT PHP_EXT_DIR)
-  set (PHP_EXT_DIR ${PHP_EXT_DIR_DEFAULT})
-endif()
-# PHP ini directory
-if (NOT PHP_INI_DIR)
-  set (PHP_INI_DIR ${PHP_INI_DIR_DEFAULT})
-endif()
-# PHP include directory
-if (NOT PHP_INCLUDE_DIR)
-  set (PHP_INCLUDE_DIR ${PHP_INCLUDE_DIR_DEFAULT})
-endif()
-
-if (CHECK_SYSINSTALL_PHP)
-  set (PROTON_INI "extension=cproton.so")
-else ()
-  pn_absolute_install_dir(PHP_INCLUDE_PATH ${PHP_INCLUDE_DIR} ${CMAKE_INSTALL_PREFIX})
-  pn_absolute_install_dir(PHP_EXTENSION_LIB ${PHP_EXT_DIR}/cproton.so ${CMAKE_INSTALL_PREFIX})
-  set (PROTON_INI "include_path=${PHP_INCLUDE_PATH}\nextension=${PHP_EXTENSION_LIB}")
-endif()
-
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/proton.ini.in
-                ${CMAKE_CURRENT_BINARY_DIR}/proton.ini
-                @ONLY)
-
-install(TARGETS cproton
-        DESTINATION ${PHP_EXT_DIR}
-        COMPONENT PHP)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cproton.php
-        DESTINATION ${PHP_INCLUDE_DIR}
-        COMPONENT PHP)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/proton.php
-        DESTINATION ${PHP_INCLUDE_DIR}
-        COMPONENT PHP)
-
-if (NOT ${PHP_INI_DIR} STREQUAL "")
-  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/proton.ini
-    DESTINATION ${PHP_INI_DIR}
-    COMPONENT PHP)
-endif ()
diff --git a/proton-c/bindings/php/compat.swg b/proton-c/bindings/php/compat.swg
deleted file mode 100644
index d7ffce0..0000000
--- a/proton-c/bindings/php/compat.swg
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-%define CONVERT_LONG_LONG_IN(lvar,t,invar)
-  switch ((*(invar))->type) {
-      case IS_DOUBLE:
-          lvar = (t) (*(invar))->value.dval;
-          break;
-      case IS_STRING: {
-          char * endptr;
-          errno = 0;
-          lvar = (t) strtoll((*(invar))->value.str.val, &endptr, 10);
-          if (*endptr && !errno) break;
-          /* FALL THRU */
-      }
-      default:
-          convert_to_long_ex(invar);
-          lvar = (t) (*(invar))->value.lval;
-  }
-%enddef
-
-%pass_by_val(long long, CONVERT_LONG_LONG_IN);
-
-%typemap(out) long long
-%{
-  if ((long long)LONG_MIN <= $1 && $1 <= (long long)LONG_MAX) {
-    return_value->value.lval = (long)($1);
-    return_value->type = IS_LONG;
-  } else {
-    char temp[256];
-    sprintf(temp, "%lld", (long long)$1);
-    ZVAL_STRING(return_value, temp, 1);
-  }
-%}
diff --git a/proton-c/bindings/php/cproton.ini b/proton-c/bindings/php/cproton.ini
deleted file mode 100644
index dab3941..0000000
--- a/proton-c/bindings/php/cproton.ini
+++ /dev/null
@@ -1,21 +0,0 @@
-;;
-; Licensed to the Apache Software Foundation (ASF) under one
-; or more contributor license agreements.  See the NOTICE file
-; distributed with this work for additional information
-; regarding copyright ownership.  The ASF licenses this file
-; to you under the Apache License, Version 2.0 (the
-; "License"); you may not use this file except in compliance
-; with the License.  You may obtain a copy of the License at
-;
-;   http://www.apache.org/licenses/LICENSE-2.0
-;
-; Unless required by applicable law or agreed to in writing,
-; software distributed under the License is distributed on an
-; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-; KIND, either express or implied.  See the License for the
-; specific language governing permissions and limitations
-; under the License.
-;;
-
-; Enable cproton extension module
-extension=cproton.so
diff --git a/proton-c/bindings/php/get_include_dir.php b/proton-c/bindings/php/get_include_dir.php
deleted file mode 100644
index 6103e41..0000000
--- a/proton-c/bindings/php/get_include_dir.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-
-$prefix = $argv[1];
-$include_path = ini_get("include_path");
-
-$php_dir = null;
-$pear_dir = null;
-$abs_dir = null;
-
-foreach (explode(PATH_SEPARATOR, $include_path) as $include_dir) {
-  if (strpos($include_dir, ".") === false &&
-      strpos($include_dir, $prefix) === 0) {
-    $abs_dir = $include_dir;
-    $suffix = substr($abs_dir, strlen($prefix));
-    if (strpos($suffix, "php") !== false) {
-      $php_dir = $abs_dir;
-    }
-    if (strpos($suffix, "pear") !== false) {
-      $pear_dir = $abs_dir;
-    }
-  }
-}
-
-if ($php_dir) {
-  print $php_dir;
-} else if ($pear_dir) {
-  print $pear_dir;
-} else if ($abs_dir) {
-  print $abs_dir;
-}
-
-print "\n";
-
-?>
diff --git a/proton-c/bindings/php/php.i b/proton-c/bindings/php/php.i
deleted file mode 100644
index 6e927f7..0000000
--- a/proton-c/bindings/php/php.i
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-%module cproton
-
-// provided by SWIG development libraries
-%include php.swg
-
-#if SWIG_VERSION < 0x020000
-%include compat.swg
-#endif
-
-%header %{
-/* Include the headers needed by the code in this wrapper file */
-#include <proton/types.h>
-#include <proton/connection.h>
-#include <proton/condition.h>
-#include <proton/delivery.h>
-#include <proton/event.h>
-#include <proton/message.h>
-#include <proton/messenger.h>
-#include <proton/session.h>
-#include <proton/url.h>
-#include <proton/reactor.h>
-#include <proton/handlers.h>
-#include <proton/sasl.h>
-
-#define zend_error_noreturn zend_error
-%}
-
-%apply (char *STRING, int LENGTH) { (char *STRING, size_t LENGTH) };
-
-// ssize_t return value
-//
-%typemap(out) ssize_t {
-    ZVAL_LONG($result, (long)$1);
-}
-
-// (char **OUTPUT_BUFFER, ssize_t *OUTPUT_LEN)
-//
-// typemap for binary buffer output arguments.  Given an uninitialized pointer for a
-// buffer (OUTPUT_BUFFER) and a pointer to an un-initialized size/error (OUTPUT_LEN), a buffer
-// will be allocated and filled with binary data. *OUTPUT_BUFFER will be set to the address
-// of the allocated buffer.  *OUTPUT_LEN will be set to the size of the data.  The maximum
-// length of the buffer must be provided by a separate argument.
-//
-// The return value is an array, with [0] set to the length of the output buffer OR an
-// error code and [1] set to the returned string object.  This value is appended to the
-// function's return value (also an array).
-//
-%typemap(in,numinputs=0) (char **OUTPUT_BUFFER, ssize_t *OUTPUT_LEN) (char *Buff = 0, ssize_t outLen = 0) {
-    // setup locals for output.
-    $1 = &Buff;
-    $2 = &outLen;
-}
-%typemap(argout,fragment="t_output_helper") (char **OUTPUT_BUFFER, ssize_t *OUTPUT_LEN) {
-    // convert to array: [0]=len||error, [1]=binary string
-    zval *tmp;
-    ALLOC_INIT_ZVAL(tmp);
-    array_init(tmp);
-    ssize_t len = *($2);
-    add_next_index_long(tmp, len); // write the len|error code
-    if (len >= 0) {
-        add_next_index_stringl(tmp, *($1), len, 0);  // 0 == take ownership of $1 memory
-    } else {
-        add_next_index_string(tmp, "", 1);    // 1 = strdup the ""
-    }
-    t_output_helper(&$result, tmp);     // append it to output array
-}
-
-%typemap(in) pn_bytes_t {
-  if (ZVAL_IS_NULL(*$input)) {
-    $1.start = NULL;
-    $1.size = 0;
-  } else {
-    $1.start = Z_STRVAL_PP($input);
-    $1.size = Z_STRLEN_PP($input);
-  }
-}
-
-%typemap(out) pn_bytes_t {
-  ZVAL_STRINGL($result, $1.start, $1.size, 1);
-}
-
-%typemap(in) pn_uuid_t {
-  memmove($1.bytes, Z_STRVAL_PP($input), 16);
-}
-
-%typemap(out) pn_uuid_t {
-  ZVAL_STRINGL($result, $1.bytes, 16, 1);
-}
-
-%typemap(in) pn_decimal128_t {
-  memmove($1.bytes, Z_STRVAL_PP($input), 16);
-}
-
-%typemap(out) pn_decimal128_t {
-  ZVAL_STRINGL($result, $1.bytes, 16, 1);
-}
-
-// The PHP SWIG typedefs define the typemap STRING, LENGTH to be binary safe (allow
-// embedded \0's).
-//
-
-// allow pn_link_send/pn_input's input buffer to be binary safe
-ssize_t pn_link_send(pn_link_t *transport, char *STRING, size_t LENGTH);
-%ignore pn_link_send;
-ssize_t pn_transport_input(pn_transport_t *transport, char *STRING, size_t LENGTH);
-%ignore pn_transport_input;
-
-
-// Use the OUTPUT_BUFFER,OUTPUT_LEN typemap to allow these functions to return
-// variable length binary data.
-
-%rename(pn_link_recv) wrap_pn_link_recv;
-// in PHP:   array = pn_link_recv(link, MAXLEN);
-//           array[0] = size || error code
-//           array[1] = native string containing binary data
-%inline %{
-    void wrap_pn_link_recv(pn_link_t *link, size_t maxCount, char **OUTPUT_BUFFER, ssize_t *OUTPUT_LEN) {
-        *OUTPUT_BUFFER = emalloc(sizeof(char) * maxCount);
-        *OUTPUT_LEN = pn_link_recv(link, *OUTPUT_BUFFER, maxCount );
-    }
-%}
-%ignore pn_link_recv;
-
-%rename(pn_transport_output) wrap_pn_transport_output;
-// in PHP:   array = pn_transport_output(transport, MAXLEN);
-//           array[0] = size || error code
-//           array[1] = native string containing binary data
-%inline %{
-    void wrap_pn_transport_output(pn_transport_t *transport, size_t maxCount, char **OUTPUT_BUFFER, ssize_t *OUTPUT_LEN) {
-        *OUTPUT_BUFFER = emalloc(sizeof(char) * maxCount);
-        *OUTPUT_LEN = pn_transport_output(transport, *OUTPUT_BUFFER, maxCount);
-    }
-%}
-%ignore pn_transport_output;
-
-%rename(pn_message_encode) wrap_pn_message_encode;
-%inline %{
-    void wrap_pn_message_encode(pn_message_t *message, size_t maxCount, char **OUTPUT_BUFFER, ssize_t *OUTPUT_LEN) {
-        *OUTPUT_BUFFER = emalloc(sizeof(char) * maxCount);
-        *OUTPUT_LEN = maxCount;
-        int err = pn_message_encode(message, *OUTPUT_BUFFER, OUTPUT_LEN);
-        if (err) {
-          *OUTPUT_LEN = err;
-          efree(*OUTPUT_BUFFER);
-        }
-    }
-%}
-%ignore pn_message_encode;
-
-
-
-//
-// allow pn_delivery/pn_delivery_tag to accept a binary safe string:
-//
-
-%rename(pn_delivery) wrap_pn_delivery;
-// in PHP:   delivery = pn_delivery(link, "binary safe string");
-//
-%inline %{
-  pn_delivery_t *wrap_pn_delivery(pn_link_t *link, char *STRING, size_t LENGTH) {
-    return pn_delivery(link, pn_dtag(STRING, LENGTH));
-  }
-%}
-%ignore pn_delivery;
-
-// pn_delivery_tag: output a copy of the pn_delivery_tag buffer
-//
-%typemap(in,numinputs=0) (const char **RETURN_STRING, size_t *RETURN_LEN) (char *Buff = 0, size_t outLen = 0) {
-    $1 = &Buff;         // setup locals for holding output values.
-    $2 = &outLen;
-}
-%typemap(argout) (const char **RETURN_STRING, size_t *RETURN_LEN) {
-    // This allocates a copy of the binary buffer for return to the caller
-    ZVAL_STRINGL($result, *($1), *($2), 1); // 1 = duplicate the input buffer
-}
-
-// Suppress "Warning(451): Setting a const char * variable may leak memory." on pn_delivery_tag_t
-%warnfilter(451) pn_delivery_tag_t;
-%rename(pn_delivery_tag) wrap_pn_delivery_tag;
-// in PHP: str = pn_delivery_tag(delivery);
-//
-%inline %{
-    void wrap_pn_delivery_tag(pn_delivery_t *d, const char **RETURN_STRING, size_t *RETURN_LEN) {
-        pn_delivery_tag_t tag = pn_delivery_tag(d);
-        *RETURN_STRING = tag.start;
-        *RETURN_LEN = tag.size;
-    }
-%}
-%ignore pn_delivery_tag;
-
-
-
-//
-// reference counter management for passing a context to/from the listener/connector
-//
-
-%typemap(in) void *PHP_CONTEXT {
-    // since we hold a pointer to the context we must increment the reference count
-    Z_ADDREF_PP($input);
-    $1 = *$input;
-}
-
-// return the context.  Apparently, PHP won't let us return a pointer to a reference
-// counted zval, so we must return a copy of the data
-%typemap(out) void * {
-    *$result = *(zval *)($1);
-    zval_copy_ctor($result);
-}
-
-%include "proton/cproton.i"
diff --git a/proton-c/bindings/php/proton.ini.in b/proton-c/bindings/php/proton.ini.in
deleted file mode 100644
index 51a774e..0000000
--- a/proton-c/bindings/php/proton.ini.in
+++ /dev/null
@@ -1,21 +0,0 @@
-;;
-; Licensed to the Apache Software Foundation (ASF) under one
-; or more contributor license agreements.  See the NOTICE file
-; distributed with this work for additional information
-; regarding copyright ownership.  The ASF licenses this file
-; to you under the Apache License, Version 2.0 (the
-; "License"); you may not use this file except in compliance
-; with the License.  You may obtain a copy of the License at
-;
-;   http://www.apache.org/licenses/LICENSE-2.0
-;
-; Unless required by applicable law or agreed to in writing,
-; software distributed under the License is distributed on an
-; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-; KIND, either express or implied.  See the License for the
-; specific language governing permissions and limitations
-; under the License.
-;;
-
-; Enable cproton extension module
-@PROTON_INI@
diff --git a/proton-c/bindings/php/proton.php b/proton-c/bindings/php/proton.php
deleted file mode 100644
index 8cad1b2..0000000
--- a/proton-c/bindings/php/proton.php
+++ /dev/null
@@ -1,1119 +0,0 @@
-<?php
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- **/
-
-include("cproton.php");
-
-class ProtonException extends Exception {}
-
-class Timeout extends ProtonException {}
-
-class MessengerException extends ProtonException {}
-
-class MessageException extends ProtonException {}
-
-function code2exc($err) {
-  switch ($err) {
-  case PN_TIMEOUT:
-    return "Timeout";
-  default:
-    return null;
-  }
-}
-
-class Messenger
-{
-  private $impl;
-
-  public function __construct($name=null) {
-    $this->impl = pn_messenger($name);
-  }
-
-  public function __destruct() {
-    pn_messenger_free($this->impl);
-  }
-
-  public function __toString() {
-    return 'Messenger("' . pn_messenger_name($this->impl) . '")';
-  }
-
-  private function _check($value) {
-    if ($value < 0) {
-      $exc = code2exc($value);
-      if ($exc == null) $exc = "MessengerException";
-      throw new $exc("[$value]: " . pn_error_text(pn_messenger_error($this->impl)));
-    } else {
-      return $value;
-    }
-  }
-
-  public function __get($name) {
-    switch ($name) {
-    case "name":
-      return pn_messenger_name($this->impl);
-    case "certificate":
-      return pn_messenger_get_certificate($this->impl);
-    case "private_key":
-      return pn_messenger_get_private_key($this->impl);
-    case "password":
-      return pn_messenger_get_password($this->impl);
-    case "trusted_certificates":
-      return pn_messenger_get_trusted_certificates($this->impl);
-    case "incoming":
-      return $this->incoming();
-    case "outgoing":
-      return $this->outgoing();
-    default:
-      throw new Exception("unknown property: " . $name);
-    }
-  }
-
-  public function __set($name, $value) {
-    switch ($name) {
-    case "certificate":
-      $this->_check(pn_messenger_set_certificate($this->impl, $value));
-      break;
-    case "private_key":
-      $this->_check(pn_messenger_set_private_key($this->impl, $value));
-      break;
-    case "password":
-      $this->_check(pn_messenger_set_password($this->impl, $value));
-      break;
-    case "trusted_certificates":
-      $this->_check(pn_messenger_set_trusted_certificates($this->impl, $value));
-      break;
-    case "timeout":
-      $this->_check(pn_messenger_set_timeout($this->impl, $value));
-      break;
-    case "outgoing_window":
-      $this->_check(pn_messenger_set_outgoing_window($this->impl, $value));
-      break;
-    case "incoming_window":
-      $this->_check(pn_messenger_set_incoming_window($this->impl, $value));
-      break;
-    default:
-      throw new Exception("unknown property: " . $name);
-    }
-  }
-
-  public function start() {
-    $this->_check(pn_messenger_start($this->impl));
-  }
-
-  public function stop() {
-    $this->_check(pn_messenger_stop($this->impl));
-  }
-
-  public function subscribe($source) {
-    if ($source == null) {
-      throw new MessengerException("null source passed to subscribe");
-    }
-    $this->_check(pn_messenger_subscribe($this->impl, $source));
-  }
-
-  public function outgoing_tracker() {
-    return pn_messenger_outgoing_tracker($this->impl);
-  }
-
-  public function put($message) {
-    $message->_pre_encode();
-    $this->_check(pn_messenger_put($this->impl, $message->impl));
-    return $this->outgoing_tracker();
-  }
-
-  public function send($n = -1) {
-    $this->_check(pn_messenger_send($this->impl, $n));
-  }
-
-  public function recv($n = -1) {
-    $this->_check(pn_messenger_recv($this->impl, $n));
-  }
-
-  public function incoming_tracker() {
-    return pn_messenger_incoming_tracker($this->impl);
-  }
-
-  public function get($message) {
-    $this->_check(pn_messenger_get($this->impl, $message->impl));
-    $message->_post_decode();
-    return $this->incoming_tracker();
-  }
-
-  public function accept($tracker = null) {
-    if ($tracker == null) {
-      $tracker = $this->incoming_tracker();
-      $flag = PN_CUMULATIVE;
-    } else {
-      $flag = 0;
-    }
-    $this->_check(pn_messenger_accept($this->impl, $tracker, $flag));
-  }
-
-  public function reject($tracker = null) {
-    if ($tracker == null) {
-      $tracker = $this->incoming_tracker();
-      $flag = PN_CUMULATIVE;
-    } else {
-      $flag = 0;
-    }
-    $this->_check(pn_messenger_reject($this->impl, $tracker, $flag));
-  }
-
-  public function route($pattern, $address) {
-    $this->_check(pn_messenger_route($this->impl, $pattern, $address));
-  }
-
-  public function outgoing() {
-    return pn_messenger_outgoing($this->impl);
-  }
-
-  public function incoming() {
-    return pn_messenger_incoming($this->impl);
-  }
-
-  public function status($tracker) {
-    return pn_messenger_status($this->impl, $tracker);
-  }
-
-}
-
-class Message {
-
-  const DEFAULT_PRIORITY = PN_DEFAULT_PRIORITY;
-
-  var $impl;
-  var $_id;
-  var $_correlation_id;
-  public $instructions = null;
-  public $annotations = null;
-  public $properties = null;
-  public $body = null;
-
-  public function __construct() {
-    $this->impl = pn_message();
-    $this->_id = new Data(pn_message_id($this->impl));
-    $this->_correlation_id = new Data(pn_message_correlation_id($this->impl));
-  }
-
-  public function __destruct() {
-    pn_message_free($this->impl);
-  }
-
-  public function __tostring() {
-    $tmp = pn_string("");
-    pn_inspect($this->impl, $tmp);
-    $result = pn_string_get($tmp);
-    pn_free($tmp);
-    return $result;
-  }
-
-  private function _check($value) {
-    if ($value < 0) {
-      $exc = code2exc($value);
-      if ($exc == null) $exc = "MessageException";
-      throw new $exc("[$value]: " . pn_message_error($this->impl));
-    } else {
-      return $value;
-    }
-  }
-
-  public function __get($name) {
-    if ($name == "impl")
-      throw new Exception();
-    $getter = "_get_$name";
-    return $this->$getter();
-  }
-
-  public function __set($name, $value) {
-    $setter = "_set_$name";
-    $this->$setter($value);
-  }
-
-  function _pre_encode() {
-    $inst = new Data(pn_message_instructions($this->impl));
-    $ann = new Data(pn_message_annotations($this->impl));
-    $props = new Data(pn_message_properties($this->impl));
-    $body = new Data(pn_message_body($this->impl));
-
-    $inst->clear();
-    if ($this->instructions != null)
-      $inst->put_object($this->instructions);
-    $ann->clear();
-    if ($this->annotations != null)
-      $ann->put_object($this->annotations);
-    $props->clear();
-    if ($this->properties != null)
-      $props->put_object($this->properties);
-
-    $body->clear();
-    if ($this->body != null) {
-      $body->put_object($this->body);
-    }
-  }
-
-  function _post_decode() {
-    $inst = new Data(pn_message_instructions($this->impl));
-    $ann = new Data(pn_message_annotations($this->impl));
-    $props = new Data(pn_message_properties($this->impl));
-    $body = new Data(pn_message_body($this->impl));
-
-    if ($inst->next())
-      $this->instructions = $inst->get_object();
-    else
-      $this->instructions = null;
-    if ($ann->next())
-      $this->annotations = $ann->get_object();
-    else
-      $this->annotations = null;
-    if ($props->next())
-      $this->properties = $props->get_object();
-    else
-      $this->properties = null;
-    if ($body->next())
-      $this->body = $body->get_object();
-    else
-      $this->body = null;
-  }
-
-  public function clear() {
-    pn_message_clear($this->impl);
-    $this->instructions = null;
-    $this->annotations = null;
-    $this->properties = null;
-    $this->body = null;
-  }
-
-  private function _get_inferred() {
-    return pn_message_is_inferred($this->impl);
-  }
-
-  private function _set_inferred($value) {
-    $this->_check(pn_message_set_inferred($this->impl, $value));
-  }
-
-  private function _get_durable() {
-    return pn_message_is_durable($this->impl);
-  }
-
-  private function _set_durable($value) {
-    $this->_check(pn_message_set_durable($this->impl, $value));
-  }
-
-  private function _get_priority() {
-    return pn_message_get_priority($this->impl);
-  }
-
-  private function _set_priority($value) {
-    $this->_check(pn_message_set_priority($this->impl, $value));
-  }
-
-  private function _get_ttl() {
-    return pn_message_get_ttl($this->impl);
-  }
-
-  private function _set_ttl($value) {
-    $this->_check(pn_message_set_ttl($this->impl, $value));
-  }
-
-  private function _get_first_acquirer() {
-    return pn_message_is_first_acquirer($this->impl);
-  }
-
-  private function _set_first_acquirer($value) {
-    $this->_check(pn_message_set_first_acquirer($this->impl, $value));
-  }
-
-  private function _get_delivery_count() {
-    return pn_message_get_delivery_count($this->impl);
-  }
-
-  private function _set_delivery_count($value) {
-    $this->_check(pn_message_set_delivery_count($this->impl, $value));
-  }
-
-  private function _get_id() {
-    return $this->_id->get_object();
-  }
-
-  private function _set_id($value) {
-    $this->_id->rewind();
-    $this->_id->put_object($value);
-  }
-
-  private function _get_user_id() {
-    return pn_message_get_user_id($this->impl);
-  }
-
-  private function _set_user_id($value) {
-    $this->_check(pn_message_set_user_id($this->impl, $value));
-  }
-
-  private function _get_address() {
-    return pn_message_get_address($this->impl);
-  }
-
-  private function _set_address($value) {
-    $this->_check(pn_message_set_address($this->impl, $value));
-  }
-
-  private function _get_subject() {
-    return pn_message_get_subject($this->impl);
-  }
-
-  private function _set_subject($value) {
-    $this->_check(pn_message_set_subject($this->impl, $value));
-  }
-
-  private function _get_reply_to() {
-    return pn_message_get_reply_to($this->impl);
-  }
-
-  private function _set_reply_to($value) {
-    $this->_check(pn_message_set_reply_to($this->impl, $value));
-  }
-
-  private function _get_correlation_id() {
-    return $this->_correlation_id->get_object();
-  }
-
-  private function _set_correlation_id($value) {
-    $this->_correlation_id->rewind();
-    $this->_correlation_id->put_object($value);
-  }
-
-  private function _get_content_type() {
-    return pn_message_get_content_type($this->impl);
-  }
-
-  private function _set_content_type($value) {
-    $this->_check(pn_message_set_content_type($this->impl, $value));
-  }
-
-  private function _get_content_encoding() {
-    return pn_message_get_content_encoding($this->impl);
-  }
-
-  private function _set_content_encoding($value) {
-    $this->_check(pn_message_set_content_encoding($this->impl, $value));
-  }
-
-  private function _get_expiry_time() {
-    return pn_message_get_expiry_time($this->impl);
-  }
-
-  private function _set_expiry_time($value) {
-    $this->_check(pn_message_set_expiry_time($this->impl, $value));
-  }
-
-  private function _get_creation_time() {
-    return pn_message_get_creation_time($this->impl);
-  }
-
-  private function _set_creation_time($value) {
-    $this->_check(pn_message_set_creation_time($this->impl, $value));
-  }
-
-  private function _get_group_id() {
-    return pn_message_get_group_id($this->impl);
-  }
-
-  private function _set_group_id($value) {
-    $this->_check(pn_message_set_group_id($this->impl, $value));
-  }
-
-  private function _get_group_sequence() {
-    return pn_message_get_group_sequence($this->impl);
-  }
-
-  private function _set_group_sequence($value) {
-    $this->_check(pn_message_set_group_sequence($this->impl, $value));
-  }
-
-  private function _get_reply_to_group_id() {
-    return pn_message_get_reply_to_group_id($this->impl);
-  }
-
-  private function _set_reply_to_group_id($value) {
-    $this->_check(pn_message_set_reply_to_group_id($this->impl, $value));
-  }
-
-  public function encode() {
-    $this->_pre_encode();
-    $sz = 16;
-    while (true) {
-      list($err, $data) = pn_message_encode($this->impl, $sz);
-      if ($err == PN_OVERFLOW) {
-        $sz *= 2;
-        continue;
-      } else {
-        $this->_check($err);
-        return $data;
-      }
-    }
-  }
-
-  public function decode($data) {
-    $this->_check(pn_message_decode($this->impl, $data, strlen($data)));
-    $this->_post_decode();
-  }
-}
-
-class Binary {
-
-  public $bytes;
-
-  public function __construct($bytes) {
-    $this->bytes = $bytes;
-  }
-
-  public function __tostring() {
-    return "Binary($this->bytes)";
-  }
-
-}
-
-class Symbol {
-
-  public $name;
-
-  public function __construct($name) {
-    $this->name = $name;
-  }
-
-  public function __tostring() {
-    return "Symbol($this->name)";
-  }
-
-}
-
-class UUID {
-
-  public $bytes;
-
-  public function __construct($bytes) {
-    if (strlen($bytes) != 16) {
-      throw new Exception("invalid argument: exactly 16 bytes required");
-    }
-    $this->bytes = $bytes;
-  }
-
-  public function __tostring() {
-    $b = $this->bytes;
-    return sprintf("UUID(%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x)",
-                   ord($b[0]), ord($b[1]), ord($b[2]), ord($b[3]),
-                   ord($b[4]), ord($b[5]), ord($b[6]), ord($b[7]), ord($b[8]), ord($b[9]),
-                   ord($b[10]), ord($b[11]), ord($b[12]), ord($b[13]), ord($b[14]), ord($b[15]));
-  }
-
-}
-
-class PList {
-
-  public $elements;
-
-  public function __construct() {
-    $this->elements = func_get_args();
-  }
-
-  public function __tostring() {
-    return "PList(" . implode(", ", $this->elements) . ")";
-  }
-
-}
-
-class Char {
-
-  public $codepoint;
-
-  public function __construct($codepoint) {
-    $this->codepoint = $codepoint;
-  }
-
-  public function __tostring() {
-    return "Char($this->codepoint)";
-  }
-
-}
-
-class Described {
-
-  public $descriptor;
-  public $value;
-
-  public function __construct($descriptor, $value) {
-    $this->descriptor = $descriptor;
-    $this->value = $value;
-  }
-
-  public function __tostring() {
-    return "Described($this->descriptor, $this->value)";
-  }
-
-}
-
-class DataException extends ProtonException {}
-
-class Data {
-
-  const NULL = PN_NULL;
-  const BOOL = PN_BOOL;
-  const UBYTE = PN_UBYTE;
-  const BYTE = PN_BYTE;
-  const USHORT = PN_USHORT;
-  const SHORT = PN_SHORT;
-  const UINT = PN_UINT;
-  const INT = PN_INT;
-  const CHAR = PN_CHAR;
-  const ULONG = PN_ULONG;
-  const LONG = PN_LONG;
-  const TIMESTAMP = PN_TIMESTAMP;
-  const FLOAT = PN_FLOAT;
-  const DOUBLE = PN_DOUBLE;
-  const DECIMAL32 = PN_DECIMAL32;
-  const DECIMAL64 = PN_DECIMAL64;
-  const DECIMAL128 = PN_DECIMAL128;
-  const UUID = PN_UUID;
-  const BINARY = PN_BINARY;
-  const STRING = PN_STRING;
-  const SYMBOL = PN_SYMBOL;
-  const DESCRIBED = PN_DESCRIBED;
-  const PARRAY = PN_ARRAY;
-  const PLIST = PN_LIST;
-  const MAP = PN_MAP;
-
-  private $impl;
-  private $free;
-
-  public function __construct($capacity=16) {
-    if (is_int($capacity)) {
-      $this->impl = pn_data($capacity);
-      $this->free = true;
-    } else {
-      $this->impl = $capacity;
-      $this->free = false;
-    }
-  }
-
-  public function __destruct() {
-    if ($this->free)
-      pn_data_free($this->impl);
-  }
-
-  public function _check($value) {
-    if ($value < 0) {
-      $exc = code2exc($value);
-      if ($exc == null) $exc = "DataException";
-      throw new $exc("[$value]");
-    } else {
-      return $value;
-    }
-  }
-
-  public function clear() {
-    pn_data_clear($this->impl);
-  }
-
-  public function rewind() {
-    pn_data_rewind($this->impl);
-  }
-
-  public function next() {
-    $found = pn_data_next($this->impl);
-    if ($found)
-      return $this->type();
-    else
-      return null;
-  }
-
-  public function prev() {
-    $found = pn_data_prev($this->impl);
-    if ($found)
-      return $this->type();
-    else
-      return null;
-  }
-
-  public function enter() {
-    return pn_data_enter($this->impl);
-  }
-
-  public function exit_() {
-    return pn_data_exit($this->impl);
-  }
-
-  public function type() {
-    $dtype = pn_data_type($this->impl);
-    if ($dtype == -1)
-      return null;
-    else
-      return $dtype;
-  }
-
-  public function encode() {
-    $size = 1024;
-    while (true) {
-      list($cd, $enc) = pn_data_encode($this->impl, $size);
-      if ($cd == PN_OVERFLOW)
-        $size *= 2;
-      else if ($cd >= 0)
-        return $enc;
-      else
-        $this->_check($cd);
-    }
-  }
-
-  public function decode($encoded) {
-    return $this->_check(pn_data_decode($this->impl, $encoded));
-  }
-
-  public function put_list() {
-    $this->_check(pn_data_put_list($this->impl));
-  }
-
-  public function put_map() {
-    $this->_check(pn_data_put_map($this->impl));
-  }
-
-  public function put_array($described, $element_type) {
-    $this->_check(pn_data_put_array($this->impl, $described, $element_type));
-  }
-
-  public function put_described() {
-    $this->_check(pn_data_put_described($this->impl));
-  }
-
-  public function put_null() {
-    $this->_check(pn_data_put_null($this->impl));
-  }
-
-  public function put_bool($b) {
-    $this->_check(pn_data_put_bool($this->impl, $b));
-  }
-
-  public function put_ubyte($ub) {
-    $this->_check(pn_data_put_ubyte($this->impl, $ub));
-  }
-
-  public function put_byte($b) {
-    $this->_check(pn_data_put_byte($this->impl, $b));
-  }
-
-  public function put_ushort($us) {
-    $this->_check(pn_data_put_ushort($this->impl, $us));
-  }
-
-  public function put_short($s) {
-    $this->_check(pn_data_put_short($this->impl, $s));
-  }
-
-  public function put_uint($ui) {
-    $this->_check(pn_data_put_uint($this->impl, $ui));
-  }
-
-  public function put_int($i) {
-    $this->_check(pn_data_put_int($this->impl, $i));
-  }
-
-  public function put_char($c) {
-    if ($c instanceof Char) {
-      $c = $c->codepoint;
-    } else {
-      $c = ord($c);
-    }
-    $this->_check(pn_data_put_char($this->impl, $c));
-  }
-
-  public function put_ulong($ul) {
-    $this->_check(pn_data_put_ulong($this->impl, $ul));
-  }
-
-  public function put_long($l) {
-    $this->_check(pn_data_put_long($this->impl, $l));
-  }
-
-  public function put_timestamp($t) {
-    $this->_check(pn_data_put_timestamp($this->impl, $t));
-  }
-
-  public function put_float($f) {
-    $this->_check(pn_data_put_float($this->impl, $f));
-  }
-
-  public function put_double($d) {
-    $this->_check(pn_data_put_double($this->impl, $d));
-  }
-
-  public function put_decimal32($d) {
-    $this->_check(pn_data_put_decimal32($this->impl, $d));
-  }
-
-  public function put_decimal64($d) {
-    $this->_check(pn_data_put_decimal64($this->impl, $d));
-  }
-
-  public function put_decimal128($d) {
-    $this->_check(pn_data_put_decimal128($this->impl, $d));
-  }
-
-  public function put_uuid($u) {
-    if ($u instanceof UUID) {
-      $u = $u->bytes;
-    }
-    $this->_check(pn_data_put_uuid($this->impl, $u));
-  }
-
-  public function put_binary($b) {
-    if ($b instanceof Binary) {
-      $b = $b->bytes;
-    }
-    $this->_check(pn_data_put_binary($this->impl, $b));
-  }
-
-  public function put_string($s) {
-    $this->_check(pn_data_put_string($this->impl, $s));
-  }
-
-  public function put_symbol($s) {
-    if ($s instanceof Symbol) {
-      $s = $s->name;
-    }
-    $this->_check(pn_data_put_symbol($this->impl, $s));
-  }
-
-  public function get_list() {
-    return pn_data_get_list($this->impl);
-  }
-
-  public function get_map() {
-    return pn_data_get_map($this->impl);
-  }
-
-  public function get_array() {
-    $count = pn_data_get_array($this->impl);
-    $described = pn_data_is_array_described($this->impl);
-    $type = pn_data_get_array_type($this->impl);
-    if ($type == -1)
-      $type = null;
-    return array($count, $described, $type);
-  }
-
-  public function is_described() {
-    return pn_data_is_described($this->impl);
-  }
-
-  public function is_null() {
-    $this->_check(pn_data_get_null($this->impl));
-  }
-
-  public function get_bool() {
-    return pn_data_get_bool($this->impl);
-  }
-
-  public function get_ubyte() {
-    return pn_data_get_ubyte($this->impl);
-  }
-
-  public function get_byte() {
-    return pn_data_get_byte($this->impl);
-  }
-
-  public function get_ushort() {
-    return pn_data_get_ushort($this->impl);
-  }
-
-  public function get_short() {
-    return pn_data_get_short($this->impl);
-  }
-
-  public function get_uint() {
-    return pn_data_get_uint($this->impl);
-  }
-
-  public function get_int() {
-    return pn_data_get_int($this->impl);
-  }
-
-  public function get_char() {
-    return new Char(pn_data_get_char($this->impl));
-  }
-
-  public function get_ulong() {
-    return pn_data_get_ulong($this->impl);
-  }
-
-  public function get_long() {
-    return pn_data_get_long($this->impl);
-  }
-
-  public function get_timestamp() {
-    return pn_data_get_timestamp($this->impl);
-  }
-
-  public function get_float() {
-    return pn_data_get_float($this->impl);
-  }
-
-  public function get_double() {
-    return pn_data_get_double($this->impl);
-  }
-
-  # XXX: need to convert
-  public function get_decimal32() {
-    return pn_data_get_decimal32($this->impl);
-  }
-
-  # XXX: need to convert
-  public function get_decimal64() {
-    return pn_data_get_decimal64($this->impl);
-  }
-
-  # XXX: need to convert
-  public function get_decimal128() {
-    return pn_data_get_decimal128($this->impl);
-  }
-
-  public function get_uuid() {
-    if (pn_data_type($this->impl) == Data::UUID)
-      return new UUID(pn_data_get_uuid($this->impl));
-    else
-      return null;
-  }
-
-  public function get_binary() {
-    return new Binary(pn_data_get_binary($this->impl));
-  }
-
-  public function get_string() {
-    return pn_data_get_string($this->impl);
-  }
-
-  public function get_symbol() {
-    return new Symbol(pn_data_get_symbol($this->impl));
-  }
-
-  public function copy($src) {
-    $this->_check(pn_data_copy($this->impl, $src->impl));
-  }
-
-  public function format() {
-    $sz = 16;
-    while (true) {
-      list($err, $result) = pn_data_format($this->impl, $sz);
-      if ($err == PN_OVERFLOW) {
-        $sz *= 2;
-        continue;
-      } else {
-        $this->_check($err);
-        return $result;
-      }
-    }
-  }
-
-  public function dump() {
-    pn_data_dump($this->impl);
-  }
-
-  public function get_null() {
-    return null;
-  }
-
-  public function get_php_described() {
-    if ($this->enter()) {
-      try {
-        $this->next();
-        $descriptor = $this->get_object();
-        $this->next();
-        $value = $this->get_object();
-        $this->exit_();
-      } catch (Exception $e) {
-        $this->exit_();
-        throw $e;
-      }
-      return new Described($descriptor, $value);
-    }
-  }
-
-  public function get_php_array() {
-    if ($this->enter()) {
-      try {
-        $result = array();
-        while ($this->next()) {
-          $result[] = $this->get_object();
-        }
-        $this->exit_();
-      } catch (Exception $e) {
-        $this->exit_();
-        throw $e;
-      }
-      return $result;
-    }
-  }
-
-  public function put_php_list($lst) {
-    $this->put_list();
-    $this->enter();
-    try {
-      foreach ($lst->elements as $e) {
-        $this->put_object($e);
-      }
-      $this->exit_();
-    } catch (Exception $e) {
-      $this->exit_();
-      throw $e;
-    }
-  }
-
-  public function get_php_list() {
-    if ($this->enter()) {
-      try {
-        $result = new PList();
-        while ($this->next()) {
-          $result->elements[] = $this->get_object();
-        }
-        $this->exit_();
-      } catch (Exception $e) {
-        $this->exit_();
-        throw $e;
-      }
-
-      return $result;
-    }
-  }
-
-  public function put_php_map($ary) {
-    $this->put_map();
-    $this->enter();
-    try {
-      foreach ($ary as $k => $v) {
-        $this->put_object($k);
-        $this->put_object($v);
-      }
-      $this->exit_();
-    } catch (Exception $e) {
-      $this->exit_();
-      throw $e;
-    }
-  }
-
-  public function get_php_map() {
-    if ($this->enter()) {
-      try {
-        $result = array();
-        while ($this->next()) {
-          $k = $this->get_object();
-          switch ($this->type()) {
-          case Data::BINARY:
-            $k = $k->bytes;
-            break;
-          case Data::SYMBOL:
-            $k = $k->name;
-            break;
-          case Data::STRING:
-          case Data::UBYTE:
-          case Data::BYTE:
-          case Data::USHORT:
-          case Data::SHORT:
-          case Data::UINT:
-          case Data::INT:
-          case Data::ULONG:
-          case Data::LONG:
-            break;
-          default:
-            $k = "$k";
-            break;
-          }
-          if ($this->next())
-            $v = $this->get_object();
-          else
-            $v = null;
-          $result[$k] = $v;
-        }
-        $this->exit_();
-      } catch (Exception $e) {
-        $this->exit_();
-        throw $e;
-      }
-      return $result;
-    }
-  }
-
-  private $put_mappings = array
-    ("NULL" => "put_null",
-     "boolean" => "put_bool",
-     "UUID" => "put_uuid",
-     "string" => "put_string",
-     "Binary" => "put_binary",
-     "Symbol" => "put_symbol",
-     "integer" => "put_long",
-     "Char" => "put_char",
-     "double" => "put_double",
-     "Described" => "put_php_described",
-     "PList" => "put_php_list",
-     "array" => "put_php_map"
-     );
-  private $get_mappings = array
-    (Data::NULL => "get_null",
-     Data::BOOL => "get_bool",
-     Data::UBYTE => "get_ubyte",
-     Data::BYTE => "get_byte",
-     Data::USHORT => "get_ushort",
-     Data::SHORT => "get_short",
-     Data::UINT => "get_uint",
-     Data::INT => "get_int",
-     Data::CHAR => "get_char",
-     Data::ULONG => "get_ulong",
-     Data::LONG => "get_long",
-     Data::TIMESTAMP => "get_timestamp",
-     Data::FLOAT => "get_float",
-     Data::DOUBLE => "get_double",
-     Data::DECIMAL32 => "get_decimal32",
-     Data::DECIMAL64 => "get_decimal64",
-     Data::DECIMAL128 => "get_decimal128",
-     Data::UUID => "get_uuid",
-     Data::BINARY => "get_binary",
-     Data::STRING => "get_string",
-     Data::SYMBOL => "get_symbol",
-     Data::DESCRIBED => "get_php_described",
-     Data::PARRAY => "get_php_array",
-     Data::PLIST => "get_php_list",
-     Data::MAP => "get_php_map"
-     );
-
-  public function put_object($obj) {
-    $type = gettype($obj);
-    if ($type == "object") {
-      $type = get_class($obj);
-    }
-    $putter = $this->put_mappings[$type];
-    if ($putter == null)
-      throw new DataException("unknown type: $type");
-    $this->$putter($obj);
-  }
-
-  public function get_object() {
-    $type = $this->type();
-    if ($type == null) return null;
-    $getter = $this->get_mappings[$type];
-    return $this->$getter();
-  }
-
-}
-
-?>
diff --git a/proton-c/bindings/php/tests.php b/proton-c/bindings/php/tests.php
deleted file mode 100644
index 8ae45cf..0000000
--- a/proton-c/bindings/php/tests.php
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-
-include("proton.php");
-
-function round_trip($body) {
-  $msg = new Message();
-  $msg->inferred = true;
-  $msg->durable = true;
-  $msg->id = 10;
-  $msg->correlation_id = "asdf";
-  $msg->properties = array();
-  $msg->properties["null"] = null;
-  $msg->properties["boolean"] = true;
-  $msg->properties["integer"] = 123;
-  $msg->properties["double"] = 3.14159;
-  $msg->properties["binary"] = new Binary("binary");
-  $msg->properties["symbol"] = new Symbol("symbol");
-  $msg->properties["uuid"] = new UUID("1234123412341234");
-  $msg->properties["list"] = new PList(1, 2, 3, 4);
-  $msg->properties["char"] = new Char(321);
-  $msg->body = $body;
-  assert($msg->id == 10);
-  assert($msg->correlation_id == "asdf");
-
-  $copy = new Message();
-  $copy->decode($msg->encode());
-  assert($copy->id == $msg->id);
-  assert($copy->correlation_id == $msg->correlation_id);
-  $diff = array_diff($msg->properties, $copy->properties);
-  assert($copy->durable == $msg->durable);
-  assert(count($diff) == 0);
-  assert($copy->body == $msg->body);
-}
-
-round_trip("this is a string body");
-round_trip(new Binary("this is a binary body"));
-round_trip(new Symbol("this is a symbol body"));
-round_trip(true);
-round_trip(1234);
-round_trip(3.14159);
-round_trip(array("pi" => 3.14159, "blueberry-pi" => "yummy"));
-
-?>
diff --git a/proton-c/bindings/python/CMakeLists.txt b/proton-c/bindings/python/CMakeLists.txt
deleted file mode 100644
index fe732d9..0000000
--- a/proton-c/bindings/python/CMakeLists.txt
+++ /dev/null
@@ -1,179 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# NB For python the SWIG module name must have the same name as the input .i file for CMake to generate the
-# correct dependencies
-
-set(CMAKE_SWIG_FLAGS "-threads")
-
-include_directories (${PYTHON_INCLUDE_PATH})
-
-set_source_files_properties(cproton.i PROPERTIES CPLUSPLUS NO)
-
-# Suppress warnings in swig generated code.
-set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
-
-list(APPEND SWIG_MODULE_cproton_EXTRA_DEPS
-    ${CMAKE_SOURCE_DIR}/proton-c/include/proton/cproton.i
-    ${PROTON_HEADERS}
-)
-
-swig_add_module(cproton python cproton.i)
-swig_link_libraries(cproton ${BINDING_DEPS} ${PYTHON_LIBRARIES})
-set_target_properties(${SWIG_MODULE_cproton_REAL_NAME}
-    PROPERTIES
-    LINK_FLAGS "${CATCH_UNDEFINED}")
-
-find_package(PythonInterp REQUIRED)
-
-if (CHECK_SYSINSTALL_PYTHON)
-  execute_process(COMMAND ${PYTHON_EXECUTABLE}
-    -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))"
-    OUTPUT_VARIABLE PYTHON_SITEARCH_PACKAGES_DEFAULT
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
-else ()
-  set (PYTHON_SITEARCH_PACKAGES_DEFAULT ${BINDINGS_DIR}/python)
-endif ()
-
-if (NOT PYTHON_SITEARCH_PACKAGES)
-  set (PYTHON_SITEARCH_PACKAGES ${PYTHON_SITEARCH_PACKAGES_DEFAULT})
-endif()
-
-set (pysrc-generated cproton.py)
-set (pysrc
-    proton/__init__.py
-    proton/handlers.py
-    proton/reactor.py
-    proton/utils.py
-    proton/wrapper.py
-    proton/_compat.py
-    )
-# extra files included in the source distribution
-set(py_dist_files
-    cproton.i
-    MANIFEST.in
-    setuputils
-    docs
-    )
-
-macro (py_compile directory files artifacts)
-  foreach (src_file ${files})
-    install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -c \"import py_compile; py_compile.compile('${src_file}', cfile='${src_file}c')\"
-                                  WORKING_DIRECTORY ${directory})")
-    install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -c \"import py_compile; py_compile.compile('${src_file}', cfile='${src_file}o')\"
-                                  WORKING_DIRECTORY ${directory})")
-    list(APPEND ${artifacts} ${directory}/${src_file}
-      ${directory}/${src_file}c
-      ${directory}/${src_file}o)
-  endforeach (src_file)
-endmacro(py_compile)
-
-py_compile(${CMAKE_CURRENT_BINARY_DIR} ${pysrc-generated} CPROTON_ARTIFACTS)
-py_compile(${CMAKE_CURRENT_SOURCE_DIR} "${pysrc}" PROTON_ARTIFACTS)
-
-find_program(EPYDOC_EXE epydoc)
-mark_as_advanced (EPYDOC_EXE)
-if (EPYDOC_EXE)
-   foreach (py_src_doc ${pysrc})
-     list(APPEND PY_DOC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${py_src_doc}")
-   endforeach(py_src_doc)
-   add_custom_target(docs-py COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../../env.py --
-     PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_CURRENT_SOURCE_DIR}
-     ${EPYDOC_EXE} -v --no-private --html -o ${CMAKE_CURRENT_BINARY_DIR}/html
-     ${PY_DOC_FILES}
-     DEPENDS ${SWIG_MODULE_${cproton}_REAL_NAME})
-   add_dependencies(docs docs-py)
-   install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html/"
-           DESTINATION "${PROTON_SHARE}/docs/api-py"
-           COMPONENT documentation
-           OPTIONAL)
-endif (EPYDOC_EXE)
-
-find_program(SPHINX_EXE sphinx-build)
-mark_as_advanced (SPHINX_EXE)
-if (SPHINX_EXE)
-   add_custom_target(tutorial-py COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../../env.py --
-     PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CMAKE_CURRENT_SOURCE_DIR}
-     ${SPHINX_EXE} -b html ${CMAKE_CURRENT_SOURCE_DIR}/docs ${CMAKE_CURRENT_BINARY_DIR}/tutorial)
-   add_dependencies(docs tutorial-py)
-   install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/tutorial/"
-           DESTINATION "${PROTON_SHARE}/docs/tutorial-py"
-           COMPONENT documentation
-           OPTIONAL)
-endif (SPHINX_EXE)
-
-install(FILES ${CPROTON_ARTIFACTS}
-        DESTINATION ${PYTHON_SITEARCH_PACKAGES}
-        COMPONENT Python)
-install(FILES ${PROTON_ARTIFACTS}
-        DESTINATION "${PYTHON_SITEARCH_PACKAGES}/proton/"
-        COMPONENT Python)
-install(TARGETS ${SWIG_MODULE_cproton_REAL_NAME}
-        DESTINATION ${PYTHON_SITEARCH_PACKAGES}
-        COMPONENT Python)
-
-set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "html;tutorial")
-
-#
-# Set up the directory 'dist' for building the python native package
-# source distribution for Pypi/pip
-#
-
-set(py_dist_dir ${CMAKE_CURRENT_BINARY_DIR}/dist)
-
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in
-               ${py_dist_dir}/setup.py
-)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/README.rst.in
-               ${py_dist_dir}/README.rst
-)
-
-file(COPY ${py_dist_files} DESTINATION ${py_dist_dir})
-
-file(MAKE_DIRECTORY ${py_dist_dir}/proton)
-file(COPY ${pysrc} DESTINATION ${py_dist_dir}/proton)
-
-add_custom_target(py_src_dist ALL)
-add_dependencies(py_src_dist generated_c_files)
-file(MAKE_DIRECTORY ${py_dist_dir}/proton-c)
-
-# copy generated source files from the binary dir to the dist
-foreach(sfile ${qpid-proton-include-generated})
-  string(REPLACE ${CMAKE_BINARY_DIR} ${py_dist_dir} dfile ${sfile})
-  add_custom_command(TARGET py_src_dist
-                     COMMAND ${CMAKE_COMMAND} -E
-                         copy ${sfile} ${dfile})
-endforeach()
-
-# copy the proton C sources to the dist
-set (all_src
-  ${qpid-proton-core}
-  ${qpid-proton-extra}
-  ${qpid-proton-include}
-  ${qpid-proton-include-extra}
-  ${qpid-proton-layers-all}
-  ${qpid-proton-platform-all}
-  ${qpid-proton-private-includes}
-  include/proton/cproton.i
-)
-foreach(sfile ${all_src})
-  add_custom_command(TARGET py_src_dist
-                     COMMAND ${CMAKE_COMMAND} -E
-                         copy ${CMAKE_SOURCE_DIR}/proton-c/${sfile} ${py_dist_dir}/proton-c/${sfile})
-endforeach()
diff --git a/proton-c/bindings/python/MANIFEST.in b/proton-c/bindings/python/MANIFEST.in
deleted file mode 100644
index a37ad72..0000000
--- a/proton-c/bindings/python/MANIFEST.in
+++ /dev/null
@@ -1,5 +0,0 @@
-graft docs
-graft setuputils
-graft proton-c
-global-exclude proton-c *.pyc *.pyo
-
diff --git a/proton-c/bindings/python/PACKAGING.txt b/proton-c/bindings/python/PACKAGING.txt
deleted file mode 100644
index fa127f0..0000000
--- a/proton-c/bindings/python/PACKAGING.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-This document describes how to build a native Python source package.
-This can be used to install the Python bindings via pip.
-
-First configure the project using 'cmake' then build it. You do not
-need to install the project. See the INSTALL.md file at the project's
-top directory for details on building.
-
-Once you have built the project, there should be a 'dist' directory in
-the Python bindings directory in the build directory.
-
-For example, assuming the build directory is named 'build':
-
-$ cd build/proton-c/bindings/python/dist
-
-You can now run the setup.py script from within the dist directory to
-build your source distribution package.
-
-To build a Python source distribution:
-
-$ python ./setup.py sdist
-
-To build and install:
-
-$ python ./setup.py build install
-
-
diff --git a/proton-c/bindings/python/README.rst.in b/proton-c/bindings/python/README.rst.in
deleted file mode 100644
index 8be1dd3..0000000
--- a/proton-c/bindings/python/README.rst.in
+++ /dev/null
@@ -1,11 +0,0 @@
-Python bindings for Qpid Proton
-===============================
-
-This module provides version @PN_VERSION_MAJOR@.@PN_VERSION_MINOR@.@PN_VERSION_POINT@ of the Proton AMQP messaging toolkit.
-
-Qpid Proton is a high-performance, lightweight messaging library. It
-can be used in the widest range of messaging applications, including
-brokers, client libraries, routers, bridges, proxies, and more. Proton
-makes it trivial to integrate with the AMQP 1.0 ecosystem from any
-platform, environment, or language.  More about `Proton <http://qpid.apache.org/proton/index.html>`_.
-
diff --git a/proton-c/bindings/python/cproton.i b/proton-c/bindings/python/cproton.i
deleted file mode 100644
index b173dd8..0000000
--- a/proton-c/bindings/python/cproton.i
+++ /dev/null
@@ -1,415 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-%module cproton
-%{
-/* Includes the header in the wrapper code */
-#if defined(_WIN32) && ! defined(__CYGWIN__)
-#include <winsock2.h>
-#endif
-#include <proton/engine.h>
-#include <proton/url.h>
-#include <proton/message.h>
-#include <proton/object.h>
-#include <proton/sasl.h>
-#include <proton/messenger.h>
-#include <proton/ssl.h>
-#include <proton/reactor.h>
-#include <proton/handlers.h>
-
-/*
-NOTE: According to ccache-swig man page: "Known problems are using
-preprocessor directives within %inline blocks and the use of ’#pragma SWIG’."
-This includes using macros in an %inline section.
-
-Keep preprocessor directives and macro expansions in the normal header section.
-*/
-
-PN_HANDLE(PNI_PYTRACER);
-%}
-
-%include <cstring.i>
-
-%cstring_output_allocate_size(char **ALLOC_OUTPUT, size_t *ALLOC_SIZE, free(*$1));
-%cstring_output_maxsize(char *OUTPUT, size_t MAX_OUTPUT_SIZE)
-
-%include <pybuffer.i>
-%pybuffer_binary(const char *BIN_IN, size_t BIN_LEN)
-
-// Typemap for methods that return binary data:
-// force the return type as binary - this is necessary for Python3
-%typemap(in,noblock=1,fragment=SWIG_AsVal_frag(size_t)) (char *BIN_OUT, size_t *BIN_SIZE)
-(int res, size_t n, char *buff = 0, $*2_ltype size) {
-  res = SWIG_AsVal(size_t)($input, &n);
-  if (!SWIG_IsOK(res)) {
-    %argument_fail(res, "(char *BIN_OUT, size_t *BIN_SIZE)", $symname, $argnum);
-  }
-  buff= %new_array(n+1, char);
-  $1 = %static_cast(buff, $1_ltype);
-  size = %numeric_cast(n,$*2_ltype);
-  $2 = &size;
-}
-%typemap(freearg,noblock=1,match="in")(char *BIN_OUT, size_t *BIN_SIZE) {
-  if (buff$argnum) %delete_array(buff$argnum);
-}
-%typemap(argout,noblock=1) (char *BIN_OUT, size_t *BIN_SIZE) {
-  %append_output(PyBytes_FromStringAndSize($1,*$2));
-}
-
-// Typemap for those methods that return variable length text data in a buffer
-// provided as a parameter.  If the method fails we must avoid attempting to
-// decode the contents of the buffer as it does not carry valid text data.
-%typemap(in,noblock=1,fragment=SWIG_AsVal_frag(size_t)) (char *VTEXT_OUT, size_t *VTEXT_SIZE)
-(int res, size_t n, char *buff = 0, $*2_ltype size) {
-  res = SWIG_AsVal(size_t)($input, &n);
-  if (!SWIG_IsOK(res)) {
-    %argument_fail(res, "(char *VTEXT_OUT, size_t *VTEXT_SIZE)", $symname, $argnum);
-  }
-  buff = %new_array(n+1, char);
-  $1 = %static_cast(buff, $1_ltype);
-  size = %numeric_cast(n,$*2_ltype);
-  $2 = &size;
-}
-%typemap(freearg,noblock=1,match="in")(char *VTEXT_OUT, size_t *VTEXT_SIZE) {
-  if (buff$argnum) %delete_array(buff$argnum);
-}
-%typemap(argout,noblock=1,fragment="SWIG_FromCharPtrAndSize") (char *VTEXT_OUT, size_t *VTEXT_SIZE) {
-  %append_output(SWIG_FromCharPtrAndSize($1,*$2));
-}
-
-
-// These are not used/needed in the python binding
-%ignore pn_dtag;
-%ignore pn_message_get_id;
-%ignore pn_message_set_id;
-%ignore pn_message_get_correlation_id;
-%ignore pn_message_set_correlation_id;
-
-%typemap(in) pn_bytes_t {
-  if ($input == Py_None) {
-    $1.start = NULL;
-    $1.size = 0;
-  } else {
-    $1.start = PyBytes_AsString($input);
-
-    if (!$1.start) {
-      return NULL;
-    }
-    $1.size = PyBytes_Size($input);
-  }
-}
-
-%typemap(out) pn_bytes_t {
-  $result = PyBytes_FromStringAndSize($1.start, $1.size);
-}
-
-%typemap(out) pn_delivery_tag_t {
-  $result = PyBytes_FromStringAndSize($1.bytes, $1.size);
-}
-
-%typemap(in) pn_uuid_t {
-  memset($1.bytes, 0, 16);
-  if ($input == Py_None) {
-    ; // Already zeroed out
-  } else {
-    const char* b = PyBytes_AsString($input);
-    if (b) {
-        memmove($1.bytes, b, (PyBytes_Size($input) < 16 ? PyBytes_Size($input) : 16));
-    } else {
-        return NULL;
-    }
-  }
-}
-
-%typemap(out) pn_uuid_t {
-  $result = PyBytes_FromStringAndSize($1.bytes, 16);
-}
-
-%apply pn_uuid_t { pn_decimal128_t };
-
-int pn_message_encode(pn_message_t *msg, char *BIN_OUT, size_t *BIN_SIZE);
-%ignore pn_message_encode;
-
-int pn_message_decode(pn_message_t *msg, const char *BIN_IN, size_t BIN_LEN);
-%ignore pn_message_decode;
-
-ssize_t pn_link_send(pn_link_t *transport, const char *BIN_IN, size_t BIN_LEN);
-%ignore pn_link_send;
-
-%rename(pn_link_recv) wrap_pn_link_recv;
-%inline %{
-  int wrap_pn_link_recv(pn_link_t *link, char *BIN_OUT, size_t *BIN_SIZE) {
-    ssize_t sz = pn_link_recv(link, BIN_OUT, *BIN_SIZE);
-    if (sz >= 0) {
-      *BIN_SIZE = sz;
-    } else {
-      *BIN_SIZE = 0;
-    }
-    return sz;
-  }
-%}
-%ignore pn_link_recv;
-
-ssize_t pn_transport_push(pn_transport_t *transport, const char *BIN_IN, size_t BIN_LEN);
-%ignore pn_transport_push;
-
-%rename(pn_transport_peek) wrap_pn_transport_peek;
-%inline %{
-  int wrap_pn_transport_peek(pn_transport_t *transport, char *BIN_OUT, size_t *BIN_SIZE) {
-    ssize_t sz = pn_transport_peek(transport, BIN_OUT, *BIN_SIZE);
-    if (sz >= 0) {
-      *BIN_SIZE = sz;
-    } else {
-      *BIN_SIZE = 0;
-    }
-    return sz;
-  }
-%}
-%ignore pn_transport_peek;
-
-%rename(pn_delivery) wrap_pn_delivery;
-%inline %{
-  pn_delivery_t *wrap_pn_delivery(pn_link_t *link, char *STRING, size_t LENGTH) {
-    return pn_delivery(link, pn_dtag(STRING, LENGTH));
-  }
-%}
-%ignore pn_delivery;
-
-%rename(pn_delivery_tag) wrap_pn_delivery_tag;
-%inline %{
-  void wrap_pn_delivery_tag(pn_delivery_t *delivery, char **ALLOC_OUTPUT, size_t *ALLOC_SIZE) {
-    pn_delivery_tag_t tag = pn_delivery_tag(delivery);
-    *ALLOC_OUTPUT = (char *) malloc(tag.size);
-    *ALLOC_SIZE = tag.size;
-    memcpy(*ALLOC_OUTPUT, tag.start, tag.size);
-  }
-%}
-%ignore pn_delivery_tag;
-
-ssize_t pn_data_decode(pn_data_t *data, const char *BIN_IN, size_t BIN_LEN);
-%ignore pn_data_decode;
-
-%rename(pn_data_encode) wrap_pn_data_encode;
-%inline %{
-  int wrap_pn_data_encode(pn_data_t *data, char *BIN_OUT, size_t *BIN_SIZE) {
-    ssize_t sz = pn_data_encode(data, BIN_OUT, *BIN_SIZE);
-    if (sz >= 0) {
-      *BIN_SIZE = sz;
-    } else {
-      *BIN_SIZE = 0;
-    }
-    return sz;
-  }
-%}
-%ignore pn_data_encode;
-
-%rename(pn_data_format) wrap_pn_data_format;
-%inline %{
-  int wrap_pn_data_format(pn_data_t *data, char *VTEXT_OUT, size_t *VTEXT_SIZE) {
-    int err = pn_data_format(data, VTEXT_OUT, VTEXT_SIZE);
-    if (err) *VTEXT_SIZE = 0;
-    return err;
-  }
-%}
-%ignore pn_data_format;
-
-bool pn_ssl_get_cipher_name(pn_ssl_t *ssl, char *OUTPUT, size_t MAX_OUTPUT_SIZE);
-%ignore pn_ssl_get_cipher_name;
-
-bool pn_ssl_get_protocol_name(pn_ssl_t *ssl, char *OUTPUT, size_t MAX_OUTPUT_SIZE);
-%ignore pn_ssl_get_protocol_name;
-
-char* pn_ssl_get_remote_subject_subfield(pn_ssl_t *ssl, pn_ssl_cert_subject_subfield field);
-%ignore pn_ssl_get_remote_subject_subfield;
-
-int pn_ssl_get_cert_fingerprint(pn_ssl_t *ssl, char *OUTPUT, size_t MAX_OUTPUT_SIZE, pn_ssl_hash_alg hash_alg);
-%ignore pn_ssl_get_cert_fingerprint;
-
-%rename(pn_ssl_get_peer_hostname) wrap_pn_ssl_get_peer_hostname;
-%inline %{
-  int wrap_pn_ssl_get_peer_hostname(pn_ssl_t *ssl, char *VTEXT_OUT, size_t *VTEXT_SIZE) {
-    int err = pn_ssl_get_peer_hostname(ssl, VTEXT_OUT, VTEXT_SIZE);
-    if (err) *VTEXT_SIZE = 0;
-    return err;
-  }
-%}
-%ignore pn_ssl_get_peer_hostname;
-
-
-%immutable PN_PYREF;
-%inline %{
-  extern const pn_class_t *PN_PYREF;
-
-  #define CID_pn_pyref CID_pn_void
-  #define pn_pyref_new NULL
-  #define pn_pyref_initialize NULL
-  #define pn_pyref_finalize NULL
-  #define pn_pyref_free NULL
-  #define pn_pyref_hashcode pn_void_hashcode
-  #define pn_pyref_compare pn_void_compare
-  #define pn_pyref_inspect pn_void_inspect
-
-  static void pn_pyref_incref(void *object) {
-    PyObject* p = (PyObject*) object;
-    SWIG_PYTHON_THREAD_BEGIN_BLOCK;
-    Py_XINCREF(p);
-    SWIG_PYTHON_THREAD_END_BLOCK;
-  }
-
-  static void pn_pyref_decref(void *object) {
-    PyObject* p = (PyObject*) object;
-    SWIG_PYTHON_THREAD_BEGIN_BLOCK;
-    Py_XDECREF(p);
-    SWIG_PYTHON_THREAD_END_BLOCK;
-  }
-
-  static int pn_pyref_refcount(void *object) {
-    return 1;
-  }
-
-  static const pn_class_t *pn_pyref_reify(void *object) {
-    return PN_PYREF;
-  }
-
-  const pn_class_t PNI_PYREF = PN_METACLASS(pn_pyref);
-  const pn_class_t *PN_PYREF = &PNI_PYREF;
-
-  void *pn_py2void(PyObject *object) {
-    return object;
-  }
-
-  PyObject *pn_void2py(void *object) {
-    if (object) {
-      PyObject* p = (PyObject*) object;
-      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
-      Py_INCREF(p);
-      SWIG_PYTHON_THREAD_END_BLOCK;
-      return p;
-    } else {
-      Py_RETURN_NONE;
-    }
-  }
-
-  PyObject *pn_cast_pn_void(void *object) {
-    return pn_void2py(object);
-  }
-
-  typedef struct {
-    PyObject *handler;
-    PyObject *dispatch;
-    PyObject *exception;
-  } pni_pyh_t;
-
-  static pni_pyh_t *pni_pyh(pn_handler_t *handler) {
-    return (pni_pyh_t *) pn_handler_mem(handler);
-  }
-
-  static void pni_pyh_finalize(pn_handler_t *handler) {
-    pni_pyh_t *pyh = pni_pyh(handler);
-    SWIG_PYTHON_THREAD_BEGIN_BLOCK;
-    Py_DECREF(pyh->handler);
-    Py_DECREF(pyh->dispatch);
-    Py_DECREF(pyh->exception);
-    SWIG_PYTHON_THREAD_END_BLOCK;
-  }
-
-  static void pni_pydispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) {
-    pni_pyh_t *pyh = pni_pyh(handler);
-    SWIG_PYTHON_THREAD_BEGIN_BLOCK;
-    PyObject *arg = SWIG_NewPointerObj(event, SWIGTYPE_p_pn_event_t, 0);
-    PyObject *pytype = PyInt_FromLong(type);
-    PyObject *result = PyObject_CallMethodObjArgs(pyh->handler, pyh->dispatch, arg, pytype, NULL);
-    if (!result) {
-      PyObject *exc, *val, *tb;
-      PyErr_Fetch(&exc, &val, &tb);
-      PyErr_NormalizeException(&exc, &val, &tb);
-      if (!val) {
-        val = Py_None;
-        Py_INCREF(val);
-      }
-      if (!tb) {
-        tb = Py_None;
-        Py_INCREF(tb);
-      }
-      {
-        PyObject *result2 = PyObject_CallMethodObjArgs(pyh->handler, pyh->exception, exc, val, tb, NULL);
-        if (!result2) {
-          PyErr_PrintEx(true);
-        }
-        Py_XDECREF(result2);
-      }
-      Py_XDECREF(exc);
-      Py_XDECREF(val);
-      Py_XDECREF(tb);
-    }
-    Py_XDECREF(arg);
-    Py_XDECREF(pytype);
-    Py_XDECREF(result);
-    SWIG_PYTHON_THREAD_END_BLOCK;
-  }
-
-  pn_handler_t *pn_pyhandler(PyObject *handler) {
-    pn_handler_t *chandler = pn_handler_new(pni_pydispatch, sizeof(pni_pyh_t), pni_pyh_finalize);
-    pni_pyh_t *phy = pni_pyh(chandler);
-    phy->handler = handler;
-    {
-      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
-      phy->dispatch = PyString_FromString("dispatch");
-      phy->exception = PyString_FromString("exception");
-      Py_INCREF(phy->handler);
-      SWIG_PYTHON_THREAD_END_BLOCK;
-    }
-    return chandler;
-  }
-
-  void pn_pytracer(pn_transport_t *transport, const char *message) {
-    PyObject *pytracer = (PyObject *) pn_record_get(pn_transport_attachments(transport), PNI_PYTRACER);
-    SWIG_PYTHON_THREAD_BEGIN_BLOCK;
-    PyObject *pytrans = SWIG_NewPointerObj(transport, SWIGTYPE_p_pn_transport_t, 0);
-    PyObject *pymsg = PyString_FromString(message);
-    PyObject *result = PyObject_CallFunctionObjArgs(pytracer, pytrans, pymsg, NULL);
-    if (!result) {
-      PyErr_PrintEx(true);
-    }
-    Py_XDECREF(pytrans);
-    Py_XDECREF(pymsg);
-    Py_XDECREF(result);
-    SWIG_PYTHON_THREAD_END_BLOCK;
-  }
-
-  void pn_transport_set_pytracer(pn_transport_t *transport, PyObject *obj) {
-    pn_record_t *record = pn_transport_attachments(transport);
-    pn_record_def(record, PNI_PYTRACER, PN_PYREF);
-    pn_record_set(record, PNI_PYTRACER, obj);
-    pn_transport_set_tracer(transport, pn_pytracer);
-  }
-
-  PyObject *pn_transport_get_pytracer(pn_transport_t *transport) {
-    pn_record_t *record = pn_transport_attachments(transport);
-    PyObject *obj = (PyObject *)pn_record_get(record, PNI_PYTRACER);
-    if (obj) {
-      Py_XINCREF(obj);
-      return obj;
-    } else {
-      Py_RETURN_NONE;
-    }
-  }
-
-%}
-
-%include "proton/cproton.i"
diff --git a/proton-c/bindings/python/docs/conf.py b/proton-c/bindings/python/docs/conf.py
deleted file mode 100644
index cae646c..0000000
--- a/proton-c/bindings/python/docs/conf.py
+++ /dev/null
@@ -1,242 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# Apache Qpid Proton documentation build configuration file, created by
-# sphinx-quickstart on Mon Feb 16 14:13:09 2015.
-#
-# This file is execfile()d with the current directory set to its containing dir.
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-import sys, os
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.insert(0, os.path.abspath('.'))
-
-# -- General configuration -----------------------------------------------------
-
-# If your documentation needs a minimal Sphinx version, state it here.
-#needs_sphinx = '1.0'
-
-# Add any Sphinx extension module names here, as strings. They can be extensions
-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo']
-
-# Add any paths that contain templates here, relative to this directory.
-#templates_path = ['_templates']
-
-# The suffix of source filenames.
-source_suffix = '.rst'
-
-# The encoding of source files.
-#source_encoding = 'utf-8-sig'
-
-# The master toctree document.
-master_doc = 'index'
-
-# General information about the project.
-project = u'Apache Qpid Proton'
-copyright = u'2015, Apache Qpid'
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-version = '0.17.0'
-# The full version, including alpha/beta/rc tags.
-release = '0.17.0-SNAPSHOT'
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#language = None
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
-
-# List of patterns, relative to source directory, that match files and
-# directories to ignore when looking for source files.
-exclude_patterns = []
-
-# The reST default role (used for this markup: `text`) to use for all documents.
-#default_role = None
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
-
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-
-# -- Options for HTML output ---------------------------------------------------
-
-# The theme to use for HTML and HTML Help pages.  See the documentation for
-# a list of builtin themes.
-html_theme = 'sphinxdoc'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further.  For a list of options available for each theme, see the
-# documentation.
-#html_theme_options = {}
-
-# Add any paths that contain custom themes here, relative to this directory.
-#html_theme_path = []
-
-# The name for this set of Sphinx documents.  If None, it defaults to
-# "<project> v<release> documentation".
-#html_title = None
-
-# A shorter title for the navigation bar.  Default is the same as html_title.
-#html_short_title = None
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-#html_logo = None
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-#html_favicon = None
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-#html_static_path = ['_static']
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-#html_domain_indices = True
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a <link> tag referring to it.  The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# This is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = None
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'ApacheQpidProtondoc'
-
-
-# -- Options for LaTeX output --------------------------------------------------
-
-latex_elements = {
-# The paper size ('letterpaper' or 'a4paper').
-#'papersize': 'letterpaper',
-
-# The font size ('10pt', '11pt' or '12pt').
-#'pointsize': '10pt',
-
-# Additional stuff for the LaTeX preamble.
-#'preamble': '',
-}
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass [howto/manual]).
-latex_documents = [
-  ('index', 'ApacheQpidProton.tex', u'Apache Qpid Proton Documentation',
-   u'The Apache Qpid Community', 'manual'),
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# If true, show page references after internal links.
-#latex_show_pagerefs = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
-
-# -- Options for manual page output --------------------------------------------
-
-# One entry per manual page. List of tuples
-# (source start file, name, description, authors, manual section).
-man_pages = [
-    ('index', 'apacheqpidproton', u'Apache Qpid Proton Documentation',
-     [u'The Apache Qpid Community'], 1)
-]
-
-# If true, show URL addresses after external links.
-#man_show_urls = False
-
-
-# -- Options for Texinfo output ------------------------------------------------
-
-# Grouping the document tree into Texinfo files. List of tuples
-# (source start file, target name, title, author,
-#  dir menu entry, description, category)
-texinfo_documents = [
-  ('index', 'ApacheQpidProton', u'Apache Qpid Proton Documentation',
-   u'The Apache Qpid Community', 'ApacheQpidProton', 'One line description of project.',
-   'Miscellaneous'),
-]
-
-# Documents to append as an appendix to all manuals.
-#texinfo_appendices = []
-
-# If false, no module index is generated.
-#texinfo_domain_indices = True
-
-# How to display URL addresses: 'footnote', 'no', or 'inline'.
-#texinfo_show_urls = 'footnote'
diff --git a/proton-c/bindings/python/docs/index.rst b/proton-c/bindings/python/docs/index.rst
deleted file mode 100644
index 927762b..0000000
--- a/proton-c/bindings/python/docs/index.rst
+++ /dev/null
@@ -1,11 +0,0 @@
-Apache Qpid Proton: python documentation
-========================================
-
-Contents:
-
-.. toctree::
-   :maxdepth: 2
-
-   tutorial
-   overview
-
diff --git a/proton-c/bindings/python/docs/overview.rst b/proton-c/bindings/python/docs/overview.rst
deleted file mode 100644
index f82deb2..0000000
--- a/proton-c/bindings/python/docs/overview.rst
+++ /dev/null
@@ -1,160 +0,0 @@
-############
-API Overview
-############
-
-=========================
-An overview of the model
-=========================
-
-Messages are transferred between connected peers over 'links'. At the
-sending peer the link is called a sender. At the receiving peer it is
-called a receiver. Messages are sent by senders and received by
-receivers. Links may have named 'source' and 'target' addresses (for
-example to identify the queue from which message were to be received
-or to which they were to be sent).
-
-Links are established over sessions. Sessions are established over
-connections. Connections are (generally) established between two
-uniquely identified containers. Though a connection can have multiple
-sessions, often this is not needed. The container API allows you to
-ignore sessions unless you actually require them.
-
-The sending of a message over a link is called a delivery. The message
-is the content sent, including all meta-data such as headers and
-annotations. The delivery is the protocol exchange associated with the
-transfer of that content.
-
-To indicate that a delivery is complete, either the sender or the
-receiver 'settles' it. When the other side learns that it has been
-settled, they will no longer communicate about that delivery. The
-receiver can also indicate whether they accept or reject the
-message.
-
-Three different delivery levels or 'guarantees' can be achieved:
-at-most-once, at-least-once or exactly-once. See
-:ref:`delivery-guarantees` for more detail.
-
-=======================================================
-A summary of the most commonly used classes and members
-=======================================================
-
-A brief summary of some of the key classes follows.
-
-The :py:class:`~proton.reactor.Container` class is a convenient entry
-point into the API, allowing connections and links to be
-established. Applications are structured as one or more event
-handlers. Handlers can be set at Container, Connection, or Link
-scope. Messages are sent by establishing an approprate sender and
-invoking its :py:meth:`~proton.Sender.send()` method. This is
-typically done when the sender is sendable, a condition indicated by
-the :py:meth:`~proton.handlers.MessagingHandler.on_sendable()` event, to
-avoid execessive build up of messages. Messages can be received by
-establishing an appropriate receiver and handling the
-:py:meth:`~proton.handlers.MessagingHandler.on_message()` event.
-
-.. autoclass:: proton.reactor.Container
-    :show-inheritance: proton.reactor.Reactor
-    :members: connect, create_receiver, create_sender, run, schedule
-    :undoc-members:
-
-    .. py:attribute:: container_id
-
-       The identifier used to identify this container in any
-       connections it establishes. Container names should be
-       unique. By default a UUID will be used.
-
-    The :py:meth:`~proton.reactor.Container.connect()` method returns
-    an instance of :py:class:`~proton.Connection`, the
-    :py:meth:`~proton.reactor.Container.create_receiver()` method
-    returns an instance of :py:class:`~proton.Receiver` and the
-    :py:meth:`~proton.reactor.Container.create_sender()` method
-    returns an instance of :py:class:`~proton.Sender`.
-
-.. autoclass:: proton.Connection
-    :members: open, close, state, session, hostname, container,
-              remote_container, remote_desired_capabilities, remote_hostname, remote_offered_capabilities , remote_properties
-    :undoc-members:
-
-.. autoclass:: proton.Receiver
-    :show-inheritance: proton.Link
-    :members: flow, recv, drain, draining
-    :undoc-members:
-
-.. autoclass:: proton.Sender
-    :show-inheritance: proton.Link
-    :members: offered, send
-    :undoc-members:
-
-.. autoclass:: proton.Link
-    :members: name, state, is_sender, is_receiver,
-              credit, queued, session, connection,
-              source, target, remote_source, remote_target
-    :undoc-members:
-
-    The :py:meth:`~proton.Link.source()`,
-    :py:meth:`~proton.Link.target()`,
-    :py:meth:`~proton.Link.remote_source()` and
-    :py:meth:`~proton.Link.remote_target()` methods all return an
-    instance of :py:class:`~proton.Terminus`.
-
-
-.. autoclass:: proton.Delivery
-    :members: update, settle, settled, remote_state, local_state, partial, readable, writable,
-              link, session, connection
-    :undoc-members:
-
-.. autoclass:: proton.handlers.MessagingHandler
-    :members: on_start, on_reactor_init,
-              on_message,
-              on_accepted,
-              on_rejected,
-              on_settled,
-              on_sendable,
-              on_connection_error,
-              on_link_error,
-              on_session_error,
-              on_disconnected,
-              accept, reject, release, settle
-    :undoc-members:
-
-.. autoclass:: proton.Event
-    :members: delivery, link, receiver, sender, session, connection, reactor, context
-    :undoc-members:
-
-.. autoclass:: proton.Message
-    :members: address, id, priority, subject, ttl, reply_to, correlation_id, durable, user_id,
-              content_type, content_encoding, creation_time, expiry_time, delivery_count, first_acquirer,
-              group_id, group_sequence, reply_to_group_id,
-              send, recv, encode, decode
-    :undoc-members:
-
-.. autoclass:: proton.Terminus
-    :members: address, dynamic, properties, capabilities, filter
-    :undoc-members:
-
-.. _delivery-guarantees:
-
-===================
-Delivery guarantees
-===================
-
-For at-most-once, the sender settles the message as soon as it sends
-it. If the connection is lost before the message is received by the
-receiver, the message will not be delivered.
-
-For at-least-once, the receiver accepts and settles the message on
-receipt. If the connection is lost before the sender is informed of
-the settlement, then the delivery is considered in-doubt and should be
-retried. This will ensure it eventually gets delivered (provided of
-course the connection and link can be reestablished). It may mean that
-it is delivered multiple times though.
-
-Finally, for exactly-once, the receiver accepts the message but
-doesn't settle it. The sender settles once it is aware that the
-receiver accepted it. In this way the receiver retains knowledge of an
-accepted message until it is sure the sender knows it has been
-accepted. If the connection is lost before settlement, the receiver
-informs the sender of all the unsettled deliveries it knows about, and
-from this the sender can deduce which need to be redelivered. The
-sender likewise informs the receiver which deliveries it knows about,
-from which the receiver can deduce which have already been settled.
diff --git a/proton-c/bindings/python/docs/tutorial.rst b/proton-c/bindings/python/docs/tutorial.rst
deleted file mode 100644
index ee8a12f..0000000
--- a/proton-c/bindings/python/docs/tutorial.rst
+++ /dev/null
@@ -1,301 +0,0 @@
-########
-Tutorial
-########
-
-============
-Hello World!
-============
-
-Tradition dictates that we start with hello world! However rather than
-simply striving for the shortest program possible, we'll aim for a
-more illustrative example while still restricting the functionality to
-sending and receiving a single message.
-
-.. literalinclude:: ../../../../examples/python/helloworld.py
-   :lines: 21-
-   :linenos:
-
-You can see the import of :py:class:`~proton.reactor.Container` from ``proton.reactor`` on the
-second line. This is a class that makes programming with proton a
-little easier for the common cases. It includes within it an event
-loop, and programs written using this utility are generally structured
-to react to various events. This reactive style is particularly suited
-to messaging applications.
-
-To be notified of a particular event, you define a class with the
-appropriately name method on it. That method is then called by the
-event loop when the event occurs.
-
-We define a class here, ``HelloWorld``, which handles the key events of
-interest in sending and receiving a message.
-
-The ``on_start()`` method is called when the event loop first
-starts. We handle that by establishing our connection (line 12), a
-sender over which to send the message (line 13) and a receiver over
-which to receive it back again (line 14).
-
-The ``on_sendable()`` method is called when message can be transferred
-over the associated sender link to the remote peer. We send out our
-``Hello World!`` message (line 17), then close the sender (line 18) as
-we only want to send one message. The closing of the sender will
-prevent further calls to ``on_sendable()``.
-
-The ``on_message()`` method is called when a message is
-received. Within that we simply print the body of the message (line
-21) and then close the connection (line 22).
-
-Now that we have defined the logic for handling these events, we
-create an instance of a :py:class:`~proton.reactor.Container`, pass it
-our handler and then enter the event loop by calling
-:py:meth:`~proton.reactor.Container.run()`. At this point control
-passes to the container instance, which will make the appropriate
-callbacks to any defined handlers.
-
-To run the example you will need to have a broker (or similar)
-accepting connections on that url either with a queue (or topic)
-matching the given address or else configured to create such a queue
-(or topic) dynamically. There is a simple broker.py script included
-alongside the examples that can be used for this purpose if
-desired. (It is also written using the API described here, and as such
-gives an example of a slightly more involved application).
-
-====================
-Hello World, Direct!
-====================
-
-Though often used in conjunction with a broker, AMQP does not
-*require* this. It also allows senders and receivers can communicate
-directly if desired.
-
-Let's modify our example to demonstrate this.
-
-.. literalinclude:: ../../../../examples/python/helloworld_direct.py
-   :lines: 21-
-   :emphasize-lines: 11,21-22,24-25
-   :linenos:
-
-The first difference, on line 11, is that rather than creating a
-receiver on the same connection as our sender, we listen for incoming
-connections by invoking the
-:py:meth:`~proton.reactor.Container.listen()` method on the
-container.
-
-As we only need then to initiate one link, the sender, we can do that
-by passing in a url rather than an existing connection, and the
-connection will also be automatically established for us.
-
-We send the message in response to the ``on_sendable()`` callback and
-print the message out in response to the ``on_message()`` callback
-exactly as before.
-
-However we also handle two new events. We now close the connection
-from the senders side once the message has been accepted (line
-22). The acceptance of the message is an indication of successful
-transfer to the peer. We are notified of that event through the
-``on_accepted()`` callback. Then, once the connection has been closed,
-of which we are notified through the ``on_closed()`` callback, we stop
-accepting incoming connections (line 25) at which point there is no
-work to be done and the event loop exits, and the run() method will
-return.
-
-So now we have our example working without a broker involved!
-
-=============================
-Asynchronous Send and Receive
-=============================
-
-Of course, these ``HelloWorld!`` examples are very artificial,
-communicating as they do over a network connection but with the same
-process. A more realistic example involves communication between
-separate processes (which could indeed be running on completely
-separate machines).
-
-Let's separate the sender from the receiver, and let's transfer more than
-a single message between them.
-
-We'll start with a simple sender.
-
-.. literalinclude:: ../../../../examples/python/simple_send.py
-   :lines: 21-
-   :linenos:
-
-As with the previous example, we define the application logic in a
-class that handles various events. As before, we use the
-``on_start()`` event to establish our sender link over which we will
-transfer messages and the ``on_sendable()`` event to know when we can
-transfer our messages.
-
-Because we are transferring more than one message, we need to keep
-track of how many we have sent. We'll use a ``sent`` member variable
-for that. The ``total`` member variable will hold the number of
-messages we want to send.
-
-AMQP defines a credit-based flow control mechanism. Flow control
-allows the receiver to control how many messages it is prepared to
-receive at a given time and thus prevents any component being
-overwhelmed by the number of messages it is sent.
-
-In the ``on_sendable()`` callback, we check that our sender has credit
-before sending messages. We also check that we haven't already sent
-the required number of messages.
-
-The ``send()`` call on line 20 is of course asynchronous. When it
-returns the message has not yet actually been transferred across the
-network to the receiver. By handling the ``on_accepted()`` event, we
-can get notified when the receiver has received and accepted the
-message. In our example we use this event to track the confirmation of
-the messages we have sent. We only close the connection and exit when
-the receiver has received all the messages we wanted to send.
-
-If we are disconnected after a message is sent and before it has been
-confirmed by the receiver, it is said to be ``in doubt``. We don't
-know whether or not it was received. In this example, we will handle
-that by resending any in-doubt messages. This is known as an
-'at-least-once' guarantee, since each message should eventually be
-received at least once, though a given message may be received more
-than once (i.e. duplicates are possible). In the ``on_disconnected()``
-callback, we reset the sent count to reflect only those that have been
-confirmed. The library will automatically try to reconnect for us, and
-when our sender is sendable again, we can restart from the point we
-know the receiver got to.
-
-Now let's look at the corresponding receiver:
-
-.. literalinclude:: ../../../../examples/python/simple_recv.py
-   :lines: 21-
-   :linenos:
-
-Here we handle the ``on_start()`` by creating our receiver, much like
-we did for the sender. We also handle the ``on_message()`` event for
-received messages and print the message out as in the ``Hello World!``
-examples. However we add some logic to allow the receiver to wait for
-a given number of messages, then to close the connection and exit. We
-also add some logic to check for and ignore duplicates, using a simple
-sequential id scheme.
-
-Again, though sending between these two examples requires some sort of
-intermediary process (e.g. a broker), AMQP allows us to send messages
-directly between two processes without this if we so wish. In that
-case one or other of the processes needs to accept incoming socket
-connections. Let's create a modified version of the receiving example
-that does this:
-
-.. literalinclude:: ../../../../examples/python/direct_recv.py
-   :lines: 21-
-   :emphasize-lines: 13,25
-   :linenos:
-
-There are only two differences here. On line 13, instead of initiating
-a link (and implicitly a connection), we listen for incoming
-connections. On line 25, when we have received all the expected
-messages, we then stop listening for incoming connections by closing
-the listener object.
-
-You can use the original send example now to send to this receiver
-directly. (Note: you will need to stop any broker that is listening on
-the 5672 port, or else change the port used by specifying a different
-address to each example via the -a command line switch).
-
-We could equally well modify the original sender to allow the original
-receiver to connect to it. Again that just requires two modifications:
-
-.. literalinclude:: ../../../../examples/python/direct_send.py
-   :lines: 21-
-   :emphasize-lines: 15,28
-   :linenos:
-
-As with the modified receiver, instead of initiating establishment of
-a link, we listen for incoming connections on line 15 and then on line
-28, when we have received confirmation of all the messages we sent, we
-can close the listener in order to exit. The symmetry in the
-underlying AMQP that enables this is quite unique and elegant, and in
-reflecting this the proton API provides a flexible toolkit for
-implementing all sorts of interesting intermediaries (the broker.py
-script provided as a simple broker for testing purposes provides an
-example of this).
-
-To try this modified sender, run the original receiver against it.
-
-================
-Request/Response
-================
-
-A common pattern is to send a request message and expect a response
-message in return. AMQP has special support for this pattern. Let's
-have a look at a simple example. We'll start with the 'server',
-i.e. the program that will process the request and send the
-response. Note that we are still using a broker in this example.
-
-Our server will provide a very simple service: it will respond with
-the body of the request converted to uppercase.
-
-.. literalinclude:: ../../../../examples/python/server.py
-   :lines: 21-
-   :linenos:
-
-The code here is not too different from the simple receiver
-example. When we receive a request however, we look at the
-:py:attr:`~proton.Message.reply_to` address on the
-:py:class:`~proton.Message` and create a sender for that over which to
-send the response. We'll cache the senders incase we get further
-requests with the same reply_to.
-
-Now let's create a simple client to test this service out.
-
-.. literalinclude:: ../../../../examples/python/client.py
-   :lines: 21-
-   :linenos:
-
-As well as sending requests, we need to be able to get back the
-responses. We create a receiver for that (see line 14), but we don't
-specify an address, we set the dynamic option which tells the broker
-we are connected to to create a temporary address over which we can
-receive our responses.
-
-We need to use the address allocated by the broker as the reply_to
-address of our requests, so we can't send them until the broker has
-confirmed our receiving link has been set up (at which point we will
-have our allocated address). To do that, we add an
-``on_link_opened()`` method to our handler class, and if the link
-associated with event is the receiver, we use that as the trigger to
-send our first request.
-
-Again, we could avoid having any intermediary process here if we
-wished. The following code implementas a server to which the client
-above could connect directly without any need for a broker or similar.
-
-.. literalinclude:: ../../../../examples/python/server_direct.py
-   :lines: 21-
-   :linenos:
-
-Though this requires some more extensive changes than the simple
-sending and receiving examples, the essence of the program is still
-the same. Here though, rather than the server establishing a link for
-the response, it relies on the link that the client established, since
-that now comes in directly to the server process.
-
-Miscellaneous
-=============
-
-Many brokers offer the ability to consume messages based on a
-'selector' that defines which messages are of interest based on
-particular values of the headers. The following example shows how that
-can be achieved:
-
-.. literalinclude:: ../../../../examples/python/selected_recv.py
-   :lines: 21-
-   :emphasize-lines: 10
-   :linenos:
-
-When creating the receiver, we specify a Selector object as an
-option. The options argument can take a single object or a
-list. Another option that is sometimes of interest when using a broker
-is the ability to 'browse' the messages on a queue, rather than
-consumig them. This is done in AMQP by specifying a distribution mode
-of 'copy' (instead of 'move' which is the expected default for
-queues). An example of that is shown next:
-
-.. literalinclude:: ../../../../examples/python/queue_browser.py
-   :lines: 21-
-   :emphasize-lines: 10
-   :linenos:
diff --git a/proton-c/bindings/python/setup.py.in b/proton-c/bindings/python/setup.py.in
deleted file mode 100755
index 57f4368..0000000
--- a/proton-c/bindings/python/setup.py.in
+++ /dev/null
@@ -1,323 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-"""
-python-qpid-proton setup script
-
-DISCLAIMER: This script took lots of inspirations from PyZMQ, which is licensed
-under the 'MODIFIED BSD LICENSE'.
-
-Although inspired by the work in PyZMQ, this script and the modules it depends
-on were largely simplified to meet the requirements of the library.
-
-The behavior of this script is to build the registered `_cproton` extension
-using the installed Qpid Proton C library and header files. If the library and
-headers are not installed, or the installed version does not match the version
-of these python bindings, then the script will attempt to build the extension
-using the Proton C sources included in the python source distribution package.
-
-While the above removes the need of *always* having Qpid Proton C development
-files installed, it does not solve the need of having `swig` and the libraries
-qpid-proton requires installed to make this setup work.
-
-From the Python side, this scripts overrides 1 command - build_ext - and it adds a
-new one. The latter - Configure - is called from the former to setup/discover what's
-in the system. The rest of the comands and steps are done normally without any kind
-of monkey patching.
-"""
-
-import glob
-import os
-import subprocess
-import sys
-
-import distutils.spawn as ds_spawn
-import distutils.sysconfig as ds_sys
-from distutils.ccompiler import new_compiler, get_default_compiler
-from distutils.core import setup, Extension
-from distutils.command.build import build
-from distutils.command.build_ext import build_ext
-from distutils.command.sdist import sdist
-from distutils import errors
-
-from setuputils import log
-from setuputils import misc
-
-
-_PROTON_VERSION=(@PN_VERSION_MAJOR@,
-                 @PN_VERSION_MINOR@,
-                 @PN_VERSION_POINT@)
-_PROTON_VERSION_STR = "%d.%d.%d" % _PROTON_VERSION
-
-
-class CheckSDist(sdist):
-
-    def run(self):
-        self.distribution.run_command('configure')
-
-        # Append the source that was removed during
-        # the configuration step.
-        _cproton = self.distribution.ext_modules[-1]
-        _cproton.sources.append('cproton.i')
-
-        try:
-            sdist.run(self)
-        finally:
-            for src in ['cproton.py', 'cproton_wrap.c']:
-                if os.path.exists(src):
-                    os.remove(src)
-
-
-class Configure(build_ext):
-    description = "Discover Qpid Proton version"
-
-    @property
-    def compiler_type(self):
-        compiler = self.compiler
-        if compiler is None:
-            return get_default_compiler()
-        elif isinstance(compiler, str):
-            return compiler
-        else:
-            return compiler.compiler_type
-
-    def prepare_swig_wrap(self):
-        """Run swig against the sources.  This will cause swig to compile the
-        cproton.i file into a .c file called cproton_wrap.c, and create
-        cproton.py.
-        """
-        ext = self.distribution.ext_modules[-1]
-
-        if 'SWIG' in os.environ:
-            self.swig = os.environ['SWIG']
-
-        try:
-            # This will actually call swig to generate the files
-            # and list the sources.
-            self.swig_sources(ext.sources, ext)
-        except (errors.DistutilsExecError, errors.DistutilsPlatformError) as e:
-            if not (os.path.exists('cproton_wrap.c') or
-                    os.path.exists('cproton.py')):
-                raise e
-
-        # now remove the cproton.i file from the source list so we don't run
-        # swig again.
-        ext.sources = ext.sources[1:]
-        ext.swig_opts = []
-
-    def use_bundled_proton(self):
-        """The proper version of libqpid-proton is not installed on the system,
-        so use the included proton-c sources to build the extension
-        """
-        log.info("Building the bundled proton-c sources into the extension")
-
-        setup_path = os.path.dirname(os.path.realpath(__file__))
-        base = self.get_finalized_command('build').build_base
-        build_include = os.path.join(base, 'include')
-        proton_base = os.path.abspath(os.path.join(setup_path, 'proton-c'))
-        proton_src = os.path.join(proton_base, 'src')
-        proton_include = os.path.join(proton_base, 'include')
-
-        log.debug("Using Proton C sources: %s" % proton_base)
-
-        # Collect all the Proton C files that need to be built.
-        # we could've used `glob(.., '*', '*.c')` but I preferred going
-        # with an explicit list of subdirs that we can control and expand
-        # depending on the version. Specifically, lets avoid adding things
-        # we don't need.
-
-        sources = []
-        for subdir in ['core', 'core/object', 'compiler',
-                       'extra', 'message', 'reactor', 'messenger', 'handlers',
-                       'platform', 'reactor/io/posix']:
-
-            sources.extend(glob.glob(os.path.join(proton_src, subdir, '*.c')))
-
-        sources.extend(filter(lambda x: not x.endswith('dump.c'),
-                       glob.iglob(os.path.join(proton_src, '*.c'))))
-
-        # Look for any optional libraries that proton needs, and adjust the
-        # source list and compile flags as necessary.
-        libraries = []
-
-        # -D flags (None means no value, just define)
-        macros=[('qpid_proton_EXPORTS', None),
-                ('USE_ATOLL', None),
-                ('USE_STRERROR_R', None)]
-
-        # Check whether openssl is installed by poking
-        # pkg-config for a minimum version 0. If it's installed, it should
-        # return True and we'll use it. Otherwise, we'll use the stub.
-        if misc.pkg_config_version_installed('openssl', atleast='0'):
-            libraries += ['ssl', 'crypto']
-            sources.append(os.path.join(proton_src, 'ssl', 'openssl.c'))
-        else:
-            sources.append(os.path.join(proton_src, 'ssl', 'ssl_stub.c'))
-            log.warn("OpenSSL not installed - disabling SSL support!")
-
-        # create a temp compiler to check for optional compile-time features
-        cc = new_compiler(compiler=self.compiler_type)
-        cc.output_dir = self.build_temp
-
-        # Some systems need to link to `rt`. Check whether `clock_gettime` is
-        # around and if librt is needed
-        if cc.has_function('clock_gettime'):
-            macros.append(('USE_CLOCK_GETTIME', None))
-        else:
-            if cc.has_function('clock_gettime', libraries=['rt']):
-                libraries.append('rt')
-                macros.append(('USE_CLOCK_GETTIME', None))
-
-        # 0.10 added an implementation for cyrus. Check
-        # if it is available before adding the implementation to the sources
-        # list. Eventually, `sasl.c` will be added and one of the existing
-        # implementations will be used.
-        if cc.has_function('sasl_client_done', includes=['sasl/sasl.h'],
-                           libraries=['sasl2']):
-            libraries.append('sasl2')
-            sources.append(os.path.join(proton_src, 'sasl', 'cyrus_sasl.c'))
-        else:
-            sources.append(os.path.join(proton_src, 'sasl', 'none_sasl.c'))
-            log.warn("Cyrus SASL not installed - only the ANONYMOUS and"
-                     " PLAIN mechanisms will be supported!")
-        sources.append(os.path.join(proton_src, 'sasl', 'sasl.c'))
-
-        # compile all the proton sources.  We'll add the resulting list of
-        # objects to the _cproton extension as 'extra objects'.  We do this
-        # instead of just lumping all the sources into the extension to prevent
-        # any proton-specific compilation flags from affecting the compilation
-        # of the generated swig code
-
-        cc = new_compiler(compiler=self.compiler_type)
-        ds_sys.customize_compiler(cc)
-
-        objects = cc.compile(sources,
-                             macros=macros,
-                             include_dirs=[build_include,
-                                           proton_include,
-                                           proton_src],
-                             # compiler command line options:
-                             extra_postargs=['-std=gnu99'],
-                             output_dir=self.build_temp)
-
-        #
-        # Now update the _cproton extension instance passed to setup to include
-        # the objects and libraries
-        #
-        _cproton = self.distribution.ext_modules[-1]
-        _cproton.extra_objects = objects
-        _cproton.include_dirs.append(build_include)
-        _cproton.include_dirs.append(proton_include)
-
-        # swig will need to access the proton headers:
-        _cproton.swig_opts.append('-I%s' % build_include)
-        _cproton.swig_opts.append('-I%s' % proton_include)
-
-        # lastly replace the libqpid-proton dependency with libraries required
-        # by the Proton objects:
-        _cproton.libraries=libraries
-
-    def libqpid_proton_installed(self, version):
-        """Check to see if the proper version of the Proton development library
-        and headers are already installed
-        """
-        return misc.pkg_config_version_installed('libqpid-proton', version)
-
-    def use_installed_proton(self):
-        """The Proton development headers and library are installed, update the
-        _cproton extension to tell it where to find the library and headers.
-        """
-        # update the Extension instance passed to setup() to use the installed
-        # headers and link library
-        _cproton = self.distribution.ext_modules[-1]
-        incs = misc.pkg_config_get_var('libqpid-proton', 'includedir')
-        for i in incs.split():
-            _cproton.swig_opts.append('-I%s' % i)
-            _cproton.include_dirs.append(i)
-        ldirs = misc.pkg_config_get_var('libqpid-proton', 'libdir')
-        _cproton.library_dirs.extend(ldirs.split())
-
-    def run(self):
-        # check if the Proton library and headers are installed and are
-        # compatible with this version of the binding.
-        if self.libqpid_proton_installed(_PROTON_VERSION_STR):
-            self.use_installed_proton()
-        else:
-            # Proton not installed or compatible, use bundled proton-c sources
-            self.use_bundled_proton()
-        self.prepare_swig_wrap()
-
-
-class CustomBuildOrder(build):
-    # The sole purpose of this class is to re-order
-    # the commands execution so that `build_ext` is executed *before*
-    # build_py. We need this to make sure `cproton.py` is generated
-    # before the python modules are collected. Otherwise, it won't
-    # be installed.
-    sub_commands = [
-        ('build_ext', build.has_ext_modules),
-        ('build_py', build.has_pure_modules),
-        ('build_clib', build.has_c_libraries),
-        ('build_scripts', build.has_scripts),
-    ]
-
-
-class CheckingBuildExt(build_ext):
-    """Subclass build_ext to build qpid-proton using `cmake`"""
-
-    def run(self):
-        # Discover qpid-proton in the system
-        self.distribution.run_command('configure')
-        build_ext.run(self)
-
-
-# Override `build_ext` and add `configure`
-cmdclass = {'configure': Configure,
-            'build': CustomBuildOrder,
-            'build_ext': CheckingBuildExt,
-            'sdist': CheckSDist}
-
-setup(name='python-qpid-proton',
-      version=_PROTON_VERSION_STR + os.environ.get('PROTON_VERSION_SUFFIX', ''),
-      description='An AMQP based messaging library.',
-      author='Apache Qpid',
-      author_email='proton@qpid.apache.org',
-      url='http://qpid.apache.org/proton/',
-      packages=['proton'],
-      py_modules=['cproton'],
-      license="Apache Software License",
-      classifiers=["License :: OSI Approved :: Apache Software License",
-                   "Intended Audience :: Developers",
-                   "Programming Language :: Python",
-                   "Programming Language :: Python :: 2",
-                   "Programming Language :: Python :: 2.6",
-                   "Programming Language :: Python :: 2.7",
-                   "Programming Language :: Python :: 3",
-                   "Programming Language :: Python :: 3.3",
-                   "Programming Language :: Python :: 3.4",
-                   "Programming Language :: Python :: 3.5"],
-      cmdclass=cmdclass,
-      # Note well: the following extension instance is modified during the
-      # installation!  If you make changes below, you may need to update the
-      # Configure class above
-      ext_modules=[Extension('_cproton',
-                             sources=['cproton.i', 'cproton_wrap.c'],
-                             swig_opts=['-threads'],
-                             extra_compile_args=['-pthread'],
-                             libraries=['qpid-proton'])])
diff --git a/proton-c/bindings/python/setuputils/PYZMQ_LICENSE.BSD b/proton-c/bindings/python/setuputils/PYZMQ_LICENSE.BSD
deleted file mode 100644
index a0a3790..0000000
--- a/proton-c/bindings/python/setuputils/PYZMQ_LICENSE.BSD
+++ /dev/null
@@ -1,32 +0,0 @@
-PyZMQ is licensed under the terms of the Modified BSD License (also known as
-New or Revised BSD), as follows:
-
-Copyright (c) 2009-2012, Brian Granger, Min Ragan-Kelley
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-Redistributions of source code must retain the above copyright notice, this
-list of conditions and the following disclaimer.
-
-Redistributions in binary form must reproduce the above copyright notice, this
-list of conditions and the following disclaimer in the documentation and/or
-other materials provided with the distribution.
-
-Neither the name of PyZMQ nor the names of its contributors may be used to
-endorse or promote products derived from this software without specific prior
-written permission.
-
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/proton-c/bindings/python/setuputils/__init__.py b/proton-c/bindings/python/setuputils/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/proton-c/bindings/python/setuputils/__init__.py
+++ /dev/null
diff --git a/proton-c/bindings/python/setuputils/log.py b/proton-c/bindings/python/setuputils/log.py
deleted file mode 100644
index f11b255..0000000
--- a/proton-c/bindings/python/setuputils/log.py
+++ /dev/null
@@ -1,46 +0,0 @@
-#-----------------------------------------------------------------------------
-#  Copyright (C) PyZMQ Developers
-#  Distributed under the terms of the Modified BSD License.
-#
-#  This bundling code is largely adapted from pyzmq-static's get.sh by
-#  Brandon Craig-Rhodes, which is itself BSD licensed.
-#-----------------------------------------------------------------------------
-
-#-----------------------------------------------------------------------------
-# Logging (adapted from h5py: http://h5py.googlecode.com)
-#-----------------------------------------------------------------------------
-
-#-----------------------------------------------------------------------------
-#  This log code is largely adapted from pyzmq's code
-#  PyZMQ Developers, which is itself Modified BSD licensed.
-#-----------------------------------------------------------------------------
-
-
-import os
-import sys
-import logging
-
-
-logger = logging.getLogger()
-if os.environ.get('DEBUG'):
-    logger.setLevel(logging.DEBUG)
-else:
-    logger.setLevel(logging.INFO)
-logger.addHandler(logging.StreamHandler(sys.stderr))
-
-
-def debug(msg):
-    logger.debug(msg)
-
-
-def info(msg):
-    logger.info(msg)
-
-
-def fatal(msg, code=1):
-    logger.error("Fatal: " + msg)
-    exit(code)
-
-
-def warn(msg):
-    logger.error("Warning: " + msg)
diff --git a/proton-c/bindings/python/setuputils/misc.py b/proton-c/bindings/python/setuputils/misc.py
deleted file mode 100644
index 54a8fde..0000000
--- a/proton-c/bindings/python/setuputils/misc.py
+++ /dev/null
@@ -1,86 +0,0 @@
-#-----------------------------------------------------------------------------
-#  Copyright (C) PyZMQ Developers
-#  Distributed under the terms of the Modified BSD License.
-#
-#  This bundling code is largely adapted from pyzmq-static's get.sh by
-#  Brandon Craig-Rhodes, which is itself BSD licensed.
-#-----------------------------------------------------------------------------
-
-#-----------------------------------------------------------------------------
-#  These functions were largely adapted from pyzmq's code
-#  PyZMQ Developers, which is itself Modified BSD licensed.
-#-----------------------------------------------------------------------------
-
-
-import errno
-import os
-import subprocess
-import sys
-
-from . import log
-
-def _call_pkg_config(args):
-    """Spawn a subprocess running pkg-config with the given args.
-
-    :param args: list of strings to pass to pkg-config's command line.
-    Refer to pkg-config's documentation for more detail.
-
-    Return the Popen object, or None if the command failed
-    """
-    try:
-        return subprocess.Popen(['pkg-config'] + args,
-                                stdout=subprocess.PIPE, stderr=subprocess.PIPE,
-                                universal_newlines=True)
-    except OSError as e:
-        if e.errno == errno.ENOENT:
-            log.warn("command not found: pkg-config")
-        else:
-            log.warn("Running pkg-config failed - %s." % e)
-    return None
-
-
-
-def pkg_config_version_installed(package, version=None, atleast=None):
-    """Check if version of a package is is installed
-
-    This function returns True/False depending on whether
-    the package is found and is the correct version.
-
-    :param version: The exact version of the package required
-    :param atleast: True if installed package is at least this version
-    """
-
-    if version is None and atleast is None:
-        log.fatal('package version string required')
-    elif version and atleast:
-        log.fatal('Specify either version or atleast, not both')
-
-    check = 'exact' if version else 'atleast'
-    p = _call_pkg_config(['--%s-version=%s' % (check,
-                                               version or atleast),
-                          package])
-    if p:
-        out,err = p.communicate()
-        if p.returncode:
-            log.info("Did not find %s via pkg-config: %s" % (package, err))
-            return False
-        log.info("Using %s version %s (found via pkg-config)" %
-                 (package,
-                  _call_pkg_config(['--modversion', package]).communicate()[0]))
-        return True
-    return False
-
-
-def pkg_config_get_var(package, name):
-    """Retrieve the value of the named package variable as a string
-    """
-    p = _call_pkg_config(['--variable=%s' % name, package])
-    if not p:
-        log.warn("pkg-config: var %s get failed, package %s", name, package)
-        return ""
-    out,err = p.communicate()
-    if p.returncode:
-        out = ""
-        log.warn(err)
-    return out
-
diff --git a/proton-c/bindings/ruby/.gitignore b/proton-c/bindings/ruby/.gitignore
deleted file mode 100644
index 153f4ae..0000000
--- a/proton-c/bindings/ruby/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-coverage
-ext/cproton/cproton.c
-html
-lib/*.so
-pkg
-tmp
diff --git a/proton-c/bindings/ruby/.yardopts b/proton-c/bindings/ruby/.yardopts
deleted file mode 100644
index bea5abe..0000000
--- a/proton-c/bindings/ruby/.yardopts
+++ /dev/null
@@ -1 +0,0 @@
---no-private lib/**/*.rb
diff --git a/proton-c/bindings/ruby/CMakeLists.txt b/proton-c/bindings/ruby/CMakeLists.txt
deleted file mode 100644
index 05c2a72..0000000
--- a/proton-c/bindings/ruby/CMakeLists.txt
+++ /dev/null
@@ -1,96 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-if (NOT DEFAULT_RUBY_TESTING)
-  message(FATAL_ERROR "Ruby bindings cannot be tested while missing dependencies")
-endif (NOT DEFAULT_RUBY_TESTING)
-list(APPEND SWIG_MODULE_cproton-ruby_EXTRA_DEPS
-    ${CMAKE_SOURCE_DIR}/proton-c/include/proton/cproton.i
-    ${PROTON_HEADERS}
-)
-
-include_directories (${RUBY_INCLUDE_PATH})
-swig_add_module(cproton-ruby ruby ruby.i)
-swig_link_libraries(cproton-ruby ${BINDING_DEPS} ${RUBY_LIBRARY})
-
-# set a compiler macro to relay the Ruby version to the extension.
-# Don't use the global CMAKE_C_FLAGS, -fvisibility=hidden causes an obscure
-# failure with release builds.
-string(REPLACE "." "" CFLAG_RUBY_VERSION "${RUBY_VERSION}")
-string(SUBSTRING "${CFLAG_RUBY_VERSION}" 0 2 CFLAG_RUBY_VERSION)
-set(CMAKE_C_FLAGS "-DRUBY${CFLAG_RUBY_VERSION}")
-
-set_target_properties(cproton-ruby
-    PROPERTIES
-    PREFIX ""
-    OUTPUT_NAME "cproton"
-    LINK_FLAGS "${CATCH_UNDEFINED}" )
-
-if (CHECK_SYSINSTALL_RUBY)
-  execute_process(COMMAND ${RUBY_EXECUTABLE}
-    -r rbconfig -e "print RbConfig::CONFIG['vendorarchdir'] || ''"
-    RESULT_VARIABLE RESULT_RUBY_ARCHLIB_DIR
-    OUTPUT_VARIABLE OUTPUT_RUBY_ARCHLIB_DIR)
-
-  if(OUTPUT_RUBY_ARCHLIB_DIR STREQUAL "")
-    execute_process(COMMAND ${RUBY_EXECUTABLE}
-      -r rbconfig -e "print RbConfig::CONFIG['archdir'] || ''"
-      RESULT_VARIABLE RESULT_RUBY_ARCHLIB_DIR
-      OUTPUT_VARIABLE OUTPUT_RUBY_ARCHLIB_DIR)
-  endif()
-
-  set(RUBY_ARCHLIB_DIR_DEFAULT "${OUTPUT_RUBY_ARCHLIB_DIR}")
-else (CHECK_SYSINSTALL_RUBY)
-  set (RUBY_ARCHLIB_DIR_DEFAULT ${BINDINGS_DIR}/ruby)
-endif (CHECK_SYSINSTALL_RUBY)
-
-if (NOT RUBY_ARCHLIB_DIR)
-  set (RUBY_ARCHLIB_DIR ${RUBY_ARCHLIB_DIR_DEFAULT})
-endif()
-
-install(TARGETS cproton-ruby
-        DESTINATION ${RUBY_ARCHLIB_DIR}
-        COMPONENT Ruby)
-install(FILES lib/qpid_proton.rb
-        DESTINATION ${RUBY_ARCHLIB_DIR}
-        COMPONENT Ruby)
-install(DIRECTORY lib/codec
-        DESTINATION ${RUBY_ARCHLIB_DIR}
-        COMPONENT Ruby)
-install(DIRECTORY lib/core
-        DESTINATION ${RUBY_ARCHLIB_DIR}
-        COMPONENT Ruby)
-install(DIRECTORY lib/event
-        DESTINATION ${RUBY_ARCHLIB_DIR}
-        COMPONENT Ruby)
-install(DIRECTORY lib/handler
-        DESTINATION ${RUBY_ARCHLIB_DIR}
-        COMPONENT Ruby)
-install(DIRECTORY lib/messenger
-        DESTINATION ${RUBY_ARCHLIB_DIR}
-        COMPONENT Ruby)
-install(DIRECTORY lib/reactor
-        DESTINATION ${RUBY_ARCHLIB_DIR}
-        COMPONENT Ruby)
-install(DIRECTORY lib/types
-        DESTINATION ${RUBY_ARCHLIB_DIR}
-        COMPONENT Ruby)
-install(DIRECTORY lib/util
-        DESTINATION ${RUBY_ARCHLIB_DIR}
-        COMPONENT Ruby)
diff --git a/proton-c/bindings/ruby/ChangeLog b/proton-c/bindings/ruby/ChangeLog
deleted file mode 100644
index ec0429e..0000000
--- a/proton-c/bindings/ruby/ChangeLog
+++ /dev/null
@@ -1,36 +0,0 @@
-Version 0.7:
-	* PROTON-452: Exposed Messenger interrupt method.
-	* PROTON-454: Add route method to Messenger.
-	* PROTON-455: Add rewrite method to Messenger.
-	* PROTON-456: Add password property to Messenger.
-
-Version 0.6:
-	* PROTON-427: Removed the flag argument from Messenger.settle.
-
-version 0.5:
-	* Duck typed the Array class to work with Qpid::Proton::Data.
-	* Duck typed the Hash class to work with Qpid::Proton::Data.
-	* Fixed broken Rspec tests due to changes in under Proton C.
-	  - Messenger.receive can accept a negative maximum
-	  - When testing bad subscribe attempts, tests now use a random string.
-	* Fixed encoding decimal128 values.
-	* Added properties field to Qpid::Proton::Message.
-	* Hashes are now automatically encoded into Data objects.
-	* Fixed encoding Time objects.
-	* Added instructions field to Qpid::Proton::Message.
-	* Added annotations field to Qpid::Proton::Message.
-	* Fixed encoding Symbol objects.
-	* Added body field to Qpid::Proton::Message.
-
-version 0.4:
-	* No language-specific features developed in this release.
-
-version 0.3:
-	* No language-specific features developed in this release.
-	* Dropped the Rakefile in favor of packaging with a gemspec.
-	* Removed the qpid_proton/version.rb file as unused.
-
-version 0.2:
-	* First implementation of the stable APIs on top of swig.
-	* Wrote the Rspec tests to test the new APIs.
-	* Added SimpleCov support to monitor Rspec test coverage.
diff --git a/proton-c/bindings/ruby/LICENSE b/proton-c/bindings/ruby/LICENSE
deleted file mode 100644
index 6b0b127..0000000
--- a/proton-c/bindings/ruby/LICENSE
+++ /dev/null
@@ -1,203 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-
diff --git a/proton-c/bindings/ruby/README.rdoc b/proton-c/bindings/ruby/README.rdoc
deleted file mode 100644
index 1663957..0000000
--- a/proton-c/bindings/ruby/README.rdoc
+++ /dev/null
@@ -1,31 +0,0 @@
-Qpid Proton Ruby Language Bindings
-==================================
-
-The Ruby code contained here provides Ruby language bindings for working
-with the Proton messaging framework.
-
-
-Creating The Bindings
-=====================
-
-To generate the bindings, you will need to have the Proton messaging
-libraries installed. You will also need to have Swig [1].
-
-To generate the bindings, simply type:
-
-    gem build qpid_proton.gemspec
-
-This will generate the Ruby wrapper for the C libraries and bundle them,
-along with the public APIs, into a gemfile. You can then install that
-gem file using:
-
-    gem install qpid_proton-##.gem
-
-where ## is the release version.
-
-[1] http://www.swig.org/
-
-KNOWN ISSUES
-============
-
- * Setting a pn_atom_t of type String to a nil returns an empty string.
diff --git a/proton-c/bindings/ruby/TODO b/proton-c/bindings/ruby/TODO
deleted file mode 100644
index 80e0272..0000000
--- a/proton-c/bindings/ruby/TODO
+++ /dev/null
@@ -1,14 +0,0 @@
-Proton Ruby bindings TODO List
-========================================================================
-
-Beyond this simple laundry list, you can find the list of bugs and
-enhacements to be fixed by going to Apache Proton JIRA instance:
-
-    https://issues.apache.org/jira/browse/PROTON
-
-Fixes & Improvements
-========================================================================
-* Fix the data mangling that occurs at specific lengths.
-* Find a better way to map between nil/empty strings for pn_atom_t.
-* Fill out the remaining tests for Qpid::Proton::Messenger
-
diff --git a/proton-c/bindings/ruby/ext/cproton/extconf.rb b/proton-c/bindings/ruby/ext/cproton/extconf.rb
deleted file mode 100644
index 6c9500b..0000000
--- a/proton-c/bindings/ruby/ext/cproton/extconf.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-require 'mkmf'
-
-# set the ruby version compiler flag
-runtime_version = RUBY_VERSION.gsub(/\./,'')[0,2]
-$CFLAGS << " -DRUBY#{runtime_version}"
-
-dir_config("qpid-proton")
-
-REQUIRED_LIBRARIES = [
-                      "qpid-proton",
-                     ]
-
-REQUIRED_LIBRARIES.each do |library|
-  abort "Missing library: #{library}" unless have_library library
-end
-
-REQUIRED_HEADERS = [
-                    "proton/engine.h",
-                    "proton/message.h",
-                    "proton/sasl.h",
-                    "proton/messenger.h"
-                   ]
-
-REQUIRED_HEADERS.each do |header|
-  abort "Missing header: #{header}" unless have_header header
-end
-
-create_makefile('cproton')
-
diff --git a/proton-c/bindings/ruby/lib/codec/data.rb b/proton-c/bindings/ruby/lib/codec/data.rb
deleted file mode 100644
index 010177d..0000000
--- a/proton-c/bindings/ruby/lib/codec/data.rb
+++ /dev/null
@@ -1,912 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Codec
-
-  # +DataError+ is raised when an error occurs while encoding
-  # or decoding data.
-  class DataError < Exception; end
-
-  # The +Data+ class provides an interface for decoding, extracting,
-  # creating, and encoding arbitrary AMQP data. A +Data+ object
-  # contains a tree of AMQP values. Leaf nodes in this tree correspond
-  # to scalars in the AMQP type system such as INT or STRING. Interior
-  # nodes in this tree correspond to compound values in the AMQP type
-  # system such as *LIST*,*MAP*, *ARRAY*, or *DESCRIBED*. The root node
-  # of the tree is the +Data+ object itself and can have an arbitrary
-  # number of children.
-  #
-  # A +Data+ object maintains the notion of the current sibling node
-  # and a current parent node. Siblings are ordered within their parent.
-  # Values are accessed and/or added by using the #next, #prev,
-  # #enter, and #exit methods to navigate to the desired location in
-  # the tree and using the supplied variety of mutator and accessor
-  # methods to access or add a value of the desired type.
-  #
-  # The mutator methods will always add a value _after_ the current node
-  # in the tree. If the current node has a next sibling the mutator method
-  # will overwrite the value on this node. If there is no current node
-  # or the current node has no next sibling then one will be added. The
-  # accessor methods always set the added/modified node to the current
-  # node. The accessor methods read the value of the current node and do
-  # not change which node is current.
-  #
-  # The following types of scalar values are supported:
-  #
-  # * NULL
-  # * BOOL
-  # * UBYTE
-  # * BYTE
-  # * USHORT
-  # * SHORT
-  # * UINT
-  # * INT
-  # * CHAR
-  # * ULONG
-  # * LONG
-  # * TIMESTAMP
-  # * FLOAT
-  # * DOUBLE
-  # * DECIMAL32
-  # * DECIMAL64
-  # * DECIMAL128
-  # * UUID
-  # * BINARY
-  # * STRING
-  # * SYMBOL
-  #
-  # The following types of compound values are supported:
-  #
-  # * DESCRIBED
-  # * ARRAY
-  # * LIST
-  # * MAP
-  #
-  class Data
-
-    # Creates a new instance with the specified capacity.
-    #
-    # @param capacity [Fixnum, Object] The initial capacity or content.
-    #
-    def initialize(capacity = 16)
-      if (!capacity.nil?) &&
-         (capacity.is_a?(Fixnum) ||
-          capacity.is_a?(Bignum))
-        @data = Cproton.pn_data(capacity)
-        @free = true
-      else
-        @data = capacity
-        @free = false
-      end
-
-      # destructor
-      ObjectSpace.define_finalizer(self, self.class.finalize!(@data, @free))
-    end
-
-    # @private
-    def self.finalize!(data, free)
-      proc {
-        Cproton.pn_data_free(data) if free
-      }
-    end
-
-    # @private
-    def to_s
-      tmp = Cproton.pn_string("")
-      Cproton.pn_inspect(@data, tmp)
-      result = Cproton.pn_string_get(tmp)
-      Cproton.pn_free(tmp)
-      return result
-    end
-
-    # Clears the object.
-    #
-    def clear
-      Cproton.pn_data_clear(@data)
-    end
-
-    # Clears the current node and sets the parent to the root node.
-    #
-    # Clearing the current node sets it *before* the first node, calling
-    # #next will advance to the first node.
-    #
-    def rewind
-      Cproton.pn_data_rewind(@data)
-    end
-
-    # Advances the current node to its next sibling and returns its types.
-    #
-    # If there is no next sibling the current node remains unchanged
-    # and nil is returned.
-    #
-    def next
-      Cproton.pn_data_next(@data)
-    end
-
-    # Advances the current node to its previous sibling and returns its type.
-    #
-    # If there is no previous sibling then the current node remains unchanged
-    # and nil is return.
-    #
-    def prev
-      return Cproton.pn_data_prev(@data) ? type : nil
-    end
-
-    # Sets the parent node to the current node and clears the current node.
-    #
-    # Clearing the current node sets it _before_ the first child.
-    #
-    def enter
-      Cproton.pn_data_enter(@data)
-    end
-
-    # Sets the current node to the parent node and the parent node to its own
-    # parent.
-    #
-    def exit
-      Cproton.pn_data_exit(@data)
-    end
-
-    # Returns the numeric type code of the current node.
-    #
-    # @return [Fixnum] The current node type.
-    # @return [nil] If there is no current node.
-    #
-    def type_code
-      dtype = Cproton.pn_data_type(@data)
-      return (dtype == -1) ? nil : dtype
-    end
-
-    # Return the type object for the current node
-    #
-    # @param [Fixnum] The object type.
-    #
-    # @see #type_code
-    #
-    def type
-      Mapping.for_code(type_code)
-    end
-
-    # Returns a representation of the data encoded in AMQP format.
-    #
-    # @return [String] The context of the Data as an AMQP data string.
-    #
-    # @example
-    #
-    #   @data.string = "This is a test."
-    #   @encoded = @data.encode
-    #
-    #   # @encoded now contains the text "This is a test." encoded for
-    #   # AMQP transport.
-    #
-    def encode
-      buffer = "\0"*1024
-      loop do
-        cd = Cproton.pn_data_encode(@data, buffer, buffer.length)
-        if cd == Cproton::PN_OVERFLOW
-          buffer *= 2
-        elsif cd >= 0
-          return buffer[0...cd]
-        else
-          check(cd)
-        end
-      end
-    end
-
-    # Decodes the first value from supplied AMQP data and returns the number
-    # of bytes consumed.
-    #
-    # @param encoded [String] The encoded data.
-    #
-    # @example
-    #
-    #   # SCENARIO: A string of encoded data, @encoded, contains the text
-    #   #           of "This is a test." and is passed to an instance of Data
-    #   #           for decoding.
-    #
-    #   @data.decode(@encoded)
-    #   @data.string #=> "This is a test."
-    #
-    def decode(encoded)
-      check(Cproton.pn_data_decode(@data, encoded, encoded.length))
-    end
-
-    # Puts a list value.
-    #
-    # Elements may be filled by entering the list node and putting element
-    # values.
-    #
-    # @example
-    #
-    #   data = Qpid::Proton::Codec::Data.new
-    #   data.put_list
-    #   data.enter
-    #   data.int = 1
-    #   data.int = 2
-    #   data.int = 3
-    #   data.exit
-    #
-    def put_list
-      check(Cproton.pn_data_put_list(@data))
-    end
-
-    # If the current node is a list, this returns the number of elements.
-    # Otherwise, it returns zero.
-    #
-    # List elements can be accessed by entering the list.
-    #
-    # @example
-    #
-    #   count = @data.list
-    #   @data.enter
-    #   (0...count).each
-    #     type = @data.next
-    #     puts "Value: #{@data.string}" if type == STRING
-    #     # ... process other node types
-    #   end
-    def list
-      Cproton.pn_data_get_list(@data)
-    end
-
-    # Puts a map value.
-    #
-    # Elements may be filled by entering the map node and putting alternating
-    # key/value pairs.
-    #
-    # @example
-    #
-    #   data = Qpid::Proton::Codec::Data.new
-    #   data.put_map
-    #   data.enter
-    #   data.string = "key"
-    #   data.string = "value"
-    #   data.exit
-    #
-    def put_map
-      check(Cproton.pn_data_put_map(@data))
-    end
-
-    # If the  current node is a map, this returns the number of child
-    # elements. Otherwise, it returns zero.
-    #
-    # Key/value pairs can be accessed by entering the map.
-    #
-    # @example
-    #
-    #   count = @data.map
-    #   @data.enter
-    #   (0...count).each do
-    #     type = @data.next
-    #     puts "Key=#{@data.string}" if type == STRING
-    #     # ... process other key types
-    #     type = @data.next
-    #     puts "Value=#{@data.string}" if type == STRING
-    #     # ... process other value types
-    #   end
-    #   @data.exit
-    def map
-      Cproton.pn_data_get_map(@data)
-    end
-
-    # @private
-    def get_map
-      ::Hash.proton_data_get(self)
-    end
-
-    # Puts an array value.
-    #
-    # Elements may be filled by entering the array node and putting the
-    # element values. The values must all be of the specified array element
-    # type.
-    #
-    # If an array is *described* then the first child value of the array
-    # is the descriptor and may be of any type.
-    #
-    # @param described [Boolean] True if the array is described.
-    # @param element_type [Fixnum] The AMQP type for each element of the array.
-    #
-    # @example
-    #
-    #   # create an array of integer values
-    #   data = Qpid::Proton::Codec::Data.new
-    #   data.put_array(false, INT)
-    #   data.enter
-    #   data.int = 1
-    #   data.int = 2
-    #   data.int = 3
-    #   data.exit
-    #
-    #   # create a described  array of double values
-    #   data.put_array(true, DOUBLE)
-    #   data.enter
-    #   data.symbol = "array-descriptor"
-    #   data.double = 1.1
-    #   data.double = 1.2
-    #   data.double = 1.3
-    #   data.exit
-    #
-    def put_array(described, element_type)
-      check(Cproton.pn_data_put_array(@data, described, element_type.code))
-    end
-
-    # If the current node is an array, returns a tuple of the element count, a
-    # boolean indicating whether the array is described, and the type of each
-    # element. Otherwise it returns +(0, false, nil).
-    #
-    # Array data can be accessed by entering the array.
-    #
-    # @example
-    #
-    #   # get the details of thecurrent array
-    #   count, described, array_type = @data.array
-    #
-    #   # enter the node
-    #   data.enter
-    #
-    #   # get the next node
-    #   data.next
-    #   puts "Descriptor: #{data.symbol}" if described
-    #   (0...count).each do
-    #     @data.next
-    #     puts "Element: #{@data.string}"
-    #   end
-    def array
-      count = Cproton.pn_data_get_array(@data)
-      described = Cproton.pn_data_is_array_described(@data)
-      array_type = Cproton.pn_data_get_array_type(@data)
-      return nil if array_type == -1
-      [count, described, Mapping.for_code(array_type) ]
-    end
-
-    # @private
-    def get_array
-      ::Array.proton_get(self)
-    end
-
-    # Puts a described value.
-    #
-    # A described node has two children, the descriptor and the value.
-    # These are specified by entering the node and putting the
-    # desired values.
-    #
-    # @example
-    #
-    #   data = Qpid::Proton::Codec::Data.new
-    #   data.put_described
-    #   data.enter
-    #   data.symbol = "value-descriptor"
-    #   data.string = "the value"
-    #   data.exit
-    #
-    def put_described
-      check(Cproton.pn_data_put_described(@data))
-    end
-
-    # @private
-    def get_described
-      raise TypeError, "not a described type" unless self.described?
-      self.enter
-      self.next
-      type = self.type
-      descriptor = type.get(self)
-      self.next
-      type = self.type
-      value = type.get(self)
-      self.exit
-      Qpid::Proton::Types::Described.new(descriptor, value)
-    end
-
-    # Checks if the current node is a described value.
-    #
-    # The described and value may be accessed by entering the described value.
-    #
-    # @example
-    #
-    #   if @data.described?
-    #     @data.enter
-    #     puts "The symbol is #{@data.symbol}"
-    #     puts "The value is #{@data.string}"
-    #   end
-    def described?
-      Cproton.pn_data_is_described(@data)
-    end
-
-    # Puts a null value.
-    #
-    def null
-      check(Cproton.pn_data_put_null(@data))
-    end
-
-    # Utility method for Qpid::Proton::Codec::Mapping
-    #
-    # @private
-    #
-    def null=(value)
-      null
-    end
-
-    # Puts an arbitrary object type.
-    #
-    # The Data instance will determine which AMQP type is appropriate and will
-    # use that to encode the object.
-    #
-    # @param object [Object] The value.
-    #
-    def object=(object)
-      Mapping.for_class(object.class).put(self, object)
-    end
-
-    # Gets the current node, based on how it was encoded.
-    #
-    # @return [Object] The current node.
-    #
-    def object
-      type = self.type
-      return nil if type.nil?
-      type.get(data)
-    end
-
-    # Checks if the current node is null.
-    #
-    # @return [Boolean] True if the node is null.
-    #
-    def null?
-      Cproton.pn_data_is_null(@data)
-    end
-
-    # Puts a boolean value.
-    #
-    # @param value [Boolean] The boolean value.
-    #
-    def bool=(value)
-      check(Cproton.pn_data_put_bool(@data, value))
-    end
-
-    # If the current node is a boolean, then it returns the value. Otherwise,
-    # it returns false.
-    #
-    # @return [Boolean] The boolean value.
-    #
-    def bool
-      Cproton.pn_data_get_bool(@data)
-    end
-
-    # Puts an unsigned byte value.
-    #
-    # @param value [Fixnum] The unsigned byte value.
-    #
-    def ubyte=(value)
-      check(Cproton.pn_data_put_ubyte(@data, value))
-    end
-
-    # If the current node is an unsigned byte, returns its value. Otherwise,
-    # it returns 0.
-    #
-    # @return [Fixnum] The unsigned byte value.
-    #
-    def ubyte
-      Cproton.pn_data_get_ubyte(@data)
-    end
-
-    # Puts a byte value.
-    #
-    # @param value [Fixnum] The byte value.
-    #
-    def byte=(value)
-      check(Cproton.pn_data_put_byte(@data, value))
-    end
-
-    # If the current node is an byte, returns its value. Otherwise,
-    # it returns 0.
-    #
-    # @return [Fixnum] The byte value.
-    #
-    def byte
-      Cproton.pn_data_get_byte(@data)
-    end
-
-    # Puts an unsigned short value.
-    #
-    # @param value [Fixnum] The unsigned short value
-    #
-    def ushort=(value)
-      check(Cproton.pn_data_put_ushort(@data, value))
-    end
-
-    # If the current node is an unsigned short, returns its value. Otherwise,
-    # it returns 0.
-    #
-    # @return [Fixnum] The unsigned short value.
-    #
-    def ushort
-      Cproton.pn_data_get_ushort(@data)
-    end
-
-    # Puts a short value.
-    #
-    # @param value [Fixnum] The short value.
-    #
-    def short=(value)
-      check(Cproton.pn_data_put_short(@data, value))
-    end
-
-    # If the current node is a short, returns its value. Otherwise,
-    # returns a 0.
-    #
-    # @return [Fixnum] The short value.
-    #
-    def short
-      Cproton.pn_data_get_short(@data)
-    end
-
-    # Puts an unsigned integer value.
-    #
-    # @param value [Fixnum] the unsigned integer value
-    #
-    def uint=(value)
-      raise TypeError if value.nil?
-      raise RangeError, "invalid uint: #{value}" if value < 0
-      check(Cproton.pn_data_put_uint(@data, value))
-    end
-
-    # If the current node is an unsigned int, returns its value. Otherwise,
-    # returns 0.
-    #
-    # @return [Fixnum] The unsigned integer value.
-    #
-    def uint
-      Cproton.pn_data_get_uint(@data)
-    end
-
-    # Puts an integer value.
-    #
-    # ==== Options
-    #
-    # * value - the integer value
-    def int=(value)
-      check(Cproton.pn_data_put_int(@data, value))
-    end
-
-    # If the current node is an integer, returns its value. Otherwise,
-    # returns 0.
-    #
-    # @return [Fixnum] The integer value.
-    #
-    def int
-      Cproton.pn_data_get_int(@data)
-    end
-
-    # Puts a character value.
-    #
-    # @param value [Fixnum] The character value.
-    #
-    def char=(value)
-      check(Cproton.pn_data_put_char(@data, value))
-    end
-
-    # If the current node is a character, returns its value. Otherwise,
-    # returns 0.
-    #
-    # @return [Fixnum] The character value.
-    #
-    def char
-      Cproton.pn_data_get_char(@data)
-    end
-
-    # Puts an unsigned long value.
-    #
-    # @param value [Fixnum] The unsigned long value.
-    #
-    def ulong=(value)
-      raise TypeError if value.nil?
-      raise RangeError, "invalid ulong: #{value}" if value < 0
-      check(Cproton.pn_data_put_ulong(@data, value))
-    end
-
-    # If the current node is an unsigned long, returns its value. Otherwise,
-    # returns 0.
-    #
-    # @return [Fixnum] The unsigned long value.
-    #
-    def ulong
-      Cproton.pn_data_get_ulong(@data)
-    end
-
-    # Puts a long value.
-    #
-    # @param value [Fixnum] The long value.
-    #
-    def long=(value)
-      check(Cproton.pn_data_put_long(@data, value))
-    end
-
-    # If the current node is a long, returns its value. Otherwise, returns 0.
-    #
-    # @return [Fixnum] The long value.
-    def long
-      Cproton.pn_data_get_long(@data)
-    end
-
-    # Puts a timestamp value.
-    #
-    # @param value [Fixnum] The timestamp value.
-    #
-    def timestamp=(value)
-      value = value.to_i if (!value.nil? && value.is_a?(Time))
-      check(Cproton.pn_data_put_timestamp(@data, value))
-    end
-
-    # If the current node is a timestamp, returns its value. Otherwise,
-    # returns 0.
-    #
-    # @return [Fixnum] The timestamp value.
-    #
-    def timestamp
-      Cproton.pn_data_get_timestamp(@data)
-    end
-
-    # Puts a float value.
-    #
-    # @param value [Float] The floating point value.
-    #
-    def float=(value)
-      check(Cproton.pn_data_put_float(@data, value))
-    end
-
-    # If the current node is a float, returns its value. Otherwise,
-    # returns 0.
-    #
-    # @return [Float] The floating point value.
-    #
-    def float
-      Cproton.pn_data_get_float(@data)
-    end
-
-    # Puts a double value.
-    #
-    # @param value [Float] The double precision floating point value.
-    #
-    def double=(value)
-      check(Cproton.pn_data_put_double(@data, value))
-    end
-
-    # If the current node is a double, returns its value. Otherwise,
-    # returns 0.
-    #
-    # @return [Float] The double precision floating point value.
-    #
-    def double
-      Cproton.pn_data_get_double(@data)
-    end
-
-    # Puts a decimal32 value.
-    #
-    # @param value [Fixnum] The decimal32 value.
-    #
-    def decimal32=(value)
-      check(Cproton.pn_data_put_decimal32(@data, value))
-    end
-
-    # If the current node is a decimal32, returns its value. Otherwise,
-    # returns 0.
-    #
-    # @return [Fixnum] The decimal32 value.
-    #
-    def decimal32
-      Cproton.pn_data_get_decimal32(@data)
-    end
-
-    # Puts a decimal64 value.
-    #
-    # @param value [Fixnum] The decimal64 value.
-    #
-    def decimal64=(value)
-      check(Cproton.pn_data_put_decimal64(@data, value))
-    end
-
-    # If the current node is a decimal64, returns its value. Otherwise,
-    # it returns 0.
-    #
-    # @return [Fixnum] The decimal64 value.
-    #
-    def decimal64
-      Cproton.pn_data_get_decimal64(@data)
-    end
-
-    # Puts a decimal128 value.
-    #
-    # @param value [Fixnum] The decimal128 value.
-    #
-    def decimal128=(value)
-      raise TypeError, "invalid decimal128 value: #{value}" if value.nil?
-      value = value.to_s(16).rjust(32, "0")
-      bytes = []
-      value.scan(/(..)/) {|v| bytes << v[0].to_i(16)}
-      check(Cproton.pn_data_put_decimal128(@data, bytes))
-    end
-
-    # If the current node is a decimal128, returns its value. Otherwise,
-    # returns 0.
-    #
-    # @return [Fixnum] The decimal128 value.
-    #
-    def decimal128
-      value = ""
-      Cproton.pn_data_get_decimal128(@data).each{|val| value += ("%02x" % val)}
-      value.to_i(16)
-    end
-
-    # Puts a +UUID+ value.
-    #
-    # The UUID is expected to be in the format of a string or else a 128-bit
-    # integer value.
-    #
-    # @param value [String, Numeric] A string or numeric representation of the UUID.
-    #
-    # @example
-    #
-    #   # set a uuid value from a string value
-    #   require 'securerandom'
-    #   @data.uuid = SecureRandom.uuid
-    #
-    #   # or
-    #   @data.uuid = "fd0289a5-8eec-4a08-9283-81d02c9d2fff"
-    #
-    #   # set a uuid value from a 128-bit value
-    #   @data.uuid = 0 # sets to 00000000-0000-0000-0000-000000000000
-    #
-    def uuid=(value)
-      raise ::ArgumentError, "invalid uuid: #{value}" if value.nil?
-
-      # if the uuid that was submitted was numeric value, then translated
-      # it into a hex string, otherwise assume it was a string represtation
-      # and attempt to decode it
-      if value.is_a? Numeric
-        value = "%032x" % value
-      else
-        raise ::ArgumentError, "invalid uuid: #{value}" if !valid_uuid?(value)
-
-        value = (value[0, 8]  +
-                 value[9, 4]  +
-                 value[14, 4] +
-                 value[19, 4] +
-                 value[24, 12])
-      end
-      bytes = []
-      value.scan(/(..)/) {|v| bytes << v[0].to_i(16)}
-      check(Cproton.pn_data_put_uuid(@data, bytes))
-    end
-
-    # If the current value is a +UUID+, returns its value. Otherwise,
-    # it returns nil.
-    #
-    # @return [String] The string representation of the UUID.
-    #
-    def uuid
-      value = ""
-      Cproton.pn_data_get_uuid(@data).each{|val| value += ("%02x" % val)}
-      value.insert(8, "-").insert(13, "-").insert(18, "-").insert(23, "-")
-    end
-
-    # Puts a binary value.
-    #
-    # A binary string is encoded as an ASCII 8-bit string value. This is in
-    # contranst to other strings, which are treated as UTF-8 encoded.
-    #
-    # @param value [String] An arbitrary string value.
-    #
-    # @see #string=
-    #
-    def binary=(value)
-      check(Cproton.pn_data_put_binary(@data, value))
-    end
-
-    # If the current node is binary, returns its value. Otherwise, it returns
-    # an empty string ("").
-    #
-    # @return [String] The binary string.
-    #
-    # @see #string
-    #
-    def binary
-      Qpid::Proton::Types::BinaryString.new(Cproton.pn_data_get_binary(@data))
-    end
-
-    # Puts a UTF-8 encoded string value.
-    #
-    # *NOTE:* A nil value is stored as an empty string rather than as a nil.
-    #
-    # @param value [String] The UTF-8 encoded string value.
-    #
-    # @see #binary=
-    #
-    def string=(value)
-      check(Cproton.pn_data_put_string(@data, value))
-    end
-
-    # If the current node is a string, returns its value. Otherwise, it
-    # returns an empty string ("").
-    #
-    # @return [String] The UTF-8 encoded string.
-    #
-    # @see #binary
-    #
-    def string
-      Qpid::Proton::Types::UTFString.new(Cproton.pn_data_get_string(@data))
-    end
-
-    # Puts a symbolic value.
-    #
-    # @param value [String] The symbolic string value.
-    #
-    def symbol=(value)
-      check(Cproton.pn_data_put_symbol(@data, value))
-    end
-
-    # If the current node is a symbol, returns its value. Otherwise, it
-    # returns an empty string ("").
-    #
-    # @return [String] The symbolic string value.
-    #
-    def symbol
-      Cproton.pn_data_get_symbol(@data)
-    end
-
-    # Get the current value as a single object.
-    #
-    # @return [Object] The current node's object.
-    #
-    # @see #type_code
-    # @see #type
-    #
-    def get
-      type.get(self);
-    end
-
-    # Puts a new value with the given type into the current node.
-    #
-    # @param value [Object] The value.
-    # @param type_code [Mapping] The value's type.
-    #
-    # @private
-    #
-    def put(value, type_code);
-      type_code.put(self, value);
-    end
-
-    private
-
-    def valid_uuid?(value)
-      # ensure that the UUID is in the right format
-      # xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
-      value =~ /[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/
-    end
-
-    # @private
-    def check(err)
-      if err < 0
-        raise DataError, "[#{err}]: #{Cproton.pn_data_error(@data)}"
-      else
-        return err
-      end
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/codec/mapping.rb b/proton-c/bindings/ruby/lib/codec/mapping.rb
deleted file mode 100644
index 4a7d5a7..0000000
--- a/proton-c/bindings/ruby/lib/codec/mapping.rb
+++ /dev/null
@@ -1,169 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Codec
-
-  # Maps between Proton types and their Ruby native language counterparts.
-  #
-  # @private
-  class Mapping
-
-    attr_reader :code
-    attr_reader :put_method
-    attr_reader :get_method
-
-    # Creates a new mapping.
-    #
-    # ==== Arguments
-    #
-    # * code    - the AMQP code for this type
-    # * name    - the AMQP name for this type
-    # * klasses - the Ruby classes for this type
-    # * getter  - overrides the get method for the type
-    def initialize(code, name, klasses = nil, getter = nil)
-
-      @debug = (name == "bool")
-
-      @code = code
-      @name = name
-
-      @@by_preferred ||= {}
-      @@by_code ||= {}
-      @@by_code["#{code}"] = self
-      @@by_name ||= {}
-      @@by_name[name] = self
-      @@by_class ||= {}
-
-      unless klasses.nil?
-        klasses.each do |klass|
-          raise "entry exists for #{klass}" if @@by_class.keys.include? klass
-          @@by_class[klass] = self unless klass.nil?
-        end
-      end
-
-      @put_method = (name + "=").intern
-
-      if getter.nil?
-        @get_method = name.intern
-      else
-        @get_method = getter.intern
-      end
-    end
-
-    def to_s; @name; end
-
-    def put(data, value)
-      data.__send__(@put_method, value)
-    end
-
-    def get(data)
-      data.__send__(@get_method)
-    end
-
-    def self.for_class(klass) # :nodoc:
-      @@by_class[klass]
-    end
-
-    def self.for_code(code)
-      @@by_code["#{code}"]
-    end
-
-  end
-
-  NULL       = Mapping.new(Cproton::PN_NULL, "null", [NilClass], "nil?")
-  BOOL       = Mapping.new(Cproton::PN_BOOL, "bool", [TrueClass, FalseClass], "bool")
-  UBYTE      = Mapping.new(Cproton::PN_UBYTE, "ubyte")
-  BYTE       = Mapping.new(Cproton::PN_BYTE, "byte")
-  USHORT     = Mapping.new(Cproton::PN_USHORT, "ushort")
-  SHORT      = Mapping.new(Cproton::PN_SHORT, "short")
-  UINT       = Mapping.new(Cproton::PN_UINT, "uint")
-  INT        = Mapping.new(Cproton::PN_INT, "int")
-  CHAR       = Mapping.new(Cproton::PN_CHAR, "char")
-  ULONG      = Mapping.new(Cproton::PN_ULONG, "ulong")
-  LONG       = Mapping.new(Cproton::PN_LONG, "long", [Fixnum, Bignum])
-  TIMESTAMP  = Mapping.new(Cproton::PN_TIMESTAMP, "timestamp", [Date, Time])
-  FLOAT      = Mapping.new(Cproton::PN_FLOAT, "float")
-  DOUBLE     = Mapping.new(Cproton::PN_DOUBLE, "double", [Float])
-  DECIMAL32  = Mapping.new(Cproton::PN_DECIMAL32, "decimal32")
-  DECIMAL64  = Mapping.new(Cproton::PN_DECIMAL64, "decimal64")
-  DECIMAL128 = Mapping.new(Cproton::PN_DECIMAL128, "decimal128")
-  UUID       = Mapping.new(Cproton::PN_UUID, "uuid")
-  BINARY     = Mapping.new(Cproton::PN_BINARY, "binary")
-  STRING     = Mapping.new(Cproton::PN_STRING, "string", [String, Symbol,
-                                                          Qpid::Proton::Types::UTFString,
-                                                          Qpid::Proton::Types::BinaryString])
-
-  # @private
-  class << STRING
-    def put(data, value)
-      # if we have a symbol then convert it to a string
-      value = value.to_s if value.is_a?(Symbol)
-
-      isutf = false
-
-      if value.is_a?(Qpid::Proton::Types::UTFString)
-        isutf = true
-      else
-        # For Ruby 1.8 we will just treat all strings as binary.
-        # For Ruby 1.9+ we can check the encoding first to see what it is
-        if RUBY_VERSION >= "1.9"
-          # If the string is ASCII-8BIT then treat is as binary. Otherwise,
-          # try to convert it to UTF-8 and, if successful, send as that.
-          if value.encoding != Encoding::ASCII_8BIT &&
-             value.encode(Encoding::UTF_8).valid_encoding?
-            isutf = true
-          end
-        end
-      end
-
-      data.string = value if isutf
-      data.binary = value if !isutf
-
-    end
-  end
-
-  SYMBOL     = Mapping.new(Cproton::PN_SYMBOL, "symbol")
-  DESCRIBED  = Mapping.new(Cproton::PN_DESCRIBED, "described", [Qpid::Proton::Types::Described], "get_described")
-  ARRAY      = Mapping.new(Cproton::PN_ARRAY, "array", nil, "get_array")
-  LIST       = Mapping.new(Cproton::PN_LIST, "list", [::Array], "get_array")
-  MAP        = Mapping.new(Cproton::PN_MAP, "map", [::Hash], "get_map")
-
-  # @private
-  class << MAP
-    def put(data, map, options = {})
-      data.put_map
-      data.enter
-      map.each_pair do |key, value|
-        if options[:keys] == :SYMBOL
-          SYMBOL.put(data, key)
-        else
-          Mapping.for_class(key.class).put(data, key)
-        end
-
-        if value.nil?
-          data.null
-        else
-          Mapping.for_class(value.class).put(data, value)
-        end
-      end
-      data.exit
-    end
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/core/base_handler.rb b/proton-c/bindings/ruby/lib/core/base_handler.rb
deleted file mode 100644
index 9a7ece4..0000000
--- a/proton-c/bindings/ruby/lib/core/base_handler.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  class BaseHandler
-
-    # Override to process unhandled events.
-    #
-    def on_unhandled(method, *args)
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/core/connection.rb b/proton-c/bindings/ruby/lib/core/connection.rb
deleted file mode 100644
index 252193d..0000000
--- a/proton-c/bindings/ruby/lib/core/connection.rb
+++ /dev/null
@@ -1,328 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  # A Connection option has at most one Qpid::Proton::Transport instance.
-  #
-  class Connection < Endpoint
-
-    # @private
-    include Util::SwigHelper
-
-    # @private
-    PROTON_METHOD_PREFIX = "pn_connection"
-
-    # @!attribute hostname
-    #
-    # @return [String] The AMQP hostname for the connection.
-    #
-    proton_accessor :hostname
-
-    # @private
-    proton_reader :attachments
-
-    attr_accessor :overrides
-    attr_accessor :session_policy
-
-    # @private
-    include Util::Wrapper
-
-    # @private
-    def self.wrap(impl)
-      return nil if impl.nil?
-
-      self.fetch_instance(impl, :pn_connection_attachments) || Connection.new(impl)
-    end
-
-    # Constructs a new instance of Connection.
-    #
-    # You do *not* need to provide the underlying C struct, as this is
-    # automatically generated as needed. The argument is a convenience
-    # for returning existing Connection objects.
-    #
-    # @param impl [pn_connection_t] The pn_connection_t struct.
-    #
-    def initialize(impl = Cproton.pn_connection)
-      super()
-      @impl = impl
-      @offered_capabilities = nil
-      @desired_capabilities = nil
-      @properties = nil
-      @overrides = nil
-      @collector = nil
-      @session_policy = nil
-      self.class.store_instance(self, :pn_connection_attachments)
-    end
-
-    def overrides?
-      !@overrides.nil?
-    end
-
-    def session_policy?
-      !@session_policy.nil?
-    end
-
-    # This method is used when working within the context of an event.
-    #
-    # @return [Connection] The connection itself.
-    #
-    def connection
-      self
-    end
-
-    # The Transport to which this connection is bound.
-    #
-    # @return [Transport] The transport, or nil if the Connection is unbound.
-    #
-    def transport
-      Transport.wrap(Cproton.pn_connection_transport(@impl))
-    end
-
-    # Associates the connection with an event collector.
-    #
-    # By doing this, key changes in the endpoint's state are reported to
-    # the connector via Event objects that can be inspected and processed.
-    #
-    # Note that, by registering a collector, the user is requesting that an
-    # indefinite number of events be queued up on its behalf. This means
-    # that, unless the application eventual processes these events, the
-    # storage requirements for keeping them will grow without bound. So be
-    # careful and do not register a collector with a connection unless the
-    # application will process the events.
-    #
-    # @param collector [Event::Collector] The event collector.
-    #
-    def collect(collector)
-      if collector.nil?
-        Cproton.pn_connection_collect(@impl, nil)
-      else
-        Cproton.pn_connection_collect(@impl, collector.impl)
-      end
-      @collector = collector
-    end
-
-    # Get the AMQP container name advertised by the remote connection
-    # endpoint.
-    #
-    # This will return nil until the REMOTE_ACTIVE state is reached.
-    #
-    # Any non-nil container returned by this operation will be valid
-    # until the connection is unbound from a transport, or freed,
-    # whichever happens sooner.
-    #
-    # @return [String] The remote connection's AMQP container name.
-    #
-    # @see #container
-    #
-    def remote_container
-      Cproton.pn_connection_remote_container(@impl)
-    end
-
-    def container=(name)
-      Cproton.pn_connection_set_container(@impl, name)
-    end
-
-    def container
-      Cproton.pn_connection_get_container(@impl)
-    end
-
-    # Get the AMQP hostname set by the remote connection endpoint.
-    #
-    # This will return nil until the #REMOTE_ACTIVE state is
-    # reached.
-    #
-    # @return [String] The remote connection's AMQP hostname.
-    #
-    # @see #hostname
-    #
-    def remote_hostname
-      Cproton.pn_connection_remote_hostname(@impl)
-    end
-
-    # Get the AMQP offered capabilities suppolied by the remote connection
-    # endpoint.
-    #
-    # This object returned is valid until the connection is freed. The Data
-    # object will be empty until the remote connection is opened, as
-    # indicated by the #REMOTE_ACTIVE flag.
-    #
-    # @return [Data] The offered capabilities.
-    #
-    def remote_offered_capabilities
-      data_to_object(Cproton.pn_connection_remote_offered_capabilities(@impl))
-    end
-
-    # Get the AMQP desired capabilities supplied by the remote connection
-    # endpoint.
-    #
-    # The object returned is valid until the connection is freed. The Data
-    # object will be empty until the remote connection is opened, as
-    # indicated by the #REMOTE_ACTIVE flag.
-    #
-    # @return [Data] The desired capabilities.
-    #
-    def remote_desired_capabilities
-      data_to_object(Cproton.pn_connection_remote_desired_capabilities(@impl))
-    end
-
-    # Get the AMQP connection properties supplie by the remote connection
-    # endpoint.
-    #
-    # The object returned is valid until the connection is freed. The Data
-    # object will be empty until the remote connection is opened, as
-    # indicated by the #REMOTE_ACTIVE flag.
-    #
-    # @return [Data] The remote properties.
-    #
-    def remote_properties
-      data_to_object(Cproton.pn_connection_remote_properites(@impl))
-    end
-
-    # Opens the connection.
-    #
-    def open
-      object_to_data(@offered_capabilities,
-                     Cproton.pn_connection_offered_capabilities(@impl))
-      object_to_data(@desired_capabilities,
-                     Cproton.pn_connection_desired_capabilities(@impl))
-      object_to_data(@properties,
-                     Cproton.pn_connection_properties(@impl))
-      Cproton.pn_connection_open(@impl)
-    end
-
-    # Closes the connection.
-    #
-    # Once this operation has completed, the #LOCAL_CLOSED state flag will be
-    # set.
-    #
-    def close
-      self._update_condition
-      Cproton.pn_connection_close(@impl)
-    end
-
-    # Gets the endpoint current state flags
-    #
-    # @see Endpoint#LOCAL_UNINIT
-    # @see Endpoint#LOCAL_ACTIVE
-    # @see Endpoint#LOCAL_CLOSED
-    # @see Endpoint#LOCAL_MASK
-    #
-    # @return [Fixnum] The state flags.
-    #
-    def state
-      Cproton.pn_connection_state(@impl)
-    end
-
-    # Returns the session for this connection.
-    #
-    # @return [Session] The session.
-    #
-    def session
-      @session ||= Session.wrap(Cproton.pn_session(@impl))
-    end
-
-    # Returns the first session from the connection that matches the specified
-    # state mask.
-    #
-    # Examines the state of each session owned by the connection, and returns
-    # the first session that matches the given state mask. If the state mask
-    # contains *both* local and remote flags, then an exact match against
-    # those flags is performed. If the state mask contains only local *or*
-    # remote flags, then a match occurs if a*any* of the local or remote flags
-    # are set, respectively.
-    #
-    # @param mask [Fixnum] The state mask to be matched.
-    #
-    # @return [Session] The first matching session, or nil if none matched.
-    #
-    # @see Endpoint#LOCAL_UNINIT
-    # @see Endpoint#LOCAL_ACTIVE
-    # @see Endpoint#LOCAL_CLOSED
-    # @see Endpoint#REMOTE_UNINIT
-    # @see Endpoint#REMOTE_ACTIVE
-    # @see Endpoint#REMOTE_CLOSED
-    #
-    def session_head(mask)
-      Session.wrap(Cproton.pn_session_header(@impl, mask))
-    end
-
-    # Returns the first link that matches the given state mask.
-    #
-    # Examines the state of each link owned by the connection and returns the
-    # first that matches the given state mask. If the state mask contains
-    # *both* local and remote flags, then an exact match against those flags
-    # is performed. If the state mask contains *only* local or remote flags,
-    # then a match occurs if *any* of the local ore remote flags are set,
-    # respectively.
-    #
-    # @param mask [Fixnum] The state mask to be matched.
-    #
-    # @return [Link] The first matching link, or nil if none matched.
-    #
-    # @see Endpoint#LOCAL_UNINIT
-    # @see Endpoint#LOCAL_ACTIVE
-    # @see Endpoint#LOCAL_CLOSED
-    # @see Endpoint#REMOTE_UNINIT
-    # @see Endpoint#REMOTE_ACTIVE
-    # @see Endpoint#REMOTE_CLOSED
-    #
-    def link_head(mask)
-      Link.wrap(Cproton.pn_link_head(@impl, mask))
-    end
-
-    # Extracts the first delivery on the connection that has pending
-    # operations.
-    #
-    # A readable delivery indicates message data is waiting to be read. A
-    # A writable delivery indcates that message data may be sent. An updated
-    # delivery indicates that the delivery's disposition has changed.
-    #
-    # A delivery will never be *both* readable and writable, but it may be
-    # both readable or writable and updated.
-    #
-    # @return [Delivery] The delivery, or nil if none are available.
-    #
-    # @see Delivery#next
-    #
-    def work_head
-      Delivery.wrap(Cproton.pn_work_head(@impl))
-    end
-
-    # Returns the code for a connection error.
-    #
-    # @return [Fixnum] The error code.
-    #
-    def error
-      Cproton.pn_error_code(Cproton.pn_connection_error(@impl))
-    end
-
-    # @private
-    def _local_condition
-      Cproton.pn_connection_condition(@impl)
-    end
-
-    # @private
-    def _remote_condition
-      Cproton.pn_connection_remote_condition(@impl)
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/core/delivery.rb b/proton-c/bindings/ruby/lib/core/delivery.rb
deleted file mode 100644
index 5c0b25c..0000000
--- a/proton-c/bindings/ruby/lib/core/delivery.rb
+++ /dev/null
@@ -1,271 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  # A Delivery maintains detail on the delivery of data to an endpoint.
-  #
-  # A Delivery has a single parent Qpid::Proton::Link
-  #
-  # @example
-  #
-  #   # SCENARIO: An event comes in notifying that data has been delivered to
-  #   #           the local endpoint. A Delivery object can be used to check
-  #   #           the details of the delivery.
-  #
-  #   delivery = @event.delivery
-  #   if delivery.readable? && !delivery.partial?
-  #     # decode the incoming message
-  #     msg = Qpid::Proton::Message.new
-  #     msg.decode(link.receive(delivery.pending))
-  #   end
-  #
-  class Delivery
-
-    # @private
-    include Util::Wrapper
-
-    # @private
-    def self.wrap(impl) # :nodoc:
-      return nil if impl.nil?
-      self.fetch_instance(impl, :pn_delivery_attachments) || Delivery.new(impl)
-    end
-
-    # @private
-    def initialize(impl)
-      @impl = impl
-      @local = Disposition.new(Cproton.pn_delivery_local(impl), true)
-      @remote = Disposition.new(Cproton.pn_delivery_remote(impl), false)
-      self.class.store_instance(self, :pn_delivery_attachments)
-    end
-
-    # @private
-    include Util::SwigHelper
-
-    # @private
-    PROTON_METHOD_PREFIX = "pn_delivery"
-
-    # @!attribute [r] tag
-    #
-    # @return [String] The tag for the delivery.
-    #
-    proton_caller :tag
-
-    # @!attribute [r] writable?
-    #
-    # A delivery is considered writable if it is the current delivery on an
-    # outgoing link, and the link has positive credit.
-    #
-    # @return [Boolean] Returns if a delivery is writable.
-    #
-    proton_caller :writable?
-
-    # @!attribute [r] readable?
-    #
-    # A delivery is considered readable if it is the current delivery on an
-    # incoming link.
-    #
-    # @return [Boolean] Returns if a delivery is readable.
-    #
-    proton_caller :readable?
-    # @!attribute [r] updated?
-    #
-    # A delivery is considered updated whenever the peer communicates a new
-    # disposition for the dlievery. Once a delivery becomes updated, it will
-    # remain so until cleared.
-    #
-    # @return [Boolean] Returns if a delivery is updated.
-    #
-    # @see #clear
-    #
-    proton_caller :updated?
-
-    # @!method clear
-    #
-    # Clear the updated flag for a delivery.
-    #
-    proton_caller :clear
-
-    # @!attribute [r] pending
-    #
-    # @return [Fixnum] Return the amount of pending message data for the
-    # delivery.
-    #
-    proton_caller :pending
-
-    # @!attribute [r] partial?
-    #
-    # @return [Boolean] Returns if the delivery has only partial message data.
-    #
-    proton_caller :partial?
-
-    # @!attribute [r] settled?
-    #
-    # @return [Boolean] Returns if the delivery is remotely settled.
-    #
-    proton_caller :settled?
-
-
-    # @!method settle
-    #
-    # Settles a delivery.
-    #
-    #  A settled delivery can never be used again.
-    #
-    proton_caller :settle
-
-    # @!method dump
-    #
-    #  Utility function for printing details of a delivery.
-    #
-    proton_caller :dump
-
-    # @!attribute [r] buffered?
-    #
-    # A delivery that is buffered has not yet been written to the wire.
-    #
-    # Note that returning false does not imply that a delivery was definitely
-    # written to the wire. If false is returned, it is not known whether the
-    # delivery was actually written to the wire or not.
-    #
-    # @return [Boolean] Returns if the delivery is buffered.
-    #
-    proton_caller :buffered?
-
-    include Util::Engine
-
-    def update(state)
-      impl = @local.impl
-      object_to_data(@local.data, Cproton.pn_disposition_data(impl))
-      object_to_data(@local.annotations, Cproton.pn_disposition_annotations(impl))
-      object_to_data(@local.condition, Cproton.pn_disposition_condition(impl))
-      Cproton.pn_delivery_update(@impl, state)
-    end
-
-    # Returns the local disposition state for the delivery.
-    #
-    # @return [Disposition] The local disposition state.
-    #
-    def local_state
-      Cproton.pn_delivery_local_state(@impl)
-    end
-
-    # Returns the remote disposition state for the delivery.
-    #
-    # @return [Disposition] The remote disposition state.
-    #
-    def remote_state
-      Cproton.pn_delivery_remote_state(@impl)
-    end
-
-    # Returns the next delivery on the connection that has pending operations.
-    #
-    # @return [Delivery, nil] The next delivery, or nil if there are none.
-    #
-    # @see Connection#work_head
-    #
-    def work_next
-      Delivery.wrap(Cproton.pn_work_next(@impl))
-    end
-
-    # Returns the parent link.
-    #
-    # @return [Link] The parent link.
-    #
-    def link
-      Link.wrap(Cproton.pn_delivery_link(@impl))
-    end
-
-    # Returns the parent session.
-    #
-    # @return [Session] The session.
-    #
-    def session
-      self.link.session
-    end
-
-    # Returns the parent connection.
-    #
-    # @return [Connection] The connection.
-    #
-    def connection
-      self.session.connection
-    end
-
-    # Returns the parent transport.
-    #
-    # @return [Transport] The transport.
-    #
-    def transport
-      self.connection.transport
-    end
-
-    # @private
-    def local_received?
-      self.local_state == Disposition::RECEIVED
-    end
-
-    # @private
-    def remote_received?
-      self.remote_state == Disposition::RECEIVED
-    end
-
-    # @private
-    def local_accepted?
-      self.local_state == Disposition::ACCEPTED
-    end
-
-    # @private
-    def remote_accepted?
-      self.remote_state == Disposition::ACCEPTED
-    end
-
-    # @private
-    def local_rejected?
-      self.local_state == Disposition::REJECTED
-    end
-
-    # @private
-    def remote_rejected?
-      self.remote_state == Disposition::REJECTED
-    end
-
-    # @private
-    def local_released?
-      self.local_state == Disposition::RELEASED
-    end
-
-    # @private
-    def remote_released?
-      self.remote_state == Disposition::RELEASED
-    end
-
-    # @private
-    def local_modified?
-      self.local_state == Disposition::MODIFIED
-    end
-
-    # @private
-    def remote_modified?
-      self.remote_state == Disposition::MODIFIED
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/core/disposition.rb b/proton-c/bindings/ruby/lib/core/disposition.rb
deleted file mode 100644
index 20dafd7..0000000
--- a/proton-c/bindings/ruby/lib/core/disposition.rb
+++ /dev/null
@@ -1,158 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  # Disposition records the current state and/or final outcome of a transfer.
-  #
-  # Every delivery contains both a local and a remote disposition. The local
-  # disposition holds the local state of the delivery, and the remote
-  # disposition holds the *last known* remote state of the delivery.
-  #
-  class Disposition
-
-    include Util::Constants
-
-    # Indicates the delivery was received.
-    self.add_constant(:RECEIVED, Cproton::PN_RECEIVED)
-    # Indicates the delivery was accepted.
-    self.add_constant(:ACCEPTED, Cproton::PN_ACCEPTED)
-    # Indicates the delivery was rejected.
-    self.add_constant(:REJECTED, Cproton::PN_REJECTED)
-    # Indicates the delivery was released.
-    self.add_constant(:RELEASED, Cproton::PN_RELEASED)
-    # Indicates the delivery was modified.
-    self.add_constant(:MODIFIED, Cproton::PN_MODIFIED)
-
-    # @private
-    include Util::Engine
-
-    attr_reader :impl
-
-    # @private
-    def initialize(impl, local)
-      @impl = impl
-      @local = local
-      @data = nil
-      @condition = nil
-      @annotations = nil
-    end
-
-    # @private
-    include Util::SwigHelper
-
-    # @private
-    PROTON_METHOD_PREFIX = "pn_disposition"
-
-    # @!attribute section_number
-    #
-    # @return [Fixnum] The section number of the disposition.
-    #
-    proton_accessor :section_number
-
-    # @!attribute section_offset
-    #
-    #  @return [Fixnum] The section offset of the disposition.
-    #
-    proton_accessor :section_offset
-
-    # @!attribute failed?
-    #
-    # @return [Boolean] The failed flag.
-    #
-    proton_accessor :failed, :is_or_get => :is
-
-    # @!attribute undeliverable?
-    #
-    # @return [Boolean] The undeliverable flag.
-    #
-    proton_accessor :undeliverable, :is_or_get => :is
-
-    # Sets the data for the disposition.
-    #
-    # @param data [Codec::Data] The data.
-    #
-    # @raise [AttributeError] If the disposition is remote.
-    #
-    def data=(data)
-      raise AttributeError.new("data attribute is read-only") unless @local
-      @data = data
-    end
-
-    # Returns the data for the disposition.
-    #
-    # @return [Codec::Data] The data.
-    #
-    def data
-      if @local
-        @data
-      else
-        data_to_object(Cproton.pn_disposition_data(@impl))
-      end
-    end
-
-    # Sets the annotations for the disposition.
-    #
-    # @param annotations [Codec::Data] The annotations.
-    #
-    # @raise [AttributeError] If the disposition is remote.
-    #
-    def annotations=(annotations)
-      raise AttributeError.new("annotations attribute is read-only") unless @local
-      @annotations = annotations
-    end
-
-    # Returns the annotations for the disposition.
-    #
-    # @return [Codec::Data] The annotations.
-    #
-    def annotations
-      if @local
-        @annotations
-      else
-        data_to_object(Cproton.pn_disposition_annotations(@impl))
-      end
-    end
-
-    # Sets the condition for the disposition.
-    #
-    # @param condition [Codec::Data] The condition.
-    #
-    # @raise [AttributeError] If the disposition is remote.
-    #
-    def condition=(condition)
-      raise AttributeError.new("condition attribute is read-only") unless @local
-      @condition = condition
-    end
-
-    # Returns the condition of the disposition.
-    #
-    # @return [Codec::Data] The condition of the disposition.
-    #
-    def condition
-      if @local
-        @condition
-      else
-        condition_to_object(Cproton.pn_disposition_condition(@impl))
-      end
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/core/endpoint.rb b/proton-c/bindings/ruby/lib/core/endpoint.rb
deleted file mode 100644
index f3ddbcb..0000000
--- a/proton-c/bindings/ruby/lib/core/endpoint.rb
+++ /dev/null
@@ -1,140 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  # Endpoint is the parent classes for Link and Session.
-  #
-  # It provides a namespace for constant values that relate to the current
-  # state of both links and sessions.
-  #
-  # @example
-  #
-  #   conn = Qpid::Proton::Connection.new
-  #   puts "Local connection flags : #{conn.state || Qpid::Proton::Endpoint::LOCAL_MASK}"
-  #   puts "Remote connection flags: #{conn.state || Qpid::Proton::Endpoint::REMOTE_MASK}"
-  #
-  class Endpoint
-
-    # The local connection is uninitialized.
-    LOCAL_UNINIT = Cproton::PN_LOCAL_UNINIT
-    # The local connection is active.
-    LOCAL_ACTIVE = Cproton::PN_LOCAL_ACTIVE
-    # The local connection is closed.
-    LOCAL_CLOSED = Cproton::PN_LOCAL_CLOSED
-
-    # The remote connection is unitialized.
-    REMOTE_UNINIT = Cproton::PN_REMOTE_UNINIT
-    # The remote connection is active.
-    REMOTE_ACTIVE = Cproton::PN_REMOTE_ACTIVE
-    # The remote connection is closed.
-    REMOTE_CLOSED = Cproton::PN_REMOTE_CLOSED
-
-    # Bitmask for the local-only flags.
-    LOCAL_MASK = Cproton::PN_LOCAL_UNINIT |
-                 Cproton::PN_LOCAL_ACTIVE |
-                 Cproton::PN_LOCAL_CLOSED
-
-    # Bitmask for the remote-only flags.
-    REMOTE_MASK = Cproton::PN_REMOTE_UNINIT |
-                  Cproton::PN_REMOTE_ACTIVE |
-                  Cproton::PN_REMOTE_CLOSED
-
-    # @private
-    include Util::Engine
-
-    # @private
-    def initialize
-      @condition = nil
-    end
-
-    # @private
-    def _update_condition
-      object_to_condition(@condition, self._local_condition)
-    end
-
-    # @private
-    def remote_condition
-      condition_to_object(self._remote_condition)
-    end
-
-    # Return the transport associated with this endpoint.
-    #
-    # @return [Transport] The transport.
-    #
-    def transport
-      self.connection.transport
-    end
-
-    def local_uninit?
-      check_state(LOCAL_UNINIT)
-    end
-
-    def local_active?
-      check_state(LOCAL_ACTIVE)
-    end
-
-    def local_closed?
-      check_state(LOCAL_CLOSED)
-    end
-
-    def remote_uninit?
-      check_state(REMOTE_UNINIT)
-    end
-
-    def remote_active?
-      check_state(REMOTE_ACTIVE)
-    end
-
-    def remote_closed?
-      check_state(REMOTE_CLOSED)
-    end
-
-    def check_state(state_mask)
-      !(self.state & state_mask).zero?
-    end
-
-    def handler
-      reactor = Qpid::Proton::Reactor::Reactor.wrap(Cproton.pn_object_reactor(@impl))
-      if reactor.nil?
-        on_error = nil
-      else
-        on_error = reactor.method(:on_error)
-      end
-      record = self.attachments
-      puts "record=#{record}"
-      WrappedHandler.wrap(Cproton.pn_record_get_handler(record), on_error)
-    end
-
-    def handler=(handler)
-      reactor = Qpid::Proton::Reactor::Reactor.wrap(Cproton.pn_object_reactor(@impl))
-      if reactor.nil?
-        on_error = nil
-      else
-        on_error = reactor.method(:on_error)
-      end
-      impl = chandler(handler, on_error)
-      record = self.attachments
-      Cproton.pn_record_set_handler(record, impl)
-      Cproton.pn_decref(impl)
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/core/exceptions.rb b/proton-c/bindings/ruby/lib/core/exceptions.rb
deleted file mode 100644
index 75d6552..0000000
--- a/proton-c/bindings/ruby/lib/core/exceptions.rb
+++ /dev/null
@@ -1,126 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid
-
-  module Proton
-
-    module Error
-
-      NONE = 0
-      EOS = Cproton::PN_EOS
-      ERROR = Cproton::PN_ERR
-      OVERFLOW = Cproton::PN_OVERFLOW
-      UNDERFLOW = Cproton::PN_UNDERFLOW
-      STATE = Cproton::PN_STATE_ERR
-      ARGUMENT = Cproton::PN_ARG_ERR
-      TIMEOUT = Cproton::PN_TIMEOUT
-      INTERRUPTED = Cproton::PN_INTR
-      INPROGRESS = Cproton::PN_INPROGRESS
-
-    end
-
-    # Represents a generic error at the messaging level.
-    #
-    class ProtonError < RuntimeError
-    end
-
-    # Represents an end-of-stream error while messaging.
-    #
-    class EOSError < ProtonError
-    end
-
-    # Represents a data overflow exception while messaging.
-    #
-    class OverflowError < ProtonError
-    end
-
-    # Represents a data underflow exception while messaging.
-    #
-    class UnderflowError < ProtonError
-    end
-
-    # Represents an invalid, missing or illegal argument while messaging.
-    #
-    class ArgumentError < ProtonError
-    end
-
-    # Represents that the client has got into an unexpected state during
-    # messaging.
-    #
-    class StateError < ProtonError
-    end
-
-    # Represents a timeout during messaging.
-    #
-    class TimeoutError < ProtonError
-    end
-
-    # Represents an interrupting during a blocking I/O operation.
-    #
-    class InterruptedError < ProtonError
-    end
-
-    class InProgressError < ProtonError
-    end
-
-    # Raised by instances of Transport.
-    #
-    class TransportError < ProtonError
-    end
-
-    # Raised by instances of SASL
-    #
-    class SASLError < TransportError
-    end
-
-    # Raised by Session.
-    #
-    class SessionError < ProtonError
-    end
-
-    # Raised when an attempt is made to change an attribute that is read-only.
-    #
-    class AttributeError < ProtonError
-    end
-
-    # Raised by link components.
-    #
-    class LinkError < ProtonError
-    end
-
-    class SSLError < TransportError
-    end
-
-    class SSLUnavailableError < SSLError
-    end
-
-    # Raised when a message is rejected.
-    #
-    class Reject < ProtonError
-    end
-
-    # Raised when a message is released.
-    #
-    class Release < ProtonError
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/core/link.rb b/proton-c/bindings/ruby/lib/core/link.rb
deleted file mode 100644
index 86a307a..0000000
--- a/proton-c/bindings/ruby/lib/core/link.rb
+++ /dev/null
@@ -1,387 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  # The base for both Sender and Receiver, providing common functionality
-  # between both ends.
-  #
-  # A Link has a single parent Qpid::Proton::Session instance.
-  #
-  class Link < Endpoint
-
-    # The sender will send all deliveries initially unsettled.
-    SND_UNSETTLED = Cproton::PN_SND_UNSETTLED
-    # The sender will send all deliveries settled to the receiver.
-    SND_SETTLED = Cproton::PN_SND_SETTLED
-    # The sender may send a mixture of settled and unsettled deliveries.
-    SND_MIXED = Cproton::PN_SND_MIXED
-
-    # The receiver will settle deliveries regardless of what the sender does.
-    RCV_FIRST = Cproton::PN_RCV_FIRST
-    # The receiver will only settle deliveries after the sender settles.
-    RCV_SECOND = Cproton::PN_RCV_SECOND
-
-    # @private
-    include Util::SwigHelper
-
-    # @private
-    PROTON_METHOD_PREFIX = "pn_link"
-
-    # @!attribute [r] state
-    #
-    # Returns the endpoint state flags.
-    #
-    proton_caller :state
-
-    # @!method open
-    #
-    # Opens the link. Once this operation has completed, the state flag will be
-    # set.
-    #
-    # @see Endpoint::LOCAL_ACTIVE
-    proton_caller :open
-
-    # @!method close
-    #
-    # Closes the link.
-    #
-    # Once this operation has completed, the state flag will be set.
-    # This may be called without first calling #open, which is the equivalent to
-    # calling #open and then #close.
-    #
-    # @see Endpoint::LOCAL_CLOSED
-    proton_caller :close
-
-    # @!method detach
-    #
-    # Detaches the link.
-    proton_caller :detach
-
-    # Advance the current delivery to the next on the link.
-    #
-    # For sending links, this operation is used to finish sending message data
-    # for the current outgoing delivery and move on to the next outgoing
-    # delivery (if any).
-    #
-    # For receiving links, this operatoin is used to finish accessing message
-    # data from the current incoming delivery and move on to the next incoming
-    # delivery (if any).
-    #
-    # @return [Boolean] True if the current delivery was changed.
-    #
-    # @see #current
-    #
-    proton_caller :advance
-
-    proton_caller :unsettled
-
-    # @!attribute [r] credit
-    #
-    # Returns the credit balance for a link.
-    #
-    # Links use a credit based flow control scheme. Every receiver maintains a
-    # credit balance that corresponds to the number of deliveries that the
-    # receiver can accept at any given moment.
-    #
-    # As more capacity becomes available at the receiver, it adds credit to this
-    # balance and communicates the new balance to the sender. Whenever a
-    # delivery is sent/received, the credit balance maintained by the link is
-    # decremented by one.
-    #
-    # Once the credit balance at the sender reaches zero, the sender must pause
-    # sending until more credit is obtained from the receiver.
-    #
-    # NOte that a sending link may still be used to send deliveries eve if
-    # credit reaches zero. However those deliveries will end up being buffer by
-    # the link until enough credit is obtained from the receiver to send them
-    # over the wire. In this case the balance reported will go negative.
-    #
-    # @return [Fixnum] The credit balance.
-    #
-    # @see #flow
-    #
-    proton_caller :credit
-
-    # @!attribute [r] remote_credit
-    #
-    # Returns the remote view of the credit.
-    #
-    # The remote view of the credit for a link differs from the local view of
-    # credit for a link by the number of queued deliveries. In other words,
-    # remote credit is defined as credit - queued.
-    #
-    # @see #queued
-    # @see #credit
-    #
-    # @return [Fixnum] The remove view of the credit.
-    #
-    proton_caller :remote_credit
-
-    # @!attribute [r] available
-    #
-    # Returns the available deliveries hint for a link.
-    #
-    # The available count for a link provides a hint as to the number of
-    # deliveries that might be able to be sent if sufficient credit were issued
-    # by the receiving link endpoint.
-    #
-    # @return [Fixnum] The available deliveries hint.
-    #
-    # @see Sender#offered
-    #
-    proton_caller :available
-
-    # @!attribute [r] queued
-    #
-    # Returns the number of queued deliveries for a link.
-    #
-    # Links may queue deliveries for a number of reasons. For example, there may
-    # be insufficient credit to send them to the receiver, or they simply may
-    # not have yet had a chance to be written to the wire.
-    #
-    # @return [Fixnum] The number of queued deliveries.
-    #
-    # @see #credit
-    #
-    proton_caller :queued
-
-    # @!attribute [r] name
-    #
-    # Returns the name of the link.
-    #
-    # @return [String] The name.
-    #
-    proton_caller :name
-
-    # @!attribute [r] sender?
-    #
-    # Returns if the link is a sender.
-    #
-    # @return [Boolean] True if the link is a sender.
-    #
-    proton_reader  :sender, :is_or_get => :is
-
-    # @!attribute [r] receiver?
-    #
-    # Returns if the link is a receiver.
-    #
-    # @return [Boolean] True if the link is a receiver.
-    #
-    proton_reader  :receiver, :is_or_get => :is
-
-    # @private
-    proton_reader :attachments
-
-    # Drains excess credit.
-    #
-    # When a link is in drain mode, the sender must use all excess credit
-    # immediately and release any excess credit back to the receiver if there
-    # are no deliveries available to send.
-    #
-    # When invoked on a Sender that is in drain mode, this operation will
-    # release all excess credit back to the receiver and return the number of
-    # credits released back to the sender. If the link is not in drain mode,
-    # this operation is a noop.
-    #
-    # When invoked on a Receiver, this operation will return and reset the
-    # number of credits the sender has released back to it.
-    #
-    # @return [Fixnum] The number of credits drained.
-    #
-    proton_caller :drained
-
-    # @private
-    include Util::Wrapper
-
-    # @private
-    def self.wrap(impl)
-      return nil if impl.nil?
-
-      result = self.fetch_instance(impl, :pn_link_attachments)
-      return result unless result.nil?
-      if Cproton.pn_link_is_sender(impl)
-        return Sender.new(impl)
-      elsif Cproton.pn_link_is_receiver(impl)
-        return Receiver.new(impl)
-      end
-    end
-
-    # @private
-    def initialize(impl)
-      @impl = impl
-      self.class.store_instance(self, :pn_link_attachments)
-    end
-
-    # Returns additional error information.
-    #
-    # Whenever a link operation fails (i.e., returns an error code) additional
-    # error details can be obtained from this method. Ther error object that is
-    # returned may also be used to clear the error condition.
-    #
-    # @return [Error] The error.
-    #
-    def error
-      Cproton.pn_link_error(@impl)
-    end
-
-    # Returns the next link that matches the given state mask.
-    #
-    # @param state_mask [Fixnum] The state mask.
-    #
-    # @return [Sender, Receiver] The next link.
-    #
-    def next(state_mask)
-      return Link.wrap(Cproton.pn_link_next(@impl, state_mask))
-    end
-
-    # Returns the locally defined source terminus.
-    #
-    # @return [Terminus] The terminus
-    def source
-      Terminus.new(Cproton.pn_link_source(@impl))
-    end
-
-    # Returns the locally defined target terminus.
-    #
-    # @return [Terminus] The terminus.
-    #
-    def target
-      Terminus.new(Cproton.pn_link_target(@impl))
-    end
-
-    # Returns a representation of the remotely defined source terminus.
-    #
-    # @return [Terminus] The terminus.
-    #
-    def remote_source
-      Terminus.new(Cproton.pn_link_remote_source(@impl))
-    end
-
-    # Returns a representation of the remotely defined target terminus.
-    #
-    # @return [Terminus] The terminus.
-    #
-    def remote_target
-      Terminus.new(Cproton.pn_link_remote_target(@impl))
-    end
-
-    # Returns the parent session.
-    #
-    # @return [Session] The session.
-    #
-    def session
-      Session.wrap(Cproton.pn_link_session(@impl))
-    end
-
-    # Returns the parent connection.
-    #
-    # @return [Connection] The connection.
-    #
-    def connection
-      self.session.connection
-    end
-
-    # Returns the parent delivery.
-    #
-    # @return [Delivery] The delivery.
-    #
-    def delivery(tag)
-      Delivery.new(Cproton.pn_delivery(@impl, tag))
-    end
-
-    # Returns the current delivery.
-    #
-    # Each link maintains a sequence of deliveries in the order they were
-    # created, along with a reference to the *current* delivery. All send and
-    # receive operations on a link take place on the *current* delivery. If a
-    # link has no current delivery, the current delivery is automatically
-    # pointed to the *next* delivery created on the link.
-    #
-    # Once initialized, the current delivery remains the same until it is
-    # changed by advancing, or until it is settled.
-    #
-    # @see #next
-    # @see Delivery#settle
-    #
-    # @return [Delivery] The current delivery.
-    #
-    def current
-      Delivery.wrap(Cproton.pn_link_current(@impl))
-    end
-
-    # Sets the local sender settle mode.
-    #
-    # @param mode [Fixnum] The settle mode.
-    #
-    # @see #SND_UNSETTLED
-    # @see #SND_SETTLED
-    # @see #SND_MIXED
-    #
-    def snd_settle_mode=(mode)
-      Cproton.pn_link_set_snd_settle_mode(@impl, mode)
-    end
-
-    # Returns the local sender settle mode.
-    #
-    # @return [Fixnum] The local sender settle mode.
-    #
-    # @see #snd_settle_mode
-    #
-    def snd_settle_mode
-      Cproton.pn_link_snd_settle_mode(@impl)
-    end
-
-    # Sets the local receiver settle mode.
-    #
-    # @param mode [Fixnum] The settle mode.
-    #
-    # @see #RCV_FIRST
-    # @see #RCV_SECOND
-    #
-    def rcv_settle_mode=(mode)
-      Cproton.pn_link_set_rcv_settle_mode(@impl, mode)
-    end
-
-    # Returns the local receiver settle mode.
-    #
-    # @return [Fixnum] The local receiver settle mode.
-    #
-    def rcv_settle_mode
-      Cproton.pn_link_rcv_settle_mode(@impl)
-    end
-
-    # @private
-    def _local_condition
-      Cproton.pn_link_condition(@impl)
-    end
-
-    # @private
-    def _remote_condition
-      Cproton.pn_link_remote_condition(@impl)
-    end
-
-    def ==(other)
-      other.respond_to?(:impl) &&
-      (Cproton.pni_address_of(other.impl) == Cproton.pni_address_of(@impl))
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/core/message.rb b/proton-c/bindings/ruby/lib/core/message.rb
deleted file mode 100644
index 53e7092..0000000
--- a/proton-c/bindings/ruby/lib/core/message.rb
+++ /dev/null
@@ -1,633 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  # A Message represents an addressable quantity of data.
-  #
-  # ==== Message Body
-  #
-  # The message body can be set using the #body= method. The message will
-  # then attempt to determine how exactly to encode the content.
-  #
-  # ==== Examples
-  #
-  # To create a message for sending:
-  #
-  #   # send a simple text message
-  #   msg = Qpid::Proton::Message.new
-  #   msg.body = "STATE: update"
-  #
-  #   # send a binary chunk of data
-  #   data = File.binread("/home/qpid/binfile.tar.gz")
-  #   msg = Qpid::Proton::Message.new
-  #   msg.body = Qpid::Proton::BinaryString.new(data)
-  #
-  class Message
-
-    # @private
-    def proton_send(sender, tag = nil)
-      dlv = sender.delivery(tag || sender.delivery_tag)
-      encoded = self.encode
-      sender.stream(encoded)
-      sender.advance
-      dlv.settle if sender.snd_settle_mode == Link::SND_SETTLED
-      return dlv
-    end
-
-    # Decodes a message from supplied AMQP data and returns the number
-    # of bytes consumed.
-    #
-    # ==== Options
-    #
-    # * encoded - the encoded data
-    #
-    def decode(encoded)
-      check(Cproton.pn_message_decode(@impl, encoded, encoded.length))
-
-      post_decode
-    end
-
-    def post_decode # :nodoc:
-      # decode elements from the message
-      @properties = {}
-      props = Codec::Data.new(Cproton::pn_message_properties(@impl))
-      if props.next
-        @properties = props.type.get(props)
-      end
-      @instructions = nil
-      insts = Codec::Data.new(Cproton::pn_message_instructions(@impl))
-      if insts.next
-        @instructions = insts.type.get(insts)
-      end
-      @annotations = nil
-      annts = Codec::Data.new(Cproton::pn_message_annotations(@impl))
-      if annts.next
-        @annotations = annts.type.get(annts)
-      end
-      @body = nil
-      body = Codec::Data.new(Cproton::pn_message_body(@impl))
-      if body.next
-        @body = body.type.get(body)
-      end
-    end
-
-    # Encodes the message.
-    def encode
-      pre_encode
-      size = 16
-      loop do
-        error, data = Cproton::pn_message_encode(@impl, size)
-        if error == Qpid::Proton::Error::OVERFLOW
-          size *= 2
-        else
-          check(error)
-          return data
-        end
-      end
-    end
-
-    def pre_encode # :nodoc:
-      # encode elements from the message
-      props = Codec::Data.new(Cproton::pn_message_properties(@impl))
-      props.clear
-      Codec::Mapping.for_class(@properties.class).put(props, @properties) unless @properties.empty?
-      insts = Codec::Data.new(Cproton::pn_message_instructions(@impl))
-      insts.clear
-      if !@instructions.nil?
-        mapping = Codec::Mapping.for_class(@instructions.class)
-        mapping.put(insts, @instructions)
-      end
-      annts = Codec::Data.new(Cproton::pn_message_annotations(@impl))
-      annts.clear
-      if !@annotations.nil?
-        mapping = Codec::Mapping.for_class(@annotations.class)
-        mapping.put(annts, @annotations, :keys => :SYMBOL)
-      end
-      body = Codec::Data.new(Cproton::pn_message_body(@impl))
-      body.clear
-      if !@body.nil?
-        mapping = Codec::Mapping.for_class(@body.class)
-        mapping.put(body, @body)
-      end
-    end
-
-    # Creates a new +Message+ instance.
-    def initialize
-      @impl = Cproton.pn_message
-      ObjectSpace.define_finalizer(self, self.class.finalize!(@impl))
-      @properties = {}
-      @instructions = {}
-      @annotations = {}
-      @body = nil
-    end
-
-    def to_s
-      tmp = Cproton.pn_string("")
-      Cproton.pn_inspect(@impl, tmp)
-      result = Cproton.pn_string_get(tmp)
-      Cproton.pn_free(tmp)
-      return result
-    end
-
-    # Invoked by garbage collection to clean up resources used
-    # by the underlying message implementation.
-    def self.finalize!(impl) # :nodoc:
-      proc {
-        Cproton.pn_message_free(impl)
-      }
-    end
-
-    # Returns the underlying message implementation.
-    def impl # :nodoc:
-      @impl
-    end
-
-    # Clears the state of the +Message+. This allows a single instance of
-    # +Message+ to be reused.
-    #
-    def clear
-      Cproton.pn_message_clear(@impl)
-      @properties.clear unless @properties.nil?
-      @instructions.clear unless @instructions.nil?
-      @annotations.clear unless @annotations.nil?
-      @body = nil
-    end
-
-    # Returns the most recent error number.
-    #
-    def errno
-      Cproton.pn_message_errno(@impl)
-    end
-
-    # Returns the most recent error message.
-    #
-    def error
-      Cproton.pn_error_text(Cproton.pn_message_error(@impl))
-    end
-
-    # Returns whether there is currently an error reported.
-    #
-    def error?
-      !Cproton.pn_message_errno(@impl).zero?
-    end
-
-    # Sets the durable flag.
-    #
-    # See ::durable for more details on message durability.
-    #
-    # ==== Options
-    #
-    # * state - the durable state
-    #
-    def durable=(state)
-      raise TypeError.new("state cannot be nil") if state.nil?
-      Cproton.pn_message_set_durable(@impl, state)
-    end
-
-    # Returns the durable property.
-    #
-    # The durable property indicates that the emessage should be held durably
-    # by any intermediaries taking responsibility for the message.
-    #
-    # ==== Examples
-    #
-    #  msg = Qpid::Proton::Message.new
-    #  msg.durable = true
-    #
-    def durable
-      Cproton.pn_message_is_durable(@impl)
-    end
-
-    # Sets the priority.
-    #
-    # +NOTE:+ Priority values are limited to the range [0,255].
-    #
-    # ==== Options
-    #
-    # * priority - the priority value
-    #
-    def priority=(priority)
-      raise TypeError.new("invalid priority: #{priority}") if priority.nil? || !([Float, Fixnum].include?(priority.class))
-      raise RangeError.new("priority out of range: #{priority}") if ((priority > 255) || (priority < 0))
-      Cproton.pn_message_set_priority(@impl, priority.floor)
-    end
-
-    # Returns the priority.
-    #
-    def priority
-      Cproton.pn_message_get_priority(@impl)
-    end
-
-    # Sets the time-to-live for the message.
-    #
-    # ==== Options
-    #
-    # * time - the time in milliseconds
-    #
-    def ttl=(time)
-      raise TypeError.new("invalid ttl: #{time}") if time.nil? || !([Float, Fixnum].include?(time.class))
-      raise RangeError.new("time out of range: #{time}") if ((time < 0))
-      Cproton.pn_message_set_ttl(@impl, time.floor)
-    end
-
-    # Returns the time-to-live, in milliseconds.
-    #
-    def ttl
-      Cproton.pn_message_get_ttl(@impl)
-    end
-
-    # Sets whether this is the first time the message was acquired.
-    #
-    # See ::first_acquirer? for more details.
-    #
-    # ==== Options
-    #
-    # * state - true if claiming the message
-    #
-    def first_acquirer=(state)
-      raise TypeError.new("invalid state: #{state}") if state.nil? || !([TrueClass, FalseClass].include?(state.class))
-      Cproton.pn_message_set_first_acquirer(@impl, state)
-    end
-
-    # Sets the delivery count for the message.
-    #
-    # See ::delivery_count for more details.
-    #
-    # ==== Options
-    #
-    # * count - the delivery count
-    #
-    def delivery_count=(count)
-      raise ::ArgumentError.new("invalid count: #{count}") if count.nil? || !([Float, Fixnum].include?(count.class))
-      raise RangeError.new("count out of range: #{count}") if count < 0
-
-      Cproton.pn_message_set_delivery_count(@impl, count.floor)
-    end
-
-    # Returns the delivery count for the message.
-    #
-    # This is the number of delivery attempts for the given message.
-    #
-    def delivery_count
-      Cproton.pn_message_get_delivery_count(@impl)
-    end
-
-    # Returns whether this is the first acquirer.
-    #
-    #
-    def first_acquirer?
-      Cproton.pn_message_is_first_acquirer(@impl)
-    end
-
-    # Sets the message id.
-    #
-    # ==== Options
-    #
-    # * id = the id
-    #
-    def id=(id)
-      Cproton.pn_message_set_id(@impl, id)
-    end
-
-    # Returns the message id.
-    #
-    def id
-      Cproton.pn_message_get_id(@impl)
-    end
-
-    # Sets the user id.
-    #
-    # ==== Options
-    #
-    # * id - the user id
-    #
-    def user_id=(id)
-      Cproton.pn_message_set_user_id(@impl, id)
-    end
-
-    # Returns the user id.
-    #
-    def user_id
-      Cproton.pn_message_get_user_id(@impl)
-    end
-
-    # Sets the destination address.
-    #
-    # ==== Options
-    #
-    # * address - the address
-    #
-    def address=(address)
-      Cproton.pn_message_set_address(@impl, address)
-    end
-
-    # Returns the destination address.
-    #
-    def address
-      Cproton.pn_message_get_address(@impl)
-    end
-
-    # Sets the subject.
-    #
-    # ==== Options
-    #
-    # * subject - the subject
-    #
-    def subject=(subject)
-      Cproton.pn_message_set_subject(@impl, subject)
-    end
-
-    # Returns the subject
-    #
-    def subject
-      Cproton.pn_message_get_subject(@impl)
-    end
-
-    # Sets the reply-to address.
-    #
-    # ==== Options
-    #
-    # * address - the reply-to address
-    #
-    def reply_to=(address)
-      Cproton.pn_message_set_reply_to(@impl, address)
-    end
-
-    # Returns the reply-to address
-    #
-    def reply_to
-      Cproton.pn_message_get_reply_to(@impl)
-    end
-
-    # Sets the correlation id.
-    #
-    # ==== Options
-    #
-    # * id - the correlation id
-    #
-    def correlation_id=(id)
-      Cproton.pn_message_set_correlation_id(@impl, id)
-    end
-
-    # Returns the correlation id.
-    #
-    def correlation_id
-      Cproton.pn_message_get_correlation_id(@impl)
-    end
-
-    # Sets the content type.
-    #
-    # ==== Options
-    #
-    # * content_type - the content type
-    #
-    def content_type=(content_type)
-      Cproton.pn_message_set_content_type(@impl, content_type)
-    end
-
-    # Returns the content type
-    #
-    def content_type
-      Cproton.pn_message_get_content_type(@impl)
-    end
-
-    # Sets the message content.
-    #
-    # *WARNING:* This method has been deprecated. Please use #body= instead to
-    # set the content of a message.
-    #
-    # ==== Options
-    #
-    # * content - the content
-    #
-    def content=(content)
-      Cproton.pn_message_load(@impl, content)
-    end
-
-    # Returns the message content.
-    #
-    # *WARNING:* This method has been deprecated. Please use #body instead to
-    # retrieve the content of a message.
-    #
-    def content
-      size = 16
-      loop do
-        result = Cproton.pn_message_save(@impl, size)
-        error = result[0]
-        data = result[1]
-        if error == Qpid::Proton::Error::OVERFLOW
-          size = size * 2
-        else
-          check(error)
-          return data
-        end
-      end
-    end
-
-    # Sets the content encoding type.
-    #
-    # ==== Options
-    #
-    # * encoding - the content encoding
-    #
-    def content_encoding=(encoding)
-      Cproton.pn_message_set_content_encoding(@impl, encoding)
-    end
-
-    # Returns the content encoding type.
-    #
-    def content_encoding
-      Cproton.pn_message_get_content_encoding(@impl)
-    end
-
-    # Sets the expiration time.
-    #
-    # ==== Options
-    #
-    # * time - the expiry time
-    #
-    def expires=(time)
-      raise TypeError.new("invalid expiry time: #{time}") if time.nil?
-      raise ::ArgumentError.new("expiry time cannot be negative: #{time}") if time < 0
-      Cproton.pn_message_set_expiry_time(@impl, time)
-    end
-
-    # Returns the expiration time.
-    #
-    def expires
-      Cproton.pn_message_get_expiry_time(@impl)
-    end
-
-    # Sets the creation time.
-    #
-    # ==== Options
-    #
-    # * time - the creation time
-    #
-    def creation_time=(time)
-      raise TypeError.new("invalid time: #{time}") if time.nil?
-      raise ::ArgumentError.new("time cannot be negative") if time < 0
-      Cproton.pn_message_set_creation_time(@impl, time)
-    end
-
-    # Returns the creation time.
-    #
-    def creation_time
-      Cproton.pn_message_get_creation_time(@impl)
-    end
-
-    # Sets the group id.
-    #
-    # ==== Options
-    #
-    # * id - the group id
-    #
-    def group_id=(id)
-      Cproton.pn_message_set_group_id(@impl, id)
-    end
-
-    # Returns the group id.
-    #
-    def group_id
-      Cproton.pn_message_get_group_id(@impl)
-    end
-
-    # Sets the group sequence number.
-    #
-    # ==== Options
-    #
-    # * seq - the sequence number
-    #
-    def group_sequence=(seq)
-      raise TypeError.new("invalid seq: #{seq}") if seq.nil?
-      Cproton.pn_message_set_group_sequence(@impl, seq)
-    end
-
-    # Returns the group sequence number.
-    #
-    def group_sequence
-      Cproton.pn_message_get_group_sequence(@impl)
-    end
-
-    # Sets the reply-to group id.
-    #
-    # ==== Options
-    #
-    # * id - the id
-    #
-    def reply_to_group_id=(id)
-      Cproton.pn_message_set_reply_to_group_id(@impl, id)
-    end
-
-    # Returns the reply-to group id.
-    #
-    def reply_to_group_id
-      Cproton.pn_message_get_reply_to_group_id(@impl)
-    end
-
-    # Returns the list of property names for associated with this message.
-    #
-    # ==== Examples
-    #
-    #   msg.properties.each do |name|
-    #   end
-    #
-    def properties
-      @properties
-    end
-
-    # Replaces the entire set of properties with the specified hash.
-    #
-    def properties=(properties)
-      @properties = properties
-    end
-
-    # Assigns the value given to the named property.
-    #
-    # ==== Arguments
-    #
-    # * name - the property name
-    # * value - the property value
-    #
-    def []=(name, value)
-      @properties[name] = value
-    end
-
-    # Retrieves the value for the specified property name. If not found, then
-    # it returns nil.
-    #
-    def [](name)
-      @properties[name]
-    end
-
-    # Deletes the named property.
-    #
-    def delete_property(name)
-      @properties.delete(name)
-    end
-
-    # Returns the instructions for this message.
-    #
-    def instructions
-      @instructions
-    end
-
-    # Assigns instructions to this message.
-    #
-    def instructions=(instr)
-      @instructions = instr
-    end
-
-    # Returns the annotations for this message.
-    #
-    def annotations
-      @annotations
-    end
-
-    # Assigns annotations to this message.
-    #
-    def annotations=(annotations)
-      @annotations = annotations
-    end
-
-    # Returns the body property of the message.
-    #
-    def body
-      @body
-    end
-
-    # Assigns a new value to the body of the message.
-    #
-    def body=(body)
-      @body = body
-    end
-
-    private
-
-    def check(err) # :nodoc:
-      if err < 0
-        raise DataError, "[#{err}]: #{Cproton.pn_message_error(@data)}"
-      else
-        return err
-      end
-    end
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/core/receiver.rb b/proton-c/bindings/ruby/lib/core/receiver.rb
deleted file mode 100644
index ca7c5e1..0000000
--- a/proton-c/bindings/ruby/lib/core/receiver.rb
+++ /dev/null
@@ -1,95 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  # The receiving endpoint.
-  #
-  # @see Sender
-  #
-  class Receiver < Link
-
-    # @private
-    include Util::SwigHelper
-
-    # @private
-    PROTON_METHOD_PREFIX = "pn_link"
-
-    # @!attribute drain
-    #
-    # The drain mode.
-    #
-    # If a receiver is in drain mode, then the sending endpoint of a link must
-    # immediately use up all available credit on the link. If this is not
-    # possible, the excess credit must be returned by invoking #drained.
-    #
-    # Only the receiving endpoint can set the drain mode.
-    #
-    # @return [Boolean] True if drain mode is set.
-    #
-    proton_accessor :drain
-
-    # @!attribute [r] draining?
-    #
-    # Returns if a link is currently draining.
-    #
-    # A link is defined to be draining when drain mode is set to true and
-    # the sender still has excess credit.
-    #
-    # @return [Boolean] True if the receiver is currently draining.
-    #
-    proton_caller :draining?
-
-    # Grants credit for incoming deliveries.
-    #
-    # @param n [Fixnum] The amount to increment the link credit.
-    #
-    def flow(n)
-      Cproton.pn_link_flow(@impl, n)
-    end
-
-    # Allows receiving up to the specified limit of data from the remote
-    # endpoint.
-    #
-    # Note that large messages can be streamed across the network, so just
-    # because there is no data to read does not imply the message is complete.
-    #
-    # To ensure the entirety of the message data has been read, either call
-    # #receive until nil is returned, or verify that #partial? is false and
-    # Delivery#pending is 0.
-    #
-    # @param limit [Fixnum] The maximum bytes to receive.
-    #
-    # @return [Fixnum, nil] The number of bytes received, or nil if the end of
-    # the stream was reached.t
-    #
-    # @see Deliver#pending To see how much buffer space is needed.
-    #
-    # @raise [LinkError] If an error occurs.
-    #
-    def receive(limit)
-      (n, bytes) = Cproton.pn_link_recv(@impl, limit)
-      return nil if n == Qpid::Proton::Error::EOS
-      raise LinkError.new("[#{n}]: #{Cproton.pn_link_error(@impl)}") if n < 0
-      return bytes
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/core/sasl.rb b/proton-c/bindings/ruby/lib/core/sasl.rb
deleted file mode 100644
index 7870652..0000000
--- a/proton-c/bindings/ruby/lib/core/sasl.rb
+++ /dev/null
@@ -1,94 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  # The SASL layer is responsible for establishing an authenticated and/or
-  # encrypted tunnel over which AMQP frames are passed between peers.
-  #
-  # The peer acting as the SASL client must provide authentication
-  # credentials.
-  #
-  # The peer acting as the SASL server must provide authentication against the
-  # received credentials.
-  #
-  # @example
-  #   # SCENARIO: the remote endpoint has not initialized their connection
-  #   #           then the local endpoint, acting as a SASL server, decides
-  #   #           to allow an anonymous connection.
-  #   #
-  #   #           The SASL layer locally assumes the role of server and then
-  #   #           enables anonymous authentication for the remote endpoint.
-  #   #
-  #   sasl = @transport.sasl
-  #   sasl.server
-  #   sasl.mechanisms("ANONYMOUS")
-  #   sasl.done(Qpid::Proton::SASL::OK)
-  #
-  class SASL
-
-    # Negotation has not completed.
-    NONE = Cproton::PN_SASL_NONE
-    # Authentication succeeded.
-    OK = Cproton::PN_SASL_OK
-    # Authentication failed due to bad credentials.
-    AUTH = Cproton::PN_SASL_AUTH
-
-    # Constructs a new instance for the given transport.
-    #
-    # @param transport [Transport] The transport.
-    #
-    # @private A SASL should be fetched only from its Transport
-    #
-    def initialize(transport)
-      @impl = Cproton.pn_sasl(transport.impl)
-    end
-
-    # Sets the acceptable SASL mechanisms.
-    #
-    # @param mechanisms [String] The space-delimited set of mechanisms.
-    #
-    # @example Use anonymous SASL authentication.
-    #  @sasl.mechanisms("GSSAPI CRAM-MD5 PLAIN")
-    #
-    def mechanisms(mechanisms)
-      Cproton.pn_sasl_mechanisms(@impl, mechanisms)
-    end
-
-    # Returns the outcome of the SASL negotiation.
-    #
-    # @return [Fixnum] The outcome.
-    #
-    def outcome
-      outcome = Cprotn.pn_sasl_outcome(@impl)
-      return nil if outcome == NONE
-      outcome
-    end
-
-    # Set the condition of the SASL negotiation.
-    #
-    # @param outcome [Fixnum] The outcome.
-    #
-    def done(outcome)
-      Cproton.pn_sasl_done(@impl, outcome)
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/core/selectable.rb b/proton-c/bindings/ruby/lib/core/selectable.rb
deleted file mode 100644
index 0ae2efe..0000000
--- a/proton-c/bindings/ruby/lib/core/selectable.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  # Selectable enables accessing the underlying file descriptors
-  # for Messenger.
-  #
-  # @private
-  class Selectable
-
-    # @private
-    include Util::SwigHelper
-
-    # @private
-    PROTON_METHOD_PREFIX = "pn_selectable"
-
-    # Returns the underlying file descriptor.
-    #
-    # This can be used in conjunction with the IO class.
-    #
-    def fileno
-      Cproton.pn_selectable_get_fd(@impl)
-    end
-
-    proton_reader :reading, :is_or_get => :is
-
-    proton_reader :writing, :is_or_get => :is
-
-    proton_caller :readable
-
-    proton_caller :writable
-
-    proton_caller :expired
-
-    proton_accessor :registered, :is_or_get => :is
-
-    proton_accessor :terminal, :is_or_get => :is
-
-    proton_caller :terminate
-
-    proton_caller :release
-
-    # @private
-    def self.wrap(impl)
-      return nil if impl.nil?
-
-      self.fetch_instance(impl, :pn_selectable_attachments) || Selectable.new(impl)
-    end
-
-    # @private
-    include Util::Wrapper
-
-    # @private
-    def initialize(impl)
-      @impl = impl
-      self.class.store_instance(self, :pn_selectable_attachments)
-    end
-
-    private
-
-    DEFAULT = Object.new
-
-    public
-
-    def fileno(fd = DEFAULT)
-      if fd == DEFAULT
-        Cproton.pn_selectable_get_fd(@impl)
-      elsif fd.nil?
-        Cproton.pn_selectable_set_fd(@impl, Cproton::PN_INVALID_SOCKET)
-      else
-        Cproton.pn_selectable_set_fd(@impl, fd)
-      end
-    end
-
-    def reading=(reading)
-      if reading.nil?
-        reading = false
-      elsif reading == "0"
-        reading = false
-      else
-        reading = true
-      end
-      Cproton.pn_selectable_set_reading(@impl, reading ? true : false)
-    end
-
-    def writing=(writing)
-      if writing.nil?
-        writing = false
-      elsif writing == "0"
-        writing = false
-      else
-        writing = true
-      end
-      Cproton.pn_selectable_set_writing(@impl, writing ? true : false)
-    end
-
-    def deadline
-      tstamp = Cproton.pn_selectable_get_deadline(@impl)
-      return nil if tstamp.nil?
-      mills_to_sec(tstamp)
-    end
-
-    def deadline=(deadline)
-      Cproton.pn_selectable_set_deadline(sec_to_millis(deadline))
-    end
-
-    def to_io
-      @io ||= IO.new(fileno)
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/core/sender.rb b/proton-c/bindings/ruby/lib/core/sender.rb
deleted file mode 100644
index 9ddcaa0..0000000
--- a/proton-c/bindings/ruby/lib/core/sender.rb
+++ /dev/null
@@ -1,76 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  # The sending endpoint.
-  #
-  # @see Receiver
-  #
-  class Sender < Link
-
-    # @private
-    include Util::ErrorHandler
-
-    # @private
-    can_raise_error :stream, :error_class => Qpid::Proton::LinkError
-
-    # Signals the availability of deliveries.
-    #
-    # @param n [Fixnum] The number of deliveries potentially available.
-    #
-    def offered(n)
-      Cproton.pn_link_offered(@impl, n)
-    end
-
-    # Sends the specified data to the remote endpoint.
-    #
-    # @param object [Object] The content to send.
-    # @param tag [Object] The tag
-    #
-    # @return [Fixnum] The number of bytes sent.
-    #
-    def send(object, tag = nil)
-      if object.respond_to? :proton_send
-        object.proton_send(self, tag)
-      else
-        stream(object)
-      end
-    end
-
-    # Send the specified bytes as part of the current delivery.
-    #
-    # @param bytes [Array] The bytes to send.
-    #
-    # @return n [Fixnum] The number of bytes sent.
-    #
-    def stream(bytes)
-      Cproton.pn_link_send(@impl, bytes)
-    end
-
-    def delivery_tag
-      @tag_count ||= 0
-      result = @tag_count.succ
-      @tag_count = result
-      return "#{result}"
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/core/session.rb b/proton-c/bindings/ruby/lib/core/session.rb
deleted file mode 100644
index 2c9c3a1..0000000
--- a/proton-c/bindings/ruby/lib/core/session.rb
+++ /dev/null
@@ -1,163 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  # A session is the parent for senders and receivers.
-  #
-  # A Session has a single parent Qpid::Proton::Connection instance.
-  #
-  class Session < Endpoint
-
-    # @private
-    include Util::Wrapper
-
-    # @private
-    include Util::SwigHelper
-
-    # @private
-    PROTON_METHOD_PREFIX = "pn_session"
-
-    # @!attribute incoming_capacity
-    #
-    # The incoming capacity of a session determines how much incoming message
-    # data the session will buffer. Note that if this value is less than the
-    # negotatied frame size of the transport, it will be rounded up to one full
-    # frame.
-    #
-    # @return [Fixnum] The incoing capacity of the session, measured in bytes.
-    #
-    proton_accessor :incoming_capacity
-
-    # @private
-    proton_reader :attachments
-
-    # @!attribute [r] outgoing_bytes
-    #
-    # @return [Fixnum] The number of outgoing bytes currently being buffered.
-    #
-    proton_caller :outgoing_bytes
-
-    # @!attribute [r] incoming_bytes
-    #
-    # @return [Fixnum] The number of incomign bytes currently being buffered.
-    #
-    proton_caller :incoming_bytes
-
-    # @!method open
-    # Opens the session.
-    #
-    # Once this operaton has completed, the state flag is updated.
-    #
-    # @see LOCAL_ACTIVE
-    #
-    proton_caller :open
-
-    # @!attribute [r] state
-    #
-    # @return [Fixnum] The endpoint state.
-    #
-    proton_caller :state
-
-    # @private
-    def self.wrap(impl)
-      return nil if impl.nil?
-      self.fetch_instance(impl, :pn_session_attachments) || Session.new(impl)
-    end
-
-    # @private
-    def initialize(impl)
-      @impl = impl
-      self.class.store_instance(self, :pn_session_attachments)
-    end
-
-    # Closed the session.
-    #
-    # Once this operation has completed, the state flag will be set. This may be
-    # called without calling #open, in which case it is the equivalence of
-    # calling #open and then close immediately.
-    #
-    def close
-      self._update_condition
-      Cproton.pn_session_close(@impl)
-    end
-
-    # Retrieves the next session from a given connection that matches the
-    # specified state mask.
-    #
-    # When uses with Connection#session_head an application can access all of
-    # the session son the connection that match the given state.
-    #
-    # @param state_mask [Fixnum] The state mask to match.
-    #
-    # @return [Session, nil] The next session if one matches, or nil.
-    #
-    def next(state_mask)
-      Session.wrap(Cproton.pn_session_next(@impl, state_mask))
-    end
-
-    # Returns the parent connection.
-    #
-    # @return [Connection] The connection.
-    #
-    def connection
-      Connection.wrap(Cproton.pn_session_connection(@impl))
-    end
-
-    # Constructs a new sender.
-    #
-    # Each sender between two AMQP containers must be uniquely named. Note that
-    # this uniqueness cannot be enforced at the library level, so some
-    # consideration should be taken in choosing link names.
-    #
-    # @param name [String] The link name.
-    #
-    # @return [Sender, nil] The sender, or nil if an error occurred.
-    #
-    def sender(name)
-      Sender.new(Cproton.pn_sender(@impl, name))
-    end
-
-    # Constructs a new receiver.
-    #
-    # Each receiver between two AMQP containers must be uniquely named. Note
-    # that this uniqueness cannot be enforced at the library level, so some
-    # consideration should be taken in choosing link names.
-    #
-    # @param name [String] The link name.
-    #
-    # @return [Receiver, nil] The receiver, or nil if an error occurred.
-    #
-    def receiver(name)
-      Receiver.new(Cproton.pn_receiver(@impl, name))
-    end
-
-    # @private
-    def _local_condition
-      Cproton.pn_session_condition(@impl)
-    end
-
-    # @private
-    def _remote_condition # :nodoc:
-      Cproton.pn_session_remote_condition(@impl)
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/core/ssl.rb b/proton-c/bindings/ruby/lib/core/ssl.rb
deleted file mode 100644
index 0b16075..0000000
--- a/proton-c/bindings/ruby/lib/core/ssl.rb
+++ /dev/null
@@ -1,164 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  # The SSL support for Transport.
-  #
-  # A Transport may be configured ot use SLL for encryption and/or
-  # authentication. A Transport can be configured as either the SSL
-  # client or the server. An SSL client is the party that proctively
-  # establishes a connection to an SSL server. An SSL server is the
-  # party that accepts a connection request from the remote SSL client.
-  #
-  # If either the client or the server needs to identify itself with the
-  # remote node, it must have its SSL certificate configured.
-  #
-  # @see SSLDomain#credentials For setting the SSL certificate.
-  #
-  # If either the client or the server needs to verify the identify of the
-  # remote node, it must have its database of trusted CAs configured.
-  #
-  # @see SSLDomain#trusted_ca_db Setting the CA database.
-  #
-  # An SSL server connection may allow the remote client to connect without
-  # SS (i.e., "in the clear").
-  #
-  # @see SSLDomain#allow_unsecured_client Allowing unsecured clients.
-  #
-  # The level of verification required of the remote may be configured.
-  #
-  # @see SSLDomain#peer_authentication Setting peer authentication.
-  #
-  # Support for SSL client session resume is provided as well.
-  #
-  # @see SSLDomain
-  # @see #resume_status
-  #
-  class SSL
-
-    # Session resume state is unkonnwn or not supported.
-    RESUME_UNKNOWN = Cproton::PN_SSL_RESUME_UNKNOWN
-    # Session renegotiated and not resumed.
-    RESUME_NEW = Cproton::PN_SSL_RESUME_NEW
-    # Session resumed from the previous session.
-    RESUME_REUSED = Cproton::PN_SSL_RESUME_REUSED
-
-    # @private
-    include Util::SwigHelper
-
-    # @private
-    PROTON_METHOD_PREFIX = "pn_ssl"
-
-    # @private
-    include Util::ErrorHandler
-
-    can_raise_error :peer_hostname=, :error_class => SSLError
-
-    # Returns whether SSL is supported.
-    #
-    # @return [Boolean] True if SSL support is available.
-    #
-    def self.present?
-      Cproton.pn_ssl_present
-    end
-
-    # @private
-    def self.create(transport, domain, session_details = nil)
-      result = nil
-      # like python, make sure we're not creating a different SSL
-      # object for a transport with an existing SSL object
-      if transport.ssl?
-        transport.instance_eval { result = @ssl }
-        if ((!domain.nil? && (result.domain != domain)) ||
-            (!session_details.nil? && (result.session_details != session_details)))
-          raise SSLException.new("cannot re-configure existing SSL object")
-        end
-      else
-        impl = Cproton.pn_ssl(transport.impl)
-        session_id = nil
-        session_id = session_details.session_id unless session_details.nil?
-        result = SSL.new(impl, domain, session_details, session_id)
-      end
-      return result
-    end
-
-    private
-
-    def initialize(impl, domain, session_details, session_id)
-      @impl = impl
-      @domain = domain.impl unless domain.nil?
-      @session_details = session_details
-      @session_id = session_id
-      Cproton.pn_ssl_init(@impl, @domain, @session_id)
-    end
-
-    public
-
-    # Returns the cipher name that is currently in used.
-    #
-    # Gets the text description of the cipher that is currently active, or
-    # returns nil if SSL is not active. Note that the cipher in use my change
-    # over time due to renegotiation or other changes to the SSL layer.
-    #
-    # @return [String, nil] The cipher name.
-    #
-    def cipher_name
-      rc, name = Cproton.pn_ssl_get_cipher_name(@impl, 128)
-      return name if rc
-      nil
-    end
-
-    # Returns the name of the SSL protocol that is currently active, or
-    # returns nil if SSL is nota ctive. Not that the protocol may change over
-    # time due to renegotation.
-    #
-    # @return [String, nil] The protocol name.
-    #
-    def protocol_name
-      rc, name = Cproton.pn_ssl_get_protocol_name(@impl, 128)
-      retur name if rc
-      nil
-    end
-
-    # Checks whether or not the state has resumed.
-    #
-    # Used for client session resume. When called on an active session, it
-    # indicates wehther the state has been resumed from a previous session.
-    #
-    # *NOTE:* This is a best-effort service - there is no guarantee that the
-    # remote server will accept the resumed parameters. The remote server may
-    # choose to ignore these parameters, and request a renegotation instead.
-    #
-    def resume_status
-      Cproton.pn_ssl_resume_status(@impl)
-    end
-
-    # Gets the peer hostname.
-    #
-    # @return [String] The peer hostname.
-    def peer_hostname
-      (error, name) = Cproton.pn_ssl_get_peer_hostname(@impl, 1024)
-      raise SSLError.new if error < 0
-      return name
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/core/ssl_details.rb b/proton-c/bindings/ruby/lib/core/ssl_details.rb
deleted file mode 100644
index 5367c80..0000000
--- a/proton-c/bindings/ruby/lib/core/ssl_details.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  # @private
-  class SSLSessionDetails
-
-    attr_reader :session_id
-
-    def initialize(session_id)
-      @session_id = session_id
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/core/ssl_domain.rb b/proton-c/bindings/ruby/lib/core/ssl_domain.rb
deleted file mode 100644
index ef3c03c..0000000
--- a/proton-c/bindings/ruby/lib/core/ssl_domain.rb
+++ /dev/null
@@ -1,156 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  # The top-level object that stores the configuration used by one or more
-  # SSL sessions.
-  #
-  # @see SSL
-  #
-  class SSLDomain
-
-    # The local connection endpoint is an SSL client.
-    # @private
-    MODE_CLIENT = Cproton::PN_SSL_MODE_CLIENT
-    # The local connection endpoint is an SSL server.
-    # @private
-    MODE_SERVER = Cproton::PN_SSL_MODE_SERVER
-
-    # Require the peer to provide a valid identifying certificate.
-    VERIFY_PEER = Cproton::PN_SSL_VERIFY_PEER
-    # Do no require a certificate nor a cipher authorization.
-    ANONYMOUS_PEER = Cproton::PN_SSL_ANONYMOUS_PEER
-    # Require a valid certficate and matching name.
-    VERIFY_PEER_NAME = Cproton::PN_SSL_VERIFY_PEER_NAME
-
-    # @private
-    include Util::ErrorHandler
-
-    can_raise_error :credentials, :error_class => Qpid::Proton::SSLError
-    can_raise_error :trusted_ca_db, :error_class => Qpid::Proton::SSLError
-    can_raise_error :peer_authentication, :error_class => Qpid::Proton::SSLError
-    can_raise_error :allow_unsecured_client, :error_class => Qpid::Proton::SSLError
-
-    # @private
-    attr_reader :impl
-
-    # @private
-    def initialize(mode)
-      @impl = Cproton.pn_ssl_domain(mode)
-      raise SSLUnavailable.new if @impl.nil?
-    end
-
-    # Set the certificate that identifies the local node to the remote.
-    #
-    # This certificate establishes the identity for thelocal node for all SSL
-    # sessions created from this domain. It will be sent to the remote if the
-    # remote needs to verify the dientify of this node. This may be used for
-    # both SSL servers and SSL clients (if client authentication is required by
-    # the server).
-    #
-    # *NOTE:* This setting affects only those instances of SSL created *after*
-    # this call returns. SSL objects created before invoking this method will
-    # use the domain's previous settings.
-    #
-    # @param cert_file [String] The filename containing the identify
-    #  certificate. For OpenSSL users, this is a PEM file. For Windows SChannel
-    #  users, this is the PKCS\#12 file or system store.
-    # @param key_file [String] An option key to access the identifying
-    #  certificate. For OpenSSL users, this is an optional PEM file containing
-    #  the private key used to sign the certificate. For Windows SChannel users,
-    #  this is the friendly name of the self-identifying certficate if there are
-    #  multiple certfificates in the store.
-    # @param password [String] The password used to sign the key, or *nil* if
-    #  the key is not protected.
-    #
-    # @raise [SSLError] If an error occurs.
-    #
-    def credentials(cert_file, key_file, password)
-      Cproton.pn_ssl_domain_set_credentials(@impl,
-                                            cert_file, key_file, password)
-    end
-
-    # Configures the set of trusted CA certificates used by this domain to
-    # verify peers.
-    #
-    # If the local SSL client/server needs to verify the identify of the remote,
-    # it must validate the signature of the remote's certificate. This function
-    # sets the database of trusted CAs that will be used to verify the signature
-    # of the remote's certificate.
-    #
-    # *NOTE:# This setting affects only those SSL instances created *after* this
-    # call returns. SSL objects created before invoking this method will use the
-    # domain's previous setting.
-    #
-    # @param certificate_db [String] The filename for the databse of trusted
-    #   CAs, used to authenticate the peer.
-    #
-    # @raise [SSLError] If an error occurs.
-    #
-    def trusted_ca_db(certificate_db)
-      Cproton.pn_ssl_domain_set_trusted_ca_db(@impl, certificate_db)
-    end
-
-    # Configures the level of verification used on the peer certificate.
-    #
-    # This method congtrols how the peer's certificate is validated, if at all.
-    # By default, neither servers nor clients attempt to verify their peers
-    # (*ANONYMOUS_PEER*). Once certficates and trusted CAs are configured, peer
-    # verification can be enabled.
-    #
-    # *NOTE:* In order to verify a peer, a trusted CA must be configured.
-    #
-    # *NOTE:* Servers must provide their own certficate when verifying a peer.
-    #
-    # *NOTE:* This setting affects only those SSL instances created after this
-    # call returns. SSL instances created before invoking this method will use
-    # the domain's previous setting.
-    #
-    # @param verify_mode [Fixnum] The level of validation to apply to the peer.
-    # @param trusted_CAs [String] The path to a database of trusted CAs that
-    #   the server will advertise to the peer client if the server has been
-    #   configured to verify its peer.
-    #
-    # @see VERIFY_PEER
-    # @see ANONYMOUS_PEER
-    # @see VERIFY_PEER_NAME
-    #
-    # @raise [SSLError] If an error occurs.
-    #
-    def peer_authentication(verify_mode, trusted_CAs = nil)
-      Cproton.pn_ssl_domain_set_peer_authentication(@impl,
-                                                    verify_mode, trusted_CAs)
-    end
-
-    # Permit a server to accept connection requests from non-SSL clients.
-    #
-    # This configures the server to "sniff" the incomfing client data stream and
-    # dynamically determine whether SSL/TLS is being used. This option is
-    # disabled by default: only clients using SSL/TLS are accepted by default.
-    #
-    # @raise [SSLError] If an error occurs.
-    #
-    def allow_unsecured_client
-      Cproton.pn_ssl_domain_allow_unsecured_client(@impl);
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/core/terminus.rb b/proton-c/bindings/ruby/lib/core/terminus.rb
deleted file mode 100644
index 4bd22d7..0000000
--- a/proton-c/bindings/ruby/lib/core/terminus.rb
+++ /dev/null
@@ -1,218 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  # Represents an endpoint for an AMQP connection..
-  #
-  # An AMQP terminus acts as either a source or a target for messages,
-  # but never as both. Every Link is associated iwth both a source and
-  # a target Terminus that is negotiated during link establishment.
-  #
-  # A terminus is composed of an AMQP address along with a number of
-  # other properties defining the quality of service and behavior of
-  # the Link.
-  #
-  class Terminus
-
-    # Indicates a non-existent source or target terminus.
-    UNSPECIFIED = Cproton::PN_UNSPECIFIED
-    # Indicates a source for messages.
-    SOURCE = Cproton::PN_SOURCE
-    # Indicates a target for messages.
-    TARGET = Cproton::PN_TARGET
-    # A special target identifying a transaction coordinator.
-    COORDINATOR = Cproton::PN_COORDINATOR
-
-    # The terminus is orphaned when the parent link is closed.
-    EXPIRE_WITH_LINK = Cproton::PN_EXPIRE_WITH_LINK
-    # The terminus is orphaned whent he parent sessio is closed.
-    EXPIRE_WITH_SESSION = Cproton::PN_EXPIRE_WITH_SESSION
-    # The terminus is orphaned when the parent connection is closed.
-    EXPIRE_WITH_CONNECTION = Cproton::PN_EXPIRE_WITH_CONNECTION
-    # The terminus is never considered orphaned.
-    EXPIRE_NEVER = Cproton::PN_EXPIRE_NEVER
-
-    # Indicates a non-durable Terminus.
-    NONDURABLE = Cproton::PN_NONDURABLE
-    # Indicates a Terminus with durably held configuration, but
-    # not the delivery state.
-    CONFIGURATION = Cproton::PN_CONFIGURATION
-    # Indicates a Terminus with both durably held configuration and
-    # durably held delivery states.
-    DELIVERIES = Cproton::PN_DELIVERIES
-
-    # The behavior is defined by the nod.e
-    DIST_MODE_UNSPECIFIED = Cproton::PN_DIST_MODE_UNSPECIFIED
-    # The receiver gets all messages.
-    DIST_MODE_COPY = Cproton::PN_DIST_MODE_COPY
-    # The receives compete for messages.
-    DIST_MODE_MOVE = Cproton::PN_DIST_MODE_MOVE
-
-    # @private
-    include Util::SwigHelper
-
-    # @private
-    PROTON_METHOD_PREFIX = "pn_terminus"
-
-    # @!attribute type
-    #
-    # @return [Fixnum] The terminus type.
-    #
-    # @see SOURCE
-    # @see TARGET
-    # @see COORDINATOR
-    #
-    proton_accessor :type
-
-    # @!attribute address
-    #
-    # @return [String] The terminus address.
-    #
-    proton_accessor :address
-
-    # @!attribute durability
-    #
-    # @return [Fixnum] The durability mode of the terminus.
-    #
-    # @see NONDURABLE
-    # @see CONFIGURATION
-    # @see DELIVERIES
-    #
-    proton_accessor :durability
-
-    # @!attribute expiry_policy
-    #
-    # @return [Fixnum] The expiry policy.
-    #
-    # @see EXPIRE_WITH_LINK
-    # @see EXPIRE_WITH_SESSION
-    # @see EXPIRE_WITH_CONNECTION
-    # @see EXPIRE_NEVER
-    #
-    proton_accessor :expiry_policy
-
-    # @!attribute timeout
-    #
-    # @return [Fixnum] The timeout period.
-    #
-    proton_accessor :timeout
-
-    # @!attribute dynamic?
-    #
-    # @return [Boolean] True if the terminus is dynamic.
-    #
-    proton_accessor :dynamic, :is_or_get => :is
-
-    # @!attribute distribution_mode
-    #
-    # @return [Fixnum] The distribution mode.
-    #
-    # @see DIST_MODE_UNSPECIFIED
-    # @see DIST_MODE_COPY
-    # @see DIST_MODE_MOVE
-    #
-    proton_accessor :distribution_mode
-
-    # @private
-    include Util::ErrorHandler
-
-    can_raise_error [:type=, :address=, :durability=, :expiry_policy=,
-                          :timeout=, :dynamic=, :distribution_mode=, :copy],
-                    :error_class => Qpid::Proton::LinkError
-
-    # @private
-    attr_reader :impl
-
-    # @private
-    def initialize(impl)
-      @impl = impl
-    end
-
-    # Access and modify the AMQP properties data for the Terminus.
-    #
-    # This operation will return an instance of Data that is valid until the
-    # Terminus is freed due to its parent being freed. Any data contained in
-    # the object will be sent as the AMQP properties for the parent Terminus
-    # instance.
-    #
-    # NOTE: this MUST take the form of a symbol keyed map to be valid.
-    #
-    # @return [Data] The terminus properties.
-    #
-    def properties
-      Data.new(Cproton.pn_terminus_properties(@impl))
-    end
-
-    # Access and modify the AMQP capabilities data for the Terminus.
-    #
-    # This operation will return an instance of Data that is valid until the
-    # Terminus is freed due to its parent being freed. Any data contained in
-    # the object will be sent as the AMQP properties for the parent Terminus
-    # instance.
-    #
-    # NOTE: this MUST take the form of a symbol keyed map to be valid.
-    #
-    # @return [Data] The terminus capabilities.
-    #
-    def capabilities
-      Data.new(Cproton.pn_terminus_capabilities(@impl))
-    end
-
-    # Access and modify the AMQP outcomes for the Terminus.
-    #
-    # This operaiton will return an instance of Data that is valid until the
-    # Terminus is freed due to its parent being freed. Any data contained in
-    # the object will be sent as the AMQP properties for the parent Terminus
-    # instance.
-    #
-    # NOTE: this MUST take the form of a symbol keyed map to be valid.
-    #
-    # @return [Data] The terminus outcomes.
-    #
-    def outcomes
-      Data.new(Cproton.pn_terminus_outcomes(@impl))
-    end
-
-    # Access and modify the AMQP filter set for the Terminus.
-    #
-    # This operation will return an instance of Data that is valid until the
-    # Terminus is freed due to its parent being freed. Any data contained in
-    # the object will be sent as the AMQP properties for the parent Terminus
-    # instance.
-    #
-    # NOTE: this MUST take the form of a symbol keyed map to be valid.
-    #
-    # @return [Data] The terminus filter.
-    #
-    def filter
-      Data.new(Cproton.pn_terminus_filter(@impl))
-    end
-
-    # Copy another Terminus into this instance.
-    #
-    # @param source [Terminus] The source instance.
-    #
-    def copy(source)
-      Cproton.pn_terminus_copy(@impl,source.impl)
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/core/transport.rb b/proton-c/bindings/ruby/lib/core/transport.rb
deleted file mode 100644
index 9ba5dc8..0000000
--- a/proton-c/bindings/ruby/lib/core/transport.rb
+++ /dev/null
@@ -1,411 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  # A transport is used by a connection to interface with the network.
-  #
-  # A transport is associated with, at most, one Connection.
-  #
-  # == Client And Server Mode
-  #
-  # Initially, a transport is configured to be a client tranpsort. It can be
-  # configured to act as a server when it is created.
-  #
-  # A client transport initiates outgoing connections.
-  #
-  # A client transport must be configured with the protocol layers to use and
-  # cannot configure itself automatically.
-  #
-  # A server transport accepts incoming connections. It can automatically
-  # configure itself to include the various protocol layers depending on the
-  # incoming protocol headers.
-  #
-  # == Tracing Data
-  #
-  # Data can be traced into and out of the transport programmatically by setting
-  # the #trace level to one of the defined trace values (TRACE_RAW, TRACE_FRM or
-  # TRACE_DRV). Tracing can also be turned off programmatically by setting the
-  # #trace level to TRACE_OFF.
-  #
-  # @example
-  #
-  #   # turns on frame tracing
-  #   @transport.trace = Qpid::Proton::Transport::TRACE_FRM
-  #
-  #   # ... do something where the frames are of interest, such as debugging
-  #
-  #   # turn tracing off again
-  #   @transport.trace = Qpid::Proton::Transport::TRACE_NONE
-  #
-  # Tracing can also be enabled from the command line by defining the similarly
-  # named environment variable before starting a Proton application:
-  #
-  # @example
-  #
-  #   # enable tracing from the command line
-  #   PN_TRACE_FRM=1 ruby my_proton_app.rb
-  #
-  class Transport
-
-    # @private
-    include Util::Engine
-
-    # Turn logging off entirely.
-    TRACE_OFF = Cproton::PN_TRACE_OFF
-    # Log raw binary data into/out of the transport.
-    TRACE_RAW = Cproton::PN_TRACE_RAW
-    # Log frames into/out of the transport.
-    TRACE_FRM = Cproton::PN_TRACE_FRM
-    # Log driver related events; i.e., initialization, end of stream, etc.
-    TRACE_DRV = Cproton::PN_TRACE_DRV
-
-    # @private
-    CLIENT = 1
-    # @private
-    SERVER = 2
-
-    # @private
-    include Util::SwigHelper
-
-    # @private
-    PROTON_METHOD_PREFIX = "pn_transport"
-
-    # @!attribute channel_max
-    #
-    # @return [Fixnum] The maximum allowed channel.
-    #
-    proton_accessor :channel_max
-
-    # @!attribute [r] remote_channel_max
-    #
-    # @return [Fixnum] The maximum allowed channel of a transport's remote peer.
-    #
-    proton_caller :remote_channel_max
-
-    # @!attribute max_frame_size
-    #
-    # @return [Fixnum] The maximum frame size.
-    #
-    proton_accessor :max_frame_size
-
-    # @!attribute [r] remote_max_frame_size
-    #
-    # @return [Fixnum] The maximum frame size of the transport's remote peer.
-    #
-    proton_reader :remote_max_frame_size
-
-    # @!attribute idle_timeout
-    #
-    # @return [Fixnum] The idle timeout.
-    #
-    proton_accessor :idle_timeout
-
-    # @!attribute [r] remote_idle_timeout
-    #
-    # @return [Fixnum] The idle timeout for the transport's remote peer.
-    #
-    proton_accessor :remote_idle_timeout
-
-    # @!attribute [r] capacity
-    #
-    # If the engine is in an exception state such as encountering an error
-    # condition or reaching the end of stream state, a negative value will
-    # be returned indicating the condition.
-    #
-    # If an error is indicated, further deteails can be obtained from
-    # #error.
-    #
-    # Calls to #process may alter the value of this value. See #process for
-    # more details
-    #
-    # @return [Fixnum] The amount of free space for input following the
-    # transport's tail pointer.
-    #
-    proton_caller :capacity
-
-    # @!attribute [r] head
-    #
-    # This referneces queued output data. It reports the bytes of output data.
-    #
-    # Calls to #pop may alter this attribute, and any data it references.
-    #
-    # @return [String] The transport's head pointer.
-    #
-    proton_caller :head
-
-    # @!attribute [r] tail
-    #
-    # The amount of free space following this data is reported by #capacity.
-    #
-    # Calls to #process may alter the value of this attribute.
-    #
-    # @return [String] The transport's tail pointer.
-    #
-    proton_caller :tail
-
-    # @!attribute [r] pending
-    #
-    # If the ending is in an exceptional state, such as encountering an error
-    # condition or reachign the end of the stream state, a negative value will
-    # be returned indicating the condition.
-    #
-    # If an error is indicated, further details can be obtained from #error.
-    #
-    # Calls to #pop may alter the value of this pointer as well.
-    #
-    # @return [Fixnum] The number of pending output bytes following the header
-    # pointer.
-    #
-    # @raise [TransportError] If any error other than an end of stream occurs.
-    #
-    proton_caller :pending
-
-    # @!attribute [r] closed?
-    #
-    # A transport is defined to be closed when both the tail and the head are
-    # closed. In other words, when both #capacity < 0 and #pending < 0.
-    #
-    # @return [Boolean] Returns true if the tranpsort is closed.
-    #
-    proton_caller :closed?
-
-    # @!attribute [r] frames_output
-    #
-    # @return [Fixnum] The number of frames output by a transport.
-    #
-    proton_reader :frames_output
-
-    # @!attribute [r] frames_input
-    #
-    # @return [Fixnum] The number of frames input by a transport.
-    #
-    proton_reader :frames_input
-
-    # @private
-    include Util::ErrorHandler
-
-    can_raise_error :process, :error_class => TransportError
-    can_raise_error :close_tail, :error_class => TransportError
-    can_raise_error :pending, :error_class => TransportError, :below => Error::EOS
-    can_raise_error :close_head, :error_class => TransportError
-
-    # @private
-    include Util::Wrapper
-
-    # @private
-    def self.wrap(impl)
-      return nil if impl.nil?
-
-      self.fetch_instance(impl, :pn_transport_attachments) || Transport.new(nil, impl)
-    end
-
-    # Creates a new transport instance.
-    #
-    # @param mode [Fixnum] The transport mode, either CLIENT or SERVER
-    # @param impl [pn_transport_t] Should not be used.
-    #
-    # @raise [TransportError] If the mode is invalid.
-    #
-    def initialize(mode = nil, impl = Cproton.pn_transport)
-      @impl = impl
-      if mode == SERVER
-        Cproton.pn_transport_set_server(@impl)
-      elsif (!mode.nil? && mode != CLIENT)
-        raise TransportError.new("cannot create transport for mode: #{mode}")
-      end
-      self.class.store_instance(self, :pn_transport_attachments)
-    end
-
-    # Returns whether the transport has any buffered data.
-    #
-    # @return [Boolean] True if the transport has no buffered data.
-    #
-    def quiesced?
-      Cproton.pn_transport_quiesced(@impl)
-    end
-
-    # Returns additional information about the condition of the transport.
-    #
-    # When a TRANSPORT_ERROR event occurs, this operaiton can be used to
-    # access the details of the error condition.
-    #
-    # The object returned is valid until the Transport is discarded.
-    #
-    def condition
-      condition_to_object Cproton.pn_transport_condition(@impl)
-    end
-
-    # Binds to the given connection.
-    #
-    # @param connection [Connection] The connection.
-    #
-    def bind(connection)
-      Cproton.pn_transport_bind(@impl, connection.impl)
-    end
-
-    # Unbinds from the previous connection.
-    #
-    def unbind
-      Cproton.pn_transport_unbind(@impl)
-    end
-
-    # Updates the transports trace flags.
-    #
-    # @param level [Fixnum] The trace level.
-    #
-    # @see TRACE_OFF
-    # @see TRACE_RAW
-    # @see TRACE_FRM
-    # @see TRACE_DRV
-    #
-    def trace(level)
-      Cproton.pn_transport_trace(@impl, level)
-    end
-
-    # Return the AMQP connection associated with the transport.
-    #
-    # @return [Connection, nil] The bound connection, or nil.
-    #
-    def connection
-      Connection.wrap(Cproton.pn_transport_connection(@impl))
-    end
-
-    # Log a message to the transport's logging mechanism.
-    #
-    # This can be using in a debugging scenario as the message will be
-    # prepended with the transport's identifier.
-    #
-    # @param message [String] The message to be logged.
-    #
-    def log(message)
-      Cproton.pn_transport_log(@impl, message)
-    end
-
-    # Pushes the supplied bytes into the tail of the transport.
-    #
-    # @param data [String] The bytes to be pushed.
-    #
-    # @return [Fixnum] The number of bytes pushed.
-    #
-    def push(data)
-      Cproton.pn_transport_push(@impl, data, data.length)
-    end
-
-    # Process input data following the tail pointer.
-    #
-    # Calling this function will cause the transport to consume the specified
-    # number of bytes of input occupying the free space following the tail
-    # pointer. It may also change the value for #tail, as well as the amount of
-    # free space reported by #capacity.
-    #
-    # @param size [Fixnum] The number of bytes to process.
-    #
-    # @raise [TransportError] If an error occurs.
-    #
-    def process(size)
-      Cproton.pn_transport_process(@impl, size)
-    end
-
-    # Indicate that the input has reached EOS (end of stream).
-    #
-    # This tells the transport that no more input will be forthcoming.
-    #
-    # @raise [TransportError] If an error occurs.
-    #
-    def close_tail
-      Cproton.pn_transport_close_tail(@impl)
-    end
-
-    # Returns the specified number of bytes from the transport's buffers.
-    #
-    # @param size [Fixnum] The number of bytes to return.
-    #
-    # @return [String] The data peeked.
-    #
-    # @raise [TransportError] If an error occurs.
-    #
-    def peek(size)
-      cd, out = Cproton.pn_transport_peek(@impl, size)
-      return nil if cd == Qpid::Proton::Error::EOS
-      raise TransportError.new if cd < -1
-      out
-    end
-
-    # Removes the specified number of bytes from the pending output queue
-    # following the transport's head pointer.
-    #
-    # @param size [Fixnum] The number of bytes to remove.
-    #
-    def pop(size)
-      Cproton.pn_transport_pop(@impl, size)
-    end
-
-    # Indicate that the output has closed.
-    #
-    # Tells the transport that no more output will be popped.
-    #
-    # @raise [TransportError] If an error occurs.
-    #
-    def close_head
-      Cproton.pn_transport_close_head(@impl)
-    end
-
-    # Process any pending transport timer events.
-    #
-    # This method should be called after all pending input has been
-    # processed by the transport (see #input), and before generating
-    # output (see #output).
-    #
-    # It returns the deadline for the next pending timer event, if any
-    # art present.
-    #
-    # @param now [Time] The timestamp.
-    #
-    # @return [Fixnum] If non-zero, the expiration time of the next pending
-    #   timer event for the transport. The caller must invoke #tick again at
-    #   least once at or before this deadline occurs.
-    #
-    def tick(now)
-      Cproton.pn_transport_tick(@impl, now)
-    end
-
-    def sasl
-      SASL.new(self)
-    end
-
-    # Creates, or returns an existing, SSL object for the transport.
-    #
-    # @param domain [SSLDomain] The SSL domain.
-    # @param session_details [SSLDetails] The SSL session details.
-    #
-    # @return [SSL] The SSL object.
-    #
-    def ssl(domain = nil, session_details = nil)
-      @ssl ||= SSL.create(self, domain, session_details) if @ssl.nil?
-    end
-
-    # @private
-    def ssl?
-      !@ssl.nil?
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/core/url.rb b/proton-c/bindings/ruby/lib/core/url.rb
deleted file mode 100644
index 1fa1222..0000000
--- a/proton-c/bindings/ruby/lib/core/url.rb
+++ /dev/null
@@ -1,77 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  class URL
-
-    attr_reader :scheme
-    attr_reader :username
-    attr_reader :password
-    attr_reader :host
-    attr_reader :port
-    attr_reader :path
-
-    def initialize(url = nil, options = {})
-      options[:defaults] = true
-
-      if url
-        @url = Cproton.pn_url_parse(url)
-        if @url.nil?
-          raise ::ArgumentError.new("invalid url: #{url}")
-        end
-      else
-        @url = Cproton.pn_url
-      end
-      @scheme = Cproton.pn_url_get_scheme(@url)
-      @username = Cproton.pn_url_get_username(@url)
-      @password = Cproton.pn_url_get_password(@url)
-      @host = Cproton.pn_url_get_host(@url)
-      @port = Cproton.pn_url_get_port(@url)
-      @path = Cproton.pn_url_get_path(@url)
-      defaults
-    end
-
-    def port=(port)
-      if port.nil?
-        Cproton.pn_url_set_port(@url, nil)
-      else
-        Cproton.pn_url_set_port(@url, port)
-      end
-    end
-
-    def port
-      Cproton.pn_url_get_port(@url).to_i
-    end
-
-    def to_s
-      "#{@scheme}://#{@username.nil? ? '' : @username}#{@password.nil? ? '' : '@' + @password + ':'}#{@host}:#{@port}/#{@path}"
-    end
-
-    private
-
-    def defaults
-      @scheme = @scheme || "ampq"
-      @host = @host || "0.0.0.0"
-      @port = @port || 5672
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/event/collector.rb b/proton-c/bindings/ruby/lib/event/collector.rb
deleted file mode 100644
index c86b0f2..0000000
--- a/proton-c/bindings/ruby/lib/event/collector.rb
+++ /dev/null
@@ -1,148 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Event
-
-  # A Collector is used to register interest in events produced by one
-  # or more Connection objects.
-  #
-  # == Events
-  #
-  # @see Qpid::Proton::Event The list of predefined events.
-  #
-  # @example
-  #
-  #   conn = Qpid::Proton::Connection.new
-  #   coll = Qpid::Proton::Event::Collector.new
-  #   conn.collect(coll)
-  #
-  #   # transport setup not included here for brevity
-  #
-  #   loop do
-  #
-  #      # wait for an event and then perform the following
-  #
-  #      event = collector.peek
-  #
-  #      unless event.nil?
-  #        case event.type
-  #
-  #        when Qpid::Proton::Event::CONNECTION_REMOTE_CLOSE
-  #          conn = event.context # the context here is the connection
-  #          # the remote connection closed, so only close our side if it's
-  #          # still open
-  #          if !(conn.state & Qpid::Proton::Endpoint::LOCAL_CLOSED)
-  #            conn.close
-  #          end
-  #
-  #        when Qpid::proton::Event::SESSION_REMOTE_OPEN
-  #          session = event.session # the context here is the session
-  #          # the remote session is now open, so if the local session is
-  #          # uninitialized, then open it
-  #          if session.state & Qpid::Proton::Endpoint::LOCAL_UNINIT
-  #            session.incoming_capacity = 1000000
-  #            session.open
-  #          end
-  #
-  #        end
-  #
-  #       # remove the processed event and get the next event
-  #       # the loop will exit when we have no more events to process
-  #       collector.pop
-  #       event = collector.peek
-  #
-  #   end
-  #
-  class Collector
-
-    # @private
-    attr_reader :impl
-
-    # Creates a new Collector.
-    #
-    def initialize
-      @impl = Cproton.pn_collector
-      ObjectSpace.define_finalizer(self, self.class.finalize!(@impl))
-    end
-
-    # @private
-    def self.finalize!(impl)
-      proc {
-        Cproton.pn_collector_free(impl)
-      }
-    end
-
-    # Releases the collector.
-    #
-    # Once in a released state, a collector will drain any internally queued
-    # events, shrink its memory footprint to a minimu, and discard any newly
-    # created events.
-    #
-    def release
-      Cproton.pn_collector_release(@impl)
-    end
-
-    # Place a new event on the collector.
-    #
-    # This operation will create a new event of the given type and context
-    # and return a new Event instance. In some cases an event of a given
-    # type can be elided. When this happens, this operation will return
-    # nil.
-    #
-    # @param context [Object] The event context.
-    # @param event_type [EventType] The event type.
-    #
-    # @return [Event] the event if it was queued
-    # @return [nil] if it was elided
-    #
-    def put(context, event_type)
-      Cproton.pn_collector_put(@impl, Cproton.pn_rb2void(context), event_type.type_code)
-    end
-
-    # Access the head event.
-    #
-    # This operation will continue to return the same event until it is
-    # cleared by using #pop. The pointer return by this  operation will be
-    # valid until ::pn_collector_pop is invoked or #free is called, whichever
-    # happens sooner.
-    #
-    # @return [Event] the head event
-    # @return [nil] if there are no events
-    #
-    # @see #pop
-    # @see #put
-    #
-    def peek
-      Event.wrap(Cproton.pn_collector_peek(@impl))
-    end
-
-    # Clear the head event.
-    #
-    # @return [Boolean] true if an event was removed
-    #
-    # @see #release
-    # @see #peek
-    #
-    def pop
-      Cproton.pn_collector_pop(@impl)
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/event/event.rb b/proton-c/bindings/ruby/lib/event/event.rb
deleted file mode 100644
index e839f63..0000000
--- a/proton-c/bindings/ruby/lib/event/event.rb
+++ /dev/null
@@ -1,318 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  module Event
-
-    # @private
-    def self.event_type(const_name, method_name = nil) # :nodoc:
-      unless Cproton.const_defined?(const_name)
-        raise RuntimeError.new("no such constant: #{const_name}")
-      end
-
-      const_value = Cproton.const_get(const_name)
-      method_name = "on_#{const_name.to_s[3..-1]}".downcase if method_name.nil?
-
-      EventType.new(const_value, method_name)
-    end
-
-    # Defined as a programming convenience. No even of this type will ever
-    # be generated.
-    NONE = event_type(:PN_EVENT_NONE)
-
-    # A reactor has been started.
-    REACTOR_INIT = event_type(:PN_REACTOR_INIT)
-    # A reactor has no more events to process.
-    REACTOR_QUIESCED = event_type(:PN_REACTOR_QUIESCED)
-    # A reactor has been stopred.
-    REACTOR_FINAL = event_type(:PN_REACTOR_FINAL)
-
-    # A timer event has occurred.
-    TIMER_TASK = event_type(:PN_TIMER_TASK)
-
-    # A connection has been created. This is the first even that will ever
-    # be issued for a connection.
-    CONNECTION_INIT = event_type(:PN_CONNECTION_INIT)
-    # A conneciton has been bound toa  transport.
-    CONNECTION_BOUND = event_type(:PN_CONNECTION_BOUND)
-    # A connection has been unbound from its transport.
-    CONNECTION_UNBOUND = event_type(:PN_CONNECTION_UNBOUND)
-    # A local connection endpoint has been opened.
-    CONNECTION_LOCAL_OPEN = event_type(:PN_CONNECTION_LOCAL_OPEN)
-    # A local connection endpoint has been closed.
-    CONNECTION_LOCAL_CLOSE = event_type(:PN_CONNECTION_LOCAL_CLOSE)
-    # A remote endpoint has opened its connection.
-    CONNECTION_REMOTE_OPEN = event_type(:PN_CONNECTION_REMOTE_OPEN)
-    # A remote endpoint has closed its connection.
-    CONNECTION_REMOTE_CLOSE = event_type(:PN_CONNECTION_REMOTE_CLOSE)
-    # A connection has been freed and any outstanding processing has been
-    # completed. This is the final event htat will ever be issued for a
-    # connection
-    CONNECTION_FINAL = event_type(:PN_CONNECTION_FINAL)
-
-    # A session has been created. This is the first event that will ever be
-    # issues for a session.
-    SESSION_INIT = event_type(:PN_SESSION_INIT)
-    # A local session endpoint has been opened.
-    SESSION_LOCAL_OPEN = event_type(:PN_SESSION_LOCAL_OPEN)
-    # A local session endpoint has been closed.
-    SESSION_LOCAL_CLOSE = event_type(:PN_SESSION_LOCAL_CLOSE)
-    # A remote endpoint has opened its session.
-    SESSION_REMOTE_OPEN = event_type(:PN_SESSION_REMOTE_OPEN)
-    # A remote endpoint has closed its session.
-    SESSION_REMOTE_CLOSE = event_type(:PN_SESSION_REMOTE_CLOSE)
-    # A session has been freed and any outstanding processing has been
-    # completed. This is the final event that will ever be issued for a
-    # session
-    SESSION_FINAL = event_type(:PN_SESSION_FINAL)
-
-    # A link has been created. This is the first event that will ever be
-    # issued for a link.
-    LINK_INIT = event_type(:PN_LINK_INIT)
-    # A local link endpoint has been opened.
-    LINK_LOCAL_OPEN = event_type(:PN_LINK_LOCAL_OPEN)
-    # A local link endpoint has been closed.
-    LINK_LOCAL_CLOSE = event_type(:PN_LINK_LOCAL_CLOSE)
-    # A local link endpoint has been detached.
-    LINK_LOCAL_DETACH = event_type(:PN_LINK_LOCAL_DETACH)
-    # A remote endpoint has opened its link.
-    LINK_REMOTE_OPEN = event_type(:PN_LINK_REMOTE_OPEN)
-    # A remote endpoint has closed its link.
-    LINK_REMOTE_CLOSE = event_type(:PN_LINK_REMOTE_CLOSE)
-    # A remote endpoint has detached its link.
-    LINK_REMOTE_DETACH = event_type(:PN_LINK_REMOTE_DETACH)
-    # The flow control state for a link has changed.
-    LINK_FLOW = event_type(:PN_LINK_FLOW)
-    # A link has been freed and any outstanding processing has been completed.
-    # This is the final event htat will ever be issued for a link.
-    LINK_FINAL = event_type(:PN_LINK_FINAL)
-
-    # A delivery has been created or updated.
-    DELIVERY = event_type(:PN_DELIVERY)
-
-    # A transport has new data to read and/or write.
-    TRANSPORT = event_type(:PN_TRANSPORT)
-    # Indicates that a transport error has occurred.
-    # @see Transport#condition To access the details of the error.
-    TRANSPORT_ERROR = event_type(:PN_TRANSPORT_ERROR)
-    # Indicates that the head of a transport has been closed. This means the
-    # transport will never produce more bytes for output to the network.
-    TRANSPORT_HEAD_CLOSED = event_type(:PN_TRANSPORT_HEAD_CLOSED)
-    # Indicates that the trail of a transport has been closed. This means the
-    # transport will never be able to process more bytes from the network.
-    TRANSPORT_TAIL_CLOSED = event_type(:PN_TRANSPORT_TAIL_CLOSED)
-    # Indicates that both the head and tail of a transport are closed.
-    TRANSPORT_CLOSED = event_type(:PN_TRANSPORT_CLOSED)
-
-    SELECTABLE_INIT = event_type(:PN_SELECTABLE_INIT)
-    SELECTABLE_UPDATED = event_type(:PN_SELECTABLE_UPDATED)
-    SELECTABLE_READABLE = event_type(:PN_SELECTABLE_READABLE)
-    SELECTABLE_WRITABLE = event_type(:PN_SELECTABLE_WRITABLE)
-    SELECTABLE_EXPIRED = event_type(:PN_SELECTABLE_EXPIRED)
-    SELECTABLE_ERROR = event_type(:PN_SELECTABLE_ERROR)
-    SELECTABLE_FINAL = event_type(:PN_SELECTABLE_FINAL)
-
-    # An Event provides notification of a state change within the protocol
-    # engine.
-    #
-    # Every event has a type that identifies what sort of state change has
-    # occurred, along with a pointer to the object whose state has changed,
-    # and also any associated objects.
-    #
-    # For more details on working with Event, please refer to Collector.
-    #
-    # @see Qpid::Proton::Event The list of predefined events.
-    #
-    class Event < EventBase
-
-      # @private
-      include Qpid::Proton::Util::ClassWrapper
-      # @private
-      include Qpid::Proton::Util::Wrapper
-
-      # Creates a Ruby object for the given pn_event_t.
-      #
-      # @private
-      def self.wrap(impl, number = nil)
-        return nil if impl.nil?
-
-        result = self.fetch_instance(impl, :pn_event_attachments)
-        return result unless result.nil?
-        number = Cproton.pn_event_type(impl) if number.nil?
-        event = Event.new(impl, number)
-        return event.context if event.context.is_a? EventBase
-        return event
-      end
-
-      # @private
-      def initialize(impl, number)
-        @impl = impl
-        class_name = Cproton.pn_class_name(Cproton.pn_event_class(impl))
-        context = class_wrapper(class_name, Cproton.pn_event_context(impl))
-        event_type = EventType.by_type(Cproton.pn_event_type(impl))
-        super(class_name, context, event_type)
-        @type = EventType.by_type(number)
-        self.class.store_instance(self, :pn_event_attachments)
-      end
-
-      # Notifies the handler(s) of this event.
-      #
-      # If a handler responds to the event's method then that method is invoked
-      # and passed the event. Otherwise, if the handler defines the
-      # +on_unhandled+ method, then that will be invoked instead.
-      #
-      # If the handler defines a +handlers+ method then that will be invoked and
-      # passed the event afterward.
-      #
-      # @example
-      #
-      #   class FallbackEventHandler
-      #
-      #     # since it now defines a handlers method, any event will iterate
-      #     # through them and invoke the +dispatch+ method on each
-      #     attr_accessor handlers
-      #
-      #     def initialize
-      #       @handlers = []
-      #     end
-      #
-      #     # invoked for any event not otherwise handled
-      #     def on_unhandled(event)
-      #       puts "Unable to invoke #{event.type.method} on #{event.context}."
-      #     end
-      #
-      #   end
-      #
-      # @param handler [Object] An object which implements either the event's
-      #    handler method or else responds to :handlers with an array of other
-      #    handlers.
-      #
-      def dispatch(handler, type = nil)
-        type = @type if type.nil?
-        if handler.is_a?(Qpid::Proton::Handler::WrappedHandler)
-          Cproton.pn_handler_dispatch(handler.impl, @impl, type.number)
-        else
-          result = Qpid::Proton::Event.dispatch(handler, type.method, self)
-          if (result != "DELEGATED") && handler.respond_to?(:handlers)
-            handler.handlers.each do |hndlr|
-              self.dispatch(hndlr)
-            end
-          end
-        end
-      end
-
-      # Returns the reactor for this event.
-      #
-      # @return [Reactor, nil] The reactor.
-      #
-      def reactor
-        impl = Cproton.pn_event_reactor(@impl)
-        Qpid::Proton::Util::ClassWrapper::WRAPPERS["pn_reactor"].call(impl)
-      end
-
-      def container
-        impl = Cproton.pn_event_reactor(@impl)
-        Qpid::Proton::Util::ClassWrapper::WRAPPERS["pn_reactor"].call(impl)
-      end
-
-      # Returns the transport for this event.
-      #
-      # @return [Transport, nil] The transport.
-      #
-      def transport
-        Qpid::Proton::Transport.wrap(Cproton.pn_event_transport(@impl))
-      end
-
-      # Returns the Connection for this event.
-      #
-      # @return [Connection, nil] The connection.
-      #
-      def connection
-        Qpid::Proton::Connection.wrap(Cproton.pn_event_connection(@impl))
-      end
-
-      # Returns the Session for this event.
-      #
-      # @return [Session, nil] The session
-      #
-      def session
-        Qpid::Proton::Session.wrap(Cproton.pn_event_session(@impl))
-      end
-
-      # Returns the Link for this event.
-      #
-      # @return [Link, nil] The link.
-      #
-      def link
-        Qpid::Proton::Link.wrap(Cproton.pn_event_link(@impl))
-      end
-
-      # Returns the Sender, or nil if there is no Link, associated  with this
-      # event if that link is a sender.
-      #
-      # @return [Sender, nil] The sender.
-      #
-      def sender
-        return self.link if !self.link.nil? && self.link.sender?
-      end
-
-      # Returns the Receiver, or nil if there is no Link, associated with this
-      # event if that link is a receiver.
-      #
-      # @return [Receiver, nil] The receiver.
-      #
-      def receiver
-        return self.link if !self.link.nil? && self.link.receiver?
-      end
-
-      # Returns the Delivery associated with this event.
-      #
-      # @return [Delivery, nil] The delivery.
-      #
-      def delivery
-        Qpid::Proton::Delivery.wrap(Cproton.pn_event_delivery(@impl))
-      end
-
-      # Sets the message.
-      #
-      # @param message [Qpid::Proton::Message] The message
-      #
-      def message=(message)
-        @message = message
-      end
-
-      # Returns the message.
-      #
-      # @return [Qpid::Proton::Message] The message.
-      #
-      def message
-        @message
-      end
-
-      # @private
-      def to_s
-        "#{self.type}(#{self.context})"
-      end
-
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/event/event_base.rb b/proton-c/bindings/ruby/lib/event/event_base.rb
deleted file mode 100644
index 6ae6959..0000000
--- a/proton-c/bindings/ruby/lib/event/event_base.rb
+++ /dev/null
@@ -1,91 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Event
-
-  # @private
-  def self.dispatch(handler, method, *args)
-    args = args.last unless args.nil?
-    if handler.respond_to? method.to_sym
-      return handler.__send__(method, args)
-    elsif handler.respond_to? :on_unhandled
-      return handler.__send__(:on_unhandled, method, args)
-    end
-  end
-
-  # EventBase is the foundation for creating application-specific events.
-  #
-  # @example
-  #
-  #   # SCENARIO: A continuation of the example in EventType.
-  #   #
-  #   #           An Event class is defined to handle receiving encrypted
-  #   #           data from a remote endpoint.
-  #
-  #   class EncryptedDataEvent < EventBase
-  #     def initialize(message)
-  #       super(EncryptedDataEvent, message,
-  #             Qpid::Proton::Event::ENCRYPTED_RECV)
-  #     end
-  #   end
-  #
-  #   # at another point, when encrypted data is received
-  #   msg = Qpid::Proton::Message.new
-  #   msg.decode(link.receive(link.pending))
-  #   if encrypted?(msg)
-  #     collector.put(EncryptedDataEvent.new(msg)
-  #   end
-  #
-  # @see EventType The EventType class for how ENCRYPTED_RECV was defined.
-  #
-  class EventBase
-
-    # Returns the name for the class associated with this event.
-    attr_reader :class_name
-
-    # Returns the associated context object for the event.
-    attr_reader :context
-
-    # Returns the type of the event.
-    attr_reader :type
-
-    # Creates a new event with the specific class_name and context of the
-    # specified type.
-    #
-    # @param class_name [String] The name of the class.
-    # @param context [Object] The event context.
-    # @param type [EventType] The event type.
-    #
-    def initialize(class_name, context, type)
-      @class_name = class_name
-      @context = context
-      @type = type
-    end
-
-    # Invokes the type-specific method on the provided handler.
-    #
-    # @param handler [Object] The handler to be notified of this event.
-    #
-    def dispatch(handler)
-      Qpid::Proton.dispatch(handler, @type.method, self)
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/event/event_type.rb b/proton-c/bindings/ruby/lib/event/event_type.rb
deleted file mode 100644
index aa5944d..0000000
--- a/proton-c/bindings/ruby/lib/event/event_type.rb
+++ /dev/null
@@ -1,71 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Event
-
-  # Manages the association between an Event and the method which should
-  # process on the context object associated with an occurance of the event.
-  #
-  # Each type is identified by a unique #type value.
-  #
-  # @example
-  #
-  #   # SCENARIO: A part of an application handles extracting and decrypting
-  #   #            data received from a remote endpoint.
-  #   #
-  #   #            An EventType is created to notify handlers that such a
-  #   #            situation has occurred.
-  #
-  #   ENCRYPTED_RECV = 10000 # the unique constant value for the event
-  #
-  #   # create a new event type which, when it occurs, invokes a method
-  #   # named :on_encrypted_data when a handler is notified of its occurrance
-  #   Qpid::Proton::Event::ENCRYPTED_RECV =
-  #     Qpid::Proton::Event::EventType.new(ENCRYPTED_RECV, :on_encrypted_data)
-  #
-  # @see EventBase EventBase for the rest of this example.
-  # @see Qpid::Proton::Event::Event The Event class for more details on events.
-  #
-  class EventType
-
-    # The method to invoke on any potential handler.
-    attr_reader :method
-    attr_reader :number
-
-    def initialize(number, method)
-      @number = number
-      @name = Cproton.pn_event_type_name(@number)
-      @method = method
-      @@types ||= {}
-      @@types[number] = self
-    end
-
-    # @private
-    def to_s
-      @name
-    end
-
-    # @private
-    def self.by_type(type) # :nodoc:
-      @@types[type]
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/handler/acking.rb b/proton-c/bindings/ruby/lib/handler/acking.rb
deleted file mode 100644
index 2c94cfe..0000000
--- a/proton-c/bindings/ruby/lib/handler/acking.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Handler
-
-  # Mixing that provides methods for acknowledging a delivery.
-  #
-  module Acking
-
-    # Accept the receivered message.
-    #
-    # @param delivery [Qpid::Proton::Delivery] The delivery.
-    #
-    def accept(delivery)
-      self.settle(delivery, Qpid::Proton::Delivery::ACCEPTED)
-    end
-
-    # Rejects a received message that is considered invalid or unprocessable.
-    #
-    # @param delivery [Qpid::Proton::Delivery] The delivery.
-    #
-    def reject(delivery)
-      self.settle(delivery, Qpid::Proton::Delivery::REJECTED)
-    end
-
-    # Releases a received message, making it available at the source for any
-    # other interested receiver.
-    #
-    # @param delivery [Qpid::Proton::Delivery] The delivery
-    # @param delivered [Boolean] True if this was considered a delivery
-    #   attempt.
-    #
-    def release(delivery, delivered = true)
-      if delivered
-        self.settle(delivery, Qpid::Proton::Delivery::MODIFIED)
-      else
-        self.settle(delivery, Qpid::Proton::Delivery::RELEASED)
-      end
-    end
-
-    # Settles the specified delivery. Updates the delivery state if a state
-    # is specified.
-    #
-    # @param delivery [Qpid::Proton::Delivery] The delivery.
-    # @param state [Fixnum] The delivery state.
-    #
-    def settle(delivery, state = nil)
-      delivery.update(state) unless state.nil?
-      delivery.settle
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/handler/c_adaptor.rb b/proton-c/bindings/ruby/lib/handler/c_adaptor.rb
deleted file mode 100644
index ef4852e..0000000
--- a/proton-c/bindings/ruby/lib/handler/c_adaptor.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Handler
-
-  # @private
-  class CAdaptor
-
-    def initialize(handler, on_error = nil)
-      @handler = handler
-      @on_error = on_error
-    end
-
-    def dispatch(cevent, ctype)
-      event = Qpid::Proton::Event::Event.wrap(cevent, ctype)
-      # TODO add a variable to enable this programmatically
-      # print "EVENT: #{event} going to #{@handler}\n"
-      event.dispatch(@handler)
-    end
-
-    def exception(error)
-      if @on_error.nil?
-        raise error
-      else
-        @on_error.call(error)
-      end
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/handler/c_flow_controller.rb b/proton-c/bindings/ruby/lib/handler/c_flow_controller.rb
deleted file mode 100644
index 377cc2f..0000000
--- a/proton-c/bindings/ruby/lib/handler/c_flow_controller.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Handler
-
-  # @private
-  class CFlowController < Qpid::Proton::Handler::WrappedHandler
-
-    include Qpid::Proton::Util::Wrapper
-
-    def initialize(window = 1024)
-      super(Cproton.pn_flowcontroller(window))
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/handler/endpoint_state_handler.rb b/proton-c/bindings/ruby/lib/handler/endpoint_state_handler.rb
deleted file mode 100644
index 727a20b..0000000
--- a/proton-c/bindings/ruby/lib/handler/endpoint_state_handler.rb
+++ /dev/null
@@ -1,217 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Handler
-
-  # A utility that exposes endpoint events; i.e., the open/close of a link,
-  # session or connection, in a more intuitive manner.
-  #
-  # A XXX_opened method will be called when both local and remote peers have
-  # opened the link, session or connection. This can be used to confirm a
-  # locally initiated action for example.
-  #
-  # A XXX_opening method will be called when the remote peer has requested
-  # an open that was not initiated locally. By default this will simply open
-  # locally, which then trigtgers the XXX_opened called.
-  #
-  # The same applies to close.
-  #
-  class EndpointStateHandler < Qpid::Proton::BaseHandler
-
-    def initialize(peer_close_is_error = false, delegate = nil)
-      @delegate = delegate
-      @peer_close_is_error = peer_close_is_error
-    end
-
-    def self.print_error(endpoint, endpoint_type)
-      if !endpoint.remote_condition.nil?
-      elsif self.local_endpoint?(endpoint) && endpoint.remote_closed?
-        logging.error("#{endpoint_type} closed by peer")
-      end
-    end
-
-    def on_link_remote_close(event)
-      if !event.link.remote_condition.nil?
-        self.on_link_error(event)
-      elsif event.link.local_closed?
-        self.on_link_closed(event)
-      else
-        self.on_link_closing(event)
-      end
-      event.link.close
-    end
-
-    def on_session_remote_close(event)
-      if !event.session.remote_condition.nil?
-        self.on_session_error(event)
-      elsif event.session.local_closed?
-        self.on_session_closed(event)
-      else
-        self.on_session_closing(event)
-      end
-      event.session.close
-    end
-
-    def on_connection_remote_close(event)
-      if !event.connection.remote_condition.nil?
-        self.on_connection_error(event)
-      elsif event.connection.local_closed?
-        self.on_connection_closed(event)
-      else
-        self.on_connection_closing(event)
-      end
-      event.connection.close
-    end
-
-    def on_connection_local_open(event)
-      self.on_connection_opened(event) if event.connection.remote_active?
-    end
-
-    def on_connection_remote_open(event)
-      if !(event.connection.state & Qpid::Proton::Endpoint::LOCAL_ACTIVE).zero?
-        self.on_connection_opened(event)
-      elsif event.connection.local_uninit?
-        self.on_connection_opening(event)
-        event.connection.open
-      end
-    end
-
-    def on_session_local_open(event)
-      self.on_session_opened(event) if event.session.remote_active?
-    end
-
-    def on_session_remote_open(event)
-      if !(event.session.state & Qpid::Proton::Endpoint::LOCAL_ACTIVE).zero?
-        self.on_session_opened(event)
-      elsif event.session.local_uninit?
-        self.on_session_opening(event)
-        event.session.open
-      end
-    end
-
-    def on_link_local_open(event)
-      self.on_link_opened(event) if event.link.remote_active?
-    end
-
-    def on_link_remote_open(event)
-      if !(event.link.state & Qpid::Proton::Endpoint::LOCAL_ACTIVE).zero?
-        self.on_link_opened(event)
-      elsif event.link.local_uninit?
-        self.on_link_opening(event)
-        event.link.open
-      end
-    end
-
-    def on_connection_opened(event)
-      Qpid::Proton::Event.dispatch(@delegate, :on_session_opened, event) if !@delegate.nil?
-    end
-
-    def on_session_opened(event)
-      Qpid::Proton::Event.dispatch(@delegate, :on_session_opened, event) if !@delegate.nil?
-    end
-
-    def on_link_opened(event)
-      Qpid::Proton::Event.dispatch(@delegate, :on_link_opened, event) if !@delegate.nil?
-    end
-
-    def on_connection_opening(event)
-      Qpid::Proton::Event.dispatch(@delegate, :on_connection_opening, event) if !@delegate.nil?
-    end
-
-    def on_session_opening(event)
-      Qpid::Proton::Event.dispatch(@delegate, :on_session_opening, event) if !@delegate.nil?
-    end
-
-    def on_link_opening(event)
-      Qpid::Proton::Event.dispatch(@delegate, :on_link_opening, event) if !@delegate.nil?
-    end
-
-    def on_connection_error(event)
-      if !@delegate.nil?
-        Qpid::Proton::Event.dispatch(@delegate, :on_connection_error, event)
-      else
-        self.log_error(event.connection, "connection")
-      end
-    end
-
-    def on_session_error(event)
-      if !@delegate.nil?
-        Qpid::Proton::Event.dispatch(@delegate, :on_session_error, event)
-      else
-        self.log_error(event.session, "session")
-        event.connection.close
-      end
-    end
-
-    def on_link_error(event)
-      if !@delegate.nil?
-        Qpid::Proton::Event.dispatch(@delegate, :on_link_error, event)
-      else
-        self.log_error(event.link, "link")
-        event.conneciton.close
-      end
-    end
-
-    def on_connection_closed(event)
-      Qpid::Proton::Event.dispatch(@delegate, :on_connection_closed, event) if !@delegate.nil?
-    end
-
-    def on_session_closed(event)
-      Qpid::Proton::Event.dispatch(@delegate, :on_session_closed, event) if !@delegate.nil?
-    end
-
-    def on_link_closed(event)
-      Qpid::Proton::Event.dispatch(@delegate, :on_link_closed, event) if !@delegate.nil?
-    end
-
-    def on_connection_closing(event)
-      if !@delegate.nil?
-        Qpid::Proton::Event.dispatch(@delegate, :on_connection_closing, event)
-      elsif @peer_close_is_error
-        self.on_connection_error(event)
-      end
-    end
-
-    def on_session_closing(event)
-      if !@delegate.nil?
-        Qpid::Proton::Event.dispatch(@delegate, :on_session_closing, event)
-      elsif @peer_close_is_error
-        self.on_session_error(event)
-      end
-    end
-
-    def on_link_closing(event)
-      if !@delegate.nil?
-        Qpid::Proton::Event.dispatch(@delegate, :on_link_closing, event)
-      elsif @peer_close_is_error
-        self.on_link_error(event)
-      end
-    end
-
-    def on_transport_tail_closed(event)
-      self.on_transport_closed(event)
-    end
-
-    def on_transport_closed(event)
-      Qpid::Proton::Event.dispatch(@delegate, :on_disconnected, event) if !@delegate.nil?
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/handler/incoming_message_handler.rb b/proton-c/bindings/ruby/lib/handler/incoming_message_handler.rb
deleted file mode 100644
index ced84a2..0000000
--- a/proton-c/bindings/ruby/lib/handler/incoming_message_handler.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Handler
-
-  # A utility for simpler and more intuitive handling of delivery events
-  # related to incoming messages.
-  #
-  class IncomingMessageHandler < Qpid::Proton::BaseHandler
-
-    include Acking
-
-    def initialize(auto_accept = true, delegate = nil)
-      @delegate = delegate
-      @auto_accept = auto_accept
-    end
-
-    def on_delivery(event)
-      delivery = event.delivery
-      return unless delivery.link.receiver?
-      if delivery.readable? && !delivery.partial?
-        event.message = Qpid::Proton::Util::Engine.receive_message(delivery)
-        if event.link.local_closed?
-          if @auto_accept
-            delivery.update(Qpid::Proton::Disposition::RELEASED)
-            delivery.settle
-          end
-        else
-          begin
-            self.on_message(event)
-            if @auto_accept
-              delivery.update(Qpid::Proton::Disposition::ACCEPTED)
-              delivery.settle
-            end
-          rescue Qpid::Proton::Reject
-            delivery.update(Qpid::Proton::Disposition::REJECTED)
-            delivery.settle
-          rescue Qpid::Proton::Release
-            delivery.update(Qpid::Proton::Disposition::MODIFIED)
-            delivery.settle
-          end
-        end
-      elsif delivery.updated? && delivery.settled?
-        self.on_settled(event)
-      end
-    end
-
-    def on_message(event)
-      Qpid::Proton::Event.dispatch(@delegate, :on_message, event) if !@delegate.nil?
-    end
-
-    def on_settled(event)
-      Qpid::Proton::Event.dispatch(@delegate, :on_settled, event) if !@delegate.nil?
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/handler/messaging_handler.rb b/proton-c/bindings/ruby/lib/handler/messaging_handler.rb
deleted file mode 100644
index b4a0bcf..0000000
--- a/proton-c/bindings/ruby/lib/handler/messaging_handler.rb
+++ /dev/null
@@ -1,218 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Handler
-
-  # A general purpose handler that simplifies processing events.
-  #
-  # @example
-  #
-  class MessagingHandler < Qpid::Proton::BaseHandler
-
-    attr_reader :handlers
-
-    # Creates a new instance.
-    #
-    # @param [Fixnum] prefetch
-    # @param [Boolean] auto_accept
-    # @param [Boolean] auto_settle
-    # @param [Boolean] peer_close_is_error
-    #
-    def initialize(prefetch = 10, auto_accept = true, auto_settle = true, peer_close_is_error = false)
-      @handlers = Array.new
-      @handlers << CFlowController.new(prefetch) unless prefetch.zero?
-      @handlers << EndpointStateHandler.new(peer_close_is_error, self)
-      @handlers << IncomingMessageHandler.new(auto_accept, self)
-      @handlers << OutgoingMessageHandler.new(auto_settle,self)
-    end
-
-    # Called when the peer closes the connection with an error condition.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_connection_error(event)
-      EndpointStateHandler.print_error(event.connection, "connection")
-    end
-
-      # Called when the peer closes the session with an error condition.
-      #
-      # @param event [Qpid:Proton::Event::Event] The event.
-      #
-    def on_session_error(event)
-      EndpointStateHandler.print_error(event.session, "session")
-      event.connection.close
-    end
-
-    # Called when the peer closes the link with an error condition.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_link_error(event)
-      EndpointStateHandler.print_error(event.link, "link")
-      event.connection.close
-    end
-
-    # Called when the event loop starts.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_reactor_init(event)
-      self.on_start(event)
-    end
-
-    # Called when the event loop starts.
-    #
-    # This method needs to be overridden.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_start(event)
-    end
-
-    # Called when the connection is closed.
-    #
-    # This method needs to be overridden.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_connection_closed(event)
-    end
-
-    # Called when the session is closed.
-    #
-    # This method needs to be overridden.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_session_closed(event)
-    end
-
-    # Called when the link is closed.
-    #
-    # This method needs to be overridden.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_link_closed(event)
-    end
-
-    # Called when the peer initiates the closing of the connection.
-    #
-    # This method needs to be overridden.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_connection_closing(event)
-    end
-
-    # Called when the peer initiates the closing of the session.
-    #
-    # This method needs to be overridden.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_session_closing(event)
-    end
-
-    # Called when the peer initiates the closing of the link.
-    #
-    # This method needs to be overridden.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_link_closing(event)
-    end
-
-    # Called when the socket is disconnected.
-    #
-    # This method needs to be overridden.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_disconnected(event)
-    end
-
-    # Called when the sender link has credit and messages can therefore
-    # be transferred.
-    #
-    # This method needs to be overridden.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_sendable(event)
-    end
-
-    # Called when the remote peer accepts an outgoing message.
-    #
-    # This method needs to be overridden.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_accepted(event)
-    end
-
-    # Called when the remote peer rejects an outgoing message.
-    #
-    # This method needs to be overridden.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_rejected(event)
-    end
-
-    # Called when the remote peer releases an outgoing message.
-    #
-    # Note that this may be in response to either the RELEASE or
-    # MODIFIED state as defined by the AMPQ specification.
-    #
-    # This method needs to be overridden.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_released(event)
-    end
-
-    # Called when the remote peer has settled hte outgoing message.
-    #
-    # This is the point at which it should never be retransmitted.
-    #
-    # This method needs to be overridden.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_settled(event)
-    end
-
-    # Called when a message is received.
-    #
-    # The message itself can be obtained as a property on the event. For
-    # the purpose of referring to this message in further actions, such as
-    # explicitly accepting it) the delivery should be used. This is also
-    # obtainable vi a property on the event.
-    #
-    # This method needs to be overridden.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_message(event)
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/handler/outgoing_message_handler.rb b/proton-c/bindings/ruby/lib/handler/outgoing_message_handler.rb
deleted file mode 100644
index 3f1f3f3..0000000
--- a/proton-c/bindings/ruby/lib/handler/outgoing_message_handler.rb
+++ /dev/null
@@ -1,100 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Handler
-
-  # A utility for simpler and more intuitive handling of delivery events
-  # related to outgoing messages.
-  #
-  class OutgoingMessageHandler < Qpid::Proton::BaseHandler
-
-    def initialize(auto_settle = true, delegate = nil)
-      @auto_settle = auto_settle
-      @delegate = delegate
-    end
-
-    def on_link_flow(event)
-      self.on_sendable(event) if event.link.sender? && event.link.credit > 0 &&
-                                 (event.link.state & Qpid::Proton::Endpoint::LOCAL_ACTIVE) &&
-                                 (event.link.state & Qpid::Proton::Endpoint::REMOTE_ACTIVE)
-    end
-
-    def on_delivery(event)
-      delivery = event.delivery
-      if delivery.link.sender? && delivery.updated?
-        if delivery.remote_accepted?
-          self.on_accepted(event)
-        elsif delivery.remote_rejected?
-          self.on_rejected(event)
-        elsif delivery.remote_released? || delivery.remote_modified?
-          self.on_released(event)
-        end
-        self.on_settled(event) if delivery.settled?
-        delivery.settle if @auto_settle
-      end
-    end
-
-    # Called when the sender link has credit and messages and be transferred.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_sendable(event)
-      Qpid::Proton::Event.dispatch(@delegate, :on_sendable, event) if !@delegate.nil?
-    end
-
-    # Called when the remote peer accepts a sent message.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_accepted(event)
-      Qpid::Proton::Event.dispatch(@delegate, :on_accepted, event) if !@delegate.nil?
-    end
-
-    # Called when the remote peer rejects a sent message.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_rejected(event)
-      Qpid::Proton::Event.dispatch(@delegate, :on_rejected, event) if !@delegate.nil?
-    end
-
-    # Called when the remote peer releases an outgoing message.
-    #
-    # Note that this may be in resposnse to either the REELAASE or MODIFIED
-    # state as defined by the AMQP specification.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_released(event)
-      Qpid::Proton::Event.dispatch(@delegate, :on_released, event) if !@delegate.nil?
-    end
-
-    # Called when the remote peer has settled the outgoing message.
-    #
-    # This is the point at which it should never be retransmitted.
-    #
-    # @param event [Qpid::Proton::Event::Event] The event.
-    #
-    def on_settled(event)
-      Qpid::Proton::Event.dispatch(@delegate, :on_settled, event) if !@delegate.nil?
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/handler/wrapped_handler.rb b/proton-c/bindings/ruby/lib/handler/wrapped_handler.rb
deleted file mode 100644
index 6d55dee..0000000
--- a/proton-c/bindings/ruby/lib/handler/wrapped_handler.rb
+++ /dev/null
@@ -1,76 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Handler
-
-  class WrappedHandler
-
-    # @private
-    include Qpid::Proton::Util::Wrapper
-
-    def self.wrap(impl, on_error = nil)
-      return nil if impl.nil?
-
-      result = self.fetch_instance(impl) || WrappedHandler.new(impl)
-      result.on_error = on_error
-      return result
-    end
-
-    include Qpid::Proton::Util::Handler
-
-    def initialize(impl_or_constructor)
-      if impl_or_constructor.is_a?(Method)
-        @impl = impl_or_constructor.call
-      else
-        @impl = impl_or_constructor
-        Cproton.pn_incref(@impl)
-      end
-      @on_error = nil
-      self.class.store_instance(self)
-    end
-
-    def add(handler)
-      return if handler.nil?
-
-      impl = chandler(handler, self.method(:_on_error))
-      Cproton.pn_handler_add(@impl, impl)
-      Cproton.pn_decref(impl)
-    end
-
-    def clear
-      Cproton.pn_handler_clear(@impl)
-    end
-
-    def on_error=(on_error)
-      @on_error = on_error
-    end
-
-    private
-
-    def _on_error(info)
-      if self.has?['on_error']
-        self['on_error'].call(info)
-      else
-        raise info
-      end
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/messenger/messenger.rb b/proton-c/bindings/ruby/lib/messenger/messenger.rb
deleted file mode 100644
index 70a01de..0000000
--- a/proton-c/bindings/ruby/lib/messenger/messenger.rb
+++ /dev/null
@@ -1,702 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-module Qpid::Proton::Messenger
-
-  # The +Messenger+ class defines a high level interface for
-  # sending and receiving Messages. Every Messenger contains
-  # a single logical queue of incoming messages and a single
-  # logical queue of outgoing messages. These messages in these
-  # queues may be destined for, or originate from, a variety of
-  # addresses.
-  #
-  # The messenger interface is single-threaded.  All methods
-  # except one ( #interrupt ) are intended to be used from within
-  # the messenger thread.
-  #
-  # === Sending & Receiving Messages
-  #
-  # The Messenger class works in conjuction with the Message class. The
-  # Message class is a mutable holder of message content.
-  #
-  # The put method copies its Message to the outgoing queue, and may
-  # send queued messages if it can do so without blocking.  The send
-  # method blocks until it has sent the requested number of messages,
-  # or until a timeout interrupts the attempt.
-  #
-  # Similarly, the recv method receives messages into the incoming
-  # queue, and may block as it attempts to receive the requested number
-  # of messages,  or until timeout is reached. It may receive fewer
-  # than the requested number.  The get method pops the
-  # eldest Message off the incoming queue and copies it into the Message
-  # object that you supply.  It will not block.
-  #
-  # The blocking attribute allows you to turn off blocking behavior entirely,
-  # in which case send and recv will do whatever they can without
-  # blocking, and then return.  You can then look at the number
-  # of incoming and outgoing messages to see how much outstanding work
-  # still remains.
-  #
-  class Messenger
-
-    include Qpid::Proton::Util::ErrorHandler
-
-    can_raise_error [:send, :receive, :password=, :start, :stop,
-                     :perform_put, :perform_get, :interrupt,
-                     :route, :rewrite, :accept, :reject,
-                     :incoming_window=, :outgoing_window=]
-
-    # Creates a new +Messenger+.
-    #
-    # The +name+ parameter is optional. If one is not provided then
-    # a unique name is generated.
-    #
-    # ==== Options
-    #
-    # * name - the name (def. nil)
-    #
-    def initialize(name = nil)
-      @impl = Cproton.pn_messenger(name)
-      @selectables = {}
-      ObjectSpace.define_finalizer(self, self.class.finalize!(@impl))
-    end
-
-    def self.finalize!(impl) # :nodoc:
-      proc {
-        Cproton.pn_messenger_free(impl)
-      }
-    end
-
-    # Returns the name.
-    #
-    def name
-      Cproton.pn_messenger_name(@impl)
-    end
-
-    # This property contains the password for the Messenger.private_key
-    # file, or +nil+ if the file is not encrypted.
-    #
-    # ==== Arguments
-    #
-    # * password - the password
-    #
-    def password=(password)
-      Cproton.pn_messenger_set_password(@impl, password)
-    end
-
-    # Returns the password property for the Messenger.private_key file.
-    #
-    def password
-      Cproton.pn_messenger_get_password(@impl)
-    end
-
-    # Sets the timeout period, in milliseconds.
-    #
-    # A negative timeout period implies an infinite timeout.
-    #
-    # ==== Options
-    #
-    # * timeout - the timeout period
-    #
-    def timeout=(timeout)
-      raise TypeError.new("invalid timeout: #{timeout}") if timeout.nil?
-      Cproton.pn_messenger_set_timeout(@impl, timeout)
-    end
-
-    # Returns the timeout period
-    #
-    def timeout
-      Cproton.pn_messenger_get_timeout(@impl)
-    end
-
-    # Returns true if blocking mode is enabled.
-    #
-    # Enable or disable blocking behavior during message sending
-    # and receiving.  This affects every blocking call, with the
-    # exception of work().  Currently, the affected calls are
-    # send, recv, and stop.
-    def blocking?
-      Cproton.pn_messenger_is_blocking(@impl)
-    end
-
-    # Sets the blocking mode.
-    def blocking=(blocking)
-      Cproton.pn_messenger_set_blocking(@impl, blocking)
-    end
-
-    # Returns true if passive mode is enabled.
-    #
-    def passive?
-      Cproton.pn_messenger_is_passive(@impl)
-    end
-
-    # Turns passive mode on or off.
-    #
-    # When set to passive mode, Messenger will not attempt to perform I/O
-    # operations internally. In this mode it is necesssary to use the
-    # Selectable type to drive any I/O needed to perform requestioned
-    # actions.
-    #
-    # In this mode Messenger will never block.
-    #
-    def passive=(mode)
-      Cproton.pn_messenger_set_passive(@impl, mode)
-    end
-
-    def deadline
-      tstamp = Cproton.pn_messenger_deadline(@impl)
-      return tstamp / 1000.0 unless tstamp.nil?
-    end
-
-    # Reports whether an error occurred.
-    #
-    def error?
-      !Cproton.pn_messenger_errno(@impl).zero?
-    end
-
-    # Returns the most recent error number.
-    #
-    def errno
-      Cproton.pn_messenger_errno(@impl)
-    end
-
-    # Returns the most recent error message.
-    #
-    def error
-      Cproton.pn_error_text(Cproton.pn_messenger_error(@impl))
-    end
-
-    # Clears the current error state.
-    #
-    def clear_error
-      error = Cproton.pn_messenger_error(@impl)
-      unless error.nil?
-        Cproton.pn_error_clear(error)
-      end
-    end
-
-    # For future compatibility, do not send or recv messages
-    # before starting the +Messenger+.
-    #
-    def start
-      at_exit { stop }
-      Cproton.pn_messenger_start(@impl)
-    end
-
-    # Stops the +Messenger+, preventing it from sending or receiving
-    # any more messages.
-    #
-    def stop
-      Cproton.pn_messenger_stop(@impl)
-    end
-
-    # Returns true if a Messenger is in the stopped state.
-    # This function does not block.
-    #
-    def stopped?
-      Cproton.pn_messenger_stopped(@impl)
-    end
-
-    # Subscribes the Messenger to messages originating from the
-    # specified source. The source is an address as specified in the
-    # Messenger introduction with the following addition. If the
-    # domain portion of the address begins with the '~' character, the
-    # Messenger will interpret the domain as host/port, bind to it,
-    # and listen for incoming messages. For example "~0.0.0.0",
-    # "amqp://~0.0.0.0" will all bind to any local interface and
-    # listen for incoming messages.  An address of "amqps://~0.0.0.0"
-    # will only permit incoming SSL connections.
-    #
-    # ==== Options
-    #
-    # * address - the source address to be subscribe
-    # * timeout - an optional time-to-live value, in seconds, for the
-    #             subscription
-    #
-    def subscribe(address, timeout=0)
-      raise TypeError.new("invalid address: #{address}") if address.nil?
-      subscription = Cproton.pn_messenger_subscribe_ttl(@impl, address, timeout)
-      raise Qpid::Proton::ProtonError.new("Subscribe failed") if subscription.nil?
-      Subscription.new(subscription)
-    end
-
-    # Path to a certificate file for the +Messenger+.
-    #
-    # This certificate is used when the +Messenger+ accepts or establishes
-    # SSL/TLS connections.  This property must be specified for the
-    # Messenger to accept incoming SSL/TLS connections and to establish
-    # client authenticated outgoing SSL/TLS connection.  Non client authenticated
-    # outgoing SSL/TLS connections do not require this property.
-    #
-    # ==== Options
-    #
-    # * certificate - the certificate
-    #
-    def certificate=(certificate)
-      Cproton.pn_messenger_set_certificate(@impl, certificate)
-    end
-
-    # Returns the path to a certificate file.
-    #
-    def certificate
-      Cproton.pn_messenger_get_certificate(@impl)
-    end
-
-    # Path to a private key file for the +Messenger+.
-    #
-    # The property must be specified for the +Messenger+ to accept incoming
-    # SSL/TLS connections and to establish client authenticated outgoing
-    # SSL/TLS connections.  Non client authenticated SSL/TLS connections
-    # do not require this property.
-    #
-    # ==== Options
-    #
-    # * key - the key file
-    #
-    def private_key=(key)
-      Cproton.pn_messenger_set_private_key(@impl, key)
-    end
-
-    # Returns the path to a private key file.
-    #
-    def private_key
-      Cproton.pn_messenger_get_private_key(@impl)
-    end
-
-    # A path to a database of trusted certificates for use in verifying the
-    # peer on an SSL/TLS connection. If this property is +nil+, then the
-    # peer will not be verified.
-    #
-    # ==== Options
-    #
-    # * certificates - the certificates path
-    #
-    def trusted_certificates=(certificates)
-      Cproton.pn_messenger_set_trusted_certificates(@impl,certificates)
-    end
-
-    # The path to the databse of trusted certificates.
-    #
-    def trusted_certificates
-      Cproton.pn_messenger_get_trusted_certificates(@impl)
-    end
-
-    # Places the content contained in the message onto the outgoing
-    # queue of the Messenger.
-    #
-    # This method will never block, however it will send any unblocked
-    # Messages in the outgoing queue immediately and leave any blocked
-    # Messages remaining in the outgoing queue.
-    # The send call may then be used to block until the outgoing queue
-    # is empty.  The outgoing attribute may be used to check the depth
-    # of the outgoing queue.
-    #
-    # ==== Options
-    #
-    # * message - the message
-    #
-    def put(message)
-      if message.nil?
-        raise TypeError.new("invalid message: #{message}")
-      end
-      unless message.kind_of?(Qpid::Proton::Message)
-        raise ::ArgumentError.new("invalid message type: #{message.class}")
-      end
-      # encode the message first
-      message.pre_encode
-      perform_put(message)
-      return outgoing_tracker
-    end
-
-    private
-
-    def perform_put(message) # :nodoc:
-      Cproton.pn_messenger_put(@impl, message.impl)
-    end
-
-    public
-
-
-    # This call will block until the indicated number of messages
-    # have been sent, or until the operation times out.
-    # If n is -1 this call will block until all outgoing messages
-    # have been sent. If n is 0 then this call will send whatever
-    # it can without blocking.
-    #
-    def send(n = -1)
-      Cproton.pn_messenger_send(@impl, n)
-    end
-
-    # Moves the message from the head of the incoming message queue into
-    # the supplied message object. Any content in the supplied message
-    # will be overwritten.
-    # A tracker for the incoming Message is returned.  The tracker can
-    # later be used to communicate your acceptance or rejection of the
-    # Message.
-    #
-    # If no message is provided in the argument, then one is created. In
-    # either case, the one returned will be the fetched message.
-    #
-    # ==== Options
-    #
-    # * msg - the (optional) +Message+ instance to be used
-    #
-    def get(msg = nil)
-      msg_impl = nil
-      if msg.nil? then
-        msg_impl = nil
-      else
-        msg_impl = msg.impl
-      end
-      perform_get(msg_impl)
-      msg.post_decode unless msg.nil?
-      return incoming_tracker
-    end
-
-    private
-
-    def perform_get(msg) # :nodoc:
-      Cproton.pn_messenger_get(@impl, msg)
-    end
-
-    public
-
-    # Receives up to limit messages into the incoming queue.  If no value
-    # for limit is supplied, this call will receive as many messages as it
-    # can buffer internally.  If the Messenger is in blocking mode, this
-    # call will block until at least one Message is available in the
-    # incoming queue.
-    #
-    # Options ====
-    #
-    # * limit - the maximum number of messages to receive
-    #
-    def receive(limit = -1)
-      Cproton.pn_messenger_recv(@impl, limit)
-    end
-
-    # Returns true if the messenger is currently receiving data.
-    def receiving?
-      Cproton.pn_messenger_receiving(@impl)
-    end
-
-    # Attempts interrupting of the messenger thread.
-    #
-    # The Messenger interface is single-threaded, and this is the only
-    # function intended to be called from outside of is thread.
-    #
-    # Call this from a non-Messenger thread to interrupt it while it
-    # is blocking. This will cause a ::InterruptError to be raised.
-    #
-    # If there is no currently blocking call, then the next blocking
-    # call will be affected, even if it is within the same thread that
-    # originated the interrupt.
-    #
-    def interrupt
-      Cproton.pn_messenger_interrupt(@impl)
-    end
-
-    # Sends or receives any outstanding messages queued for a Messenger.
-    #
-    # This will block for the indicated timeout.  This method may also do I/O
-    # other than sending and receiving messages.  For example, closing
-    # connections after stop() has been called.
-    #
-    def work(timeout=-1)
-      err = Cproton.pn_messenger_work(@impl, timeout)
-      if (err == Cproton::PN_TIMEOUT) then
-        return false
-      else
-        check_for_error(err)
-        return true
-      end
-    end
-
-    # Returns the number messages in the outgoing queue that have not been
-    # transmitted.
-    #
-    def outgoing
-      Cproton.pn_messenger_outgoing(@impl)
-    end
-
-    # Returns the number of messages in the incoming queue that have not
-    # been retrieved.
-    #
-    def incoming
-      Cproton.pn_messenger_incoming(@impl)
-    end
-
-    # Adds a routing rule to the Messenger's internal routing table.
-    #
-    # The route procedure may be used to influence how a Messenger will
-    # internally treat a given address or class of addresses. Every call
-    # to the route procedure will result in Messenger appending a routing
-    # rule to its internal routing table.
-    #
-    # Whenever a Message is presented to a Messenger for delivery, it
-    # will match the address of this message against the set of routing
-    # rules in order. The first rule to match will be triggered, and
-    # instead of routing based on the address presented in the message,
-    # the Messenger will route based on the address supplied in the rule.
-    #
-    # The pattern matching syntax supports two types of matches, a '%'
-    # will match any character except a '/', and a '*' will match any
-    # character including a '/'.
-    #
-    # A routing address is specified as a normal AMQP address, however it
-    # may additionally use substitution variables from the pattern match
-    # that triggered the rule.
-    #
-    # ==== Arguments
-    #
-    # * pattern - the address pattern
-    # * address - the target address
-    #
-    # ==== Examples
-    #
-    #   # route messages sent to foo to the destionaty amqp://foo.com
-    #   messenger.route("foo", "amqp://foo.com")
-    #
-    #   # any message to foobar will be routed to amqp://foo.com/bar
-    #   messenger.route("foobar", "amqp://foo.com/bar")
-    #
-    #   # any message to bar/<path> will be routed to the same path within
-    #   # the amqp://bar.com domain
-    #   messenger.route("bar/*", "amqp://bar.com/$1")
-    #
-    #   # route all Message objects over TLS
-    #   messenger.route("amqp:*", "amqps:$1")
-    #
-    #   # supply credentials for foo
-    #   messenger.route("amqp://foo.com/*", "amqp://user:password@foo.com/$1")
-    #
-    #   # supply credentials for all domains
-    #   messenger.route("amqp://*", "amqp://user:password@$1")
-    #
-    #   # route all addresses through a single proxy while preserving the
-    #   # original destination
-    #   messenger.route("amqp://%$/*", "amqp://user:password@proxy/$1/$2")
-    #
-    #   # route any address through a single broker
-    #   messenger.route("*", "amqp://user:password@broker/$1")
-    #
-    def route(pattern, address)
-      Cproton.pn_messenger_route(@impl, pattern, address)
-    end
-
-    # Similar to #route, except that the destination of
-    # the Message is determined before the message address is rewritten.
-    #
-    # The outgoing address is only rewritten after routing has been
-    # finalized.  If a message has an outgoing address of
-    # "amqp://0.0.0.0:5678", and a rewriting rule that changes its
-    # outgoing address to "foo", it will still arrive at the peer that
-    # is listening on "amqp://0.0.0.0:5678", but when it arrives there,
-    # the receiver will see its outgoing address as "foo".
-    #
-    # The default rewrite rule removes username and password from addresses
-    # before they are transmitted.
-    #
-    # ==== Arguments
-    #
-    # * pattern - the outgoing address
-    # * address - the target address
-    #
-    def rewrite(pattern, address)
-      Cproton.pn_messenger_rewrite(@impl, pattern, address)
-    end
-
-    def selectable
-      impl = Cproton.pn_messenger_selectable(@impl)
-
-      # if we don't have any selectables, then return
-      return nil if impl.nil?
-
-      fd = Cproton.pn_selectable_get_fd(impl)
-
-      selectable = @selectables[fd]
-      if selectable.nil?
-        selectable = Selectable.new(self, impl)
-        @selectables[fd] = selectable
-      end
-      return selectable
-    end
-
-    # Returns a +Tracker+ for the message most recently sent via the put
-    # method.
-    #
-    def outgoing_tracker
-      impl = Cproton.pn_messenger_outgoing_tracker(@impl)
-      return nil if impl == -1
-      Tracker.new(impl)
-    end
-
-    # Returns a +Tracker+ for the most recently received message.
-    #
-    def incoming_tracker
-      impl = Cproton.pn_messenger_incoming_tracker(@impl)
-      return nil if impl == -1
-      Tracker.new(impl)
-    end
-
-    # Signal the sender that you have acted on the Message
-    # pointed to by the tracker.  If no tracker is supplied,
-    # then all messages that have been returned by the get
-    # method are accepted, except those that have already been
-    # auto-settled by passing beyond your incoming window size.
-    #
-    # ==== Options
-    #
-    # * tracker - the tracker
-    #
-    def accept(tracker = nil)
-      raise TypeError.new("invalid tracker: #{tracker}") unless tracker.nil? or valid_tracker?(tracker)
-      if tracker.nil? then
-        tracker = self.incoming_tracker
-        flag = Cproton::PN_CUMULATIVE
-      else
-        flag = 0
-      end
-      Cproton.pn_messenger_accept(@impl, tracker.impl, flag)
-    end
-
-    # Rejects the incoming message identified by the tracker.
-    # If no tracker is supplied, all messages that have been returned
-    # by the get method are rejected, except those that have already
-    # been auto-settled by passing beyond your outgoing window size.
-    #
-    # ==== Options
-    #
-    # * tracker - the tracker
-    #
-    def reject(tracker)
-      raise TypeError.new("invalid tracker: #{tracker}") unless tracker.nil? or valid_tracker?(tracker)
-      if tracker.nil? then
-        tracker = self.incoming_tracker
-        flag = Cproton::PN_CUMULATIVE
-      else
-        flag = 0
-      end
-      Cproton.pn_messenger_reject(@impl, tracker.impl, flag)
-    end
-
-    # Gets the last known remote state of the delivery associated with
-    # the given tracker, as long as the Message is still within your
-    # outgoing window. (Also works on incoming messages that are still
-    # within your incoming queue. See TrackerStatus for details on the
-    # values returned.
-    #
-    # ==== Options
-    #
-    # * tracker - the tracker
-    #
-    def status(tracker)
-      raise TypeError.new("invalid tracker: #{tracker}") unless valid_tracker?(tracker)
-      TrackerStatus.by_value(Cproton.pn_messenger_status(@impl, tracker.impl))
-    end
-
-    # Frees a Messenger from tracking the status associated
-    # with a given tracker. If you don't supply a tracker, all
-    # outgoing messages up to the most recent will be settled.
-    #
-    # ==== Options
-    #
-    # * tracker - the tracker
-    #
-    # ==== Examples
-    #
-    def settle(tracker)
-      raise TypeError.new("invalid tracker: #{tracker}") unless valid_tracker?(tracker)
-      if tracker.nil? then
-        tracker = self.incoming_tracker
-        flag = Cproton::PN_CUMULATIVE
-      else
-        flag = 0
-      end
-      Cproton.pn_messenger_settle(@impl, tracker.impl, flag)
-    end
-
-    # Sets the incoming window.
-    #
-    # The Messenger will track the remote status of this many incoming
-    # deliveries after they have been accepted or rejected.
-    #
-    # Messages enter this window only when you take them into your application
-    # using get().  If your incoming window size is n, and you get n+1 messages
-    # without explicitly accepting or rejecting the oldest message, then the
-    # message that passes beyond the edge of the incoming window will be
-    # assigned the default disposition of its link.
-    #
-    # ==== Options
-    #
-    # * window - the window size
-    #
-    def incoming_window=(window)
-      raise TypeError.new("invalid window: #{window}") unless valid_window?(window)
-      Cproton.pn_messenger_set_incoming_window(@impl, window)
-    end
-
-    # Returns the incoming window.
-    #
-    def incoming_window
-      Cproton.pn_messenger_get_incoming_window(@impl)
-    end
-
-    # Sets the outgoing window.
-    #
-    # The Messenger will track the remote status of this many outgoing
-    # deliveries after calling send.
-    # A Message enters this window when you call the put() method with the
-    # message.  If your outgoing window size is n, and you call put n+1
-    # times, status information will no longer be available for the
-    # first message.
-    #
-    # ==== Options
-    #
-    # * window - the window size
-    #
-    def outgoing_window=(window)
-      raise TypeError.new("invalid window: #{window}") unless valid_window?(window)
-      Cproton.pn_messenger_set_outgoing_window(@impl, window)
-    end
-
-    # Returns the outgoing window.
-    #
-    def outgoing_window
-      Cproton.pn_messenger_get_outgoing_window(@impl)
-    end
-
-    # Unregisters a selectable object.
-    def unregister_selectable(fileno) # :nodoc:
-      @selectables.delete(fileno)
-    end
-
-    private
-
-    def valid_tracker?(tracker)
-      !tracker.nil? && tracker.is_a?(Tracker)
-    end
-
-    def valid_window?(window)
-      !window.nil? && [Float, Fixnum].include?(window.class)
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/messenger/subscription.rb b/proton-c/bindings/ruby/lib/messenger/subscription.rb
deleted file mode 100644
index 6d4973e..0000000
--- a/proton-c/bindings/ruby/lib/messenger/subscription.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Messenger
-
-  # A +Subscription+ is an opaque object for working with a +Messenger+'s
-  # subscriptions.
-  #
-  class Subscription
-
-    def initialize(impl) # :nodoc:
-      @impl = impl
-    end
-
-    def impl # :nodoc:
-      @impl
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/messenger/tracker.rb b/proton-c/bindings/ruby/lib/messenger/tracker.rb
deleted file mode 100644
index 55507e5..0000000
--- a/proton-c/bindings/ruby/lib/messenger/tracker.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Messenger
-
-  # A +Tracker+ is used to track the disposition of a +Message+.
-  #
-  class Tracker
-
-    CUMULATIVE = Cproton::PN_CUMULATIVE
-
-    def initialize(impl) # :nodoc:
-      @impl = impl
-    end
-
-    def impl # :nodoc:
-      @impl
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/messenger/tracker_status.rb b/proton-c/bindings/ruby/lib/messenger/tracker_status.rb
deleted file mode 100644
index 6eea9ce..0000000
--- a/proton-c/bindings/ruby/lib/messenger/tracker_status.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Messenger
-
-  # TrackerStatus contains symbols that represent the status value for a
-  # Tracker.
-  #
-  class TrackerStatus
-
-    def initialize value, name # :nodoc:
-      @value = value
-      @name = name
-    end
-
-    def value # :nodoc:
-      @value
-    end
-
-    def to_s # :nodoc:
-      @name.to_s
-    end
-
-    def self.by_name(name) # :nodoc:
-      @by_name[name.to_sym] unless name.nil?
-    end
-
-    def self.by_value(value) # :nodoc:
-      @by_value[value] unless value.nil?
-    end
-
-    private
-
-    def self.add_item(key, value) # :nodoc:
-      @by_name ||= {}
-      @by_name[key] = TrackerStatus.new value, key
-      @by_value ||= {}
-      @by_value[value] = @by_name[key]
-    end
-
-    def self.const_missing(key) # :nodoc:
-      @by_name[key]
-    end
-
-    self.add_item :UNKNOWN,  Cproton::PN_STATUS_UNKNOWN
-    self.add_item :PENDING,  Cproton::PN_STATUS_PENDING
-    self.add_item :ACCEPTED, Cproton::PN_STATUS_ACCEPTED
-    self.add_item :REJECTED, Cproton::PN_STATUS_REJECTED
-    self.add_item :SETTLED,  Cproton::PN_STATUS_SETTLED
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/qpid_proton.rb b/proton-c/bindings/ruby/lib/qpid_proton.rb
deleted file mode 100644
index 1d614a4..0000000
--- a/proton-c/bindings/ruby/lib/qpid_proton.rb
+++ /dev/null
@@ -1,132 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-require "cproton"
-require "date"
-require "weakref"
-
-if RUBY_VERSION < "1.9"
-require "kconv"
-else
-  require "securerandom"
-end
-
-# Exception classes
-require "core/exceptions"
-
-# Utility classes
-require "util/version"
-require "util/error_handler"
-require "util/constants"
-require "util/swig_helper"
-require "util/condition"
-require "util/wrapper"
-require "util/class_wrapper"
-require "util/engine"
-require "util/uuid"
-require "util/timeout"
-require "util/handler"
-require "util/reactor"
-
-# Types
-require "types/strings"
-require "types/hash"
-require "types/array"
-require "types/described"
-
-# Codec classes
-require "codec/mapping"
-require "codec/data"
-
-# Event API classes
-require "event/event_type"
-require "event/event_base"
-require "event/event"
-require "event/collector"
-
-# Main Proton classes
-require "core/selectable"
-require "core/message"
-require "core/endpoint"
-require "core/session"
-require "core/terminus"
-require "core/disposition"
-require "core/delivery"
-require "core/link"
-require "core/sender"
-require "core/receiver"
-require "core/connection"
-require "core/sasl"
-require "core/ssl_domain"
-require "core/ssl_details"
-require "core/ssl"
-require "core/transport"
-require "core/base_handler"
-require "core/url"
-
-# Messenger API classes
-require "messenger/subscription"
-require "messenger/tracker_status"
-require "messenger/tracker"
-require "messenger/messenger"
-
-# Handler classes
-require "handler/c_adaptor"
-require "handler/wrapped_handler"
-require "handler/acking"
-require "handler/endpoint_state_handler"
-require "handler/incoming_message_handler"
-require "handler/outgoing_message_handler"
-require "handler/c_flow_controller"
-require "handler/messaging_handler"
-
-# Reactor classes
-require "reactor/task"
-require "reactor/acceptor"
-require "reactor/reactor"
-require "reactor/ssl_config"
-require "reactor/global_overrides"
-require "reactor/urls"
-require "reactor/connector"
-require "reactor/backoff"
-require "reactor/session_per_connection"
-require "reactor/container"
-require "reactor/link_option"
-
-module Qpid::Proton
-  # @private
-  def self.registry
-    @registry ||= {}
-  end
-
-  # @private
-  def self.add_to_registry(key, value)
-    self.registry[key] = value
-  end
-
-  # @private
-  def self.get_from_registry(key)
-    self.registry[key]
-  end
-
-  # @private
-  def self.delete_from_registry(key)
-    self.registry.delete(key)
-  end
-end
diff --git a/proton-c/bindings/ruby/lib/reactor/acceptor.rb b/proton-c/bindings/ruby/lib/reactor/acceptor.rb
deleted file mode 100644
index 83e0596..0000000
--- a/proton-c/bindings/ruby/lib/reactor/acceptor.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Reactor
-
-  class Acceptor
-
-    include Qpid::Proton::Util::Wrapper
-
-    def initialize(impl)
-      @impl = impl
-      self.class.store_instance(self)
-    end
-
-    def set_ssl_domain(ssl_domain)
-      Cproton.pn_acceptor_set_ssl_domain(@impl, ssl_domain.impl)
-    end
-
-    def close
-      Cproton.pn_acceptor_close(@impl)
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/reactor/backoff.rb b/proton-c/bindings/ruby/lib/reactor/backoff.rb
deleted file mode 100644
index 99682e5..0000000
--- a/proton-c/bindings/ruby/lib/reactor/backoff.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Reactor
-
-  class Backoff
-
-    def initialize
-      @delay = 0
-    end
-
-    def reset
-      @delay = 0
-    end
-
-    def next
-      current = @delay
-      current = 0.1 if current.zero?
-      @delay = [10, 2 * current].min
-      return current
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/reactor/connector.rb b/proton-c/bindings/ruby/lib/reactor/connector.rb
deleted file mode 100644
index a6523db..0000000
--- a/proton-c/bindings/ruby/lib/reactor/connector.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Reactor
-
-  class Connector < Qpid::Proton::BaseHandler
-
-    attr_accessor :address
-    attr_accessor :reconnect
-    attr_accessor :ssl_domain
-
-    def initialize(connection)
-      @connection = connection
-      @address = nil
-      @heartbeat = nil
-      @reconnect = nil
-      @ssl_domain = nil
-    end
-
-    def on_connection_local_open(event)
-      self.connect(event.connection)
-    end
-
-    def on_connection_remote_open(event)
-      if !@reconnect.nil?
-        @reconnect.reset
-        @transport = nil
-      end
-    end
-
-    def on_transport_tail_closed(event)
-      self.on_transport_closed(event)
-    end
-
-    def on_transport_closed(event)
-      if !@connection.nil? && !(@connection.state & Qpid::Proton::Endpoint::LOCAL_ACTIVE).zero?
-        if !@reconnect.nil?
-          event.transport.unbind
-          delay = @reconnect.next
-          if delay == 0
-            self.connect(@connection)
-          else
-            event.reactor.schedule(delay, self)
-          end
-        else
-          @connection = nil
-        end
-      end
-    end
-
-    def on_timer_task(event)
-      self.connect(@connection)
-    end
-
-    def on_connection_remote_close(event)
-      @connection = nil
-    end
-
-    def connect(connection)
-      url = @address.next
-      connection.hostname = "#{url.host}:#{url.port}"
-
-      transport = Qpid::Proton::Transport.new
-      transport.bind(connection)
-      if !@heartbeat.nil?
-        transport.idle_timeout = @heartbeat
-      elsif (url.scheme == "amqps") && !@ssl_domain.nil?
-        @ssl = Qpid::Proton::SSL.new(transport, @ssl_domain)
-        @ss.peer_hostname = url.host
-      elsif !url.username.nil?
-        sasl = transport.sasl
-        if url.username == "anonymous"
-          sasl.mechanisms("ANONYMOUS")
-        else
-          sasl.plain(url.username, url.password)
-        end
-      end
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/reactor/container.rb b/proton-c/bindings/ruby/lib/reactor/container.rb
deleted file mode 100644
index 2a7a030..0000000
--- a/proton-c/bindings/ruby/lib/reactor/container.rb
+++ /dev/null
@@ -1,272 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Reactor
-
-  # @private
-  class InternalTransactionHandler < Qpid::Proton::Handler::OutgoingMessageHandler
-
-    def initialize
-      super
-    end
-
-    def on_settled(event)
-      if event.delivery.respond_to? :transaction
-        event.transaction = event.delivery.transaction
-        event.delivery.transaction.handle_outcome(event)
-      end
-    end
-
-  end
-
-
-  # A representation of the AMQP concept of a container which, loosely
-  # speaking, is something that establishes links to or from another
-  # container on which messages are transferred.
-  #
-  # This is an extension to the Reactor classthat adds convenience methods
-  # for creating instances of Qpid::Proton::Connection, Qpid::Proton::Sender
-  # and Qpid::Proton::Receiver.
-  #
-  # @example
-  #
-  class Container < Reactor
-
-    include Qpid::Proton::Util::Reactor
-
-    include Qpid::Proton::Util::UUID
-
-    attr_accessor :container_id
-    attr_accessor :global_handler
-
-    def initialize(handlers, options = {})
-      super(handlers, options)
-
-      # only do the following if we're creating a new instance
-      if !options.has_key?(:impl)
-        @ssl = SSLConfig.new
-        if options[:global_handler]
-          self.global_handler = GlobalOverrides.new(options[:global_handler])
-        else
-          # very ugly, but using self.global_handler doesn't work in the constructor
-          ghandler = Reactor.instance_method(:global_handler).bind(self).call
-          ghandler = GlobalOverrides.new(ghandler)
-          Reactor.instance_method(:global_handler=).bind(self).call(ghandler)
-        end
-        @trigger = nil
-        @container_id = generate_uuid
-      end
-    end
-
-    # Initiates the establishment of an AMQP connection.
-    #
-    # @param options [Hash] A hash of named arguments.
-    #
-    def connect(options = {})
-      conn = self.connection(options[:handler])
-      conn.container = self.container_id || generate_uuid
-      connector = Connector.new(conn)
-      conn.overrides = connector
-      if !options[:url].nil?
-        connector.address = URLs.new([options[:url]])
-      elsif !options[:urls].nil?
-        connector.address = URLs.new(options[:urls])
-      elsif !options[:address].nil?
-        connector.address = URLs.new([Qpid::Proton::URL.new(options[:address])])
-      else
-        raise ::ArgumentError.new("either :url or :urls or :address required")
-      end
-
-      connector.heartbeat = options[:heartbeat] if !options[:heartbeat].nil?
-      if !options[:reconnect].nil?
-        connector.reconnect = options[:reconnect]
-      else
-        connector.reconnect = Backoff.new()
-      end
-
-      connector.ssl_domain = SessionPerConnection.new # TODO seems this should be configurable
-
-      conn.open
-
-      return conn
-    end
-
-    def _session(context)
-      if context.is_a?(Qpid::Proton::URL)
-        return self._session(self.connect(:url => context))
-      elsif context.is_a?(Qpid::Proton::Session)
-        return context
-      elsif context.is_a?(Qpid::Proton::Connection)
-        if context.session_policy?
-          return context.session_policy.session(context)
-        else
-          return self.create_session(context)
-        end
-      else
-        return context.session
-      end
-    end
-
-    # Initiates the establishment of a link over which messages can be sent.
-    #
-    # @param context [String, URL] The context.
-    # @param opts [Hash] Additional options.
-    # @param opts [String, Qpid::Proton::URL] The target address.
-    # @param opts [String] :source The source address.
-    # @param opts [Boolean] :dynamic
-    # @param opts [Object] :handler
-    # @param opts [Object] :tag_generator The tag generator.
-    # @param opts [Hash] :options Addtional link options
-    #
-    # @return [Sender] The sender.
-    #
-    def create_sender(context, opts = {})
-      if context.is_a?(::String)
-        context = Qpid::Proton::URL.new(context)
-      end
-
-      target = opts[:target]
-      if context.is_a?(Qpid::Proton::URL) && target.nil?
-        target = context.path
-      end
-
-      session = self._session(context)
-
-      sender = session.sender(opts[:name] ||
-                              id(session.connection.container,
-                                target, opts[:source]))
-        sender.source.address = opts[:source] if !opts[:source].nil?
-        sender.target.address = target if target
-        sender.handler = opts[:handler] if !opts[:handler].nil?
-        sender.tag_generator = opts[:tag_generator] if !opts[:tag_gnenerator].nil?
-        self._apply_link_options(opts[:options], sender)
-        sender.open
-        return sender
-    end
-
-    # Initiates the establishment of a link over which messages can be received.
-    #
-    # There are two accepted arguments for the context
-    #  1. If a Connection is supplied then the link is established using that
-    # object. The source, and optionally the target, address can be supplied
-    #  2. If it is a String or a URL then a new Connection is created on which
-    # the link will be attached. If a path is specified, but not the source
-    # address, then the path of the URL is used as the target address.
-    #
-    # The name will be generated for the link if one is not specified.
-    #
-    # @param context [Connection, URL, String] The connection or the address.
-    # @param opts [Hash] Additional otpions.
-    # @option opts [String, Qpid::Proton::URL] The source address.
-    # @option opts [String] :target The target address
-    # @option opts [String] :name The link name.
-    # @option opts [Boolean] :dynamic
-    # @option opts [Object] :handler
-    # @option opts [Hash] :options Additional link options.
-    #
-    # @return [Receiver
-    #
-    def create_receiver(context, opts = {})
-      if context.is_a?(::String)
-        context = Qpid::Proton::URL.new(context)
-      end
-
-      source = opts[:source]
-      if context.is_a?(Qpid::Proton::URL) && source.nil?
-        source = context.path
-      end
-
-      session = self._session(context)
-
-      receiver = session.receiver(opts[:name] ||
-                                  id(session.connection.container,
-                                      source, opts[:target]))
-      receiver.source.address = source if source
-      receiver.source.dynamic = true if opts.has_key?(:dynamic) && opts[:dynamic]
-      receiver.target.address = opts[:target] if !opts[:target].nil?
-      receiver.handler = opts[:handler] if !opts[:handler].nil?
-      self._apply_link_options(opts[:options], receiver)
-      receiver.open
-      return receiver
-    end
-
-    def declare_transaction(context, handler = nil, settle_before_discharge = false)
-      if context.respond_to? :txn_ctl && !context.__send__(:txn_ctl).nil?
-        class << context
-          attr_accessor :txn_ctl
-        end
-        context.txn_ctl = self.create_sender(context, nil, "txn-ctl",
-        InternalTransactionHandler.new())
-      end
-      return Transaction.new(context.txn_ctl, handler, settle_before_discharge)
-    end
-
-    # Initiates a server socket, accepting incoming AMQP connections on the
-    # interface and port specified.
-    #
-    # @param url []
-    # @param ssl_domain []
-    #
-    def listen(url, ssl_domain = nil)
-      url = Qpid::Proton::URL.new(url)
-      acceptor = self.acceptor(url.host, url.port)
-      ssl_config = ssl_domain
-      if ssl_config.nil? && (url.scheme == 'amqps') && @ssl
-        ssl_config = @ssl.server
-      end
-      if !ssl_config.nil?
-        acceptor.ssl_domain(ssl_config)
-      end
-      return acceptor
-    end
-
-    def do_work(timeout = nil)
-      self.timeout = timeout unless timeout.nil?
-      self.process
-    end
-
-    def id(container, remote, local)
-      if !local.nil? && !remote.nil?
-        "#{container}-#{remote}-#{local}"
-      elsif !local.nil?
-        "#{container}-#{local}"
-      elsif !remote.nil?
-        "#{container}-#{remote}"
-      else
-        "#{container}-#{generate_uuid}"
-      end
-    end
-
-    def _apply_link_options(options, link)
-      if !options.nil? && !options.empty?
-        if !options.is_a?(::List)
-          options = [Options].flatten
-        end
-
-        options.each {|option| o.apply(link) if o.test(link)}
-      end
-    end
-
-    def to_s
-      "#{self.class}<@impl=#{Cproton.pni_address_of(@impl)}>"
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/reactor/global_overrides.rb b/proton-c/bindings/ruby/lib/reactor/global_overrides.rb
deleted file mode 100644
index 11d05a5..0000000
--- a/proton-c/bindings/ruby/lib/reactor/global_overrides.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Reactor
-
-  class GlobalOverrides
-
-    def initialize(base)
-      @base = base
-    end
-
-    def on_unhandled(name, event)
-      event.dispatch(@base) unless self.override?(event)
-    end
-
-    def override?(event)
-      conn = event.connection
-      if !conn.nil? && conn.overrides?
-        overrides = conn.overrides
-        result = event.dispatch(overrides)
-        return result
-      end
-      false
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/reactor/link_option.rb b/proton-c/bindings/ruby/lib/reactor/link_option.rb
deleted file mode 100644
index 628a811..0000000
--- a/proton-c/bindings/ruby/lib/reactor/link_option.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Reactor
-
-  class LinkOption
-    def apply(link)
-    end
-
-    # Subclasses should override this to selectively apply an option.
-    def test(link)
-      true
-    end
-  end
-
-  class AtMostOne < LinkOption
-    def apply(link)
-      link.snd_settle_mod = Link::SND_SETTLED
-    end
-  end
-
-  class AtLeastOnce < LinkOption
-    def apply(link)
-      link.snd_settle_mode = Link::SND_UNSETTLED
-      link.rcv_settle_mode = Link::RCV_FIRST
-    end
-  end
-
-  class SenderOption < LinkOption
-    def test(link)
-      link.sender?
-    end
-  end
-
-  class ReceiverOption < LinkOption
-    def test(link)
-      link.receiver?
-    end
-  end
-
-  class DynamicNodeProperties < LinkOption
-    def initialize(properties = {})
-      @properties = []
-      properties.each do |property|
-        @properties << property.to_sym
-      end
-    end
-
-    def apply(link)
-      if link.receiver?
-        link.source.properties.dict = @properties
-      else
-        link.target.properties.dict = @properties
-      end
-    end
-  end
-
-  class Filter < ReceiverOption
-    def initialize(filter_set = {})
-      @filter_set = filter_set
-    end
-
-    def apply(receiver)
-      receiver.source.filter.dict = @filter_set
-    end
-  end
-
-  #class Selector < Filter
-  #  def initialize(value, name = 'selector')
-  #
-  #  end
-  #end
-
-end
diff --git a/proton-c/bindings/ruby/lib/reactor/reactor.rb b/proton-c/bindings/ruby/lib/reactor/reactor.rb
deleted file mode 100644
index a0ff7e0..0000000
--- a/proton-c/bindings/ruby/lib/reactor/reactor.rb
+++ /dev/null
@@ -1,196 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Reactor
-
-  class Reactor
-
-    include Qpid::Proton::Util::Handler
-
-    # @private
-    include Qpid::Proton::Util::SwigHelper
-
-    # @private
-    PROTON_METHOD_PREFIX = "pn_reactor"
-
-    proton_caller :yield
-
-    proton_caller :mark
-
-    proton_caller :start
-
-    proton_caller :stop
-
-    # @private
-    include Qpid::Proton::Util::Timeout
-
-    include Qpid::Proton::Util::Wrapper
-
-    attr_reader :errors
-
-    def self.wrap(impl)
-      return nil if impl.nil?
-
-      self.fetch_instance(impl, :pn_reactor_attachments) || Reactor.new(nil, :impl => impl)
-    end
-
-    def initialize(handlers, options = {})
-      @impl = options[:impl]
-      if @impl.nil?
-        @impl = Cproton.pn_reactor
-      end
-      if !handlers.nil?
-        [handlers].flatten.each {|handler| self.handler.add(handler)}
-      end
-      @errors = []
-      @handlers = []
-      self.class.store_instance(self, :pn_reactor_attachments)
-    end
-
-    # Returns whether the reactor has any unbuffered data.
-    #
-    # @return [Boolean] True if there is no unbuffered data.
-    #
-    def quiesced?
-      Cproton.pn_reactor_quiesced(@impl)
-    end
-
-    def on_error(info)
-      self.errors << info
-      self.yield
-    end
-
-    def global_handler
-      impl = Cproton.pn_reactor_get_global_handler(@impl)
-      Qpid::Proton::Handler::WrappedHandler.wrap(impl, self.method(:on_error))
-    end
-
-    def global_handler=(handler)
-      impl = chandler(handler, self.method(:on_error))
-      Cproton.pn_reactor_set_global_handler(@impl, impl)
-      Cproton.pn_decref(impl)
-    end
-
-    # Returns the timeout period.
-    #
-    # @return [Fixnum] The timeout period, in seconds.
-    #
-    def timeout
-      millis_to_timeout(Cproton.pn_reactor_get_timeout(@impl))
-    end
-
-    # Sets the timeout period.
-    #
-    # @param timeout [Fixnum] The timeout, in seconds.
-    #
-    def timeout=(timeout)
-      Cproton.pn_reactor_set_timeout(@impl, timeout_to_millis(timeout))
-    end
-
-    def handler
-      impl = Cproton.pn_reactor_get_handler(@impl)
-      Qpid::Proton::Handler::WrappedHandler.wrap(impl, self.method(:on_error))
-    end
-
-    def handler=(handler)
-      impl = chandler(handler, set.method(:on_error))
-      Cproton.pn_reactor_set_handler(@impl, impl)
-      Cproton.pn_decref(impl)
-    end
-
-    def run(&block)
-      self.timeout = 3.14159265359
-      self.start
-      while self.process do
-        if block_given?
-          yield
-        end
-      end
-      self.stop
-    end
-
-    def wakeup
-      n = Cproton.pn_reactor_wakeup(@impl)
-      unless n.zero?
-        raise IOError.new(Cproton.pn_reactor_error(@impl))
-      end
-    end
-
-    def process
-      result = Cproton.pn_reactor_process(@impl)
-      if !self.errors.nil? && !self.errors.empty?
-        (0...self.errors.size).each do |index|
-          error_set = self.errors[index]
-          print error.backtrace.join("\n")
-        end
-        raise self.errors.last
-      end
-      return result
-    end
-
-    def schedule(delay, task)
-      impl = chandler(task, self.method(:on_error))
-      task = Task.wrap(Cproton.pn_reactor_schedule(@impl, sec_to_millis(delay), impl))
-      Cproton.pn_decref(impl)
-      return task
-    end
-
-    def acceptor(host, port, handler = nil)
-      impl = chandler(handler, self.method(:on_error))
-      aimpl = Cproton.pn_reactor_acceptor(@impl, host, "#{port}", impl)
-      Cproton.pn_decref(impl)
-      if !aimpl.nil?
-        return Acceptor.new(aimpl)
-      else
-        io_error = Cproton.pn_reactor_error(@impl)
-        error_text = Cproton.pn_error_text(io_error)
-        text = "(#{Cproton.pn_error_text(io_error)} (#{host}:#{port}))"
-        raise IOError.new(text)
-      end
-    end
-
-    def connection(handler = nil)
-      impl = chandler(handler, self.method(:on_error))
-      conn = Qpid::Proton::Connection.wrap(Cproton.pn_reactor_connection(@impl, impl))
-      Cproton.pn_decref(impl)
-      return conn
-    end
-
-    def selectable(handler = nil)
-      impl = chandler(handler, self.method(:on_error))
-      result = Selectable.wrap(Cproton.pn_reactor_selectable(@impl))
-      if !impl.nil?
-        record = Cproton.pn_selectable_attachments(result.impl)
-        Cproton.pn_record_set_handler(record, impl)
-        Cproton.pn_decref(impl)
-      end
-      return result
-    end
-
-    def update(sel)
-      Cproton.pn_reactor_update(@impl, sel.impl)
-    end
-
-    def push_event(obj, etype)
-      Cproton.pn_collector_put(Cproton.pn_reactor_collector(@impl), Qpid::Proton::Util::RBCTX, Cproton.pn_py2void(obj), etype.number)
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/reactor/session_per_connection.rb b/proton-c/bindings/ruby/lib/reactor/session_per_connection.rb
deleted file mode 100644
index f8180c0..0000000
--- a/proton-c/bindings/ruby/lib/reactor/session_per_connection.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Reactor
-
-  class SessionPerConnection
-
-    include Qpid::Proton::Util::Reactor
-
-    def initialize
-      @default_session = nil
-    end
-
-    def session(connection)
-      if @default_session.nil?
-        @default_session = self.create_session
-        @default_session.context = self
-      end
-      return @default_session
-    end
-
-    def on_session_remote_close(event)
-      event.connection.close
-      @default_session = nil
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/reactor/ssl_config.rb b/proton-c/bindings/ruby/lib/reactor/ssl_config.rb
deleted file mode 100644
index 56fec71..0000000
--- a/proton-c/bindings/ruby/lib/reactor/ssl_config.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Reactor
-
-  class SSLConfig
-
-    def initialize
-      @client = Qpid::Proton::SSLDomain.new(Qpid::Proton::SSLDomain::MODE_CLIENT)
-      @server = Qpid::Proton::SSLDomain.new(Qpid::Proton::SSLDomain::MODE_SERVER)
-    end
-
-    def set_credentials(cert_file, key_file, password)
-      @client.set_credentials(cert_file, key_file, password)
-      @server.set_credentials(cert_file, key_file, password)
-    end
-
-    def set_trusted_ca_db(certificate_db)
-      @client.set_trusted_ca_db(certificate_db)
-      @server.set_trusted_ca_db(certificate_db)
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/reactor/task.rb b/proton-c/bindings/ruby/lib/reactor/task.rb
deleted file mode 100644
index 6818ed2..0000000
--- a/proton-c/bindings/ruby/lib/reactor/task.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Reactor
-
-  class Task
-
-    # @private
-    include Qpid::Proton::Util::Wrapper
-
-    def self.wrap(impl)
-      return nil if impl.nil?
-      self.fetch_instance(impl, :pn_task_attachments) || Task.new(impl)
-    end
-
-    def initialize(impl)
-      @impl = impl
-      self.class.store_instance(self, :pn_task_attachments)
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/reactor/urls.rb b/proton-c/bindings/ruby/lib/reactor/urls.rb
deleted file mode 100644
index 8cdb16c..0000000
--- a/proton-c/bindings/ruby/lib/reactor/urls.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Reactor
-
-  class URLs
-
-    def initialize(values)
-      @values = [values].flatten
-      @iter = @values.each
-    end
-
-    def next
-      begin
-        return @iter.next
-      rescue StopIteration
-        @iter = @values.each
-        return @iter.next
-      end
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/types/array.rb b/proton-c/bindings/ruby/lib/types/array.rb
deleted file mode 100644
index f5c6b50..0000000
--- a/proton-c/bindings/ruby/lib/types/array.rb
+++ /dev/null
@@ -1,172 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-#--
-# Patch the Array class to provide methods for adding its contents
-# to a Qpid::Proton::Data instance.
-#++
-
-module Qpid::Proton::Types
-
-  # Holds the information for an AMQP Array compound type.
-  #
-  # It holds the type for the array and the descriptor if the
-  # array is described.
-  #
-  # @private
-  #
-  class ArrayHeader
-    attr_reader :type
-    attr_reader :descriptor
-
-    def initialize(type, descriptor = nil)
-      @type = type
-      @descriptor = descriptor
-    end
-
-    # Returns true if the array is described.
-    def described?
-      !@descriptor.nil?
-    end
-
-    def ==(that)
-      ((@type == that.type) && (@descriptor == that.descriptor))
-    end
-  end
-
-end
-
-# @private
-class Array # :nodoc:
-
-  # Used to declare an array as an AMQP array.
-  #
-  # The value, if defined, is an instance of Qpid::Proton::Types::ArrayHeader
-  attr_accessor :proton_array_header
-
-  # Returns true if the array is the a Proton described type.
-  def proton_described?
-    !@proton_array_header.nil? && @proton_array_header.described?
-  end
-
-  # Puts the elements of the array into the specified Qpid::Proton::Data object.
-  def proton_put(data)
-    raise TypeError, "data object cannot be nil" if data.nil?
-
-    if @proton_array_header.nil?
-      proton_put_list(data)
-    else
-      proton_put_array(data)
-    end
-  end
-
-  private
-
-  def proton_put_list(data)
-    # create a list, then enter it and add each element
-    data.put_list
-    data.enter
-    each do |element|
-      # get the proton type for the element
-      mapping = Qpid::Proton::Codec::Mapping.for_class(element.class)
-      # add the element
-      mapping.put(data, element)
-    end
-    # exit the list
-    data.exit
-  end
-
-  def proton_put_array(data)
-    data.put_array(@proton_array_header.described?, @proton_array_header.type)
-    data.enter
-    if @proton_array_header.described?
-      data.symbol = @proton_array_header.descriptor
-    end
-
-    each do |element|
-      @proton_array_header.type.put(data, element)
-    end
-
-    data.exit
-  end
-
-  class << self
-
-    # Gets the elements of an array or list out of the specified
-    # Qpid::Proton::Data object.
-    def proton_get(data)
-      raise TypeError, "can't convert nil into Qpid::Proton::Data" if data.nil?
-
-      type = data.type
-
-      if type == Qpid::Proton::Codec::LIST
-        result = proton_get_list(data)
-      elsif type == Qpid::Proton::Codec::ARRAY
-        result = proton_get_array(data)
-      else
-        raise TypeError, "element is not a list and not an array"
-      end
-    end
-
-    private
-
-    def proton_get_list(data)
-      size = data.list
-      raise TypeError, "not a list" unless data.enter
-      elements = []
-      (0...size).each do
-        data.next
-        type = data.type
-        raise TypeError, "missing next element in list" unless type
-        elements << type.get(data)
-      end
-      data.exit
-      return elements
-    end
-
-    def proton_get_array(data)
-      count, described, type = data.array
-
-      raise TypeError, "not an array" unless data.enter
-      elements = []
-
-      descriptor = nil
-
-      if described
-        data.next
-        descriptor = data.symbol
-      end
-
-      elements.proton_array_header = Qpid::Proton::Types::ArrayHeader.new(type, descriptor)
-      (0...count).each do |which|
-        if data.next
-          etype = data.type
-          raise TypeError, "missing next element in array" unless etype
-          raise TypeError, "invalid array element: #{etype}" unless etype == type
-          elements << type.get(data)
-        end
-      end
-      data.exit
-      return elements
-    end
-
-  end
-
-end
-
diff --git a/proton-c/bindings/ruby/lib/types/described.rb b/proton-c/bindings/ruby/lib/types/described.rb
deleted file mode 100644
index 7c09d3f..0000000
--- a/proton-c/bindings/ruby/lib/types/described.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Types
-
-  # @private
-  class Described
-
-    attr_reader :descriptor
-    attr_reader :value
-
-    def initialize(descriptor, value)
-      @descriptor = descriptor
-      @value = value
-    end
-
-    # Puts the description into the Data object.
-    #
-    # ==== Arguments
-    #
-    # * data - the Qpid::Proton::Data instance
-    #
-    # ==== Examples
-    #
-    #   described = Qpid::Proton::Described.new("my-descriptor", "the value")
-    #   data = Qpid::Proton::Data.new
-    #   ...
-    #   described.put(data)
-    #
-    def put(data)
-      data.symbol = @descriptor
-      data.string = @value
-    end
-
-    def ==(that) # :nodoc:
-      (that.is_a?(Qpid::Proton::Types::Described) &&
-       (self.descriptor == that.descriptor) &&
-       (self.value == that.value))
-    end
-
-    def to_s # :nodoc:
-      "descriptor=#{descriptor} value=#{value}"
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/types/hash.rb b/proton-c/bindings/ruby/lib/types/hash.rb
deleted file mode 100644
index e6836d5..0000000
--- a/proton-c/bindings/ruby/lib/types/hash.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-#--
-# Patch the Hash class to provide methods for adding its contents
-# to a Qpid::Proton::Data instance.
-#++
-
-# @private
-class Hash # :nodoc:
-
-  # Places the contents of the hash into the specified data object.
-  #
-  # ==== Arguments
-  #
-  # * data - the Qpid::Proton::Data instance
-  #
-  # ==== Examples
-  #
-  #   data = Qpid::Proton::Data.new
-  #   values = {:foo => :bar}
-  #   values.proton_data_put(data)
-  #
-  def proton_data_put(data)
-    raise TypeError, "data object cannot be nil" if data.nil?
-
-    data.put_map
-    data.enter
-
-    each_pair do |key, value|
-      type = Qpid::Proton::Codec::Mapping.for_class(key.class)
-      type.put(data, key)
-      type = Qpid::Proton::Codec::Mapping.for_class(value.class)
-      type.put(data, value)
-    end
-
-    data.exit
-  end
-
-  class << self
-
-    def proton_data_get(data)
-      raise TypeError, "data object cannot be nil" if data.nil?
-
-      type = data.type
-
-      raise TypeError, "element is not a map" unless type == Qpid::Proton::Codec::MAP
-
-      count = data.map
-      result = {}
-
-      data.enter
-
-      (0...(count/2)).each do
-        data.next
-        type = data.type
-        key = type.get(data)
-        data.next
-        type = data.type
-        value = type.get(data)
-        result[key] = value
-      end
-
-      data.exit
-
-      return result
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/types/strings.rb b/proton-c/bindings/ruby/lib/types/strings.rb
deleted file mode 100644
index ffbea3c..0000000
--- a/proton-c/bindings/ruby/lib/types/strings.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Types
-
-  # @private
-  def self.is_valid_utf?(value)
-    # In Ruby 1.9+ we have encoding methods that can check the content of
-    # the string, so use them to see if what we have is unicode. If so,
-    # good! If not, then just treat is as binary.
-    #
-    # No such thing in Ruby 1.8. So there we need to use Iconv to try and
-    # convert it to unicode. If it works, good! But if it raises an
-    # exception then we'll treat it as binary.
-    if RUBY_VERSION < "1.9"
-      return true if value.isutf8
-      return false
-    else
-      return true if (value.encoding == "UTF-8" ||
-                      value.encode("UTF-8").valid_encoding?)
-
-      return false
-    end
-  end
-
-  # UTFString lets an application explicitly state that a
-  # string of characters is to be UTF-8 encoded.
-  #
-  class UTFString < ::String
-
-    def initialize(value)
-      if !Qpid::Proton::Types.is_valid_utf?(value)
-        raise RuntimeError.new("invalid UTF string")
-      end
-
-      super(value)
-    end
-
-  end
-
-  # BinaryString lets an application explicitly declare that
-  # a string value represents arbitrary data.
-  #
-  class BinaryString < ::String; end
-
-end
diff --git a/proton-c/bindings/ruby/lib/util/class_wrapper.rb b/proton-c/bindings/ruby/lib/util/class_wrapper.rb
deleted file mode 100644
index dec16e9..0000000
--- a/proton-c/bindings/ruby/lib/util/class_wrapper.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Util
-
-  # This mixin provides a method for mapping from an underlying Proton
-  # C library class to a Ruby class.
-  #
-  # @private
-  #
-  module ClassWrapper
-
-    WRAPPERS =
-      {
-        "pn_void" => proc {|x| Cproton.pn_void2rb(x)},
-        "pn_rbref" => proc {|x| Cproton.pn_void2rb(x)},
-        "pn_connection" => proc {|x| Qpid::Proton::Connection.wrap(Cproton.pn_cast_pn_connection(x))},
-        "pn_session" => proc {|x| Qpid::Proton::Session.wrap(Cproton.pn_cast_pn_session(x))},
-        "pn_link" => proc {|x| Qpid::Proton::Link.wrap(Cproton.pn_cast_pn_link(x))},
-        "pn_delivery" => proc {|x| Qpid::Proton::Delivery.wrap(Cproton.pn_cast_pn_delivery(x))},
-        "pn_transport" => proc {|x| Qpid::Proton::Transport.wrap(Cproton.pn_cast_pn_transport(x))},
-        "pn_selectable" => proc {|x| Qpid::Proton::Selectable.wrap(Cproton.pn_cast_pn_selectable(x))},
-        "pn_reactor" => proc {|x| Qpid::Proton::Reactor::Reactor.wrap(Cproton.pn_cast_pn_reactor(x))},
-        "pn_task" => proc {|x| Qpid::Proton::Reactor::Task.wrap(Cproton.pn_cast_pn_task(x))},
-      }
-
-    def class_wrapper(clazz, c_impl, &block)
-      proc_func = WRAPPERS[clazz]
-      if !proc_func.nil?
-        proc_func.yield(c_impl)
-      elsif block_given?
-        yield(c_impl)
-      end
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/util/condition.rb b/proton-c/bindings/ruby/lib/util/condition.rb
deleted file mode 100644
index b8fd94b..0000000
--- a/proton-c/bindings/ruby/lib/util/condition.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Util
-
-  class Condition
-
-    def initialize(name, description = nil, info = nil)
-      @name = name
-      @description = description
-      @info = info
-    end
-
-    # @private
-    def to_s
-      "Condition(#{@name}, #{@description}, #{@info})"
-    end
-
-    # @private
-    def ==(other)
-      ((other.class = self.class) &&
-       (other.name == self.name) && 
-       (other.description == self.description) &&
-       (other.info == self.info))
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/util/constants.rb b/proton-c/bindings/ruby/lib/util/constants.rb
deleted file mode 100644
index 50225e6..0000000
--- a/proton-c/bindings/ruby/lib/util/constants.rb
+++ /dev/null
@@ -1,85 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Util
-
-  # Provides a means for defining constant values within the namespace
-  # of a class.
-  #
-  # If the class has defined the class method, :post_add_constant, then that
-  # method will be invoked after each new item is added. It must be defined
-  # *before* any constants are defined.
-  #
-  # ==== Example
-  #
-  #   class GrammarComponent
-  #
-  #     include Qpid::Proton::Constants
-  #
-  #     def self.post_add_constant(key, value)
-  #       @terminal << value if value.terminal?
-  #       @nonterminal << value if !value.terminal? && !value.rule
-  #       @rule << value if value.rule
-  #     end
-  #
-  #     self.add_constant :LEFT_PARENTHESIS, new GrammarComponent("(", :terminal)
-  #     self.add_constant :RIGHT_PARENTHESIS, new GrammarComponent(")", :terminal)
-  #     self.add_constant :ELEMENT, new GrammarComponent("E", :rule)
-  #
-  #     def initialize(component, type)
-  #       @component = component
-  #       @type = type
-  #     end
-  #
-  #     def terminal?; @type == :terminal; end
-  #
-  #     def rule?; @type == :rule; end
-  #
-  #   end
-  #
-  # @private
-  #
-  module Constants
-
-    def self.included(base)
-      base.extend ClassMethods
-    end
-
-    module ClassMethods
-
-      def add_constant(key, value)
-        self.const_set(key, value)
-
-        @pn_by_value ||= {}
-        @pn_by_value[value] = key
-
-        if self.respond_to? :post_add_constant
-          self.post_add_constant(key, value)
-        end
-      end
-
-      def by_value(value)
-        (@pn_by_value || {})[value]
-      end
-
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/util/engine.rb b/proton-c/bindings/ruby/lib/util/engine.rb
deleted file mode 100644
index 53aa672..0000000
--- a/proton-c/bindings/ruby/lib/util/engine.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Util
-
-  # @private
-  module Engine
-
-    # Convenience method to receive messages from a delivery.
-    #
-    # @param delivery [Qpid::Proton::Delivery] The delivery.
-    # @param message [Qpid::Proton::Message] The message to use.
-    #
-    # @return [Qpid::Proton::Message] the message
-    #
-    def self.receive_message(delivery, msg = nil)
-      msg = Qpid::Proton::Message.new if msg.nil?
-      msg.decode(delivery.link.receive(delivery.pending))
-      delivery.link.advance
-      return msg
-    end
-
-    def data_to_object(data_impl) # :nodoc:
-      object = nil
-      unless data_impl.nil?
-        data = Qpid::Proton::Codec::Data.new(data_impl)
-        data.rewind
-        data.next
-        object = data.object
-        data.rewind
-      end
-      return object
-    end
-
-    def object_to_data(object, data_impl) # :nodoc:
-      unless object.nil?
-        data = Data.new(data_impl)
-        data.object = object
-      end
-    end
-
-    def condition_to_object(condition) # :nodoc:
-      result = nil
-      if Cproton.pn_condition_is_set(condition)
-        result = Condition.new(Cproton.pn_condition_get_name(condition),
-                               Cproton.pn_condition_get_description(condition),
-                               data_to_object(Cproton.pn_condition_info(condition)))
-      end
-      return result
-    end
-
-    def object_to_condition(object, condition) # :nodoc:
-      Cproton.pn_condition_clear(condition)
-      unless object.nil?
-        Cproton.pn_condition_set_name(condition, object.name)
-        Cproton.pn_condition_set_description(condition, object.description)
-        info = Data.new(Cproton.pn_condition_info(condition))
-        if object.info?
-          info.object = object.info
-        end
-      end
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/util/error_handler.rb b/proton-c/bindings/ruby/lib/util/error_handler.rb
deleted file mode 100644
index da51214..0000000
--- a/proton-c/bindings/ruby/lib/util/error_handler.rb
+++ /dev/null
@@ -1,127 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Util
-
-  # Provides mixin functionality for dealing with exception conditions.
-  #
-  # @private
-  module ErrorHandler
-
-    def self.included(base)
-      base.extend(self)
-
-      unless defined? base.to_be_wrapped
-        class << base
-          @@to_be_wrapped = []
-        end
-      end
-
-      define_method :method_added do |name|
-        if (!@@to_be_wrapped.nil?) && (@@to_be_wrapped.include? name)
-          @@to_be_wrapped.delete name
-          create_exception_handler_wrapper(name)
-        end
-      end
-    end
-
-    def can_raise_error(method_names, options = {})
-      error_class = options[:error_class]
-      below = options[:below] || 0
-      # coerce the names to be an array
-      Array(method_names).each do |method_name|
-        # if the method doesn't already exist then queue this aliasing
-        unless self.method_defined? method_name
-          @@to_be_wrapped ||= []
-          @@to_be_wrapped << method_name
-        else
-          create_exception_handler_wrapper(method_name, error_class, below)
-        end
-      end
-    end
-
-    def create_exception_handler_wrapper(method_name, error_class = nil, below = 0)
-      original_method_name = method_name.to_s
-      wrapped_method_name = "_excwrap_#{original_method_name}"
-      alias_method wrapped_method_name, original_method_name
-      define_method original_method_name do |*args, &block|
-        # need to get a reference to the method object itself since
-        # calls to Class.send interfere with Messenger.send
-        method = self.method(wrapped_method_name.to_sym)
-        rc = method.call(*args, &block)
-        check_for_error(rc, error_class) if rc < below
-        return rc
-      end
-    end
-
-    # Raises an Proton-specific error if a return code is non-zero.
-    #
-    # Expects the class to provide an +error+ method.
-    def check_for_error(code, error_class = nil)
-
-      raise ::ArgumentError.new("Invalid error code: #{code}") if code.nil?
-
-      return code if code > 0
-
-      case(code)
-
-      when Qpid::Proton::Error::NONE
-        return
-
-      when Qpid::Proton::Error::EOS
-        raise Qpid::Proton::EOSError.new(self.error)
-
-      when Qpid::Proton::Error::ERROR
-        raise Qpid::Proton::ProtonError.new(self.error)
-
-      when Qpid::Proton::Error::OVERFLOW
-        raise Qpid::Proton::OverflowError.new(self.error)
-
-      when Qpid::Proton::Error::UNDERFLOW
-        raise Qpid::Proton::UnderflowError.new(self.error)
-
-      when Qpid::Proton::Error::ARGUMENT
-        raise Qpid::Proton::ArgumentError.new(self.error)
-
-      when Qpid::Proton::Error::STATE
-        raise Qpid::Proton::StateError.new(self.error)
-
-      when Qpid::Proton::Error::TIMEOUT
-        raise Qpid::Proton::TimeoutError.new(self.error)
-
-      when Qpid::Proton::Error::INPROGRESS
-        return
-
-      when Qpid::Proton::Error::INTERRUPTED
-        raise Qpid::Proton::InterruptedError.new(self.error)
-
-      when Qpid::Proton::Error::INPROGRESS
-        raise Qpid::Proton::InProgressError.new(self.error)
-
-      else
-
-        raise ::ArgumentError.new("Unknown error code: #{code}")
-
-      end
-
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/util/handler.rb b/proton-c/bindings/ruby/lib/util/handler.rb
deleted file mode 100644
index e7d07b1..0000000
--- a/proton-c/bindings/ruby/lib/util/handler.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Util
-
-  # @private
-  module Handler
-
-    def chandler(handler, on_error)
-      return nil if handler.nil?
-
-      if handler.instance_of?(Qpid::Proton::Handler::WrappedHandler)
-        impl = handler.impl
-        Cproton.pn_incref(impl)
-        return impl
-      else
-        cadaptor = Qpid::Proton::Handler::CAdaptor.new(handler, on_error)
-        rbhandler = Cproton.pn_rbhandler(cadaptor)
-        return rbhandler
-      end
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/util/reactor.rb b/proton-c/bindings/ruby/lib/util/reactor.rb
deleted file mode 100644
index 0bcb557..0000000
--- a/proton-c/bindings/ruby/lib/util/reactor.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Util
-
-  module Reactor
-
-    def create_session(connection, handler = nil)
-      session = connection.session
-      session.open
-      return session
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/util/swig_helper.rb b/proton-c/bindings/ruby/lib/util/swig_helper.rb
deleted file mode 100644
index d60e9e4..0000000
--- a/proton-c/bindings/ruby/lib/util/swig_helper.rb
+++ /dev/null
@@ -1,114 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Util
-
-  # Provides helper functions for writing wrapper functions for the
-  # underlying C APIs.
-  #
-  # Before defining any mutators the class must define the name of the
-  # prefix for methods with the constant PROTON_METOD_PREFIX.
-  #
-  # == Mutators, Setters And Getters
-  #
-  # There are three types of wrappers that are supported:
-  #
-  # [proton_writer] Defines a set-only method for the named attribute.
-  # [proton_reader] Defines a get-only method for the named attribute.
-  # [proton_accessor] Defines both a set- and a get-method for the named
-  #                  attribute.
-  # [proton_caller] A simple wrapper for calling an underlying method,
-  #                  avoids repetitive boiler plate coding.
-  #
-  # == Arguments
-  #
-  # [:is_or_get => {:is, :get}] For both the getter and the mutator types
-  # you can also declare that the method uses "is" instead of "get" in the
-  # underlying API. Such methods are then defined with "?"
-  #
-  # @example
-  #   class Terminus
-  #
-  #     include WrapperHelper
-  #
-  #     PROTON_METHOD_PREFIX = "pn_terminus"
-  #
-  #     # add methods "type" and "type=" that call "pn_terminus_{get,set}_type"
-  #     proton_accessor :type
-  #
-  #     # adds the method "dynamic?" that calls "pn_terminus_is_dynamic"
-  #     proton_accessor :dynamic, :is_or_get => :is
-  #
-  #     # adds a method named "foo" that calls "pn_terminus_foo"
-  #     proton_caller :foo
-  #
-  #   end
-  #
-  # @private
-  module SwigHelper
-
-    def self.included(base)
-      base.extend ClassMethods
-    end
-
-    module ClassMethods # :nodoc:
-
-      def create_wrapper_method(name, proton_method, with_arg = false)
-        if with_arg
-          define_method "#{name}" do |arg|
-            Cproton.__send__(proton_method.to_sym, @impl, arg)
-          end
-        else
-          define_method "#{name}" do
-            Cproton.__send__(proton_method.to_sym, @impl)
-          end
-        end
-      end
-
-      # Defines a method that calls an underlying C library function.
-      def proton_caller(name, options = {})
-        proton_method = "#{self::PROTON_METHOD_PREFIX}_#{name}"
-        # drop the trailing '?' if this is a property method
-        proton_method = proton_method[0..-2] if proton_method.end_with? "?"
-        create_wrapper_method(name, proton_method)
-      end
-
-      def proton_writer(name, options = {})
-        proton_method = "#{self::PROTON_METHOD_PREFIX}_set_#{name}"
-        create_wrapper_method("#{name}=", proton_method, true)
-      end
-
-      def proton_reader(name, options = {})
-        an_is_method = options[:is_or_get] == :is
-        prefix = (an_is_method) ? "is" : "get"
-        proton_method = "#{self::PROTON_METHOD_PREFIX}_#{prefix}_#{name}"
-        name = "#{name}?" if an_is_method
-        create_wrapper_method(name, proton_method)
-      end
-
-      def proton_accessor(name, options = {})
-        proton_writer(name, options)
-        proton_reader(name, options)
-      end
-
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/util/timeout.rb b/proton-c/bindings/ruby/lib/util/timeout.rb
deleted file mode 100644
index f4647f5..0000000
--- a/proton-c/bindings/ruby/lib/util/timeout.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Util
-
-  # Provides methods for converting between milliseconds, seconds
-  # and timeout values.
-  #
-  # @private
-  module Timeout
-
-    def sec_to_millis(s)
-      return (s * 1000).to_int
-    end
-
-    def millis_to_sec(ms)
-      return (ms.to_f / 1000.0).to_int
-    end
-
-    def timeout_to_millis(s)
-      return Cproton::PN_MILLIS_MAX if s.nil?
-
-      return sec_to_millis(s)
-    end
-
-    def millis_to_timeout(ms)
-      return nil if ms == Cproton::PN_MILLIS_MAX
-
-      return millis_to_sec(ms)
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/util/uuid.rb b/proton-c/bindings/ruby/lib/util/uuid.rb
deleted file mode 100644
index 882715b..0000000
--- a/proton-c/bindings/ruby/lib/util/uuid.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Util
-
-  module UUID
-
-    def generate_uuid
-      # generate a UUID based on what APIs are available with the current
-      # version of Ruby
-      SecureRandom.uuid
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/lib/util/version.rb b/proton-c/bindings/ruby/lib/util/version.rb
deleted file mode 100644
index f9962ba..0000000
--- a/proton-c/bindings/ruby/lib/util/version.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Util
-
-  # The major version for the underlying Proton library.
-  # @private
-  VERSION_MAJOR = Cproton::PN_VERSION_MAJOR
-
-  # The minor version for the underlying Proton library.
-  # @private
-  VERSION_MINOR = Cproton::PN_VERSION_MINOR
-
-end
diff --git a/proton-c/bindings/ruby/lib/util/wrapper.rb b/proton-c/bindings/ruby/lib/util/wrapper.rb
deleted file mode 100644
index 8db1c4e..0000000
--- a/proton-c/bindings/ruby/lib/util/wrapper.rb
+++ /dev/null
@@ -1,124 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton::Util
-
-  # @private
-  module Wrapper
-
-    # @private
-    def impl=(impl)
-      @impl = impl
-    end
-
-    # @private
-    def impl
-      @impl
-    end
-
-    def self.registry
-      @registry ||= {}
-    end
-
-    def self.included(base)
-      base.extend(ClassMethods)
-    end
-
-    # Adds methods to the target class for storing and retrieving pure Ruby
-    # wrappers to underlying Proton structures.
-    #
-    # Such wrappers are stored in a registry using a key. The key is then
-    # attached to the Proton structure as a record. That record lives for as
-    # long as the Proton structure lives, and when the structure is released
-    # the record acts as hook to also delete the Ruby wrapper object from the
-    # registry.
-    #
-    # @private
-    #
-    module ClassMethods
-
-      # @private
-      def get_key(impl)
-        ("%032x" % Cproton.pni_address_of(impl))
-      end
-
-      # Stores the given object for later retrieval.
-      #
-      # @param object [Object] The object.
-      # @param attachment_method [Symbol] The Proton attachment method.
-      #
-      def store_instance(object, attachment_method = nil)
-        # ensure the impl has a reference to the wrapper object
-        object.impl.instance_eval { @proton_wrapper = object }
-        registry_key = get_key(object.impl)
-        unless attachment_method.nil?
-          record = Cproton.__send__(attachment_method, object.impl)
-          rbkey = Cproton.Pn_rbkey_new
-          Cproton.Pn_rbkey_set_registry(rbkey, Cproton.pn_rb2void(Qpid::Proton::Util::Wrapper.registry))
-          Cproton.Pn_rbkey_set_method(rbkey, "delete")
-          Cproton.Pn_rbkey_set_key_value(rbkey, registry_key)
-          Cproton.pn_record_def(record, RBCTX, Cproton.Pn_rbkey__class());
-          Cproton.pn_record_set(record, RBCTX, rbkey)
-        end
-        Qpid::Proton::Util::Wrapper.registry[registry_key] = object
-      end
-
-      # Retrieves the wrapper object with the supplied Proton struct.
-      #
-      # @param impl [Object] The wrapper for the Proton struct.
-      # @param attachment_method [Symbol] The Proton attachment method.
-      #
-      # @return [Object] The Ruby wrapper object.
-      #
-      def fetch_instance(impl, attachment_method = nil)
-        # if the impl has a wrapper already attached, then return it
-        if impl.instance_variable_defined?(:@proton_wrapper)
-          return impl.instance_variable_get(:@proton_wrapper)
-        end
-        unless attachment_method.nil?
-          record = Cproton.__send__(attachment_method, impl)
-          rbkey = Cproton.pni_void2rbkey(Cproton.pn_record_get(record, RBCTX))
-          # if we don't have a key, then we don't have an object
-          return nil if rbkey.nil?
-          registry_key = Cproton.Pn_rbkey_get_key_value(rbkey)
-        else
-          registry_key = get_key(impl)
-        end
-        # if the object's not in the registry then return
-        return nil unless Qpid::Proton::Util::Wrapper.registry.has_key?(registry_key)
-
-        result = Qpid::Proton::Util::Wrapper.registry[registry_key]
-        # result = nil unless result.weakref_alive?
-        if result.nil?
-          raise Qpid::Proton::ProtonError.new("missing object for key=#{registry_key}")
-        else
-          # update the impl since the Swig wrapper for it may have changed
-          result.impl = impl
-        end
-        return result
-      end
-
-    end
-
-  end
-
-  # @private
-  RBCTX = Wrapper.hash.to_i
-
-end
diff --git a/proton-c/bindings/ruby/qpid_proton.gemspec b/proton-c/bindings/ruby/qpid_proton.gemspec
deleted file mode 100644
index 1acaff1..0000000
--- a/proton-c/bindings/ruby/qpid_proton.gemspec
+++ /dev/null
@@ -1,36 +0,0 @@
-# -*- encoding: utf-8 -*-
-lib = File.expand_path('lib/', __FILE__)
-$:.unshift lib unless $:.include?(lib)
-
-# Generate the Swig wrapper
-system "swig -ruby -I/usr/include -o ext/cproton/cproton.c ruby.i"
-
-Gem::Specification.new do |s|
-  s.name        = "qpid_proton"
-  s.version     = "0.3"
-  s.licenses    = ['Apache-2.0']
-  s.platform    = Gem::Platform::RUBY
-  s.authors     = ["Darryl L. Pierce"]
-  s.email       = ["proton@qpid.apache.org"]
-  s.homepage    = "http://qpid.apache.org/proton"
-  s.summary     = "Ruby language bindings for the Qpid Proton messaging framework"
-  s.description = <<-EOF
-Proton is a high performance, lightweight messaging library. It can be used in
-the widest range of messaging applications including brokers, client libraries,
-routers, bridges, proxies, and more. Proton is based on the AMQP 1.0 messaging
-standard.
-EOF
-
-  s.extensions   = "ext/cproton/extconf.rb"
-  s.files        = Dir[
-                "LICENSE",
-                "TODO",
-                "ChangeLog",
-                "ext/cproton/*.rb",
-                "ext/cproton/*.c",
-                "lib/**/*.rb",
-                ]
-  s.require_path = 'lib'
-  s.add_runtime_dependency "json"
-end
-
diff --git a/proton-c/bindings/ruby/ruby.i b/proton-c/bindings/ruby/ruby.i
deleted file mode 100644
index d5979f3..0000000
--- a/proton-c/bindings/ruby/ruby.i
+++ /dev/null
@@ -1,640 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-%module cproton
-
-%{
-#include <proton/engine.h>
-#include <proton/message.h>
-#include <proton/sasl.h>
-#include <proton/messenger.h>
-#include <proton/ssl.h>
-#include <proton/types.h>
-#include <proton/url.h>
-#include <proton/reactor.h>
-#include <proton/handlers.h>
-%}
-
-/*
-NOTE: According to ccache-swig man page: "Known problems are using
-preprocessor directives within %inline blocks and the use of ’#pragma SWIG’."
-This includes using macros in an %inline section.
-
-Keep preprocessor directives and macro expansions in the normal header section.
-*/
-
-%include <cstring.i>
-
-%cstring_output_withsize(char *OUTPUT, size_t *OUTPUT_SIZE)
-%cstring_output_allocate_size(char **ALLOC_OUTPUT, size_t *ALLOC_SIZE, free(*$1));
-%cstring_output_maxsize(char *OUTPUT, size_t MAX_OUTPUT_SIZE)
-
-%{
-#if !defined(RSTRING_LEN)
-#  define RSTRING_LEN(x) (RSTRING(X)->len)
-#  define RSTRING_PTR(x) (RSTRING(x)->ptr)
-#endif
-%}
-
-%typemap(in) pn_bytes_t {
-  if ($input == Qnil) {
-    $1.start = NULL;
-    $1.size = 0;
-  } else {
-    $1.start = RSTRING_PTR($input);
-    if (!$1.start) {
-      $1.size = 0;
-    }
-    $1.size = RSTRING_LEN($input);
-  }
-}
-
-%typemap(out) pn_bytes_t {
-  $result = rb_str_new($1.start, $1.size);
-}
-
-%typemap(in) pn_atom_t
-{
-  if ($input == Qnil)
-    {
-      $1.type = PN_NULL;
-    }
-  else
-    {
-      switch(TYPE($input))
-        {
-        case T_TRUE:
-          $1.type = PN_BOOL;
-          $1.u.as_bool = true;
-          break;
-
-        case T_FALSE:
-          $1.type = PN_BOOL;
-          $1.u.as_bool = false;
-          break;
-
-        case T_FLOAT:
-          $1.type = PN_FLOAT;
-          $1.u.as_float = NUM2DBL($input);
-          break;
-
-        case T_STRING:
-          $1.type = PN_STRING;
-          $1.u.as_bytes.start = RSTRING_PTR($input);
-          if ($1.u.as_bytes.start)
-            {
-              $1.u.as_bytes.size = RSTRING_LEN($input);
-            }
-          else
-            {
-              $1.u.as_bytes.size = 0;
-            }
-          break;
-
-        case T_FIXNUM:
-          $1.type = PN_INT;
-          $1.u.as_int = FIX2LONG($input);
-          break;
-
-        case T_BIGNUM:
-          $1.type = PN_LONG;
-          $1.u.as_long = NUM2LL($input);
-          break;
-
-        }
-    }
-}
-
-%typemap(out) pn_atom_t
-{
-  switch($1.type)
-    {
-    case PN_NULL:
-      $result = Qnil;
-      break;
-
-    case PN_BOOL:
-      $result = $1.u.as_bool ? Qtrue : Qfalse;
-      break;
-
-    case PN_BYTE:
-      $result = INT2NUM($1.u.as_byte);
-      break;
-
-    case PN_UBYTE:
-      $result = UINT2NUM($1.u.as_ubyte);
-      break;
-
-    case PN_SHORT:
-      $result = INT2NUM($1.u.as_short);
-      break;
-
-    case PN_USHORT:
-      $result = UINT2NUM($1.u.as_ushort);
-      break;
-
-    case PN_INT:
-      $result = INT2NUM($1.u.as_int);
-      break;
-
-     case PN_UINT:
-      $result = UINT2NUM($1.u.as_uint);
-      break;
-
-    case PN_LONG:
-      $result = LL2NUM($1.u.as_long);
-      break;
-
-    case PN_ULONG:
-      $result = ULL2NUM($1.u.as_ulong);
-      break;
-
-    case PN_FLOAT:
-      $result = rb_float_new($1.u.as_float);
-      break;
-
-    case PN_DOUBLE:
-      $result = rb_float_new($1.u.as_double);
-      break;
-
-    case PN_STRING:
-      $result = rb_str_new($1.u.as_bytes.start, $1.u.as_bytes.size);
-      break;
-
-    default:
-       break;
-    }
-}
-
-%typemap (in) pn_decimal32_t
-{
-  $1 = FIX2UINT($input);
-}
-
-%typemap (out) pn_decimal32_t
-{
-  $result = ULL2NUM($1);
-}
-
-%typemap (in) pn_decimal64_t
-{
-  $1 = NUM2ULL($input);
-}
-
-%typemap (out) pn_decimal64_t
-{
-  $result = ULL2NUM($1);
-}
-
-%typemap (in) pn_decimal128_t
-{
-  int index;
-
-  for(index = 0; index < 16; index++)
-    {
-      VALUE element = rb_ary_entry($input, index);
-      $1.bytes[16 - (index + 1)] = FIX2INT(element);
-    }
-}
-
-%typemap (out) pn_decimal128_t
-{
-  int index;
-
-  $result = rb_ary_new2(16);
-  for(index = 0; index < 16; index++)
-    {
-      rb_ary_store($result, 16 - (index + 1), CHR2FIX($1.bytes[index]));
-    }
-}
-
-%typemap (in) pn_uuid_t
-{
-  int index;
-
-  for(index = 0; index < 16; index++)
-    {
-      VALUE element = rb_ary_entry($input, index);
-      $1.bytes[16 - (index + 1)] = FIX2INT(element);
-    }
-}
-
-%typemap (out) pn_uuid_t
-{
-  int index;
-
-  $result = rb_ary_new2(16);
-  for(index = 0; index < 16; index++)
-    {
-      rb_ary_store($result, 16 - (index + 1), CHR2FIX($1.bytes[index]));
-    }
-}
-
-int pn_message_encode(pn_message_t *msg, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_message_encode;
-
-ssize_t pn_link_send(pn_link_t *transport, char *STRING, size_t LENGTH);
-%ignore pn_link_send;
-
-%rename(pn_link_recv) wrap_pn_link_recv;
-%inline %{
-  int wrap_pn_link_recv(pn_link_t *link, char *OUTPUT, size_t *OUTPUT_SIZE) {
-    ssize_t sz = pn_link_recv(link, OUTPUT, *OUTPUT_SIZE);
-    if (sz >= 0) {
-      *OUTPUT_SIZE = sz;
-    } else {
-      *OUTPUT_SIZE = 0;
-    }
-    return sz;
-  }
-%}
-%ignore pn_link_recv;
-
-ssize_t pn_transport_input(pn_transport_t *transport, char *STRING, size_t LENGTH);
-%ignore pn_transport_input;
-
-%rename(pn_transport_output) wrap_pn_transport_output;
-%inline %{
-  int wrap_pn_transport_output(pn_transport_t *transport, char *OUTPUT, size_t *OUTPUT_SIZE) {
-    ssize_t sz = pn_transport_output(transport, OUTPUT, *OUTPUT_SIZE);
-    if (sz >= 0) {
-      *OUTPUT_SIZE = sz;
-    } else {
-      *OUTPUT_SIZE = 0;
-    }
-    return sz;
-  }
-%}
-%ignore pn_transport_output;
-
-%rename(pn_transport_peek) wrap_pn_transport_peek;
-%inline %{
-  int wrap_pn_transport_peek(pn_transport_t *transport, char *OUTPUT, size_t *OUTPUT_SIZE) {
-    ssize_t sz = pn_transport_peek(transport, OUTPUT, *OUTPUT_SIZE);
-    if(sz >= 0) {
-      *OUTPUT_SIZE = sz;
-    } else {
-      *OUTPUT_SIZE = 0;
-    }
-    return sz;
-  }
-%}
-%ignore pn_transport_peek;
-
-%rename(pn_delivery) wrap_pn_delivery;
-%inline %{
-  pn_delivery_t *wrap_pn_delivery(pn_link_t *link, char *STRING, size_t LENGTH) {
-    return pn_delivery(link, pn_dtag(STRING, LENGTH));
-  }
-%}
-%ignore pn_delivery;
-
-// Suppress "Warning(451): Setting a const char * variable may leak memory." on pn_delivery_tag_t
-%warnfilter(451) pn_delivery_tag_t;
-%rename(pn_delivery_tag) wrap_pn_delivery_tag;
-%inline %{
-  void wrap_pn_delivery_tag(pn_delivery_t *delivery, char **ALLOC_OUTPUT, size_t *ALLOC_SIZE) {
-    pn_delivery_tag_t tag = pn_delivery_tag(delivery);
-    *ALLOC_OUTPUT = malloc(tag.size);
-    *ALLOC_SIZE = tag.size;
-    memcpy(*ALLOC_OUTPUT, tag.start, tag.size);
-  }
-%}
-%ignore pn_delivery_tag;
-
-bool pn_ssl_get_cipher_name(pn_ssl_t *ssl, char *OUTPUT, size_t MAX_OUTPUT_SIZE);
-%ignore pn_ssl_get_cipher_name;
-
-bool pn_ssl_get_protocol_name(pn_ssl_t *ssl, char *OUTPUT, size_t MAX_OUTPUT_SIZE);
-%ignore pn_ssl_get_protocol_name;
-
-%inline %{
-#if defined(RUBY20) || defined(RUBY21)
-
-  typedef void *non_blocking_return_t;
-#define RB_BLOCKING_CALL rb_thread_call_without_gvl
-
-#elif defined(RUBY19)
-
-    typedef VALUE non_blocking_return_t;
-#define RB_BLOCKING_CALL rb_thread_blocking_region
-
-#endif
-  %}
-
-%rename(pn_messenger_send) wrap_pn_messenger_send;
-%rename(pn_messenger_recv) wrap_pn_messenger_recv;
-%rename(pn_messenger_work) wrap_pn_messenger_work;
-
-%inline %{
-
-#if defined(RB_BLOCKING_CALL)
-
-    static non_blocking_return_t pn_messenger_send_no_gvl(void *args) {
-    VALUE result = Qnil;
-    pn_messenger_t *messenger = (pn_messenger_t *)((void **)args)[0];
-    int *limit = (int *)((void **)args)[1];
-
-    int rc = pn_messenger_send(messenger, *limit);
-
-    result = INT2NUM(rc);
-    return (non_blocking_return_t )result;
-    }
-
-    static non_blocking_return_t pn_messenger_recv_no_gvl(void *args) {
-    VALUE result = Qnil;
-    pn_messenger_t *messenger = (pn_messenger_t *)((void **)args)[0];
-    int *limit = (int *)((void **)args)[1];
-
-    int rc = pn_messenger_recv(messenger, *limit);
-
-    result = INT2NUM(rc);
-    return (non_blocking_return_t )result;
-  }
-
-    static non_blocking_return_t pn_messenger_work_no_gvl(void *args) {
-      VALUE result = Qnil;
-      pn_messenger_t *messenger = (pn_messenger_t *)((void **)args)[0];
-      int *timeout = (int *)((void **)args)[1];
-
-      int rc = pn_messenger_work(messenger, *timeout);
-
-      result = INT2NUM(rc);
-      return (non_blocking_return_t )result;
-    }
-
-#endif
-
-  int wrap_pn_messenger_send(pn_messenger_t *messenger, int limit) {
-    int result = 0;
-
-#if defined(RB_BLOCKING_CALL)
-
-    // only release the gil if we're blocking
-    if(pn_messenger_is_blocking(messenger)) {
-      VALUE rc;
-      void* args[2];
-
-      args[0] = messenger;
-      args[1] = &limit;
-
-      rc = RB_BLOCKING_CALL(pn_messenger_send_no_gvl,
-                            &args, RUBY_UBF_PROCESS, NULL);
-
-      if(RTEST(rc))
-        {
-          result = FIX2INT(rc);
-        }
-    }
-
-#else // !defined(RB_BLOCKING_CALL)
-    result = pn_messenger_send(messenger, limit);
-#endif // defined(RB_BLOCKING_CALL)
-
-    return result;
-  }
-
-  int wrap_pn_messenger_recv(pn_messenger_t *messenger, int limit) {
-    int result = 0;
-
-#if defined(RB_BLOCKING_CALL)
-    // only release the gil if we're blocking
-    if(pn_messenger_is_blocking(messenger)) {
-      VALUE rc;
-      void* args[2];
-
-      args[0] = messenger;
-      args[1] = &limit;
-
-      rc = RB_BLOCKING_CALL(pn_messenger_recv_no_gvl,
-                            &args, RUBY_UBF_PROCESS, NULL);
-
-      if(RTEST(rc))
-        {
-          result = FIX2INT(rc);
-        }
-
-    } else {
-      result = pn_messenger_recv(messenger, limit);
-    }
-#else // !defined(RB_BLOCKING_CALL)
-    result = pn_messenger_recv(messenger, limit);
-#endif // defined(RB_BLOCKING_CALL)
-
-      return result;
-  }
-
-  int wrap_pn_messenger_work(pn_messenger_t *messenger, int timeout) {
-    int result = 0;
-
-#if defined(RB_BLOCKING_CALL)
-    // only release the gil if we're blocking
-    if(timeout) {
-      VALUE rc;
-      void* args[2];
-
-      args[0] = messenger;
-      args[1] = &timeout;
-
-      rc = RB_BLOCKING_CALL(pn_messenger_work_no_gvl,
-                            &args, RUBY_UBF_PROCESS, NULL);
-
-      if(RTEST(rc))
-        {
-          result = FIX2INT(rc);
-        }
-    } else {
-      result = pn_messenger_work(messenger, timeout);
-    }
-#else
-    result = pn_messenger_work(messenger, timeout);
-#endif
-
-    return result;
-  }
-
-%}
-
-%ignore pn_messenger_send;
-%ignore pn_messenger_recv;
-%ignore pn_messenger_work;
-
-%{
-typedef struct Pn_rbkey_t {
-  void *registry;
-  char *method;
-  char *key_value;
-} Pn_rbkey_t;
-
-void Pn_rbkey_initialize(void *vp_rbkey) {
-  Pn_rbkey_t *rbkey = (Pn_rbkey_t*)vp_rbkey;
-  assert(rbkey);
-  rbkey->registry = NULL;
-  rbkey->method = NULL;
-  rbkey->key_value = NULL;
-}
-
-void Pn_rbkey_finalize(void *vp_rbkey) {
-  Pn_rbkey_t *rbkey = (Pn_rbkey_t*)vp_rbkey;
-  if(rbkey && rbkey->registry && rbkey->method && rbkey->key_value) {
-    rb_funcall((VALUE )rbkey->registry, rb_intern(rbkey->method), 1, rb_str_new2(rbkey->key_value));
-  }
-  if(rbkey->key_value) {
-    free(rbkey->key_value);
-    rbkey->key_value = NULL;
-  }
-}
-
-/* NOTE: no macro or preprocessor definitions in %inline sections */
-#define CID_Pn_rbkey CID_pn_void
-#define Pn_rbkey_inspect NULL
-#define Pn_rbkey_compare NULL
-#define Pn_rbkey_hashcode NULL
-
-pn_class_t* Pn_rbkey__class(void) {
-    static pn_class_t clazz = PN_CLASS(Pn_rbkey);
-    return &clazz;
-}
-
-Pn_rbkey_t *Pn_rbkey_new(void) {
-    return (Pn_rbkey_t *) pn_class_new(Pn_rbkey__class(), sizeof(Pn_rbkey_t));
-}
-%}
-
-pn_class_t* Pn_rbkey__class(void);
-Pn_rbkey_t *Pn_rbkey_new(void);
-
-%inline %{
-
-Pn_rbkey_t *Pn_rbkey_new(void);
-
-void Pn_rbkey_set_registry(Pn_rbkey_t *rbkey, void *registry) {
-  assert(rbkey);
-  rbkey->registry = registry;
-}
-
-void *Pn_rbkey_get_registry(Pn_rbkey_t *rbkey) {
-  assert(rbkey);
-  return rbkey->registry;
-}
-
-void Pn_rbkey_set_method(Pn_rbkey_t *rbkey, char *method) {
-  assert(rbkey);
-  rbkey->method = method;
-}
-
-char *Pn_rbkey_get_method(Pn_rbkey_t *rbkey) {
-  assert(rbkey);
-  return rbkey->method;
-}
-
-void Pn_rbkey_set_key_value(Pn_rbkey_t *rbkey, char *key_value) {
-  assert(rbkey);
-  rbkey->key_value = malloc(strlen(key_value) + 1);
-  strncpy(rbkey->key_value, key_value, strlen(key_value) + 1);
-}
-
-char *Pn_rbkey_get_key_value(Pn_rbkey_t *rbkey) {
-  assert(rbkey);
-  return rbkey->key_value;
-}
-
-Pn_rbkey_t *pni_void2rbkey(void *object) {
-  return (Pn_rbkey_t *)object;
-}
-
-VALUE pn_void2rb(void *object) {
-  return (VALUE )object;
-}
-
-void *pn_rb2void(VALUE object) {
-  return (void *)object;
-}
-
-VALUE pni_address_of(void *object) {
-  return ULL2NUM((unsigned long )object);
-}
-
-%}
-
-//%rename(pn_collector_put) wrap_pn_collector_put;
-//%inline %{
-//  pn_event_t *wrap_pn_collector_put(pn_collector_t *collector, void *context,
-//                               pn_event_type_t type) {
-//    return pn_collector_put(collector, PN_RBREF, context, type);
-//  }
-//  %}
-//%ignore pn_collector_put;
-
-int pn_ssl_get_peer_hostname(pn_ssl_t *ssl, char *OUTPUT, size_t *OUTPUT_SIZE);
-%ignore pn_ssl_get_peer_hostname;
-
-%inline %{
-
-  VALUE pni_ruby_get_proton_module() {
-    VALUE mQpid = rb_define_module("Qpid");
-    return rb_define_module_under(mQpid, "Proton");
-  }
-
-  void pni_ruby_add_to_registry(VALUE key, VALUE value) {
-    VALUE result = rb_funcall(pni_ruby_get_proton_module(), rb_intern("add_to_registry"), 2, key, value);
-  }
-
-  VALUE pni_ruby_get_from_registry(VALUE key) {
-     return rb_funcall(pni_ruby_get_proton_module(), rb_intern("get_from_registry"), 1, key);
-  }
-
-  void pni_ruby_delete_from_registry(VALUE stored_key) {
-    rb_funcall(pni_ruby_get_proton_module(), rb_intern("delete_from_registry"), 1, stored_key);
-  }
-
-  typedef struct {
-    VALUE handler_key;
-  } Pni_rbhandler_t;
-
-  static Pni_rbhandler_t *pni_rbhandler(pn_handler_t *handler) {
-    return (Pni_rbhandler_t *) pn_handler_mem(handler);
-  }
-
-  static void pni_rbdispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) {
-    Pni_rbhandler_t *rbh = pni_rbhandler(handler);
-    VALUE rbhandler = pni_ruby_get_from_registry(rbh->handler_key);
-
-    rb_funcall(rbhandler, rb_intern("dispatch"), 2, SWIG_NewPointerObj(event, SWIGTYPE_p_pn_event_t, 0), INT2FIX(type));
-  }
-
-  static void pni_rbhandler_finalize(pn_handler_t *handler) {
-    Pni_rbhandler_t *rbh = pni_rbhandler(handler);
-    pni_ruby_delete_from_registry(rbh->handler_key);
-  }
-
-  pn_handler_t *pn_rbhandler(VALUE handler) {
-    pn_handler_t *chandler = pn_handler_new(pni_rbdispatch, sizeof(Pni_rbhandler_t), pni_rbhandler_finalize);
-    Pni_rbhandler_t *rhy = pni_rbhandler(chandler);
-
-    VALUE ruby_key = rb_class_new_instance(0, NULL, rb_cObject);
-    pni_ruby_add_to_registry(ruby_key, handler);
-
-    rhy->handler_key = ruby_key;
-
-    return chandler;
-  }
-
-%}
-
-%include "proton/cproton.i"
diff --git a/proton-c/bindings/ruby/spec/qpid/proton/array_spec.rb b/proton-c/bindings/ruby/spec/qpid/proton/array_spec.rb
deleted file mode 100644
index 2f26fdf..0000000
--- a/proton-c/bindings/ruby/spec/qpid/proton/array_spec.rb
+++ /dev/null
@@ -1,114 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-require "spec_helper"
-
-describe "The extended array type" do
-
-  before :each do
-    @data        = Qpid::Proton::Codec::Data.new
-    @list        = random_list(rand(100))
-    @undescribed = random_array(rand(100))
-    @description = random_string(128)
-    @described   = random_array(rand(100), true, @description)
-  end
-
-  it "can be created like a normal array" do
-    value = []
-
-    expect(value).to respond_to(:proton_put)
-    expect(value).to respond_to(:proton_array_header)
-    expect(value.class).to respond_to(:proton_get)
-    expect(value).to respond_to :proton_described?
-  end
-
-  it "raises an error when putting into a nil Data object" do
-    expect {
-      @list.proton_put(nil)
-    }.to raise_error
-  end
-
-  it "raises an error when getting from a nil Data object" do
-    expect {
-      Array.proton_get(nil)
-    }.to raise_error(TypeError)
-  end
-
-  it "raises an error when the data object is empty" do
-    expect {
-      Array.proton_get(@data)
-    }.to raise_error(TypeError)
-  end
-
-  it "raises an error when the current object is not a list" do
-    @data.string = random_string(128)
-    @data.rewind
-
-    expect {
-      Array.proton_get(@data)
-    }.to raise_error(TypeError)
-  end
-
-  it "does not have an array header when it's a simple list" do
-    expect(@list.proton_described?).to eq(false)
-  end
-
-  it "can be put into a Data object as a list" do
-    @list.proton_put(@data)
-    result = Array.proton_get(@data)
-    expect(result).to match_array(@list)
-    expect(result.proton_array_header).to eq(nil)
-  end
-
-  it "has an array header when it's an AMQP array" do
-    expect(@undescribed.proton_array_header).not_to be_nil
-    expect(@described.proton_array_header).not_to be_nil
-  end
-
-  it "raises an error when the elements of an Array are dissimilar and is put into a Data object" do
-    value = []
-    value.proton_array_header = Qpid::Proton::Types::ArrayHeader.new(Qpid::Proton::Codec::INT)
-    value << random_string(16)
-
-    expect {
-      value.proton_put(@data)
-    }.to raise_error(TypeError)
-  end
-
-  it "can be put into a Data object as an undescribed array" do
-    @undescribed.proton_put(@data)
-    result = Array.proton_get(@data)
-    be_close_array(@undescribed, result)
-
-    expect(result.proton_array_header).not_to be_nil
-    expect(result.proton_array_header).to eq(@undescribed.proton_array_header)
-    expect(result.proton_array_header.described?).to eq(false)
-  end
-
-  it "can be put into a Data object as a described array" do
-    @described.proton_put(@data)
-    result = Array.proton_get(@data)
-    be_close_array(@described, result)
-
-    expect(result.proton_array_header).not_to be_nil
-    expect(result.proton_array_header).to eq(@described.proton_array_header)
-    expect(result.proton_array_header.described?).to eq(true)
-  end
-
-end
diff --git a/proton-c/bindings/ruby/spec/qpid/proton/data_spec.rb b/proton-c/bindings/ruby/spec/qpid/proton/data_spec.rb
deleted file mode 100644
index c8c7d18..0000000
--- a/proton-c/bindings/ruby/spec/qpid/proton/data_spec.rb
+++ /dev/null
@@ -1,493 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-require "spec_helper"
-
-module Qpid
-
-  module Proton
-
-    describe "A data object" do
-
-      before :each do
-        @data = Qpid::Proton::Codec::Data.new
-      end
-
-      it "can be initialized" do
-        expect(@data).not_to be_nil
-      end
-
-      it "can hold a null" do
-        @data.null
-        expect(@data.null?).to eq(true)
-      end
-
-      it "can hold a true boolean" do
-        @data.bool = true
-        expect(@data.bool).to eq(true)
-      end
-
-      it "can hold a false boolean" do
-        @data.bool = false
-        expect(@data.bool).to eq(false)
-      end
-
-      it "raises an error on a negative ubyte" do
-        expect {
-          @data.ubyte = (0 - (rand(127) + 1))
-        }.to raise_error(RangeError)
-      end
-
-      it "raises an error on a null ubyte" do
-        expect {
-          @data.ubyte = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold an unsigned byte" do
-        value = rand(255)
-        @data.ubyte = value
-        expect(@data.ubyte).to eq(value)
-      end
-
-      it "can hold a byte" do
-        value = rand(128)
-        @data.byte = value
-        expect(@data.byte).to eq(value)
-      end
-
-      it "can hold a negative byte" do
-        value = 0 - (rand(126) + 1)
-        @data.byte = value
-        expect(@data.byte).to eq(value)
-      end
-
-      it "raises an error on a negative ushort" do
-        expect {
-          @data.ushort = (0 - (rand(65535) + 1))
-        }.to raise_error(RangeError)
-      end
-
-      it "raises an error on a nil ushort" do
-        expect {
-          @data.ushort = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold a zero unsigned short" do
-        @data.ushort = 0
-        expect(@data.ushort).to eq(0)
-      end
-
-      it "can hold an unsigned short" do
-        value = rand(2**15) + 1
-        @data.ushort = value
-        expect(@data.ushort).to eq(value)
-      end
-
-      it "raises an error on a nil short" do
-        expect {
-          @data.short = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold a short" do
-        value = rand(2**15) + 1
-        @data.short = value
-        expect(@data.short).to eq(value)
-      end
-
-      it "can hold a zero short" do
-        @data.short = 0
-        expect(@data.short).to eq(0)
-      end
-
-      it "can hold a negative short" do
-        value = (0 - (rand(2**15) + 1))
-        @data.short = value
-        expect(@data.short).to eq(value)
-      end
-
-      it "raises an error on a nil uint" do
-        expect {
-          @data.uint = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "raises an error on a negative uint" do
-        expect {
-          @data.uint = (0 - (rand(2**32) + 1))
-        }.to raise_error(RangeError)
-      end
-
-      it "can hold an unsigned integer" do
-        value = rand(2**32) + 1
-        @data.uint = value
-        expect(@data.uint).to eq(value)
-      end
-
-      it "can hold a zero unsigned integer" do
-        @data.uint = 0
-        expect(@data.uint).to eq(0)
-      end
-
-      it "raise an error on a null integer" do
-        expect {
-          @data.int = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold an integer" do
-        value = rand(2**31) + 1
-        @data.int = value
-        expect(@data.int).to eq(value)
-      end
-
-      it "can hold zero as an integer" do
-        @data.int = 0
-        expect(@data.int).to eq(0)
-      end
-
-      it "raises an error on a null character" do
-        expect {
-          @data.char = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold a character" do
-        source = random_string(256)
-        index = rand(source.length)
-        value = source[index,1].bytes.to_a[0]
-        @data.char = value
-        expect(@data.char).to eq(value)
-      end
-
-      it "raises an error on a null ulong" do
-        expect {
-          @data.ulong = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "raises an error on a negative ulong" do
-        expect {
-          @data.ulong = (0 - (rand(2**63) + 1))
-        }.to raise_error(RangeError)
-      end
-
-      it "can have a zero unsigned long" do
-        @data.ulong = 0
-        expect(@data.ulong).to eq(0)
-      end
-
-      it "can hold an unsigned long" do
-        value = rand(2**63) + 1
-        @data.ulong = value
-        expect(@data.ulong).to eq(value)
-      end
-
-      it "raises an error on a null long" do
-        expect {
-          @data.long = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can have a zero long" do
-        @data.long = 0
-        expect(@data.long).to eq(0)
-      end
-
-      it "can hold a long" do
-        value = rand(2**63) + 1
-        @data.long = value
-        expect(@data.long).to eq(value)
-      end
-
-      it "raise an error on a null timestamp" do
-        expect {
-          @data.timestamp = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can handle a negative timestamp" do
-        last_year = Time.now - (60*60*24*365)
-        @data.timestamp = last_year
-        expect(@data.timestamp).to eq(last_year.to_i)
-      end
-
-      it "can handle a zero timestamp" do
-        @data.timestamp = 0
-        expect(@data.timestamp).to eq(0)
-      end
-
-      it "can hold a timestamp" do
-        next_year = Time.now + (60*60*24*365)
-        @data.timestamp = next_year
-        expect(@data.timestamp).to eq(next_year.to_i)
-      end
-
-      it "raises an error on a null float" do
-        expect {
-          @data.float = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold a negative float" do
-        value = 0.0 - (1.0 + rand(2.0**15)).to_f
-        @data.float = value
-        expect(@data.float).to eq(value)
-      end
-
-      it "can hold a zero float" do
-        @data.float = 0.0
-        expect(@data.float).to eq(0.0)
-      end
-
-      it "can hold a float" do
-        value = (1.0 + rand(2.0**15)).to_f
-        @data.float = value
-        expect(@data.float).to eq(value)
-      end
-
-      it "raise an error on a null double" do
-        expect {
-          @data.double = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold a negative double" do
-        value = 0.0 - (1.0 + rand(2.0**31)).to_f
-        @data.double = value
-        expect(@data.double).to eq(value)
-      end
-
-      it "can hold a zero double" do
-        @data.double = 0.0
-        expect(@data.double).to eq(0.0)
-      end
-
-      it "can hold a double" do
-        value = (1.0 + rand(2.0**31)).to_f
-        @data.double = value
-        expect(@data.double).to eq(value)
-      end
-
-      it "raises an error on a null decimal32" do
-        expect {
-          @data.decimal32 = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold a zero decimal32" do
-        @data.decimal32 = 0
-        expect(@data.decimal32).to eq(0)
-      end
-
-      it "can hold a decimal32" do
-        value = 1 + rand(2**31)
-        @data.decimal32 = value
-        expect(@data.decimal32).to eq(value)
-      end
-
-      it "raises an error on a null decimal64" do
-        expect {
-          @data.decimal64 = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold a zero decimal64" do
-        @data.decimal64 = 0
-        expect(@data.decimal64).to eq(0)
-      end
-
-      it "can hold a decimal64" do
-        value = 1 + rand(2**63)
-        @data.decimal64 = value
-        expect(@data.decimal64).to eq(value)
-      end
-
-      it "raises an error on a null decimal128" do
-        expect {
-          @data.decimal128 = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can hold a zero decimal128" do
-        @data.decimal128 = 0
-        expect(@data.decimal128).to eq(0)
-      end
-
-      it "can hold a decimal128" do
-        value = rand(2**127)
-        @data.decimal128 = value
-        expect(@data.decimal128).to eq(value)
-      end
-
-      it "raises an error on a null UUID" do
-        expect {
-          @data.uuid = nil
-        }.to raise_error(::ArgumentError)
-      end
-
-      it "raises an error on a malformed UUID" do
-        expect {
-          @data.uuid = random_string(36)
-        }.to raise_error(::ArgumentError)
-      end
-
-      it "can set a UUID from an integer value" do
-        @data.uuid = 336307859334295828133695192821923655679
-        expect(@data.uuid).to eq("fd0289a5-8eec-4a08-9283-81d02c9d2fff")
-      end
-
-      it "can hold a UUID" do
-        value = "fd0289a5-8eec-4a08-9283-81d02c9d2fff"
-        @data.uuid = value
-        expect(@data.uuid).to eq(value)
-      end
-
-      it "can hold a null binary" do
-        @data.binary = nil
-        expect(@data.binary).to eq("")
-      end
-
-      it "can hold a binary" do
-        value = random_string(128)
-        @data.binary = value
-        expect(@data.binary).to eq(value)
-      end
-
-      it "can hold a null string" do
-        @data.string = nil
-        expect(@data.string).to eq("")
-      end
-
-      it "can hold a string" do
-        value = random_string(128)
-        @data.string = value
-        expect(@data.string).to eq(value)
-      end
-
-      it "can hold a null symbol" do
-        @data.symbol = nil
-        expect(@data.symbol).to eq("")
-      end
-
-      it "can hold a symbol" do
-        value = random_string(128)
-        @data.symbol = value
-        expect(@data.symbol).to eq(value)
-      end
-
-      it "can hold a described value" do
-        name = random_string(16)
-        value = random_string(16)
-        @data.put_described
-        @data.enter
-        @data.symbol = name
-        @data.string = value
-        @data.exit
-
-        expect(@data.described?).to eq(true)
-        @data.enter
-        @data.next
-        expect(@data.symbol).to eq(name)
-        @data.next
-        expect(@data.string).to eq(value)
-      end
-
-      it "raises an error when setting the wrong type in an array"
-
-      it "can hold an array" do
-        values = []
-        (1..(rand(100) + 5)).each { values << rand(2**16) }
-        @data.put_array false, Qpid::Proton::Codec::INT
-        @data.enter
-        values.each { |value| @data.int = value }
-        @data.exit
-
-        @data.enter
-        values.each do |value|
-          @data.next
-          expect(@data.int).to eq(value)
-        end
-      end
-
-      it "can hold a described array" do
-        values = []
-        (1..(rand(100) + 5)).each { values << random_string(64) }
-        descriptor = random_string(32)
-        @data.put_array true, Qpid::Proton::Codec::STRING
-        @data.enter
-        @data.symbol = descriptor
-        values.each { |value| @data.string = value }
-        @data.exit
-
-        expect(@data.array).to match_array([values.size, true, Qpid::Proton::Codec::STRING])
-        @data.enter
-        @data.next
-        expect(@data.symbol).to eq(descriptor)
-        values.each do |value|
-          @data.next
-          expect(@data.string).to eq(value)
-        end
-      end
-
-      it "can hold a list" do
-        values = []
-        (1..(rand(100) + 5)).each { values << random_string(128) }
-        @data.put_list
-        @data.enter
-        values.each {|value| @data.string = value}
-        @data.exit
-
-        @data.enter
-        values.each do |value|
-          @data.next
-          expect(@data.string).to eq(value)
-        end
-      end
-
-      it "can hold a map" do
-        keys = []
-        (1..(rand(100) + 5)).each {keys << random_string(128)}
-        values = {}
-        keys.each {|key| values[key] = random_string(128)}
-
-        @data.put_map
-        @data.enter
-        keys.each do |key|
-          @data.string = key
-          @data.string = values[key]
-        end
-        @data.exit
-
-        @data.enter
-        keys.each do |key|
-          @data.next
-          expect(@data.string).to eq(key)
-          @data.next
-          expect(@data.string).to eq(values[key])
-        end
-      end
-
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/spec/qpid/proton/exception_handling_spec.rb b/proton-c/bindings/ruby/spec/qpid/proton/exception_handling_spec.rb
deleted file mode 100644
index e296a69..0000000
--- a/proton-c/bindings/ruby/spec/qpid/proton/exception_handling_spec.rb
+++ /dev/null
@@ -1,96 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-module Qpid
-
-  module Proton
-
-    class ExceptionHandlingClass
-      include Qpid::Proton::Util::ErrorHandler
-
-      def error
-        "This is a test error: #{Time.new}"
-      end
-    end
-
-    describe "The exception handling mixin" do
-
-      before (:each) do
-        @handler = Qpid::Proton::ExceptionHandlingClass.new
-      end
-
-      it "does not raise an error on a zero code" do
-        expect {
-          @handler.check_for_error(0)
-        }.to_not raise_error
-      end
-
-      it "raises EOS on PN_EOS" do
-        expect {
-          @handler.check_for_error(Qpid::Proton::Error::EOS)
-        }.to raise_error(Qpid::Proton::EOSError)
-      end
-
-      it "raises Error on PN_ERR" do
-        expect {
-          @handler.check_for_error(Qpid::Proton::Error::ERROR)
-        }.to raise_error(Qpid::Proton::ProtonError)
-      end
-
-      it "raises Overflow on PN_OVERFLOW" do
-        expect {
-          @handler.check_for_error(Qpid::Proton::Error::OVERFLOW)
-        }.to raise_error(Qpid::Proton::OverflowError)
-      end
-
-      it "raises Underflow on PN_UNDERFLOW" do
-        expect {
-          @handler.check_for_error(Qpid::Proton::Error::UNDERFLOW)
-        }.to raise_error(Qpid::Proton::UnderflowError)
-      end
-
-      it "raises Argument on PN_ARG_ERR" do
-        expect {
-          @handler.check_for_error(Qpid::Proton::Error::ARGUMENT)
-        }.to raise_error(Qpid::Proton::ArgumentError)
-      end
-
-      it "raises Timeout on PN_TIMEOUT" do
-        expect {
-          @handler.check_for_error(Qpid::Proton::Error::TIMEOUT)
-        }.to raise_error(Qpid::Proton::TimeoutError)
-      end
-
-      it "raises an Ruby ArgumentError on a nil code" do
-        expect {
-          @handler.check_for_error(nil)
-        }.to raise_error(::ArgumentError)
-      end
-
-      it "raises a Ruby ArgumentError on an unknown value" do
-        expect {
-          @handler.check_for_error("farkle")
-        }.to raise_error(::ArgumentError)
-      end
-
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/spec/qpid/proton/hash_spec.rb b/proton-c/bindings/ruby/spec/qpid/proton/hash_spec.rb
deleted file mode 100644
index 7568ac1..0000000
--- a/proton-c/bindings/ruby/spec/qpid/proton/hash_spec.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-require "spec_helper"
-
-describe "The extended hash type" do
-
-  before :each do
-    @data = Qpid::Proton::Codec::Data.new
-    @hash = random_hash(rand(128) + 64)
-  end
-
-  it "raises an error when put into a nil Data instance" do
-    expect {
-      @hash.proton_data_put(nil)
-    }.to raise_error(TypeError)
-  end
-
-  it "can be put into an instance of Data" do
-    @hash.proton_data_put(@data)
-    result = Hash.proton_data_get(@data)
-    expect(result.keys).to match_array(@hash.keys)
-    expect(result.values).to match_array(@hash.values)
-  end
-
-  it "raises an error when retrieved from a nil Data instance" do
-    expect {
-      Hash.proton_data_get(nil)
-    }.to raise_error(TypeError)
-  end
-
-  it "raises an error when trying to get what is not a Hash" do
-    @data.string = random_string(128)
-    @data.rewind
-
-    expect {
-      Hash.proton_data_get(@data)
-    }.to raise_error(TypeError)
-  end
-
-end
diff --git a/proton-c/bindings/ruby/spec/qpid/proton/message_spec.rb b/proton-c/bindings/ruby/spec/qpid/proton/message_spec.rb
deleted file mode 100644
index 36e4695..0000000
--- a/proton-c/bindings/ruby/spec/qpid/proton/message_spec.rb
+++ /dev/null
@@ -1,638 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-require "spec_helper"
-
-module Qpid
-
-  module Proton
-
-    describe "A message" do
-
-      before (:each) do
-        @message = Qpid::Proton::Message.new
-      end
-
-      it "can be created" do
-        expect(@message).not_to be_nil
-      end
-
-      it "can be cleared" do
-        subject = random_string(16)
-        @message.subject = subject
-        expect(@message.subject).to eq(subject)
-        @message.clear
-        expect(@message.subject).not_to eq(subject)
-      end
-
-      it "can be durable" do
-        @message.durable = true
-        expect(@message.durable).to eq(true)
-        @message.durable = false
-        expect(@message.durable).to eq(false)
-      end
-
-      it "raises an error when setting durable to nil" do
-        expect {
-          @message.durable = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "raises an error when setting the priority to nil" do
-        expect {
-          @message.priority = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "raises an error when setting the priority to a non-number" do
-        expect {
-          @message.priority = "abck"
-        }.to raise_error(TypeError)
-      end
-
-      it "sets the priority to the integer portion when a float" do
-        priority = rand(100) / 10
-        @message.priority = priority
-        expect(@message.priority).to eq(priority.floor)
-      end
-
-      it "rejects a priority with too large of a value" do
-        expect {
-          @message.priority = (rand(100) + 256)
-        }.to raise_error(RangeError)
-      end
-
-      it "rejects a negative priority" do
-        expect {
-          @message.priority = (0 - (rand(255) + 1))
-        }.to raise_error(RangeError)
-      end
-
-      it "has a priority" do
-        priority = rand(256)
-        @message.priority = priority
-        expect(@message.priority).to eq(priority)
-      end
-
-      it "raises an error when setting the time-to-live to nil" do
-        expect {
-          @message.ttl = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "raises an error when setting the time-to-live to a non-number" do
-        expect {
-          @message.ttl = random_string(5)
-        }.to raise_error(TypeError)
-      end
-
-      it "sets the time-to-live to the integer portion when a float" do
-        ttl = (rand(32767) / 10)
-        @message.ttl = ttl
-        expect(@message.ttl).to eq(ttl.floor)
-      end
-
-      it "raises an error when the time-to-live is negative" do
-        expect {
-          @message.ttl = (0 - rand(1000))
-        }.to raise_error(RangeError)
-      end
-
-      it "has a time-to-live" do
-        ttl = rand(32767)
-        @message.ttl = ttl
-        expect(@message.ttl).to eq(ttl)
-      end
-
-      it "raises an error when setting first acquirer to nil" do
-        expect {
-          @message.first_acquirer = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "raises and error when setting first acquirer to a non-boolean" do
-        expect {
-          @message.first_acquirer = random_string(16)
-        }.to raise_error(TypeError)
-      end
-
-      it "has a first acquirer" do
-        @message.first_acquirer = true
-        expect(@message.first_acquirer?).to eq(true)
-
-        @message.first_acquirer = false
-        expect(@message.first_acquirer?).to eq(false)
-      end
-
-      it "raises an error on a nil delivery count" do
-        expect {
-          @message.delivery_count = nil
-        }.to raise_error(::ArgumentError)
-      end
-
-      it "raises an error on a negative delivery count" do
-        expect {
-          @message.delivery_count = -1
-        }.to raise_error(RangeError)
-      end
-
-      it "raises an error on a non-numeric delivery count" do
-        expect {
-          @message.delivery_count = "farkle"
-        }.to raise_error(::ArgumentError)
-      end
-
-      it "converts a floating point delivery count to its integer portion" do
-          count = rand(255) / 10.0
-          @message.delivery_count = count
-          expect(@message.delivery_count).to eq(count.floor)
-        end
-
-      it "has a delivery count" do
-        count = rand(255)
-        @message.delivery_count = count
-        expect(@message.delivery_count).to eq(count)
-      end
-
-      it "allows setting a nil id" do
-        @message.id = nil
-        expect(@message.id).to be_nil
-      end
-
-      it "has an id" do
-        id = random_string(16)
-        @message.id = id
-        expect(@message.id).to eq(id)
-      end
-
-      it "allows setting a nil user id" do
-        @message.user_id = nil
-        expect(@message.user_id).to eq("")
-      end
-
-      it "has a user id" do
-        id = random_string(16)
-        @message.user_id = id
-        expect(@message.user_id).to eq(id)
-      end
-
-      it "allows setting a nil address" do
-        @message.address = nil
-        expect(@message.address).to be_nil
-      end
-
-      it "has an address" do
-        address = "//0.0.0.0/#{random_string(16)}"
-        @message.address = address
-        expect(@message.address).to eq(address)
-      end
-
-      it "allows setting a nil subject" do
-        @message.subject = nil
-        expect(@message.subject).to be_nil
-      end
-
-      it "has a subject" do
-        subject = random_string(50)
-        @message.subject = subject
-        expect(@message.subject).to eq(subject)
-      end
-
-      it "will allow a nil reply-to address" do
-        @message.reply_to = nil
-        expect(@message.reply_to).to be_nil
-      end
-
-      it "has a reply-to address" do
-        address = "//0.0.0.0/#{random_string(16)}"
-        @message.reply_to = address
-        expect(@message.reply_to).to eq(address)
-      end
-
-      it "will allow a nil correlation id" do
-        @message.correlation_id = nil
-        expect(@message.correlation_id).to be_nil
-      end
-
-      it "has a correlation id" do
-        id = random_string(25)
-        @message.correlation_id = id
-        expect(@message.correlation_id).to eq(id)
-      end
-
-      it "will allow a nil content type" do
-        @message.content_type = nil
-        expect(@message.content_type).to be_nil
-      end
-
-      it "will allow an empty content type" do
-        @message.content_type = ""
-        expect(@message.content_type).to eq("")
-      end
-
-      it "has a content type" do
-        content_type = random_string(32)
-        @message.content_type = content_type
-        expect(@message.content_type).to eq(content_type)
-      end
-
-      it "can have nil content encoding" do
-        @message.content_encoding = nil
-        expect(@message.content_encoding).to be_nil
-      end
-
-      it "has a content encoding" do
-        encoding = "#{random_string(8)}/#{random_string(8)}"
-        @message.content_encoding = encoding
-        expect(@message.content_encoding).to eq(encoding)
-      end
-
-      it "raises an error on a nil expiry time" do
-        expect {
-          @message.expires = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "raises an error on a negative expiry time" do
-        expect {
-          @message.expires = (0-(rand(65535)))
-        }.to raise_error(::ArgumentError)
-      end
-
-      it "can have a zero expiry time" do
-        @message.expires = 0
-        expect(@message.expires).to equal(0)
-      end
-
-      it "has an expiry time" do
-        time = rand(65535)
-        @message.expires = time
-        expect(@message.expires).to eq(time)
-      end
-
-      it "raises an error on a nil creation time" do
-        expect {
-          @message.creation_time = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "raises an error on a negative creation time" do
-        expect {
-          @message.creation_time = (0 - rand(65535))
-        }.to raise_error(::ArgumentError)
-      end
-
-      it "can have a zero creation time" do
-        @message.creation_time = 0
-        expect(@message.creation_time).to eq(0)
-      end
-
-      it "has a creation time" do
-        time = rand(65535)
-        @message.creation_time = time
-        expect(@message.creation_time).to eq(time)
-      end
-
-      it "can have a nil group id" do
-        @message.group_id = nil
-        expect(@message.group_id).to be_nil
-      end
-
-      it "can have an empty group id" do
-        @message.group_id = ""
-        expect(@message.group_id).to eq("")
-      end
-
-      it "has a group id" do
-        id = random_string(16)
-        @message.group_id = id
-        expect(@message.group_id).to eq(id)
-      end
-
-
-      it "raises an error on a nil group sequence" do
-        expect {
-          @message.group_sequence = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can have a negative group sequence" do
-        seq = (0 - rand(32767))
-        @message.group_sequence = seq
-        expect(@message.group_sequence).to eq(seq)
-      end
-
-      it "can have a zero group sequence" do
-        @message.group_sequence = 0
-        expect(@message.group_sequence).to eq(0)
-      end
-
-      it "has a group sequence" do
-        id = rand(32767)
-        @message.group_sequence = id
-        expect(@message.group_sequence).to eq(id)
-      end
-
-      it "can have a nil reply-to group id" do
-        @message.reply_to_group_id = nil
-        expect(@message.reply_to_group_id).to be_nil
-      end
-
-      it "can have an empty reply-to group id" do
-        @message.reply_to_group_id = ""
-        expect(@message.reply_to_group_id).to eq("")
-      end
-
-      it "has a reply-to group id" do
-        id = random_string(16)
-        @message.reply_to_group_id = id
-        expect(@message.reply_to_group_id).to eq(id)
-      end
-
-      it "has properties" do
-        expect(@message).to respond_to(:properties)
-        expect(@message).to respond_to(:properties=)
-        expect(@message).to respond_to(:[])
-        expect(@message).to respond_to(:[]=)
-
-        expect(@message.properties).to be_kind_of({}.class)
-      end
-
-      it "can replace the set of properties" do
-        values = random_hash(128)
-
-        @message.properties = values.clone
-        expect(@message.properties).to eq(values)
-      end
-
-      it "can set properties" do
-        name = random_string(16)
-        value = random_string(128)
-
-        @message[name] = value
-        expect(@message[name]).to eq(value)
-      end
-
-      it "can update properties" do
-        name = random_string(16)
-        value = random_string(128)
-
-        @message[name] = value
-        expect(@message[name]).to eq(value)
-
-        value = random_string(128)
-        @message[name] = value
-        expect(@message[name]).to eq(value)
-      end
-
-      it "can hold a null property" do
-        name = random_string(16)
-        value = random_string(128)
-
-        @message[name] = value
-        expect(@message[name]).to eq(value)
-
-        @message[name] = nil
-        expect(@message[name]).to be_nil
-      end
-
-      it "can delete a property" do
-        name = random_string(16)
-        value = random_string(128)
-
-        @message[name] = value
-        expect(@message[name]).to eq(value)
-
-        @message.delete_property(name)
-        expect(@message.properties.keys).to_not include(name)
-      end
-
-      it "has no properties after being cleared" do
-        name = random_string(16)
-        value = random_string(128)
-
-        @message[name] = value
-        expect(@message[name]).to eq(value)
-
-        @message.clear
-        expect(@message.properties).to be_empty
-      end
-
-      it "has instructions" do
-        expect(@message).to respond_to(:instructions)
-        expect(@message).to respond_to("instructions=".to_sym)
-      end
-
-      it "can set an instruction" do
-        name = random_string(16)
-        value = random_string(128)
-
-        @message.instructions[name] = value
-        expect(@message.instructions[name]).to eq(value)
-      end
-
-      it "can update an instruction" do
-        name = random_string(16)
-        value = random_string(128)
-
-        @message.instructions[name] = value
-        expect(@message.instructions[name]).to eq(value)
-
-        value = random_string(128)
-        @message.instructions[name] = value
-        expect(@message.instructions[name]).to eq(value)
-      end
-
-      it "can delete the instructions" do
-        name = random_string(16)
-        value = random_string(128)
-
-        @message.instructions[name] = value
-        expect(@message.instructions).to_not be_empty
-
-        @message.instructions = nil
-        expect(@message.instructions).to be_nil
-      end
-
-      it "can replace the instructions" do
-        values = random_hash(rand(128) + 1)
-
-        @message.instructions = values.clone
-        expect(@message.instructions).to eq(values)
-
-        values = random_hash(rand(64) + 1)
-
-        @message.instructions = values.clone
-        expect(@message.instructions).to eq(values)
-      end
-
-      it "can delete the set of instructions" do
-        values = random_hash(rand(128) + 1)
-
-        @message.instructions = values.clone
-        expect(@message.instructions).to eq(values)
-
-        @message.instructions = nil
-        expect(@message.instructions).to be_nil
-      end
-
-      it "has no instructions after being cleared" do
-        value = random_hash(128)
-
-        @message.instructions = value.clone
-        expect(@message.instructions).to eq(value)
-
-         @message.clear
-        expect(@message.instructions).to be_empty
-      end
-
-      it "has annotations" do
-        expect(@message).to respond_to(:annotations)
-        expect(@message).to respond_to(:annotations=)
-      end
-
-      it "can set an annotation" do
-        name = random_hash(32)
-        value = random_hash(256)
-
-        @message.annotations[name] = value.clone
-        expect(@message.annotations[name]).to eq(value)
-      end
-
-      it "can update an annotation" do
-        name = random_hash(32)
-        value = random_hash(256)
-
-        @message.annotations[name] = value.clone
-        expect(@message.annotations[name]).to eq(value)
-
-        value = random_hash(128)
-
-        @message.annotations[name] = value.clone
-        expect(@message.annotations[name]).to eq(value)
-      end
-
-      it "can delete an annotation" do
-        name = random_hash(32)
-        value = random_hash(256)
-
-        @message.annotations[name] = value.clone
-        expect(@message.annotations[name]).to eq(value)
-
-        @message.annotations[name] = nil
-        expect(@message.annotations[name]).to be_nil
-      end
-
-      it "can replace all annotations" do
-        values = random_hash(rand(128) + 1)
-
-        @message.annotations = values.clone
-        expect(@message.annotations).to eq(values)
-
-        values = random_hash(rand(64) + 1)
-
-        @message.annotations = values.clone
-        expect(@message.annotations).to eq(values)
-      end
-
-      it "can delete the set of annotations" do
-        value = random_hash(rand(128) + 1)
-
-        @message.annotations = value.clone
-        expect(@message.annotations).to eq(value)
-
-        @message.annotations = nil
-        expect(@message.annotations).to be_nil
-      end
-
-      it "has no annotations after being cleared" do
-        value = random_hash(16)
-
-        @message.annotations = value
-        expect(@message.annotations).to eq(value)
-
-        @message.clear
-        expect(@message.annotations).to be_empty
-      end
-
-      it "has a body property" do
-        expect(@message).to respond_to(:body)
-        expect(@message).to respond_to(:body=)
-      end
-
-      it "has a default body that is nil" do
-        expect(@message.body).to be_nil
-      end
-
-      it "has no body after being cleared" do
-        name = random_string(16)
-        value = random_string(128)
-
-        @message.body = value
-        expect(@message.body).to eq(value)
-
-        @message.clear
-        expect(@message.body).to be_nil
-      end
-
-      it "can set the body property" do
-        (1..3).each do |which|
-          case which
-            when 0
-            value = random_string(32)
-            when 1
-            value = random_array(100)
-            when 2
-            value = random_hash(100)
-            when 3
-            value = rand(512)
-          end
-
-          @message.body = value
-          expect(@message.body).to eq(value)
-        end
-      end
-
-      it "can update the body property" do
-        (1..3).each do |which|
-          case which
-            when 0
-            value = random_string(32)
-            when 1
-            value = random_array(100)
-            when 2
-            value = random_hash(100)
-            when 3
-            value = rand(512)
-          end
-
-          @message.body = value
-          expect(@message.body).to eq(value)
-
-          @message.body = nil
-          expect(@message.body).to be_nil
-        end
-      end
-
-    end
-
-  end
-
-end
-
diff --git a/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb b/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb
deleted file mode 100644
index 8e50331..0000000
--- a/proton-c/bindings/ruby/spec/qpid/proton/messenger_spec.rb
+++ /dev/null
@@ -1,407 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-require "spec_helper"
-
-module Qpid
-
-  module Proton
-
-    describe "A messenger" do
-
-      before (:each) do
-        @messenger = Qpid::Proton::Messenger::Messenger.new
-      end
-
-      after (:each) do
-        begin
-          @messenger.stop
-        rescue ProtonError => error
-          # ignore this error
-        end
-      end
-
-      it "will generate a name if one is not provided" do
-        expect(@messenger.name).to_not be_nil
-      end
-
-      it "will accept an assigned name" do
-        name = random_string(16)
-        msgr = Qpid::Proton::Messenger::Messenger.new(name)
-        expect(msgr.name).to eq(name)
-      end
-
-      it "raises an error on a nil timeout" do
-        expect {
-          @messenger.timeout = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "can have a negative timeout" do
-        timeout = (0 - rand(65535))
-        @messenger.timeout = timeout
-        expect(@messenger.timeout).to eq(timeout)
-      end
-
-      it "has a timeout" do
-        timeout = rand(65535)
-        @messenger.timeout = timeout
-        expect(@messenger.timeout).to eq(timeout)
-      end
-
-      it "has an error number" do
-        expect(@messenger.error?).to eq(false)
-        expect(@messenger.errno).to eq(0)
-        # force an error
-        expect {
-          @messenger.subscribe("amqp://~#{random_string}")
-        }.to raise_error(ProtonError)
-        expect(@messenger.error?).to eq(true)
-        expect(@messenger.errno).to_not eq(0)
-      end
-
-      it "has an error message" do
-        expect(@messenger.error?).to eq(false)
-        expect(@messenger.error).to be_nil
-        # force an error
-        expect {
-          @messenger.subscribe("amqp://~#{random_string}")
-        }.to raise_error(ProtonError)
-        expect(@messenger.error?).to eq(true)
-        expect(@messenger.errno).to_not be_nil
-      end
-
-      it "can be started" do
-        expect {
-          @messenger.start
-        }.to_not raise_error
-      end
-
-      it "can be stopped" do
-        expect {
-          @messenger.stop
-        }.to_not raise_error
-      end
-
-      it "raises an error when subscribing to a nil address" do
-        expect {
-          @messenger.subscribe(nil)
-        }.to raise_error(TypeError)
-      end
-
-      it "raises an error when subscribing to an invalid address" do
-        expect {
-          @messenger.subscribe("amqp://~#{random_string}")
-        }.to raise_error(ProtonError)
-        expect(@messenger.error?).to eq(true)
-        expect(@messenger.errno).to_not eq(nil)
-      end
-
-      it "can have a nil certificate" do
-        expect {
-          @messenger.certificate = nil
-          expect(@messenger.certificate).to be_nil
-        }.to_not raise_error
-      end
-
-      it "can have a certificate" do
-        cert = random_string(128)
-        @messenger.certificate = cert
-        expect(@messenger.certificate).to eq(cert)
-      end
-
-      it "can have a nil private key" do
-        expect {
-          @messenger.private_key = nil
-          expect(@messenger.private_key).to be_nil
-        }.to_not raise_error
-      end
-
-      it "can have a private key" do
-        key = random_string(128)
-        @messenger.private_key = key
-        expect(@messenger.private_key).to eq(key)
-      end
-
-      it "can have a nil trusted certificates" do
-        expect {
-          @messenger.trusted_certificates = nil
-          expect(@messenger.trusted_certificates).to be_nil
-        }.to_not raise_error
-      end
-
-      it "has a list of trusted certificates" do
-        certs = random_string(128)
-        @messenger.trusted_certificates = certs
-        expect(@messenger.trusted_certificates).to eq(certs)
-      end
-
-      it "raises an error on a nil outgoing window" do
-        expect {
-          @messenger.outgoing_window = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "raises an error on a non-numeric outgoing window" do
-        expect {
-          @messenger.outgoing_window = random_string(16)
-        }.to raise_error(TypeError)
-      end
-
-      it "can have a negative outgoing window" do
-        window = 0 - (rand(256) + 1)
-        @messenger.outgoing_window = window
-        expect(@messenger.outgoing_window).to eq(window)
-      end
-
-      it "can have a positive outgoing window" do
-        window = (rand(256) + 1)
-        @messenger.outgoing_window = window
-        expect(@messenger.outgoing_window).to eq(window)
-      end
-
-      it "can have a zero outgoing window" do
-        window = 0
-        @messenger.outgoing_window = window
-        expect(@messenger.outgoing_window).to eq(window)
-      end
-
-      it "raises an error on a nil incoming window" do
-        expect {
-          @messenger.incoming_window = nil
-        }.to raise_error(TypeError)
-      end
-
-      it "raises an error on a non-numeric incoming window" do
-        expect {
-          @messenger.incoming_window = random_string(16)
-        }.to raise_error(TypeError)
-      end
-
-      it "can have a negative incoming window" do
-        window = 0 - (rand(256) + 1)
-        @messenger.incoming_window = window
-        expect(@messenger.incoming_window).to eq(window)
-      end
-
-      it "can have a positive incoming window" do
-        window = (rand(256) + 1)
-        @messenger.incoming_window = window
-        expect(@messenger.incoming_window).to eq(window)
-      end
-
-      it "can have a zero incoming window" do
-        window = 0
-        @messenger.incoming_window = window
-        expect(@messenger.incoming_window).to eq(window)
-      end
-
-      it "can be put into passive mode" do
-        @messenger.passive = true
-        expect(@messenger.passive?).to eq(true)
-      end
-
-      it "can be taken out of passive mode" do
-        @messenger.passive = false
-        expect(@messenger.passive?).to eq(false)
-      end
-
-      it "can clear non-existent errors with failing" do
-        expect {
-          @messenger.clear_error
-        }.to_not raise_error
-      end
-
-      it "can clear errors" do
-        begin
-          @messenger.accept # should cause an error
-        rescue; end
-
-        expect(@messenger.error).to_not be_nil
-        @messenger.clear_error
-        expect(@messenger.error).to be_nil
-      end
-
-      describe "once started" do
-
-        before (:each) do
-          @messenger.start
-        end
-
-        after (:each) do
-          begin
-            @messenger.stop
-          rescue ProtonError => error
-            # ignore this error
-          end
-        end
-
-        it "can subscribe to an address" do
-          expect(@messenger.subscribe("amqp://~0.0.0.0:#{5700+rand(1024)}")).to_not be_nil
-        end
-
-        it "returns a tracker's status"
-
-        describe "and subscribed to an address" do
-
-          before (:each) do
-            # create a receiver
-            @port = 5700 + rand(1024)
-            @receiver = Qpid::Proton::Messenger::Messenger.new("receiver")
-            @receiver.subscribe("amqp://~0.0.0.0:#{@port}")
-            @messenger.timeout = 0
-            @receiver.timeout = 0
-            @receiver.start
-
-            Thread.new do
-              @receiver.receive(10)
-            end
-
-            @msg = Qpid::Proton::Message.new
-            @msg.address = "amqp://0.0.0.0:#{@port}"
-            @msg.body = "Test sent #{Time.new}"
-          end
-
-          after (:each) do
-            begin
-              @messenger.stop
-            rescue ProtonError => error
-              # ignore this error
-            end
-            begin
-              @receiver.stop
-            rescue
-            end
-          end
-
-          it "raises an error when queueing a nil message" do
-            expect {
-              @messenger.put(nil)
-            }.to raise_error(TypeError)
-          end
-
-          it "raises an error when queueing an invalid object" do
-            expect {
-              @messenger.put("This is not a message")
-            }.to raise_error(::ArgumentError)
-          end
-
-          it "can place a message in the outgoing queue" do
-            expect {
-              @messenger.put(@msg)
-            }.to_not raise_error
-          end
-
-          it "can send with an empty queue"
-
-          describe "with a an outgoing tracker" do
-
-            before(:each) do
-              @messenger.put(@msg)
-              @tracker = @messenger.outgoing_tracker
-            end
-
-            it "has an outgoing tracker" do
-              expect(@tracker).to_not be_nil
-            end
-
-            it "returns a tracker's status"
-
-            it "raises an error when settling with a nil tracker" do
-              expect {
-                @messenger.settle(nil)
-              }.to raise_error(TypeError)
-            end
-
-            it "can settle a tracker's status" do
-              @messenger.settle(@tracker)
-            end
-
-            it "raises an error when checking status on a nil tracker" do
-              expect {
-                @messenger.status(nil)
-              }.to raise_error(TypeError)
-            end
-
-            it "raises an error when checking status on an invalid tracker" do
-              expect {
-                @messenger.status(random_string(16))
-              }.to raise_error(TypeError)
-            end
-
-            it "can check the status of a tracker" do
-              expect(@messenger.status(@tracker)).to_not be_nil
-            end
-
-          end
-
-          it "has an incoming tracker"
-          it "can reject an incoming message"
-
-          it "raises an error when accepting with an invalid tracker" do
-            expect {
-              @messenger.accept(random_string(16))
-            }.to raise_error(TypeError)
-          end
-
-          it "can accept a message"
-
-          it "raises an error when rejecting with an invalid tracker" do
-            expect {
-              @messenger.accept(random_string(16))
-            }.to raise_error(TypeError)
-          end
-
-          describe "with messages sent" do
-
-            before (:each) do
-              @messenger.put(@msg)
-            end
-
-            it "can send messages"
-
-            it "raises an error when receiving with a nil max" do
-              expect {
-                @messenger.receive(nil)
-              }.to raise_error(TypeError)
-            end
-
-            it "raises an error when receiving with a non-numeric max" do
-              expect {
-                @messenger.receive("farkle")
-              }.to raise_error(TypeError)
-            end
-
-            it "can receive messages"
-            it "and create a new message when one wasn't provided"
-            it "can get a message from the incoming queue"
-            it "can tell how many outgoing messages are pending"
-            it "can tell how many incoming messages are queued"
-
-          end
-
-        end
-
-      end
-
-    end
-
-  end
-
-end
diff --git a/proton-c/bindings/ruby/spec/spec_helper.rb b/proton-c/bindings/ruby/spec/spec_helper.rb
deleted file mode 100644
index 346cb0e..0000000
--- a/proton-c/bindings/ruby/spec/spec_helper.rb
+++ /dev/null
@@ -1,155 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-begin
-  require "simplecov"
-  puts "simplecov available"
-
-  SimpleCov.start do
-    add_filter "/lib/*/*.rb"
-    add_filter "message_format.rb"
-  end
-
-rescue
-  puts "simplecov not available"
-end
-
-require "securerandom"
-require "qpid_proton"
-
-# in Ruby 1.8 there is no SecureRandom module
-if RUBY_VERSION < "1.9"
-  module SecureRandom
-    class << self
-      def method_missing(method_sym, *arguments, &block)
-        case method_sym
-        when :urlsafe_base64
-          r19_urlsafe_base64(*arguments)
-        when :uuid
-          r19_uuid(*arguments)
-        else
-          super
-        end
-      end
-
-      private
-      def r19_urlsafe_base64(n=nil, padding=false)
-        s = [random_bytes(n)].pack("m*")
-        s.delete!("\n")
-        s.tr!("+/", "-_")
-        s.delete!("=") if !padding
-        s
-      end
-
-      def r19_uuid
-        ary = random_bytes(16).unpack("NnnnnN")
-        ary[2] = (ary[2] & 0x0fff) | 0x4000
-        ary[3] = (ary[3] & 0x3fff) | 0x8000
-        "%08x-%04x-%04x-%04x-%04x%08x" % ary
-      end
-    end
-  end
-end
-
-# Generates a random string of the specified length
-def random_string(length = 8)
-  (0...length).map{65.+(rand(25)).chr}.join
-end
-
-# Generates a random list of the specified length.
-def random_list(length)
-  result = []
-  (0...length).each do |element|
-    type = rand(8192) % 4
-    low = rand(512)
-    high = rand(8192)
-
-    case
-    when element == 0 then result << rand(128)
-    when element == 1 then result << random_string(rand(128))
-    when element == 2 then result << rand * (low - high).abs + low
-    when element == 3 then result << SecureRandom.uuid
-    end
-  end
-
-  return result
-end
-
-# Generates a random array of a random type.
-# Returns both the array and the type.
-def random_array(length, described = false, description = nil)
-  result = []
-  type = rand(128) % 4
-  low = rand(512)
-  high = rand(8192)
-
-  (0...length).each do |element|
-    case
-      when type == 0 then result << rand(1024)
-      when type == 1 then result << random_string(rand(128))
-      when type == 2 then result << rand * (low - high).abs + low
-      when type == 3 then result << SecureRandom.uuid
-    end
-  end
-
-  # create the array header
-  case
-    when type == 0 then type = Qpid::Proton::Codec::INT
-    when type == 1 then type = Qpid::Proton::Codec::STRING
-    when type == 2 then type = Qpid::Proton::Codec::FLOAT
-    when type == 3 then type = Qpid::Proton::Codec::UUID
-  end
-
-  result.proton_array_header = Qpid::Proton::Types::ArrayHeader.new(type, description)
-
-  return result
-end
-
-# Generates a random hash of values.
-def random_hash(length)
-  result = {}
-  values = random_list(length)
-  values.each do |value|
-    result[random_string(64)] = value
-  end
-  return result
-end
-
-# taken from http://stackoverflow.com/questions/6855944/rounding-problem-with-rspec-tests-when-comparing-float-arrays
-RSpec::Matchers.define :be_close_array do |expected, truth|
-  match do |actual|
-    same = 0
-    for i in 0..actual.length-1
-      same +=1 if actual[i].round(truth) == expected[i].round(truth)
-    end
-    same == actual.length
-  end
-
-  failure_message_for_should do |actual|
-    "expected that #{actual} would be close to #{expected}"
-  end
-
-  failure_message_for_should_not do |actual|
-    "expected that #{actual} would not be close to #{expected}"
-  end
-
-  description do
-    "be a close to #{expected}"
-  end
-end
diff --git a/proton-c/docs/api/CMakeLists.txt b/proton-c/docs/api/CMakeLists.txt
deleted file mode 100644
index 7756e48..0000000
--- a/proton-c/docs/api/CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-find_package(Doxygen)
-if (DOXYGEN_FOUND)
-  configure_file (${CMAKE_CURRENT_SOURCE_DIR}/user.doxygen.in
-                  ${CMAKE_CURRENT_BINARY_DIR}/user.doxygen)
-  add_custom_target (docs-c COMMAND ${DOXYGEN_EXECUTABLE} user.doxygen)
-  add_dependencies (docs docs-c)
-
-  # HTML files are generated to ./html - put those in the install.
-  install (DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html/"
-           DESTINATION "${PROTON_SHARE}/docs/api-c"
-           COMPONENT documentation
-           OPTIONAL)
-
-  set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES html)
-endif (DOXYGEN_FOUND)
diff --git a/proton-c/docs/api/index.md b/proton-c/docs/api/index.md
deleted file mode 100644
index cf35c33..0000000
--- a/proton-c/docs/api/index.md
+++ /dev/null
@@ -1,37 +0,0 @@
-# Introduction {#index}
-
-This is the C API for the Proton AMQP protocol engine. It allows you
-to write client and server applications that send and receive AMQP
-messages.
-
-## Core
-
-@ref core is a collection of types and functions representing AMQP
-concepts.  Together they form a "protocol engine" API to create AMQP
-connections and links, handle @ref event "events", and send and
-receive @ref message "messages".
-
-## Types
-
-@ref types contains C data types, including @ref amqp\_types and @ref
-api\_types.
-
-## Codec
-
-@ref codec has functions for AMQP data encoding and decoding.
-
-## IO
-
-@ref io holds interfaces for integrating Proton with platform IO.
-
-The @ref proactor is a portable, proactive, asynchronous API for
-single- or multithreaded applications. It associates AMQP @ref
-connection "connections" with network connections (@ref transport
-"transports") and allows one or more threads to handle @ref event
-"events".
-
-**Low-level integration** - The @ref connection\_driver provides a
-low-level SPI to feed byte streams from any source to the protocol
-engine. You can use it to integrate Proton directly with a foreign
-event loop or IO library, or to implement your own @ref proactor to
-transparently replace Proton's IO layer.
diff --git a/proton-c/docs/api/user.doxygen.in b/proton-c/docs/api/user.doxygen.in
deleted file mode 100644
index 4a02bd2..0000000
--- a/proton-c/docs/api/user.doxygen.in
+++ /dev/null
@@ -1,88 +0,0 @@
-##
-## Licensed to the Apache Software Foundation (ASF) under one
-## or more contributor license agreements.  See the NOTICE file
-## distributed with this work for additional information
-## regarding copyright ownership.  The ASF licenses this file
-## to you under the Apache License, Version 2.0 (the
-## "License"); you may not use this file except in compliance
-## with the License.  You may obtain a copy of the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing,
-## software distributed under the License is distributed on an
-## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-## KIND, either express or implied.  See the License for the
-## specific language governing permissions and limitations
-## under the License.
-##
-
-# Project options
-
-PROJECT_NAME            = "Qpid Proton C API"
-PROJECT_NUMBER          = @PN_VERSION_MAJOR@.@PN_VERSION_MINOR@.@PN_VERSION_POINT@
-OUTPUT_DIRECTORY        = .
-OUTPUT_LANGUAGE         = English
-BRIEF_MEMBER_DESC       = YES
-REPEAT_BRIEF            = YES
-ALWAYS_DETAILED_SEC     = NO
-INLINE_INHERITED_MEMB   = YES
-JAVADOC_AUTOBRIEF       = YES
-INHERIT_DOCS            = YES
-INLINE_SIMPLE_STRUCTS   = YES
-HIDE_UNDOC_CLASSES      = YES
-HIDE_COMPOUND_REFERENCE = YES
-HIDE_SCOPE_NAMES        = YES
-MAX_INITIALIZER_LINES   = 0
-ALPHABETICAL_INDEX      = NO
-
-# Redefine protected as private and strip out the PN_EXTERN and
-# PNX_EXTERN macros
-
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = YES
-EXPAND_ONLY_PREDEF = YES
-PREDEFINED = PN_EXTERN= PNX_EXTERN=
-
-# Configuration options related to warning and progress messages
-
-QUIET                  = YES
-WARNINGS               = YES
-
-# Configuration options related to the input files
-
-INPUT = @CMAKE_SOURCE_DIR@/proton-c/include @CMAKE_SOURCE_DIR@/proton-c/docs @CMAKE_SOURCE_DIR@/examples/c
-FILE_PATTERNS          = *.h *.md *.dox
-EXCLUDE_PATTERNS       = */examples/*.c \
-                         */examples/*.h \
-                         */include/proton/cid.h \
-                         */include/proton/engine.h \
-                         */include/proton/handlers.h \
-                         */include/proton/import_export.h \
-                         */include/proton/log.h \
-                         */include/proton/object.h \
-                         */include/proton/parser.h \
-                         */include/proton/reactor.h \
-                         */include/proton/selectable.h \
-                         */include/proton/type_compat.h
-FULL_PATH_NAMES        = YES
-RECURSIVE              = YES
-STRIP_FROM_PATH        = @CMAKE_SOURCE_DIR@/proton-c/include
-EXAMPLE_PATH           = @CMAKE_SOURCE_DIR@/examples/c
-EXAMPLE_RECURSIVE      = YES
-
-# View and list options
-
-GENERATE_TREEVIEW       = YES
-GENERATE_TODOLIST       = NO
-GENERATE_TESTLIST       = NO
-GENERATE_BUGLIST        = NO
-GENERATE_DEPRECATEDLIST = YES
-IGNORE_PREFIX           = pn_ PN_
-
-# Configuration options related to the output format
-
-GENERATE_HTML          = YES
-HTML_OUTPUT            = html
-HTML_FILE_EXTENSION    = .html
-GENERATE_LATEX         = NO
diff --git a/proton-c/env.py b/proton-c/env.py
deleted file mode 100644
index 04fa8bb..0000000
--- a/proton-c/env.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-#
-# A platform-agnostic tool for running a program in a modified environment.
-#
-
-import sys
-import os
-import subprocess
-from optparse import OptionParser
-
-def main(argv=None):
-
-    parser = OptionParser(usage="Usage: %prog [options] [--] VAR=VALUE... command [options] arg1 arg2...")
-    parser.add_option("-i", "--ignore-environment",
-                      action="store_true", default=False,
-                      help="Start with an empty environment (do not inherit current environment)")
-
-    (options, args) = parser.parse_args(args=argv)
-
-    if options.ignore_environment:
-        new_env = {}
-    else:
-        new_env = os.environ.copy()
-
-    # pull out each name value pair
-    while (len(args)):
-        z = args[0].split("=",1)
-        if len(z) != 2:
-            break;  # done with env args
-        if len(z[0]) == 0:
-            raise Exception("Error: incorrect format for env var: '%s'" % str(args[x]))
-        del args[0]
-        if len(z[1]) == 0:
-            # value is not present, so delete it
-            if z[0] in new_env:
-                del new_env[z[0]]
-        else:
-            new_env[z[0]] = z[1]
-
-    if len(args) == 0 or len(args[0]) == 0:
-        raise Exception("Error: syntax error in command arguments")
-
-    if new_env.get("VALGRIND") and new_env.get("VALGRIND_ALL"):
-        # Python generates a lot of possibly-lost errors that are not errors, don't show them.
-        args = [new_env.get("VALGRIND"), "--show-reachable=no", "--show-possibly-lost=no",
-                "--error-exitcode=42"] + args
-
-    p = subprocess.Popen(args, env=new_env)
-    return p.wait()
-
-if __name__ == "__main__":
-    sys.exit(main())
diff --git a/proton-c/include/proton/cid.h b/proton-c/include/proton/cid.h
deleted file mode 100644
index 2d68896..0000000
--- a/proton-c/include/proton/cid.h
+++ /dev/null
@@ -1,74 +0,0 @@
-#ifndef PROTON_CID_H
-#define PROTON_CID_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/**
- * @cond INTERNAL
- */
-
-typedef enum {
-  CID_pn_object = 1,
-  CID_pn_void,
-  CID_pn_weakref,
-
-  CID_pn_string,
-  CID_pn_list,
-  CID_pn_map,
-  CID_pn_hash,
-  CID_pn_record,
-
-  CID_pn_collector,
-  CID_pn_event,
-
-  CID_pn_encoder,
-  CID_pn_decoder,
-  CID_pn_data,
-
-  CID_pn_connection,
-  CID_pn_session,
-  CID_pn_link,
-  CID_pn_delivery,
-  CID_pn_transport,
-
-  CID_pn_message,
-
-  CID_pn_reactor,
-  CID_pn_handler,
-  CID_pn_timer,
-  CID_pn_task,
-
-  CID_pn_io,
-  CID_pn_selector,
-  CID_pn_selectable,
-
-  CID_pn_url,
-
-  CID_pn_listener,
-  CID_pn_proactor
-} pn_cid_t;
-
-/**
- * @endcond
- */
-
-#endif /* cid.h */
diff --git a/proton-c/include/proton/codec.h b/proton-c/include/proton/codec.h
deleted file mode 100644
index 8f96774..0000000
--- a/proton-c/include/proton/codec.h
+++ /dev/null
@@ -1,1295 +0,0 @@
-#ifndef PROTON_CODEC_H
-#define PROTON_CODEC_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/object.h>
-#include <proton/types.h>
-#include <proton/error.h>
-#include <proton/type_compat.h>
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- *
- * @copybrief codec
- */
-
-/**
- * Identifies an AMQP type.
- *
- * @ingroup amqp_types
- */
-typedef enum {
-
-  /**
-   * The NULL AMQP type.
-   */
-  PN_NULL = 1,
-
-  /**
-   * The boolean AMQP type.
-   */
-  PN_BOOL = 2,
-
-  /**
-   * The unsigned byte AMQP type. An 8 bit unsigned integer.
-   */
-  PN_UBYTE = 3,
-
-  /**
-   * The byte AMQP type. An 8 bit signed integer.
-   */
-  PN_BYTE = 4,
-
-  /**
-   * The unsigned short AMQP type. A 16 bit unsigned integer.
-   */
-  PN_USHORT = 5,
-
-  /**
-   * The short AMQP type. A 16 bit signed integer.
-   */
-  PN_SHORT = 6,
-
-  /**
-   * The unsigned int AMQP type. A 32 bit unsigned integer.
-   */
-  PN_UINT = 7,
-
-  /**
-   * The signed int AMQP type. A 32 bit signed integer.
-   */
-  PN_INT = 8,
-
-  /**
-   * The char AMQP type. A 32 bit unicode character.
-   */
-  PN_CHAR = 9,
-
-  /**
-   * The ulong AMQP type. An unsigned 32 bit integer.
-   */
-  PN_ULONG = 10,
-
-  /**
-   * The long AMQP type. A signed 32 bit integer.
-   */
-  PN_LONG = 11,
-
-  /**
-   * The timestamp AMQP type. A signed 64 bit value measuring
-   * milliseconds since the epoch.
-   */
-  PN_TIMESTAMP = 12,
-
-  /**
-   * The float AMQP type. A 32 bit floating point value.
-   */
-  PN_FLOAT = 13,
-
-  /**
-   * The double AMQP type. A 64 bit floating point value.
-   */
-  PN_DOUBLE = 14,
-
-  /**
-   * The decimal32 AMQP type. A 32 bit decimal floating point value.
-   */
-  PN_DECIMAL32 = 15,
-
-  /**
-   * The decimal64 AMQP type. A 64 bit decimal floating point value.
-   */
-  PN_DECIMAL64 = 16,
-
-  /**
-   * The decimal128 AMQP type. A 128 bit decimal floating point value.
-   */
-  PN_DECIMAL128 = 17,
-
-  /**
-   * The UUID AMQP type. A 16 byte UUID.
-   */
-  PN_UUID = 18,
-
-  /**
-   * The binary AMQP type. A variable length sequence of bytes.
-   */
-  PN_BINARY = 19,
-
-  /**
-   * The string AMQP type. A variable length sequence of unicode
-   * characters.
-   */
-  PN_STRING = 20,
-
-  /**
-   * The symbol AMQP type. A variable length sequence of unicode
-   * characters.
-   */
-  PN_SYMBOL = 21,
-
-  /**
-   * A described AMQP type.
-   */
-  PN_DESCRIBED = 22,
-
-  /**
-   * An AMQP array. A monomorphic sequence of other AMQP values.
-   */
-  PN_ARRAY = 23,
-
-  /**
-   *  An AMQP list. A polymorphic sequence of other AMQP values.
-   */
-  PN_LIST = 24,
-
-  /**
-   * An AMQP map. A polymorphic container of other AMQP values formed
-   * into key/value pairs.
-   */
-  PN_MAP = 25,
-
-  /**
-   * A special invalid type value that is returned when no valid type
-   * is available.
-   */
-  PN_INVALID = -1
-} pn_type_t;
-
-/**
- * Return a string name for an AMQP type.
- *
- * @ingroup amqp_types
- * @param type an AMQP type
- * @return the string name of the given type
- */
-PN_EXTERN const char *pn_type_name(pn_type_t type);
-
-/**
- * A descriminated union that holds any scalar AMQP value. The type
- * field indicates the AMQP type of the value, and the union may be
- * used to access the value for a given type.
- *
- * @ingroup api_types
- */
-typedef struct {
-  /**
-   * Indicates the type of value the atom is currently pointing to.
-   * See ::pn_type_t for details on AMQP types.
-   */
-  pn_type_t type;
-  union {
-    /**
-     * Valid when type is ::PN_BOOL.
-     */
-    bool as_bool;
-
-    /**
-     * Valid when type is ::PN_UBYTE.
-     */
-    uint8_t as_ubyte;
-
-    /**
-     * Valid when type is ::PN_BYTE.
-     */
-    int8_t as_byte;
-
-    /**
-     * Valid when type is ::PN_USHORT.
-     */
-    uint16_t as_ushort;
-
-    /**
-     * Valid when type is ::PN_SHORT.
-     */
-    int16_t as_short;
-
-    /**
-     * Valid when type is ::PN_UINT.
-     */
-    uint32_t as_uint;
-
-    /**
-     * Valid when type is ::PN_INT.
-     */
-    int32_t as_int;
-
-    /**
-     * Valid when type is ::PN_CHAR.
-     */
-    pn_char_t as_char;
-
-    /**
-     * Valid when type is ::PN_ULONG.
-     */
-    uint64_t as_ulong;
-
-    /**
-     * Valid when type is ::PN_LONG.
-     */
-    int64_t as_long;
-
-    /**
-     * Valid when type is ::PN_TIMESTAMP.
-     */
-    pn_timestamp_t as_timestamp;
-
-    /**
-     * Valid when type is ::PN_FLOAT.
-     */
-    float as_float;
-
-    /**
-     * Valid when type is ::PN_DOUBLE.
-     */
-    double as_double;
-
-    /**
-     * Valid when type is ::PN_DECIMAL32.
-     */
-    pn_decimal32_t as_decimal32;
-
-    /**
-     * Valid when type is ::PN_DECIMAL64.
-     */
-    pn_decimal64_t as_decimal64;
-
-    /**
-     * Valid when type is ::PN_DECIMAL128.
-     */
-    pn_decimal128_t as_decimal128;
-
-    /**
-     * Valid when type is ::PN_UUID.
-     */
-    pn_uuid_t as_uuid;
-
-    /**
-     * Valid when type is ::PN_BINARY or ::PN_STRING or ::PN_SYMBOL.
-     * When the type is ::PN_STRING the field will point to utf8
-     * encoded unicode. When the type is ::PN_SYMBOL, the field will
-     * point to 7-bit ASCII. In the latter two cases, the bytes
-     * pointed to are *not* necessarily null terminated.
-     */
-    pn_bytes_t as_bytes;
-  } u;
-} pn_atom_t;
-
-/**
- * @addtogroup data
- * @{
- */
-
-/**
- * An AMQP Data object.
- *
- * A pn_data_t object provides an interface for decoding, extracting,
- * creating, and encoding arbitrary AMQP data. A pn_data_t object
- * contains a tree of AMQP values. Leaf nodes in this tree correspond
- * to scalars in the AMQP type system such as @link ::PN_INT ints
- * @endlink or @link ::PN_STRING strings @endlink. Non-leaf nodes in
- * this tree correspond to compound values in the AMQP type system
- * such as @link ::PN_LIST lists @endlink, @link ::PN_MAP maps
- * @endlink, @link ::PN_ARRAY arrays @endlink, or @link ::PN_DESCRIBED
- * described @endlink values. The root node of the tree is the
- * pn_data_t object itself and can have an arbitrary number of
- * children.
- *
- * A pn_data_t object maintains the notion of the current node and the
- * current parent node. Siblings are ordered within their parent.
- * Values are accessed and/or added by using the ::pn_data_next(),
- * ::pn_data_prev(), ::pn_data_enter(), and ::pn_data_exit()
- * operations to navigate to the desired location in the tree and
- * using the supplied variety of pn_data_put_* / pn_data_get_*
- * operations to access or add a value of the desired type.
- *
- * The pn_data_put_* operations will always add a value _after_ the
- * current node in the tree. If the current node has a next sibling
- * the pn_data_put_* operations will overwrite the value on this node.
- * If there is no current node or the current node has no next sibling
- * then one will be added. The pn_data_put_* operations always set the
- * added/modified node to the current node. The pn_data_get_*
- * operations read the value of the current node and do not change
- * which node is current.
- *
- * The following types of scalar values are supported:
- *
- *  - ::PN_NULL
- *  - ::PN_BOOL
- *  - ::PN_UBYTE
- *  - ::PN_USHORT
- *  - ::PN_SHORT
- *  - ::PN_UINT
- *  - ::PN_INT
- *  - ::PN_ULONG
- *  - ::PN_LONG
- *  - ::PN_FLOAT
- *  - ::PN_DOUBLE
- *  - ::PN_BINARY
- *  - ::PN_STRING
- *  - ::PN_SYMBOL
- *
- * The following types of compound values are supported:
- *
- *  - ::PN_DESCRIBED
- *  - ::PN_ARRAY
- *  - ::PN_LIST
- *  - ::PN_MAP
- */
-typedef struct pn_data_t pn_data_t;
-
-/**
- * Construct a pn_data_t object with the supplied initial capacity. A
- * pn_data_t will grow automatically as needed, so an initial capacity
- * of 0 is permitted.
- *
- * @param capacity the initial capacity
- * @return the newly constructed pn_data_t
- */
-PN_EXTERN pn_data_t *pn_data(size_t capacity);
-
-/**
- * Free a pn_data_t object.
- *
- * @param data a pn_data_t object or NULL
- */
-PN_EXTERN void pn_data_free(pn_data_t *data);
-
-/**
- * Access the current error code for a given pn_data_t.
- *
- * @param data a pn_data_t object
- * @return the current error code
- */
-PN_EXTERN int pn_data_errno(pn_data_t *data);
-
-/**
- * Access the current error for a givn pn_data_t.
- *
- * Every pn_data_t has an error descriptor that is created with the
- * pn_data_t and dies with the pn_data_t. The error descriptor is
- * updated whenever an operation fails. The ::pn_data_error() function
- * may be used to access a pn_data_t's error descriptor.
- *
- * @param data a pn_data_t object
- * @return a pointer to the pn_data_t's error descriptor
- */
-PN_EXTERN pn_error_t *pn_data_error(pn_data_t *data);
-
-/**
- * @cond INTERNAL
- */
-PN_EXTERN int pn_data_vfill(pn_data_t *data, const char *fmt, va_list ap);
-PN_EXTERN int pn_data_fill(pn_data_t *data, const char *fmt, ...);
-PN_EXTERN int pn_data_vscan(pn_data_t *data, const char *fmt, va_list ap);
-PN_EXTERN int pn_data_scan(pn_data_t *data, const char *fmt, ...);
-/**
- * @endcond
- */
-
-/**
- * Clears a pn_data_t object.
- *
- * A cleared pn_data_t object is equivalent to a newly constructed
- * one.
- *
- * @param data the pn_data_t object to clear
- */
-PN_EXTERN void pn_data_clear(pn_data_t *data);
-
-/**
- * Returns the total number of nodes contained in a pn_data_t object.
- * This includes all parents, children, siblings, grandchildren, etc.
- * In other words the count of all ancesters and descendents of the
- * current node, along with the current node if there is one.
- *
- * @param data a pn_data_t object
- * @return the total number of nodes in the pn_data_t object
- */
-PN_EXTERN size_t pn_data_size(pn_data_t *data);
-
-/**
- * Clears current node pointer and sets the parent to the root node.
- * Clearing the current node sets it _before_ the first node, calling
- * ::pn_data_next() will advance to the first node.
- */
-PN_EXTERN void pn_data_rewind(pn_data_t *data);
-
-/**
- * Advances the current node to its next sibling and returns true. If
- * there is no next sibling the current node remains unchanged and
- * false is returned.
- *
- * @param data a pn_data_t object
- * @return true iff the current node was changed
- */
-PN_EXTERN bool pn_data_next(pn_data_t *data);
-
-/**
- * Moves the current node to its previous sibling and returns true. If
- * there is no previous sibling the current node remains unchanged and
- * false is returned.
- *
- * @param data a pn_data_t object
- * @return true iff the current node was changed
- */
-PN_EXTERN bool pn_data_prev(pn_data_t *data);
-
-/**
- * Sets the parent node to the current node and clears the current
- * node. Clearing the current node sets it _before_ the first child,
- * calling ::pn_data_next() advances to the first child. This
- * operation will return false if there is no current node or if the
- * current node is not a compound type.
- *
- * @param data a pn_data_object
- * @return true iff the pointers to the current/parent nodes are changed
- */
-PN_EXTERN bool pn_data_enter(pn_data_t *data);
-
-/**
- * Sets the current node to the parent node and the parent node to its
- * own parent. This operation will return false if there is no current
- * node or parent node.
- *
- * @param data a pn_data object
- * @return true iff the pointers to the current/parent nodes are
- *         changed
- */
-PN_EXTERN bool pn_data_exit(pn_data_t *data);
-
-/**
- * @cond INTERNAL
- */
-PN_EXTERN bool pn_data_lookup(pn_data_t *data, const char *name);
-/**
- * @endcond
- */
-
-/**
- * Access the type of the current node. Returns PN_INVALID if there is no
- * current node.
- *
- * @param data a data object
- * @return the type of the current node
- */
-PN_EXTERN pn_type_t pn_data_type(pn_data_t *data);
-
-/**
- * Prints the contents of a pn_data_t object using ::pn_data_format()
- * to stdout.
- *
- * @param data a pn_data_t object
- * @return zero on success or an error on failure
- */
-PN_EXTERN int pn_data_print(pn_data_t *data);
-
-/**
- * Formats the contents of a pn_data_t object in a human readable way
- * and writes them to the indicated location. The size pointer must
- * hold the amount of free space following the bytes pointer, and upon
- * success will be updated to indicate how much space has been used.
- *
- * @param data a pn_data_t object
- * @param bytes a buffer to write the output to
- * @param size a pointer to the size of the buffer
- * @return zero on succes, or an error on failure
- */
-PN_EXTERN int pn_data_format(pn_data_t *data, char *bytes, size_t *size);
-
-/**
- * Writes the contents of a data object to the given buffer as an AMQP
- * data stream.
- *
- * @param data the data object to encode
- * @param bytes the buffer for encoded data
- * @param size the size of the buffer
- *
- * @return the size of the encoded data on success or an error code on failure
- */
-PN_EXTERN ssize_t pn_data_encode(pn_data_t *data, char *bytes, size_t size);
-
-/**
- * Returns the number of bytes needed to encode a data object.
- *
- * @param data the data object
- *
- * @return the size of the encoded data or an error code if data is invalid.
- */
-PN_EXTERN ssize_t pn_data_encoded_size(pn_data_t *data);
-
-/**
- * Decodes a single value from the contents of the AMQP data stream
- * into the current data object. Note that if the pn_data_t object is
- * pointing to a current node, the decoded value will overwrite the
- * current one. If the pn_data_t object has no current node then a
- * node will be appended to the current parent. If there is no current
- * parent then a node will be appended to the pn_data_t itself.
- *
- * Upon success, this operation returns the number of bytes consumed
- * from the AMQP data stream. Upon failure, this operation returns an
- * error code.
- *
- * @param data a pn_data_t object
- * @param bytes a pointer to an encoded AMQP data stream
- * @param size the size of the encoded AMQP data stream
- * @return the number of bytes consumed from the AMQP data stream or an error code
- */
-PN_EXTERN ssize_t pn_data_decode(pn_data_t *data, const char *bytes, size_t size);
-
-/**
- * Puts an empty list value into a pn_data_t. Elements may be filled
- * by entering the list node using ::pn_data_enter() and using
- * pn_data_put_* to add the desired contents. Once done,
- * ::pn_data_exit() may be used to return to the current level in the
- * tree and put more values.
- *
- *   @code
- *   pn_data_t *data = pn_data(0);
- *   ...
- *   pn_data_put_list(data);
- *   pn_data_enter(data);
- *   pn_data_put_int(data, 1);
- *   pn_data_put_int(data, 2);
- *   pn_data_put_int(data, 3);
- *   pn_data_exit(data);
- *   ...
- *   @endcode
- *
- * @param data a pn_data_t object
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_list(pn_data_t *data);
-
-/**
- * Puts an empty map value into a pn_data_t. Elements may be filled by
- * entering the map node and putting alternating key value pairs.
- *
- *   @code
- *   pn_data_t *data = pn_data(0);
- *   ...
- *   pn_data_put_map(data);
- *   pn_data_enter(data);
- *   pn_data_put_string(data, pn_bytes(3, "key"));
- *   pn_data_put_string(data, pn_bytes(5, "value"));
- *   pn_data_exit(data);
- *   ...
- *   @endcode
- *
- * @param data a pn_data_t object
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_map(pn_data_t *data);
-
-/**
- * Puts an empty array value into a pn_data_t. Elements may be filled
- * by entering the array node and putting the element values. The
- * values must all be of the specified array element type. If an array
- * is described then the first child value of the array is the
- * descriptor and may be of any type.
- *
- * @code
- *   pn_data_t *data = pn_data(0);
- *   ...
- *   pn_data_put_array(data, false, PN_INT);
- *   pn_data_enter(data);
- *   pn_data_put_int(data, 1);
- *   pn_data_put_int(data, 2);
- *   pn_data_put_int(data, 3);
- *   pn_data_exit(data);
- *   ...
- *   pn_data_put_array(data, True, Data.DOUBLE);
- *   pn_data_enter(data);
- *   pn_data_put_symbol(data, "array-descriptor");
- *   pn_data_put_double(data, 1.1);
- *   pn_data_put_double(data, 1.2);
- *   pn_data_put_double(data, 1.3);
- *   pn_data_exit(data);
- *   ...
- * @endcode
- *
- * @param data a pn_data_t object
- * @param described specifies whether the array is described
- * @param type the type of the array
- *
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_array(pn_data_t *data, bool described, pn_type_t type);
-
-/**
- * Puts a described value into a pn_data_t object. A described node
- * has two children, the descriptor and the value. These are specified
- * by entering the node and putting the desired values.
- *
- * @code
- *   pn_data_t *data = pn_data(0);
- *   ...
- *   pn_data_put_described(data);
- *   pn_data_enter(data);
- *   pn_data_put_symbol(data, pn_bytes(16, "value-descriptor"));
- *   pn_data_put_string(data, pn_bytes(9, "the value"));
- *   pn_data_exit(data);
- *   ...
- * @endcode
- *
- * @param data a pn_data_t object
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_described(pn_data_t *data);
-
-/**
- * Puts a ::PN_NULL value.
- *
- * @param data a pn_data_t object
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_null(pn_data_t *data);
-
-/**
- * Puts a ::PN_BOOL value.
- *
- * @param data a pn_data_t object
- * @param b the value
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_bool(pn_data_t *data, bool b);
-
-/**
- * Puts a ::PN_UBYTE value.
- *
- * @param data a pn_data_t object
- * @param ub the value
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_ubyte(pn_data_t *data, uint8_t ub);
-
-/**
- * Puts a ::PN_BYTE value.
- *
- * @param data a pn_data_t object
- * @param b the value
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_byte(pn_data_t *data, int8_t b);
-
-/**
- * Puts a ::PN_USHORT value.
- *
- * @param data a pn_data_t object
- * @param us the value
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_ushort(pn_data_t *data, uint16_t us);
-
-/**
- * Puts a ::PN_SHORT value.
- *
- * @param data a pn_data_t object
- * @param s the value
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_short(pn_data_t *data, int16_t s);
-
-/**
- * Puts a ::PN_UINT value.
- *
- * @param data a pn_data_t object
- * @param ui the value
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_uint(pn_data_t *data, uint32_t ui);
-
-/**
- * Puts a ::PN_INT value.
- *
- * @param data a pn_data_t object
- * @param i the value
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_int(pn_data_t *data, int32_t i);
-
-/**
- * Puts a ::PN_CHAR value.
- *
- * @param data a pn_data_t object
- * @param c the value
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_char(pn_data_t *data, pn_char_t c);
-
-/**
- * Puts a ::PN_ULONG value.
- *
- * @param data a pn_data_t object
- * @param ul the value
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_ulong(pn_data_t *data, uint64_t ul);
-
-/**
- * Puts a ::PN_LONG value.
- *
- * @param data a pn_data_t object
- * @param l the value
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_long(pn_data_t *data, int64_t l);
-
-/**
- * Puts a ::PN_TIMESTAMP value.
- *
- * @param data a pn_data_t object
- * @param t the value
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_timestamp(pn_data_t *data, pn_timestamp_t t);
-
-/**
- * Puts a ::PN_FLOAT value.
- *
- * @param data a pn_data_t object
- * @param f the value
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_float(pn_data_t *data, float f);
-
-/**
- * Puts a ::PN_DOUBLE value.
- *
- * @param data a pn_data_t object
- * @param d the value
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_double(pn_data_t *data, double d);
-
-/**
- * Puts a ::PN_DECIMAL32 value.
- *
- * @param data a pn_data_t object
- * @param d the value
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_decimal32(pn_data_t *data, pn_decimal32_t d);
-
-/**
- * Puts a ::PN_DECIMAL64 value.
- *
- * @param data a pn_data_t object
- * @param d the value
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_decimal64(pn_data_t *data, pn_decimal64_t d);
-
-/**
- * Puts a ::PN_DECIMAL128 value.
- *
- * @param data a pn_data_t object
- * @param d the value
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_decimal128(pn_data_t *data, pn_decimal128_t d);
-
-/**
- * Puts a ::PN_UUID value.
- *
- * @param data a pn_data_t object
- * @param u the value
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_uuid(pn_data_t *data, pn_uuid_t u);
-
-/**
- * Puts a ::PN_BINARY value. The bytes referenced by the pn_bytes_t
- * argument are copied and stored inside the pn_data_t object.
- *
- * @param data a pn_data_t object
- * @param bytes the value
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_binary(pn_data_t *data, pn_bytes_t bytes);
-
-/**
- * Puts a ::PN_STRING value. The bytes referenced by the pn_bytes_t
- * argument are copied and stored inside the pn_data_t object.
- *
- * @param data a pn_data_t object
- * @param string utf8 encoded unicode
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_string(pn_data_t *data, pn_bytes_t string);
-
-/**
- * Puts a ::PN_SYMBOL value. The bytes referenced by the pn_bytes_t
- * argument are copied and stored inside the pn_data_t object.
- *
- * @param data a pn_data_t object
- * @param symbol ascii encoded symbol
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_symbol(pn_data_t *data, pn_bytes_t symbol);
-
-/**
- * Puts any scalar value value.
- *
- * @param data a pn_data_t object
- * @param atom the value
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_put_atom(pn_data_t *data, pn_atom_t atom);
-
-/**
- * If the current node is a list, return the number of elements,
- * otherwise return zero. List elements can be accessed by entering
- * the list.
- *
- * @code
- *   ...
- *   size_t count = pn_data_get_list(data);
- *   pn_data_enter(data);
- *   for (size_t i = 0; i < count; i++) {
- *       if (pn_data_next(data)) {
- *         switch (pn_data_type(data)) {
- *         case PN_STRING:
- *           ...
- *           break;
- *         case PN_INT:
- *           ...
- *           break;
- *        }
- *   }
- *   pn_data_exit(data);
- *   ...
- * @endcode
-.*
- * @param data a pn_data_t object
- * @return the size of a list node
- */
-PN_EXTERN size_t pn_data_get_list(pn_data_t *data);
-
-/**
- * If the current node is a map, return the number of child elements,
- * otherwise return zero. Key value pairs can be accessed by entering
- * the map.
- *
- * @code
- *   ...
- *   size_t count = pn_data_get_map(data);
- *   pn_data_enter(data);
- *   for (size_t i = 0; i < count/2; i++) {
- *     // read key
- *     if (pn_data_next(data)) {
- *       switch (pn_data_type(data)) {
- *         case PN_STRING:
- *           ...
- *         break;
- *         ...
- *       }
- *     }
- *     ...
- *     // read value
- *     if (pn_data_next(data)) {
- *       switch (pn_data_type(data)) {
- *         case PN_INT:
- *           ...
- *         break;
- *         ...
- *       }
- *     }
- *     ...
- *   }
- *   pn_data_exit(data);
- *   ...
- * @endcode
- *
- * @param data a pn_data_t object
- * @return the number of child elements of a map node
- */
-PN_EXTERN size_t pn_data_get_map(pn_data_t *data);
-
-/**
- * If the current node is an array, return the number of elements in
- * the array, otherwise return 0. Array data can be accessed by
- * entering the array. If the array is described, the first child node
- * will be the descriptor, and the remaining count child nodes
- * will be the elements of the array.
- *
- * @code
- *   ...
- *   size_t count = pn_data_get_array(data);
- *   bool described = pn_data_is_array_described(data);
- *   pn_type_t type = pn_data_get_array_type(data);
- *
- *   pn_data_enter(data);
- *
- *   if (described && pn_data_next(data)) {
- *       // the descriptor could be another type, but let's assume it's a symbol
- *       pn_bytes_t descriptor = pn_data_get_symbol(data);
- *   }
- *
- *   for (size_t i = 0; i < count; i++) {
- *     if (pn_data_next(data)) {
- *         // all elements will be values of the array type retrieved above
- *         ...
- *     }
- *   }
- *   pn_data_exit(data);
- *   ...
- * @endcode
- *
- * @param data a pn_data_t object
- * @return the number of elements of an array node
- */
-PN_EXTERN size_t pn_data_get_array(pn_data_t *data);
-
-/**
- * Returns true if the current node points to a described array.
- *
- * @param data a pn_data_t object
- * @return true if the current node points to a described array
- */
-PN_EXTERN bool pn_data_is_array_described(pn_data_t *data);
-
-/**
- * Return the array type if the current node points to an array,
- * PN_INVALID otherwise.
- *
- * @param data a pn_data_t object
- * @return the element type of an array node
- */
-PN_EXTERN pn_type_t pn_data_get_array_type(pn_data_t *data);
-
-/**
- * Checks if the current node is a described value. The descriptor and
- * value may be accessed by entering the described value node.
- *
- * @code
- *   ...
- *   // read a symbolically described string
- *   if (pn_data_is_described(data)) {
- *     pn_data_enter(data);
- *     pn_data_next(data);
- *     assert(pn_data_type(data) == PN_SYMBOL);
- *     pn_bytes_t symbol = pn_data_get_symbol(data);
- *     pn_data_next(data);
- *     assert(pn_data_type(data) == PN_STRING);
- *     pn_bytes_t utf8 = pn_data_get_string(data);
- *     pn_data_exit(data);
- *   }
- *   ...
- * @endcode
- *
- * @param data a pn_data_t object
- * @return true if the current node is a described type
- */
-PN_EXTERN bool pn_data_is_described(pn_data_t *data);
-
-/**
- * Checks if the current node is a ::PN_NULL.
- *
- * @param data a pn_data_t object
- * @return true iff the current node is ::PN_NULL
- */
-PN_EXTERN bool pn_data_is_null(pn_data_t *data);
-
-/**
- * If the current node is a ::PN_BOOL, returns its value.
- *
- * @param data a pn_data_t object
- */
-PN_EXTERN bool pn_data_get_bool(pn_data_t *data);
-
-/**
- * If the current node is a ::PN_UBYTE, return its value, otherwise
- * return 0.
- *
- * @param data a pn_data_t object
- */
-PN_EXTERN uint8_t pn_data_get_ubyte(pn_data_t *data);
-
-/**
- * If the current node is a signed byte, returns its value, returns 0
- * otherwise.
- *
- * @param data a pn_data_t object
- */
-PN_EXTERN int8_t pn_data_get_byte(pn_data_t *data);
-
-/**
- * If the current node is an unsigned short, returns its value,
- * returns 0 otherwise.
- *
- * @param data a pn_data_t object
- */
-PN_EXTERN uint16_t pn_data_get_ushort(pn_data_t *data);
-
-/**
- * If the current node is a signed short, returns its value, returns 0
- * otherwise.
- *
- * @param data a pn_data_t object
- */
-PN_EXTERN int16_t pn_data_get_short(pn_data_t *data);
-
-/**
- * If the current node is an unsigned int, returns its value, returns
- * 0 otherwise.
- *
- * @param data a pn_data_t object
- */
-PN_EXTERN uint32_t pn_data_get_uint(pn_data_t *data);
-
-/**
- * If the current node is a signed int, returns its value, returns 0
- * otherwise.
- *
- * @param data a pn_data_t object
- */
-PN_EXTERN int32_t pn_data_get_int(pn_data_t *data);
-
-/**
- * If the current node is a char, returns its value, returns 0
- * otherwise.
- *
- * @param data a pn_data_t object
- */
-PN_EXTERN pn_char_t pn_data_get_char(pn_data_t *data);
-
-/**
- * If the current node is an unsigned long, returns its value, returns
- * 0 otherwise.
- *
- * @param data a pn_data_t object
- */
-PN_EXTERN uint64_t pn_data_get_ulong(pn_data_t *data);
-
-/**
- * If the current node is an signed long, returns its value, returns 0
- * otherwise.
- *
- * @param data a pn_data_t object
- */
-PN_EXTERN int64_t pn_data_get_long(pn_data_t *data);
-
-/**
- * If the current node is a timestamp, returns its value, returns 0
- * otherwise.
- *
- * @param data a pn_data_t object
- */
-PN_EXTERN pn_timestamp_t pn_data_get_timestamp(pn_data_t *data);
-
-/**
- * If the current node is a float, returns its value, raises 0
- * otherwise.
- *
- * @param data a pn_data_t object
- */
-PN_EXTERN float pn_data_get_float(pn_data_t *data);
-
-/**
- * If the current node is a double, returns its value, returns 0
- * otherwise.
- *
- * @param data a pn_data_t object
- */
-PN_EXTERN double pn_data_get_double(pn_data_t *data);
-
-/**
- * If the current node is a decimal32, returns its value, returns 0
- * otherwise.
- *
- * @param data a pn_data_t object
- */
-PN_EXTERN pn_decimal32_t pn_data_get_decimal32(pn_data_t *data);
-
-/**
- * If the current node is a decimal64, returns its value, returns 0
- * otherwise.
- *
- * @param data a pn_data_t object
- */
-PN_EXTERN pn_decimal64_t pn_data_get_decimal64(pn_data_t *data);
-
-/**
- * If the current node is a decimal128, returns its value, returns 0
- * otherwise.
- *
- * @param data a pn_data_t object
- */
-PN_EXTERN pn_decimal128_t pn_data_get_decimal128(pn_data_t *data);
-
-/**
- * If the current node is a UUID, returns its value, returns None
- * otherwise.
- *
- * @param data a pn_data_t object
- * @return a uuid value
- */
-PN_EXTERN pn_uuid_t pn_data_get_uuid(pn_data_t *data);
-
-/**
- * If the current node is binary, returns its value, returns ""
- * otherwise. The pn_bytes_t returned will point to memory held inside
- * the pn_data_t. When the pn_data_t is cleared or freed, this memory
- * will be reclaimed.
- *
- * @param data a pn_data_t object
- */
-PN_EXTERN pn_bytes_t pn_data_get_binary(pn_data_t *data);
-
-/**
- * If the current node is a string, returns its value, returns ""
- * otherwise. The pn_bytes_t returned will point to memory held inside
- * the pn_data_t. When the pn_data_t is cleared or freed, this memory
- * will be reclaimed.
- *
- * @param data a pn_data_t object
- * @return a pn_bytes_t pointing to utf8
- */
-PN_EXTERN pn_bytes_t pn_data_get_string(pn_data_t *data);
-
-/**
- * If the current node is a symbol, returns its value, returns ""
- * otherwise. The pn_bytes_t returned will point to memory held inside
- * the pn_data_t. When the pn_data_t is cleared or freed, this memory
- * will be reclaimed.
- *
- * @param data a pn_data_t object
- * @return a pn_bytes_t pointing to ascii
- */
-PN_EXTERN pn_bytes_t pn_data_get_symbol(pn_data_t *data);
-
-/**
- * If the current node is a symbol, string, or binary, return the
- * bytes representing its value. The pn_bytes_t returned will point to
- * memory held inside the pn_data_t. When the pn_data_t is cleared or
- * freed, this memory will be reclaimed.
- *
- * @param data a pn_data_t object
- * @return a pn_bytes_t pointing to the node's value
- */
-PN_EXTERN pn_bytes_t pn_data_get_bytes(pn_data_t *data);
-
-/**
- * If the current node is a scalar value, return it as a pn_atom_t.
- *
- * @param data a pn_data_t object
- * @return the value of the current node as pn_atom_t
- */
-PN_EXTERN pn_atom_t pn_data_get_atom(pn_data_t *data);
-
-/**
- * Copy the contents of another pn_data_t object. Any values in the
- * data object will be lost.
- *
- * @param data a pn_data_t object
- * @param src the sourc pn_data_t to copy from
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_copy(pn_data_t *data, pn_data_t *src);
-
-/**
- * Append the contents of another pn_data_t object.
- *
- * @param data a pn_data_t object
- * @param src the sourc pn_data_t to append from
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_append(pn_data_t *data, pn_data_t *src);
-
-/**
- * Append up to _n_ values from the contents of another pn_data_t
- * object.
- *
- * @param data a pn_data_t object
- * @param src the sourc pn_data_t to append from
- * @param limit the maximum number of values to append
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_data_appendn(pn_data_t *data, pn_data_t *src, int limit);
-
-/**
- * Modify a pn_data_t object to behave as if the current node is the
- * root node of the tree. This impacts the behaviour of
- * ::pn_data_rewind(), ::pn_data_next(), ::pn_data_prev(), and
- * anything else that depends on the navigational state of the
- * pn_data_t object. Use ::pn_data_widen() to reverse the effect of
- * this operation.
- *
- * @param data a pn_data_t object
- */
-PN_EXTERN void pn_data_narrow(pn_data_t *data);
-
-/**
- * Reverse the effect of ::pn_data_narrow().
- *
- * @param data a pn_data_t object
- */
-PN_EXTERN void pn_data_widen(pn_data_t *data);
-
-/**
- * Returns a handle for the current navigational state of a pn_data_t
- * so that it can be later restored using ::pn_data_restore().
- *
- * @param data a pn_data_t object
- * @return a handle for the current navigational state
- */
-PN_EXTERN pn_handle_t pn_data_point(pn_data_t *data);
-
-/**
- * Restores a prior navigational state that was saved using
- * ::pn_data_point(). If the data object has been modified in such a
- * way that the prior navigational state cannot be restored, then this
- * will return false and the navigational state will remain unchanged,
- * otherwise it will return true.
- *
- * @param data a pn_data_t object
- * @param point a handle referencing the saved navigational state
- * @return true iff the prior navigational state was restored
- */
-PN_EXTERN bool pn_data_restore(pn_data_t *data, pn_handle_t point);
-
-/**
- * Dumps a debug representation of the internal state of the pn_data_t
- * object that includes its navigational state to stdout for debugging
- * purposes.
- *
- * @param data a pn_data_t object that is behaving in a confusing way
- */
-PN_EXTERN void pn_data_dump(pn_data_t *data);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* codec.h */
diff --git a/proton-c/include/proton/condition.h b/proton-c/include/proton/condition.h
deleted file mode 100644
index 631a678..0000000
--- a/proton-c/include/proton/condition.h
+++ /dev/null
@@ -1,195 +0,0 @@
-#ifndef PROTON_CONDITION_H
-#define PROTON_CONDITION_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/codec.h>
-#include <proton/type_compat.h>
-#include <stddef.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- *
- * @copybrief condition
- *
- * @addtogroup condition
- * @{
- */
-
-/**
- * An AMQP Condition object. Conditions hold exceptional information
- * pertaining to the closing of an AMQP endpoint such as a Connection,
- * Session, or Link. Conditions also hold similar information
- * pertaining to deliveries that have reached terminal states.
- * Connections, Sessions, Links, and Deliveries may all have local and
- * remote conditions associated with them.
- *
- * The local condition may be modified by the local endpoint to signal
- * a particular condition to the remote peer. The remote condition may
- * be examined by the local endpoint to detect whatever condition the
- * remote peer may be signaling. Although often conditions are used to
- * indicate errors, not all conditions are errors per/se, e.g.
- * conditions may be used to redirect a connection from one host to
- * another.
- *
- * Every condition has a short symbolic name, a longer description,
- * and an additional info map associated with it. The name identifies
- * the formally defined condition, and the map contains additional
- * information relevant to the identified condition.
- */
-typedef struct pn_condition_t pn_condition_t;
-
-/**
- * Returns true if the condition object is holding some information,
- * i.e. if the name is set to some non NULL value. Returns false
- * otherwise.
- *
- * @param[in] condition the condition object to test
- * @return true iff some condition information is set
- */
-PN_EXTERN bool pn_condition_is_set(pn_condition_t *condition);
-
-/**
- * Clears the condition object of any exceptional information. After
- * calling ::pn_condition_clear(), ::pn_condition_is_set() is
- * guaranteed to return false and ::pn_condition_get_name() as well as
- * ::pn_condition_get_description() will return NULL. The ::pn_data_t
- * returned by ::pn_condition_info() will still be valid, but will
- * have been cleared as well (See ::pn_data_clear()).
- *
- * @param[in] condition the condition object to clear
- */
-PN_EXTERN void pn_condition_clear(pn_condition_t *condition);
-
-/**
- * Returns the name associated with the exceptional condition, or NULL
- * if there is no conditional information set.
- *
- * @param[in] condition the condition object
- * @return a pointer to the name, or NULL
- */
-PN_EXTERN const char *pn_condition_get_name(pn_condition_t *condition);
-
-/**
- * Sets the name associated with the exceptional condition.
- *
- * @param[in] condition the condition object
- * @param[in] name the desired name
- * @return an error code or 0 on success
- */
-PN_EXTERN int pn_condition_set_name(pn_condition_t *condition, const char *name);
-
-/**
- * Gets the description associated with the exceptional condition.
- *
- * @param[in] condition the condition object
- * @return a pointer to the description, or NULL
- */
-PN_EXTERN const char *pn_condition_get_description(pn_condition_t *condition);
-
-/**
- * Sets the description associated with the exceptional condition.
- *
- * @param[in] condition the condition object
- * @param[in] description the desired description
- * @return an error code or 0 on success
- */
-PN_EXTERN int pn_condition_set_description(pn_condition_t *condition, const char *description);
-
-/**
- * Returns a data object that holds the additional information
- * associated with the condition. The data object may be used both to
- * access and to modify the additional information associated with the
- * condition.
- *
- * @param[in] condition the condition object
- * @return a data object holding the additional information for the condition
- */
-PN_EXTERN pn_data_t *pn_condition_info(pn_condition_t *condition);
-
-/**
- * Set the name and printf-style formatted description.
- */
-PN_EXTERN int pn_condition_vformat(pn_condition_t *, const char *name, const char *fmt, va_list ap);
-
-/**
- * Set the name and printf-style formatted description.
- */
-PN_EXTERN int pn_condition_format(pn_condition_t *, const char *name, const char *fmt, ...);
-
-/**
- * Returns true if the condition is a redirect.
- *
- * @param[in] condition the condition object
- * @return true if the condition is a redirect, false otherwise
- */
-PN_EXTERN bool pn_condition_is_redirect(pn_condition_t *condition);
-
-/**
- * Retrieves the redirect host from the additional information
- * associated with the condition. If the condition is not a redirect,
- * this will return NULL.
- *
- * @param[in] condition the condition object
- * @return the redirect host or NULL
- */
-PN_EXTERN const char *pn_condition_redirect_host(pn_condition_t *condition);
-
-/**
- * Retrieves the redirect port from the additional information
- * associated with the condition. If the condition is not a redirect,
- * this will return an error code.
- *
- * @param[in] condition the condition object
- * @return the redirect port or an error code
- */
-PN_EXTERN int pn_condition_redirect_port(pn_condition_t *condition);
-
-/**
- * Copy the src condition to the dst condition.
- */
-PN_EXTERN int pn_condition_copy(pn_condition_t *dest, pn_condition_t *src);
-
-/**
- * Create a condition object.
- */
-PN_EXTERN pn_condition_t *pn_condition(void);
-
-/**
- * Free a condition object.
- */  
-PN_EXTERN void pn_condition_free(pn_condition_t *);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* condition.h */
diff --git a/proton-c/include/proton/connection.h b/proton-c/include/proton/connection.h
deleted file mode 100644
index 748cd13..0000000
--- a/proton-c/include/proton/connection.h
+++ /dev/null
@@ -1,505 +0,0 @@
-#ifndef PROTON_CONNECTION_H
-#define PROTON_CONNECTION_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/codec.h>
-#include <proton/condition.h>
-#include <proton/error.h>
-#include <proton/type_compat.h>
-#include <proton/types.h>
-
-#include <stddef.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- *
- * @copybrief connection
- *
- * @addtogroup connection
- * @{
- */
-
-/**
- * The local @link pn_state_t endpoint state @endlink is uninitialized.
- */
-#define PN_LOCAL_UNINIT (1)
-
-/**
- * The local @link pn_state_t endpoint state @endlink is active.
- */
-
-#define PN_LOCAL_ACTIVE (2)
-
-/**
- * The local @link pn_state_t endpoint state @endlink is closed.
- */
-#define PN_LOCAL_CLOSED (4)
-
-/**
- * The remote @link pn_state_t endpoint state @endlink is uninitialized.
- */
-#define PN_REMOTE_UNINIT (8)
-
-/**
- * The remote @link pn_state_t endpoint state @endlink is active.
- */
-#define PN_REMOTE_ACTIVE (16)
-
-/**
- * The remote @link pn_state_t endpoint state @endlink is closed.
- */
-#define PN_REMOTE_CLOSED (32)
-
-/**
- * A mask for values of ::pn_state_t that preserves only the local
- * bits of an endpoint's state.
- */
-#define PN_LOCAL_MASK (PN_LOCAL_UNINIT | PN_LOCAL_ACTIVE | PN_LOCAL_CLOSED)
-
-/**
- * A mask for values of ::pn_state_t that preserves only the remote
- * bits of an endpoint's state.
- */
-#define PN_REMOTE_MASK (PN_REMOTE_UNINIT | PN_REMOTE_ACTIVE | PN_REMOTE_CLOSED)
-
-PN_EXTERN pn_connection_t *pn_connection(void);
-
-/**
- * Factory to construct a new Connection.
- *
- * @return pointer to a new connection object.
- */
-PN_EXTERN pn_connection_t *pn_connection(void);
-
-/**
- * Free a connection object.
- *
- * When a connection object is freed, all ::pn_session_t, ::pn_link_t,
- * and ::pn_delivery_t objects associated with the connection are also
- * freed.
- *
- * @param[in] connection the connection object to free (or NULL)
- */
-PN_EXTERN void pn_connection_free(pn_connection_t *connection);
-
-/**
- * Release a connection object.
- *
- * When a connection object is released, all ::pn_session_t and
- * ::pn_link_t, objects associated with the connection are also
- * released and all ::pn_delivery_t objects are settled.
- *
- * @param[in] connection the connection object to be released
- */
-PN_EXTERN void pn_connection_release(pn_connection_t *connection);
-
-/**
- * @deprecated
- *
- * Get additional error information associated with the connection.
- *
- * Whenever a connection operation fails (i.e. returns an error code),
- * additional error details can be obtained using this function. The
- * error object that is returned may also be used to clear the error
- * condition.
- *
- * The pointer returned by this operation is valid until the
- * connection object is freed.
- *
- * @param[in] connection the connection object
- * @return the connection's error object
- */
-PN_EXTERN pn_error_t *pn_connection_error(pn_connection_t *connection);
-
-/**
- * Associate a connection object with an event collector.
- *
- * By associating a connection object with an event collector, key
- * changes in endpoint state are reported to the collector via
- * ::pn_event_t objects that can be inspected and processed. See
- * ::pn_event_t for more details on the kinds of events.
- *
- * Note that by registering a collector, the user is requesting that
- * an indefinite number of events be queued up on his behalf. This
- * means that unless the application eventually processes these
- * events, the storage requirements for keeping them will grow without
- * bound. In other words, don't register a collector with a connection
- * if you never intend to process any of the events.
- *
- * @param[in] connection the connection object
- * @param[in] collector the event collector
- */
-PN_EXTERN void pn_connection_collect(pn_connection_t *connection, pn_collector_t *collector);
-
-/**
- * Get the collector set with pn_connection_collect()
- * @return NULL if pn_connection_collect() has not been called.
-*/
-PN_EXTERN pn_collector_t* pn_connection_collector(pn_connection_t *connection);
-
-/**
- * @deprecated
- *
- * Get the application context that is associated with a connection
- * object.
- *
- * The application context for a connection may be set using
- * ::pn_connection_set_context.
- *
- * @param[in] connection the connection whose context is to be returned.
- * @return the application context for the connection object
- */
-PN_EXTERN void *pn_connection_get_context(pn_connection_t *connection);
-
-/**
- * @deprecated
- *
- * Set a new application context for a connection object.
- *
- * The application context for a connection object may be retrieved
- * using ::pn_connection_get_context.
- *
- * @param[in] connection the connection object
- * @param[in] context the application context
- */
-PN_EXTERN void pn_connection_set_context(pn_connection_t *connection, void *context);
-
-/**
- * Get the attachments that are associated with a connection object.
- *
- * @param[in] connection the connection whose attachments are to be returned.
- * @return the attachments for the connection object
- */
-PN_EXTERN pn_record_t *pn_connection_attachments(pn_connection_t *connection);
-
-/**
- * Get the endpoint state flags for a connection.
- *
- * @param[in] connection the connection
- * @return the connection's state flags
- */
-PN_EXTERN pn_state_t pn_connection_state(pn_connection_t *connection);
-
-/**
- * Open a connection.
- *
- * Once this operation has completed, the PN_LOCAL_ACTIVE state flag
- * will be set.
- *
- * @param[in] connection the connection object
- */
-PN_EXTERN void pn_connection_open(pn_connection_t *connection);
-
-/**
- * Close a connection.
- *
- * Once this operation has completed, the PN_LOCAL_CLOSED state flag
- * will be set. This may be called without calling
- * ::pn_connection_open, in this case it is equivalent to calling
- * ::pn_connection_open followed by ::pn_connection_close.
- *
- * @param[in] connection the connection object
- */
-PN_EXTERN void pn_connection_close(pn_connection_t *connection);
-
-/**
- * Reset a connection object back to the uninitialized state.
- *
- * Note that this does *not* remove any contained ::pn_session_t,
- * ::pn_link_t, and ::pn_delivery_t objects.
- *
- * @param[in] connection the connection object
- */
-PN_EXTERN void pn_connection_reset(pn_connection_t *connection);
-
-/**
- * Get the local condition associated with the connection endpoint.
- *
- * The ::pn_condition_t object retrieved may be modified prior to
- * closing the connection in order to indicate a particular condition
- * exists when the connection closes. This is normally used to
- * communicate error conditions to the remote peer, however it may
- * also be used in non error cases such as redirects. See
- * ::pn_condition_t for more details.
- *
- * The pointer returned by this operation is valid until the
- * connection object is freed.
- *
- * @param[in] connection the connection object
- * @return the connection's local condition object
- */
-PN_EXTERN pn_condition_t *pn_connection_condition(pn_connection_t *connection);
-
-/**
- * Get the remote condition associated with the connection endpoint.
- *
- * The ::pn_condition_t object retrieved may be examined in order to
- * determine whether the remote peer was indicating some sort of
- * exceptional condition when the remote connection endpoint was
- * closed. The ::pn_condition_t object returned may not be modified.
- *
- * The pointer returned by this operation is valid until the
- * connection object is freed.
- *
- * @param[in] connection the connection object
- * @return the connection's remote condition object
- */
-PN_EXTERN pn_condition_t *pn_connection_remote_condition(pn_connection_t *connection);
-
-/**
- * Get the AMQP Container name advertised by a connection object.
- *
- * The pointer returned by this operation is valid until
- * ::pn_connection_set_container is called, or until the connection
- * object is freed, whichever happens sooner.
- *
- * @param[in] connection the connection object
- * @return a pointer to the container name
- */
-PN_EXTERN const char *pn_connection_get_container(pn_connection_t *connection);
-
-/**
- * Set the AMQP Container name advertised by a connection object.
- *
- * @param[in] connection the connection object
- * @param[in] container the container name
- */
-PN_EXTERN void pn_connection_set_container(pn_connection_t *connection, const char *container);
-
-/**
- * Set the authentication username for a client connection
- *
- * It is necessary to set the username and password before binding the connection
- * to a trasnport and it isn't allowed to change them after the binding.
- *
- * If not set then no authentication will be negotiated unless the client
- * sasl layer is explicitly created (this would be for sometting like Kerberos
- * where the credentials are implicit in the environment, or to explicitly use
- * the ANONYMOUS SASL mechanism)
- *
- * @param[in] connection the connection
- * @param[in] user the username
- */
-PN_EXTERN void pn_connection_set_user(pn_connection_t *connection, const char *user);
-
-/**
- * Set the authentication password for a client connection
- *
- * It is necessary to set the username and password before binding the connection
- * to a trasnport and it isn't allowed to change them after the binding.
- *
- * Note that the password is write only and has no accessor as the underlying
- * implementation should be zeroing the password after use to avoid the password
- * being present in memory longer than necessary
- *
- * @param[in] connection the connection
- * @param[in] password the password corresponding to the username - this will be copied and zeroed out after use
- */
-PN_EXTERN void pn_connection_set_password(pn_connection_t *connection, const char *password);
-
-/**
- * Get the authentication username for a client connection
- *
- * @param[in] connection the connection
- * @return the username passed into the connection
- */
-PN_EXTERN const char *pn_connection_get_user(pn_connection_t *connection);
-
-/**
- * Get the value of the AMQP Hostname used by a connection object.
- *
- * The pointer returned by this operation is valid until
- * ::pn_connection_set_hostname is called, or until the connection
- * object is freed, whichever happens sooner.
- *
- * @param[in] connection the connection object
- * @return a pointer to the hostname
- */
-PN_EXTERN const char *pn_connection_get_hostname(pn_connection_t *connection);
-
-/**
- * Set the name of the virtual host (either fully qualified or relative) to
- * which this connection is connecting to.  This information may be used by the
- * remote peer to determine the correct back-end service to connect the client
- * to. This value will be sent in the Open performative, and will be used by
- * SSL and SASL layers to identify the peer.
- *
- * @note Note: the virtual host string is passed verbatim, it is not parsed as
- * a URL or modified in any way. It should not contain numeric IP addresses or
- * port numbers unless that is what you intend to send as the virtual host name
- * @param[in] connection the connection object
- * @param[in] hostname the virtual host name
- */
-PN_EXTERN void pn_connection_set_hostname(pn_connection_t *connection, const char *hostname);
-
-/**
- * Get the AMQP Container name advertised by the remote connection
- * endpoint.
- *
- * This will return NULL until the ::PN_REMOTE_ACTIVE state is
- * reached. See ::pn_state_t for more details on endpoint state.
- *
- * Any non null pointer returned by this operation will be valid until
- * the connection object is unbound from a transport or freed,
- * whichever happens sooner.
- *
- * @param[in] connection the connection object
- * @return a pointer to the remote container name
- */
-PN_EXTERN const char *pn_connection_remote_container(pn_connection_t *connection);
-
-/**
- * Get the AMQP Hostname set by the remote connection endpoint.
- *
- * This will return NULL until the ::PN_REMOTE_ACTIVE state is
- * reached. See ::pn_state_t for more details on endpoint state.
- *
- * Any non null pointer returned by this operation will be valid until
- * the connection object is unbound from a transport or freed,
- * whichever happens sooner.
- *
- * @param[in] connection the connection object
- * @return a pointer to the remote hostname
- */
-PN_EXTERN const char *pn_connection_remote_hostname(pn_connection_t *connection);
-
-/**
- * Access/modify the AMQP offered capabilities data for a connection
- * object.
- *
- * This operation will return a pointer to a ::pn_data_t object that
- * is valid until the connection object is freed. Any data contained
- * by the ::pn_data_t object will be sent as the offered capabilites
- * for the parent connection object. Note that this MUST take the form
- * of an array of symbols to be valid.
- *
- * The ::pn_data_t pointer returned is valid until the connection
- * object is freed.
- *
- * @param[in] connection the connection object
- * @return a pointer to a pn_data_t representing the offered capabilities
- */
-PN_EXTERN pn_data_t *pn_connection_offered_capabilities(pn_connection_t *connection);
-
-/**
- * Access/modify the AMQP desired capabilities data for a connection
- * object.
- *
- * This operation will return a pointer to a ::pn_data_t object that
- * is valid until the connection object is freed. Any data contained
- * by the ::pn_data_t object will be sent as the desired capabilites
- * for the parent connection object. Note that this MUST take the form
- * of an array of symbols to be valid.
- *
- * The ::pn_data_t pointer returned is valid until the connection
- * object is freed.
- *
- * @param[in] connection the connection object
- * @return a pointer to a pn_data_t representing the desired capabilities
- */
-PN_EXTERN pn_data_t *pn_connection_desired_capabilities(pn_connection_t *connection);
-
-/**
- * Access/modify the AMQP properties data for a connection object.
- *
- * This operation will return a pointer to a ::pn_data_t object that
- * is valid until the connection object is freed. Any data contained
- * by the ::pn_data_t object will be sent as the AMQP properties for
- * the parent connection object. Note that this MUST take the form of
- * a symbol keyed map to be valid.
- *
- * The ::pn_data_t pointer returned is valid until the connection
- * object is freed.
- *
- * @param[in] connection the connection object
- * @return a pointer to a pn_data_t representing the connection properties
- */
-PN_EXTERN pn_data_t *pn_connection_properties(pn_connection_t *connection);
-
-/**
- * Access the AMQP offered capabilites supplied by the remote
- * connection endpoint.
- *
- * This operation will return a pointer to a ::pn_data_t object that
- * is valid until the connection object is freed. This data object
- * will be empty until the remote connection is opened as indicated by
- * the ::PN_REMOTE_ACTIVE flag.
- *
- * @param[in] connection the connection object
- * @return the remote offered capabilities
- */
-PN_EXTERN pn_data_t *pn_connection_remote_offered_capabilities(pn_connection_t *connection);
-
-/**
- * Access the AMQP desired capabilites supplied by the remote
- * connection endpoint.
- *
- * This operation will return a pointer to a ::pn_data_t object that
- * is valid until the connection object is freed. This data object
- * will be empty until the remote connection is opened as indicated by
- * the ::PN_REMOTE_ACTIVE flag.
- *
- * @param[in] connection the connection object
- * @return the remote desired capabilities
- */
-PN_EXTERN pn_data_t *pn_connection_remote_desired_capabilities(pn_connection_t *connection);
-
-/**
- * Access the AMQP connection properties supplied by the remote
- * connection endpoint.
- *
- * This operation will return a pointer to a ::pn_data_t object that
- * is valid until the connection object is freed. This data object
- * will be empty until the remote connection is opened as indicated by
- * the ::PN_REMOTE_ACTIVE flag.
- *
- * @param[in] connection the connection object
- * @return the remote connection properties
- */
-PN_EXTERN pn_data_t *pn_connection_remote_properties(pn_connection_t *connection);
-
-/**
- * Get the transport bound to a connection object.
- *
- * If the connection is unbound, then this operation will return NULL.
- *
- * @param[in] connection the connection object
- * @return the transport bound to a connection, or NULL if the
- * connection is unbound
- */
-PN_EXTERN pn_transport_t *pn_connection_transport(pn_connection_t *connection);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* connection.h */
diff --git a/proton-c/include/proton/connection_driver.h b/proton-c/include/proton/connection_driver.h
deleted file mode 100644
index b34376d..0000000
--- a/proton-c/include/proton/connection_driver.h
+++ /dev/null
@@ -1,251 +0,0 @@
-#ifndef PROTON_CONNECTION_DRIVER_H
-#define PROTON_CONNECTION_DRIVER_H 1
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * @file
- *
- * @copybrief connection_driver
- *
- * Associate a @ref connection and @ref transport with AMQP byte
- * streams from any source.
- *
- * - process AMQP-encoded bytes from some input byte stream
- * - generate ::pn_event_t events for your application to handle
- * - encode resulting AMQP output bytes for some output byte stream
- *
- * The pn_connection_driver_() functions provide a simplified API and
- * extra logic to use ::pn_connection_t and ::pn_transport_t as a
- * unit.  You can also access them directly for features that do not
- * have pn_connection_driver_() functions.
- *
- * The driver buffers events and data, you should run it until
- * pn_connection_driver_finished() is true, to ensure all reading,
- * writing and event handling (including ERROR and FINAL events) is
- * finished.
- *
- * ## Error handling
- *
- * The pn_connection_driver_*() functions do not return an error
- * code. IO errors set the transport condition and are returned as a
- * PN_TRANSPORT_ERROR. The integration code can set errors using
- * pn_connection_driver_errorf().
- *
- * ## IO patterns
- *
- * This API supports asynchronous, proactive, non-blocking and
- * reactive IO. An integration does not have to follow the
- * dispatch-read-write sequence above, but note that you should handle
- * all available events before calling
- * pn_connection_driver_read_buffer() and check that `size` is
- * non-zero before starting a blocking or asynchronous read call. A
- * `read` started while there are unprocessed CLOSE events in the
- * buffer may never complete.
- *
- * AMQP is a full-duplex, asynchronous protocol. The "read" and
- * "write" sides of an AMQP connection can close separately.
- *
- * ## Thread safety
- *
- * The @ref connection_driver types are not thread safe, but each
- * connection and its associated types forms an independent
- * unit. Different connections can be processed concurrently by
- * different threads.
- *
- * @addtogroup connection_driver
- * @{
- */
-
-#include <proton/import_export.h>
-#include <proton/event.h>
-#include <proton/types.h>
-
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * The elements needed to drive AMQP IO and events.
- */
-typedef struct pn_connection_driver_t {
-  pn_connection_t *connection;
-  pn_transport_t *transport;
-  pn_event_batch_t batch;
-} pn_connection_driver_t;
-
-/**
- * Set connection and transport to the provided values, or create a new
- * @ref pn_connection_t or @ref pn_transport_t if either is NULL.
- * The provided values belong to the connection driver and will be freed by
- * pn_connection_driver_destroy()
- *
- * The transport is bound automatically after the PN_CONNECTION_INIT has been is
- * handled by the application. It can be bound earlier with
- * pn_connection_driver_bind().
- *
- * The following functions must be called before the transport is
- * bound to have effect: pn_connection_set_username(), pn_connection_set_password(),
- * pn_transport_set_server()
- *
- * @return PN_OUT_OF_MEMORY if any allocation fails.
- */
-PN_EXTERN int pn_connection_driver_init(pn_connection_driver_t*, pn_connection_t*, pn_transport_t*);
-
-/** Force binding of the transport.
- * This happens automatically after the PN_CONNECTION_INIT is processed.
- *
- * @return PN_STATE_ERR if the transport is already bound.
- */
-PN_EXTERN int pn_connection_driver_bind(pn_connection_driver_t *d);
-
-/**
- * Unbind, release and free the connection and transport. Set all pointers to
- * NULL.  Does not free the @ref pn_connection_driver_t struct itself.
- */
-PN_EXTERN void pn_connection_driver_destroy(pn_connection_driver_t *);
-
-/**
- * Get the read buffer.
- *
- * Copy data from your input byte source to buf.start, up to buf.size.
- * Call pn_connection_driver_read_done() when reading is complete.
- *
- * buf.size==0 means reading is not possible: no buffer space or the read side is closed.
- */
-PN_EXTERN pn_rwbytes_t pn_connection_driver_read_buffer(pn_connection_driver_t *);
-
-/**
- * Process the first n bytes of data in pn_connection_driver_read_buffer() and
- * reclaim the buffer space.
- */
-PN_EXTERN void pn_connection_driver_read_done(pn_connection_driver_t *, size_t n);
-
-/**
- * Close the read side. Call when the IO can no longer be read.
- */
-PN_EXTERN void pn_connection_driver_read_close(pn_connection_driver_t *);
-
-/**
- * True if read side is closed.
- */
-PN_EXTERN bool pn_connection_driver_read_closed(pn_connection_driver_t *);
-
-/**
- * Get the write buffer.
- *
- * Write data from buf.start to your IO destination, up to a max of buf.size.
- * Call pn_connection_driver_write_done() when writing is complete.
- *
- * buf.size==0 means there is nothing to write.
- */
- PN_EXTERN pn_bytes_t pn_connection_driver_write_buffer(pn_connection_driver_t *);
-
-/**
- * Call when the first n bytes of pn_connection_driver_write_buffer() have been
- * written to IO. Reclaims the buffer space and reset the write buffer.
- */
-PN_EXTERN void pn_connection_driver_write_done(pn_connection_driver_t *, size_t n);
-
-/**
- * Close the write side. Call when IO can no longer be written to.
- */
-PN_EXTERN void pn_connection_driver_write_close(pn_connection_driver_t *);
-
-/**
- * True if write side is closed.
- */
-PN_EXTERN bool pn_connection_driver_write_closed(pn_connection_driver_t *);
-
-/**
- * Close both sides side.
- */
-PN_EXTERN void pn_connection_driver_close(pn_connection_driver_t * c);
-
-/**
- * Get the next event to handle.
- *
- * @return pointer is valid till the next call of
- * pn_connection_driver_next(). NULL if there are no more events available now,
- * reading/writing may produce more.
- */
-PN_EXTERN pn_event_t* pn_connection_driver_next_event(pn_connection_driver_t *);
-
-/**
- * True if  pn_connection_driver_next_event() will return a non-NULL event.
- */
-PN_EXTERN bool pn_connection_driver_has_event(pn_connection_driver_t *);
-
-/**
- * Return true if the the driver is closed for reading and writing and there are
- * no more events.
- *
- * Call pn_connection_driver_free() to free all related memory.
- */
-PN_EXTERN bool pn_connection_driver_finished(pn_connection_driver_t *);
-
-/**
- * Set IO error information.
- *
- * The name and formatted description are set on the transport condition, and
- * returned as a PN_TRANSPORT_ERROR event from pn_connection_driver_next_event().
- *
- * You must call this *before* pn_connection_driver_read_close() or
- * pn_connection_driver_write_close() to ensure the error is processed.
- */
-PN_EXTERN void pn_connection_driver_errorf(pn_connection_driver_t *d, const char *name, const char *fmt, ...);
-
-/**
- * Set IO error information via a va_list, see pn_connection_driver_errorf()
- */
-PN_EXTERN void pn_connection_driver_verrorf(pn_connection_driver_t *d, const char *name, const char *fmt, va_list);
-
-/**
- * Log a string message using the connection's transport log.
- */
-PN_EXTERN void pn_connection_driver_log(pn_connection_driver_t *d, const char *msg);
-
-/**
- * Log a printf formatted message using the connection's transport log.
- */
-PN_EXTERN void pn_connection_driver_logf(pn_connection_driver_t *d, char *fmt, ...);
-
-/**
- * Log a printf formatted message using the connection's transport log.
- */
-PN_EXTERN void pn_connection_driver_vlogf(pn_connection_driver_t *d, const char *fmt, va_list ap);
-
-/**
- * If batch is part of a connection_driver, return the connection_driver address,
- * else return NULL
- */
-PN_EXTERN pn_connection_driver_t* pn_event_batch_connection_driver(pn_event_batch_t *batch);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* connection_driver.h */
diff --git a/proton-c/include/proton/cproton.i b/proton-c/include/proton/cproton.i
deleted file mode 100644
index 931437e..0000000
--- a/proton-c/include/proton/cproton.i
+++ /dev/null
@@ -1,1059 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-typedef unsigned int size_t;
-typedef signed int ssize_t;
-typedef unsigned char uint8_t;
-typedef signed char int8_t;
-typedef unsigned short uint16_t;
-typedef signed short int16_t;
-typedef unsigned long int uint32_t;
-typedef long int int32_t;
-typedef unsigned long long int uint64_t;
-typedef long long int int64_t;
-typedef unsigned long int uintptr_t;
-
-/* Parse these interface header files to generate APIs for script languages */
-
-%include "proton/import_export.h"
-
-%ignore _PROTON_VERSION_H;
-%include "proton/version.h"
-
-/* We cannot safely just wrap pn_bytes_t but each language binding must have a typemap for it - presumably to a string type */
-%ignore pn_bytes_t;
-%ignore pn_rwbytes_t;
-
-/* pn_event_batch_t is not used directly by bindings */
-%ignore pn_event_batch_t;
-
-/* There is no need to wrap pn_class_t aa it is an internal implementation detail and cannot be used outside the library */
-%ignore pn_class_t;
-
-/* Ignore C APIs related to pn_atom_t - they can all be achieved with pn_data_t */
-%ignore pn_atom_t;
-%ignore pn_atom_t_u; /* Seem to need this even though its nested in pn_atom_t */
-%ignore pn_data_get_atom;
-%ignore pn_data_put_atom;
-
-%ignore pn_delivery_tag_t;
-%ignore pn_decimal128_t;
-%ignore pn_uuid_t;
-
-%include "proton/types.h"
-%ignore pn_string_vformat;
-%ignore pn_string_vaddf;
-%immutable PN_OBJECT;
-%immutable PN_VOID;
-%immutable PN_WEAKREF;
-/* Treat pn_handle_t like uintptr_t - syntactically it is a C void* but really it's just an int */
-%apply uintptr_t { pn_handle_t };
-%include "proton/object.h"
-
-%ignore pn_error_format;
-%ignore pn_error_vformat;
-%ignore pn_condition_format;
-%ignore pn_condition_vformat;
-
-/* checks that ensure only allowed values are supplied or returned */
-%aggregate_check(int, check_error,
-                 PN_EOS, PN_ERR, PN_OVERFLOW, PN_UNDERFLOW,
-                 PN_STATE_ERR, PN_ARG_ERR, PN_TIMEOUT);
-
-%aggregate_check(int, check_state,
-                 PN_LOCAL_UNINIT, PN_LOCAL_ACTIVE, PN_LOCAL_CLOSED,
-                 PN_REMOTE_UNINIT, PN_REMOTE_ACTIVE, PN_REMOTE_CLOSED);
-
-%aggregate_check(int, check_disposition, 0,
-                 PN_RECEIVED, PN_ACCEPTED, PN_REJECTED,
-                 PN_RELEASED, PN_MODIFIED);
-
-%aggregate_check(int, check_trace,
-                 PN_TRACE_OFF, PN_TRACE_RAW, PN_TRACE_FRM, PN_TRACE_DRV);
-
-%aggregate_check(int, check_sasl_outcome,
-                 PN_SASL_NONE, PN_SASL_OK, PN_SASL_AUTH,
-                 PN_SASL_SYS, PN_SASL_PERM, PN_SASL_TEMP);
-
-
-%contract pn_code(int code)
-{
- require:
-  check_error(code);
-}
-
-%contract pn_error()
-{
- ensure:
-  pn_error != NULL;
-}
-
-%contract pn_error_free(pn_error_t *error)
-{
- require:
-  error != NULL;
-}
-
-%contract pn_error_clear(pn_error_t *error)
-{
- require:
-  error != NULL;
-}
-
-%contract pn_error_set(pn_error_t *error, int code, const char *text)
-{
- require:
-  error != NULL;
-}
-
-%contract pn_error_vformat(pn_error_t *error, int code, const char *fmt, va_list ap)
-{
- require:
-  error != NULL;
-}
-
-%contract pn_error_format(pn_error_t *error, int code, const char *fmt, ...)
-{
- require:
-  error != NULL;
-}
-
-%contract pn_error_code(pn_error_t *error)
-{
- require:
-  error != NULL;
-}
-
-%contract pn_error_text(pn_error_t *error)
-{
- require:
-  error != NULL;
-}
-
-%include "proton/error.h"
-
-%contract pn_connection(void)
-{
- ensure:
-  pn_connection != NULL;
-}
-
-%contract pn_connection_state(pn_connection_t *connection)
-{
- require:
-  connection != NULL;
-}
-
-%contract pn_connection_error(pn_connection_t *connection)
-{
- require:
-  connection != NULL;
-}
-
-%contract pn_connection_get_container(pn_connection_t *connection)
-{
- require:
-  connection != NULL;
-}
-
-%contract pn_connection_set_container(pn_connection_t *connection, const char *container)
-{
- require:
-  connection != NULL;
-}
-
-%contract pn_connection_get_hostname(pn_connection_t *connection)
-{
- require:
-  connection != NULL;
-}
-
-%contract pn_connection_set_hostname(pn_connection_t *connection, const char *hostname)
-{
- require:
-  connection != NULL;
-}
-
-%contract pn_connection_remote_container(pn_connection_t *connection)
-{
- require:
-  connection != NULL;
-}
-
-%contract pn_connection_remote_hostname(pn_connection_t *connection)
-{
- require:
-  connection != NULL;
-}
-
-%contract pn_work_head(pn_connection_t *connection)
-{
- require:
-  connection != NULL;
-}
-
-%contract pn_work_next(pn_delivery_t *delivery)
-{
- require:
-  delivery != NULL;
-}
-
-%contract pn_session(pn_connection_t *connection)
-{
- require:
-  connection != NULL;
-}
-
-%contract pn_transport(pn_connection_t *connection)
-{
- require:
-  connection != NULL;
- ensure:
-  pn_transport != NULL;
-}
-
-%contract pn_session_head(pn_connection_t *connection, pn_state_t state)
-{
- require:
-  connection != NULL;
-}
-
-%contract pn_session_next(pn_session_t *session, pn_state_t state)
-{
- require:
-  session != NULL;
-}
-
-%contract pn_link_head(pn_connection_t *connection, pn_state_t state)
-{
- require:
-  connection != NULL;
-}
-
-%contract pn_link_next(pn_link_t *link, pn_state_t state)
-{
- require:
-  link != NULL;
-}
-
-%contract pn_connection_open(pn_connection_t *connection)
-{
- require:
-  connection != NULL;
-}
-
-%contract pn_connection_close(pn_connection_t *connection)
-{
- require:
- connection != NULL;
-}
-
-%contract pn_connection_free(pn_connection_t *connection)
-{
- require:
-  connection != NULL;
-}
-
-%contract pn_transport_error(pn_transport_t *transport)
-{
- require:
-  transport != NULL;
-}
-
-%contract pn_transport_input(pn_transport_t *transport, char *bytes, size_t available)
-{
- require:
-  transport != NULL;
-}
-
-%contract pn_transport_output(pn_transport_t *transport, char *bytes, size_t size)
-{
- require:
-  transport != NULL;
-}
-
-#%contract pn_transport_tick(pn_transport_t *transport, pn_timestamp_t now)
-#{
-#  # this method currently always returns 0
-#}
-
-%contract pn_transport_trace(pn_transport_t *transport, pn_trace_t trace)
-{
- require:
-  transport != NULL;
-}
-
-%contract pn_transport_free(pn_transport_t *transport)
-{
- require:
-  transport != NULL;
-}
-
-%contract pn_session_state(pn_session_t *session)
-{
- require:
-  session != NULL;
-}
-
-%contract pn_session_error(pn_session_t *session)
-{
- require:
-  session != NULL;
-}
-
-%contract pn_sender(pn_session_t *session, const char *name)
-{
- require:
-  session != NULL;
- ensure:
-  pn_sender != NULL;
-}
-
-%contract pn_receiver(pn_session_t *session, const char *name)
-{
- require:
-  session != NULL;
- ensure:
-  pn_receiver != NULL;
-}
-
-%contract pn_session_connection(pn_session_t *session)
-{
- require:
-  session != NULL;
- ensure:
-  pn_session_connection != NULL;
-}
-
-%contract pn_session_open(pn_session_t *session)
-{
- require:
-  session != NULL;
-}
-
-%contract pn_session_close(pn_session_t *session)
-{
- require:
-  session != NULL;
-}
-
-%contract pn_session_free(pn_session_t *session)
-{
- require:
-  session != NULL;
-}
-
-%contract pn_link_name(pn_link_t *link)
-{
- require:
-  link != NULL;
-}
-
-%contract pn_link_is_sender(pn_link_t *link)
-{
- require:
-  link != NULL;
-}
-
-%contract pn_link_is_receiver(pn_link_t *link)
-{
- require:
-  link != NULL;
-}
-
-%contract pn_link_state(pn_link_t *link)
-{
- require:
-  link != NULL;
-}
-
-%contract pn_link_error(pn_link_t *link)
-{
- require:
-  link != NULL;
-}
-
-%contract pn_link_session(pn_link_t *link)
-{
- require:
-  link != NULL;
- ensure:
-  pn_link_session != NULL;
-}
-
-%contract pn_link_get_target(pn_link_t *link)
-{
- require:
-  link != NULL;
-}
-
-%contract pn_link_get_source(pn_link_t *link)
-{
- require:
-  link != NULL;
-}
-
-%contract pn_link_set_source(pn_link_t *link, const char *source)
-{
- require:
-  link != NULL;
-}
-
-%contract pn_link_set_target(pn_link_t *link, const char *target)
-{
- require:
-  link != NULL;
-}
-
-%contract pn_link_remote_source(pn_link_t *link)
-{
- require:
-  link != NULL;
-}
-
-%contract pn_link_remote_target(pn_link_t *link)
-{
- require:
-  link != NULL;
-}
-
-%contract pn_delivery(pn_link_t *link, pn_delivery_tag_t tag)
-{
- require:
-  link != NULL;
- ensure:
-  pn_delivery != NULL;
-}
-
-%contract pn_link_current(pn_link_t *link)
-{
- require:
-  link != NULL;
-}
-
-%contract pn_link_advance(pn_link_t *link)
-{
- require:
-  link != NULL;
-}
-
-%contract pn_link_credit(pn_link_t *link)
-{
- require:
-  link != NULL;
-}
-
-%contract pn_link_queued(pn_link_t *link)
-{
- require:
-  link != NULL;
-}
-
-%contract pn_link_unsettled(pn_link_t *link)
-{
- require:
-  link != NULL;
-}
-
-%contract pn_unsettled_head(pn_link_t *link)
-{
- require:
-  link != NULL;
-}
-
-%contract pn_unsettled_next(pn_delivery_t *delivery)
-{
- require:
-  delivery != NULL;
-}
-
-%contract pn_link_open(pn_link_t *sender)
-{
- require:
-  sender != NULL;
-}
-
-%contract pn_link_close(pn_link_t *sender)
-{
- require:
-  sender != NULL;
-}
-
-%contract pn_link_free(pn_link_t *sender)
-{
- require:
-  sender != NULL;
-}
-
-%contract pn_link_send(pn_link_t *sender, const char *bytes, size_t n)
-{
- require:
-  sender != NULL;
-}
-
-%contract pn_link_drained(pn_link_t *sender)
-{
- require:
-  sender != NULL;
-}
-
-%contract pn_link_flow(pn_link_t *receiver, int credit)
-{
- require:
-  receiver != NULL;
-}
-
-%contract pn_link_drain(pn_link_t *receiver, int credit)
-{
- require:
-  receiver != NULL;
-}
-
-%contract pn_link_recv(pn_link_t *receiver, char *bytes, size_t n)
-{
- require:
-  receiver != NULL;
-}
-
-%contract pn_delivery_tag(pn_delivery_t *delivery)
-{
- require:
-  delivery != NULL;
-}
-
-%contract pn_delivery_link(pn_delivery_t *delivery)
-{
- require:
-  delivery != NULL;
-}
-
-%contract pn_delivery_local_state(pn_delivery_t *delivery)
-{
- require:
-  delivery != NULL;
-}
-
-%contract pn_delivery_remote_state(pn_delivery_t *delivery)
-{
- require:
-  delivery != NULL;
-}
-
-%contract pn_delivery_settled(pn_delivery_t *delivery)
-{
- require:
-  delivery != NULL;
-}
-
-%contract pn_delivery_pending(pn_delivery_t *delivery)
-{
- require:
-  delivery != NULL;
-}
-
-%contract pn_delivery_writable(pn_delivery_t *delivery)
-{
- require:
-  delivery != NULL;
-}
-
-%contract pn_delivery_readable(pn_delivery_t *delivery)
-{
- require:
-  delivery != NULL;
-}
-
-%contract pn_delivery_updated(pn_delivery_t *delivery)
-{
- require:
-  delivery != NULL;
-}
-
-%contract pn_delivery_clear(pn_delivery_t *delivery)
-{
- require:
-  delivery != NULL;
-}
-
-%contract pn_delivery_update(pn_delivery_t *delivery, pn_disposition_t disposition)
-{
- require:
-  delivery != NULL;
-  check_disposition(disposition);
-}
-
-%contract pn_delivery_settle(pn_delivery_t *delivery)
-{
- require:
-  delivery != NULL;
-}
-
-%contract pn_delivery_dump(pn_delivery_t *delivery)
-{
- require:
-  delivery != NULL;
-}
-
-%include "proton/condition.h"
-%include "proton/connection.h"
-%include "proton/session.h"
-%include "proton/link.h"
-%include "proton/terminus.h"
-%include "proton/delivery.h"
-%include "proton/disposition.h"
-%ignore pn_transport_vlogf;
-%include "proton/transport.h"
-%include "proton/event.h"
-
-%inline %{
-  /* assume the binding does the incref in the wrapper */
-  pn_event_t* pn_event_copy(pn_event_t *evt) { return evt; }
-%}
-
-%contract pn_event_copy(pn_event_t *evt)
-{
- require:
-  evt != NULL;
-}
-
-%contract pn_message_free(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_clear(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_errno(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_error(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_is_durable(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_set_durable(pn_message_t *msg, bool durable)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_get_priority(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_set_priority(pn_message_t *msg, uint8_t priority)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_get_ttl(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_set_ttl(pn_message_t *msg, pn_millis_t ttl)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_is_first_acquirer(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_set_first_acquirer(pn_message_t *msg, bool first)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_get_delivery_count(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_set_delivery_count(pn_message_t *msg, uint32_t count)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_get_id(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_set_id(pn_message_t *msg, pn_atom_t id)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_get_user_id(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_set_user_id(pn_message_t *msg, pn_bytes_t user_id)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_get_address(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_set_address(pn_message_t *msg, const char *address)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_get_subject(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_set_subject(pn_message_t *msg, const char *subject)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_get_reply_to(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_set_reply_to(pn_message_t *msg, const char *reply_to)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_get_correlation_id(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_set_correlation_id(pn_message_t *msg, pn_atom_t atom)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_get_content_type(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_set_content_type(pn_message_t *msg, const char *type)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_get_content_encoding(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_set_content_encoding(pn_message_t *msg, const char *encoding)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_get_expiry_time(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_set_expiry_time(pn_message_t *msg, pn_timestamp_t time)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_get_creation_time(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_set_creation_time(pn_message_t *msg, pn_timestamp_t time)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_get_group_id(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_set_group_id(pn_message_t *msg, const char *group_id)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_get_group_sequence(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_set_group_sequence(pn_message_t *msg, pn_sequence_t n)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_get_reply_to_group_id(pn_message_t *msg)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_set_reply_to_group_id(pn_message_t *msg, const char *reply_to_group_id)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_decode(pn_message_t *msg, const char *bytes, size_t size)
-{
- require:
-  msg != NULL;
-}
-
-%contract pn_message_encode(pn_message_t *msg, char *bytes, size_t *size)
-{
- require:
-  msg != NULL;
-  *size >= 0;
-}
-
-%include "proton/message.h"
-
-%contract pn_sasl()
-{
- ensure:
-  pn_sasl != NULL;
-}
-
-%contract pn_sasl_allowed_mechs(pn_sasl_t *sasl, const char *mechanisms)
-{
- require:
-  sasl != NULL;
-}
-
-
-%contract pn_sasl_done(pn_sasl_t *sasl, pn_sasl_outcome_t outcome)
-{
- require:
-  sasl != NULL;
-  check_sasl_outcome(outcome);
-}
-
-%contract pn_sasl_outcome(pn_sasl_t *sasl)
-{
- require:
-  sasl != NULL;
- ensure:
-  check_sasl_outcome(pn_sasl_outcome);
-}
-
-%include "proton/sasl.h"
-
-%contract pn_messenger_name(pn_messenger_t *messenger)
-{
- require:
-  messenger != NULL;
- ensure:
-  pn_messenger_name != NULL;
-}
-
-%contract pn_messenger_set_timeout(pn_messenger_t *messenger, int timeout)
-{
- require:
-  messenger != NULL;
-}
-
-%contract pn_messenger_get_timeout(pn_messenger_t *messenger)
-{
- require:
-  messenger != NULL;
-}
-
-%contract pn_messenger_free(pn_messenger_t *messenger)
-{
- require:
-  messenger != NULL;
-}
-
-%contract pn_messenger_errno(pn_messenger_t *messenger)
-{
- require:
-  messenger != NULL;
-}
-
-%contract pn_messenger_error(pn_messenger_t *messenger)
-{
- require:
-  messenger != NULL;
-}
-
-%contract pn_messenger_start(pn_messenger_t *messenger)
-{
- require:
-  messenger != NULL;
-}
-
-%contract pn_messenger_stop(pn_messenger_t *messenger)
-{
- require:
-  messenger != NULL;
-}
-
-%contract pn_messenger_subscribe(pn_messenger_t *messenger, const char *source)
-{
- require:
-  messenger != NULL;
-  source != NULL;
-}
-
-%contract pn_messenger_put(pn_messenger_t *messenger, pn_message_t *msg)
-{
- require:
-  messenger != NULL;
-  msg != NULL;
-}
-
-%contract pn_messenger_send(pn_messenger_t *messenger)
-{
- require:
-  messenger != NULL;
-}
-
-%contract pn_messenger_recv(pn_messenger_t *messenger, int n)
-{
- require:
-  messenger != NULL;
-}
-
-%contract pn_messenger_get(pn_messenger_t *messenger, pn_message_t *msg)
-{
- require:
-  messenger != NULL;
-}
-
-%contract pn_messenger_outgoing(pn_messenger_t *messenger)
-{
- require:
-  messenger != NULL;
- ensure:
-  pn_messenger_outgoing >= 0;
-}
-
-%contract pn_messenger_incoming(pn_messenger_t *messenger)
-{
- require:
-  messenger != NULL;
- ensure:
-  pn_messenger_incoming >= 0;
-}
-
-
-%include "proton/messenger.h"
-
-%include "proton/selectable.h"
-
-%include "proton/ssl.h"
-
-%ignore pn_decode_atoms;
-%ignore pn_encode_atoms;
-%ignore pn_decode_one;
-
-%ignore pn_print_atom;
-%ignore pn_type_str;
-%ignore pn_print_atoms;
-%ignore pn_format_atoms;
-%ignore pn_format_atom;
-
-%ignore pn_fill_atoms;
-%ignore pn_vfill_atoms;
-%ignore pn_ifill_atoms;
-%ignore pn_vifill_atoms;
-%ignore pn_scan_atoms;
-%ignore pn_vscan_atoms;
-%ignore pn_data_vfill;
-%ignore pn_data_vscan;
-
-%include "proton/codec.h"
-
-%inline %{
-  pn_connection_t *pn_cast_pn_connection(void *x) { return (pn_connection_t *) x; }
-  pn_session_t *pn_cast_pn_session(void *x) { return (pn_session_t *) x; }
-  pn_link_t *pn_cast_pn_link(void *x) { return (pn_link_t *) x; }
-  pn_delivery_t *pn_cast_pn_delivery(void *x) { return (pn_delivery_t *) x; }
-  pn_transport_t *pn_cast_pn_transport(void *x) { return (pn_transport_t *) x; }
-  pn_reactor_t *pn_cast_pn_reactor(void *x) { return (pn_reactor_t *) x; }
-  pn_task_t *pn_cast_pn_task(void *x) { return (pn_task_t *) x; }
-  pn_selectable_t *pn_cast_pn_selectable(void *x) { return (pn_selectable_t *) x; }
-%}
-
-%include "proton/url.h"
-
-%include "proton/reactor.h"
-%include "proton/handlers.h"
diff --git a/proton-c/include/proton/delivery.h b/proton-c/include/proton/delivery.h
deleted file mode 100644
index 209bf78..0000000
--- a/proton-c/include/proton/delivery.h
+++ /dev/null
@@ -1,314 +0,0 @@
-#ifndef PROTON_DELIVERY_H
-#define PROTON_DELIVERY_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/disposition.h>
-#include <proton/type_compat.h>
-#include <stddef.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- *
- * @copybrief delivery
- *
- * @addtogroup delivery
- * @{
- */
-
-/**
- * An AMQP delivery tag.
- */
-typedef pn_bytes_t pn_delivery_tag_t;
-
-/**
- * Construct a delivery tag.
- *
- * @param[in] bytes a pointer to the beginning of the tag
- * @param[in] size the size of the tag
- * @return the delivery tag
- */
-PN_EXTERN pn_delivery_tag_t pn_dtag(const char *bytes, size_t size);
-
-/**
- * Create a delivery on a link.
- *
- * Every delivery object within a link must be supplied with a unique
- * tag. Links maintain a sequence of delivery object in the order that
- * they are created.
- *
- * @param[in] link a link object
- * @param[in] tag the delivery tag
- * @return a newly created delivery, or NULL if there was an error
- */
-PN_EXTERN pn_delivery_t *pn_delivery(pn_link_t *link, pn_delivery_tag_t tag);
-
-/**
- * @deprecated
- *
- * Get the application context that is associated with a delivery object.
- *
- * The application context for a delivery may be set using
- * ::pn_delivery_set_context.
- *
- * @param[in] delivery the delivery whose context is to be returned.
- * @return the application context for the delivery object
- */
-PN_EXTERN void *pn_delivery_get_context(pn_delivery_t *delivery);
-
-/**
- * @deprecated
- *
- * Set a new application context for a delivery object.
- *
- * The application context for a delivery object may be retrieved using
- * ::pn_delivery_get_context.
- *
- * @param[in] delivery the delivery object
- * @param[in] context the application context
- */
-PN_EXTERN void pn_delivery_set_context(pn_delivery_t *delivery, void *context);
-
-/**
- * Get the attachments that are associated with a delivery object.
- *
- * @param[in] delivery the delivery whose attachments are to be returned.
- * @return the attachments for the delivery object
- */
-PN_EXTERN pn_record_t *pn_delivery_attachments(pn_delivery_t *delivery);
-
-/**
- * Get the tag for a delivery object.
- *
- * @param[in] delivery a delivery object
- * @return the delivery tag
- */
-PN_EXTERN pn_delivery_tag_t pn_delivery_tag(pn_delivery_t *delivery);
-
-/**
- * Get the parent link for a delivery object.
- *
- * @param[in] delivery a delivery object
- * @return the parent link
- */
-PN_EXTERN pn_link_t *pn_delivery_link(pn_delivery_t *delivery);
-
-/**
- * Get the local disposition for a delivery.
- *
- * The pointer returned by this object is valid until the delivery is
- * settled.
- *
- * @param[in] delivery a delivery object
- * @return a pointer to the local disposition
- */
-PN_EXTERN pn_disposition_t *pn_delivery_local(pn_delivery_t *delivery);
-
-/**
- * Get the local disposition state for a delivery.
- *
- * @param[in] delivery a delivery object
- * @return the local disposition state
- */
-PN_EXTERN uint64_t pn_delivery_local_state(pn_delivery_t *delivery);
-
-/**
- * Get the remote disposition for a delivery.
- *
- * The pointer returned by this object is valid until the delivery is
- * settled.
- *
- * @param[in] delivery a delivery object
- * @return a pointer to the remote disposition
- */
-PN_EXTERN pn_disposition_t *pn_delivery_remote(pn_delivery_t *delivery);
-
-/**
- * Get the remote disposition state for a delivery.
- *
- * @param[in] delivery a delivery object
- * @return the remote disposition state
- */
-PN_EXTERN uint64_t pn_delivery_remote_state(pn_delivery_t *delivery);
-
-/**
- * Check if a delivery is remotely settled.
- *
- * @param[in] delivery a delivery object
- * @return true if the delivery is settled at the remote endpoint, false otherwise
- */
-PN_EXTERN bool pn_delivery_settled(pn_delivery_t *delivery);
-
-/**
- * Get the amount of pending message data for a delivery.
- *
- * @param[in] delivery a delivery object
- * @return the amount of pending message data in bytes
- */
-PN_EXTERN size_t pn_delivery_pending(pn_delivery_t *delivery);
-
-/**
- * Check if a delivery only has partial message data.
- *
- * @param[in] delivery a delivery object
- * @return true if the delivery only contains part of a message, false otherwise
- */
-PN_EXTERN bool pn_delivery_partial(pn_delivery_t *delivery);
-
-/**
- * Check if a delivery is writable.
- *
- * A delivery is considered writable if it is the current delivery on
- * an outgoing link, and the link has positive credit.
- *
- * @param[in] delivery a delivery object
- * @return true if the delivery is writable, false otherwise
- */
-PN_EXTERN bool pn_delivery_writable(pn_delivery_t *delivery);
-
-/**
- * Check if a delivery is readable.
- *
- * A delivery is considered readable if it is the current delivery on
- * an incoming link.
- *
- * @param[in] delivery a delivery object
- * @return true if the delivery is readable, false otherwise
- */
-PN_EXTERN bool pn_delivery_readable(pn_delivery_t *delivery);
-
-/**
- * Check if a delivery is updated.
- *
- * A delivery is considered updated whenever the peer communicates a
- * new disposition for the delivery. Once a delivery becomes updated,
- * it will remain so until ::pn_delivery_clear is called.
- *
- * @param[in] delivery a delivery object
- * @return true if the delivery is updated, false otherwise
- */
-PN_EXTERN bool pn_delivery_updated(pn_delivery_t *delivery);
-
-/**
- * Update the disposition of a delivery.
- *
- * When update is invoked the updated disposition of the delivery will
- * be communicated to the peer.
- *
- * @param[in] delivery a delivery object
- * @param[in] state the updated delivery state
- */
-PN_EXTERN void pn_delivery_update(pn_delivery_t *delivery, uint64_t state);
-
-/**
- * Clear the updated flag for a delivery.
- *
- * See ::pn_delivery_updated.
- *
- * @param[in] delivery a delivery object
- */
-PN_EXTERN void pn_delivery_clear(pn_delivery_t *delivery);
-
-/**
- * Return true if delivery is the current delivery for its link.
- *
- * @param[in] delivery a delivery object
- * @return true if delivery is the current delivery for its link.
- */
-PN_EXTERN bool pn_delivery_current(pn_delivery_t *delivery);
-
-/**
- * Settle a delivery.
- *
- * A settled delivery can never be used again.
- *
- * @note If pn_delivery_current(delivery) is true before the call then
- * pn_link_advance(pn_delivery_link(deliver)) is called automatically.
- *
- * @param[in] delivery a delivery object
- */
-PN_EXTERN void pn_delivery_settle(pn_delivery_t *delivery);
-
-/**
- * Utility function for printing details of a delivery.
- *
- * @param[in] delivery a delivery object
- */
-PN_EXTERN void pn_delivery_dump(pn_delivery_t *delivery);
-
-/**
- * Check if a delivery is buffered.
- *
- * A delivery that is buffered has not yet been written to the wire.
- *
- * Note that returning false does not imply that a delivery was
- * definitely written to the wire. If false is returned, it is not
- * known whether the delivery was actually written to the wire or not.
- *
- * @param[in] delivery a delivery object
- * @return true if the delivery is buffered
- */
-PN_EXTERN bool pn_delivery_buffered(pn_delivery_t *delivery);
-
-/**
- * Extracts the first delivery on the connection that has pending
- * operations.
- *
- * Retrieves the first delivery on the Connection that has pending
- * operations. A readable delivery indicates message data is waiting
- * to be read. A writable delivery indicates that message data may be
- * sent. An updated delivery indicates that the delivery's disposition
- * has changed. A delivery will never be both readable and writible,
- * but it may be both readable and updated or both writiable and
- * updated.
- *
- * @param[in] connection the connection
- * @return the first delivery object that needs to be serviced, else
- * NULL if none
- */
-PN_EXTERN pn_delivery_t *pn_work_head(pn_connection_t *connection);
-
-/**
- * Get the next delivery on the connection that needs has pending
- * operations.
- *
- * @param[in] delivery the previous delivery retrieved from
- *                     either pn_work_head or pn_work_next
- * @return the next delivery that has pending operations, else
- * NULL if none
- */
-PN_EXTERN pn_delivery_t *pn_work_next(pn_delivery_t *delivery);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* delivery.h */
diff --git a/proton-c/include/proton/disposition.h b/proton-c/include/proton/disposition.h
deleted file mode 100644
index 1d35db7..0000000
--- a/proton-c/include/proton/disposition.h
+++ /dev/null
@@ -1,231 +0,0 @@
-#ifndef PROTON_DISPOSITION_H
-#define PROTON_DISPOSITION_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/type_compat.h>
-#include <proton/condition.h>
-#include <stddef.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- *
- * Delivery state
- *
- * @addtogroup delivery
- * @{
- */
-
-/**
- * Dispositions record the current state and/or final outcome of a
- * transfer. Every delivery contains both a local and remote
- * disposition. The local disposition holds the local state of the
- * delivery, and the remote disposition holds the last known remote
- * state of the delivery.
- */
-typedef struct pn_disposition_t pn_disposition_t;
-
-/**
- * The PN_RECEIVED delivery state is a non terminal state indicating
- * how much (if any) message data has been received for a delivery.
- */
-#define PN_RECEIVED (0x0000000000000023)
-
-/**
- * The PN_ACCEPTED delivery state is a terminal state indicating that
- * the delivery was successfully processed. Once in this state there
- * will be no further state changes prior to the delivery being
- * settled.
- */
-#define PN_ACCEPTED (0x0000000000000024)
-
-/**
- * The PN_REJECTED delivery state is a terminal state indicating that
- * the delivery could not be processed due to some error condition.
- * Once in this state there will be no further state changes prior to
- * the delivery being settled.
- */
-#define PN_REJECTED (0x0000000000000025)
-
-/**
- * The PN_RELEASED delivery state is a terminal state indicating that
- * the delivery is being returned to the sender. Once in this state
- * there will be no further state changes prior to the delivery being
- * settled.
- */
-#define PN_RELEASED (0x0000000000000026)
-
-/**
- * The PN_MODIFIED delivery state is a terminal state indicating that
- * the delivery is being returned to the sender and should be
- * annotated by the sender prior to further delivery attempts. Once in
- * this state there will be no further state changes prior to the
- * delivery being settled.
- */
-#define PN_MODIFIED (0x0000000000000027)
-
-/**
- * Get the type of a disposition.
- *
- * Defined values are:
- *
- *  - ::PN_RECEIVED
- *  - ::PN_ACCEPTED
- *  - ::PN_REJECTED
- *  - ::PN_RELEASED
- *  - ::PN_MODIFIED
- *
- * @param[in] disposition a disposition object
- * @return the type of the disposition
- */
-PN_EXTERN uint64_t pn_disposition_type(pn_disposition_t *disposition);
-
-/**
- * Access the condition object associated with a disposition.
- *
- * The ::pn_condition_t object retrieved by this operation may be
- * modified prior to updating a delivery. When a delivery is updated,
- * the condition described by the disposition is reported to the peer
- * if applicable to the current delivery state, e.g. states such as
- * ::PN_REJECTED.
- *
- * The pointer returned by this operation is valid until the parent
- * delivery is settled.
- *
- * @param[in] disposition a disposition object
- * @return a pointer to the disposition condition
- */
-PN_EXTERN pn_condition_t *pn_disposition_condition(pn_disposition_t *disposition);
-
-/**
- * Access the disposition as a raw pn_data_t.
- *
- * Dispositions are an extension point in the AMQP protocol. The
- * disposition interface provides setters/getters for those
- * dispositions that are predefined by the specification, however
- * access to the raw disposition data is provided so that other
- * dispositions can be used.
- *
- * The ::pn_data_t pointer returned by this operation is valid until
- * the parent delivery is settled.
- *
- * @param[in] disposition a disposition object
- * @return a pointer to the raw disposition data
- */
-PN_EXTERN pn_data_t *pn_disposition_data(pn_disposition_t *disposition);
-
-/**
- * Get the section number associated with a disposition.
- *
- * @param[in] disposition a disposition object
- * @return a section number
- */
-PN_EXTERN uint32_t pn_disposition_get_section_number(pn_disposition_t *disposition);
-
-/**
- * Set the section number associated with a disposition.
- *
- * @param[in] disposition a disposition object
- * @param[in] section_number a section number
- */
-PN_EXTERN void pn_disposition_set_section_number(pn_disposition_t *disposition, uint32_t section_number);
-
-/**
- * Get the section offset associated with a disposition.
- *
- * @param[in] disposition a disposition object
- * @return a section offset
- */
-PN_EXTERN uint64_t pn_disposition_get_section_offset(pn_disposition_t *disposition);
-
-/**
- * Set the section offset associated with a disposition.
- *
- * @param[in] disposition a disposition object
- * @param[in] section_offset a section offset
- */
-PN_EXTERN void pn_disposition_set_section_offset(pn_disposition_t *disposition, uint64_t section_offset);
-
-/**
- * Check if a disposition has the failed flag set.
- *
- * @param[in] disposition a disposition object
- * @return true if the disposition has the failed flag set, false otherwise
- */
-PN_EXTERN bool pn_disposition_is_failed(pn_disposition_t *disposition);
-
-/**
- * Set the failed flag on a disposition.
- *
- * @param[in] disposition a disposition object
- * @param[in] failed the value of the failed flag
- */
-PN_EXTERN void pn_disposition_set_failed(pn_disposition_t *disposition, bool failed);
-
-/**
- * Check if a disposition has the undeliverable flag set.
- *
- * @param[in] disposition a disposition object
- * @return true if the disposition has the undeliverable flag set, false otherwise
- */
-PN_EXTERN bool pn_disposition_is_undeliverable(pn_disposition_t *disposition);
-
-/**
- * Set the undeliverable flag on a disposition.
- *
- * @param[in] disposition a disposition object
- * @param[in] undeliverable the value of the undeliverable flag
- */
-PN_EXTERN void pn_disposition_set_undeliverable(pn_disposition_t *disposition, bool undeliverable);
-
-/**
- * Access the annotations associated with a disposition.
- *
- * The ::pn_data_t object retrieved by this operation may be modified
- * prior to updating a delivery. When a delivery is updated, the
- * annotations described by the ::pn_data_t are reported to the peer
- * if applicable to the current delivery state, e.g. states such as
- * ::PN_MODIFIED. The ::pn_data_t must be empty or contain a symbol
- * keyed map.
- *
- * The pointer returned by this operation is valid until the parent
- * delivery is settled.
- *
- * @param[in] disposition a disposition object
- * @return the annotations associated with the disposition
- */
-PN_EXTERN pn_data_t *pn_disposition_annotations(pn_disposition_t *disposition);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* disposition.h */
diff --git a/proton-c/include/proton/engine.h b/proton-c/include/proton/engine.h
deleted file mode 100644
index 9763e07..0000000
--- a/proton-c/include/proton/engine.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef PROTON_ENGINE_H
-#define PROTON_ENGINE_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/**
- * @cond INTERNAL
- */
-
-#include <proton/condition.h>
-#include <proton/connection.h>
-#include <proton/session.h>
-#include <proton/terminus.h>
-#include <proton/link.h>
-#include <proton/delivery.h>
-#include <proton/event.h>
-#include <proton/transport.h>
-
-/**
- * @endcond
- */
-
-#endif /* engine.h */
diff --git a/proton-c/include/proton/error.h b/proton-c/include/proton/error.h
deleted file mode 100644
index c115ee1..0000000
--- a/proton-c/include/proton/error.h
+++ /dev/null
@@ -1,132 +0,0 @@
-#ifndef PROTON_ERROR_H
-#define PROTON_ERROR_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- *
- * @copybrief error
- *
- * @addtogroup error
- * @{
- */
-
-/**
- * An int error `code` and some string `text` to describe the error.
- */
-typedef struct pn_error_t pn_error_t;
-
-#define PN_OK (0)              /**< No error */
-#define PN_EOS (-1)            /**< End of stream */
-#define PN_ERR (-2)            /**< General error */
-#define PN_OVERFLOW (-3)       /**< Overflow error */
-#define PN_UNDERFLOW (-4)      /**< Underflow error */
-#define PN_STATE_ERR (-5)      /**< State error */
-#define PN_ARG_ERR (-6)        /**< Argument error */
-#define PN_TIMEOUT (-7)        /**< Timeout */
-#define PN_INTR (-8)           /**< Interrupt */
-#define PN_INPROGRESS (-9)     /**< In-progress */
-#define PN_OUT_OF_MEMORY (-10) /**< Out-of-momory error */
-
-/**
- * Get the name of the error code. Returned pointer is to a static
- * constant, do not delete.
- */
-PN_EXTERN const char *pn_code(int code);
-
-/**
- * Create an error object.
- */    
-PN_EXTERN pn_error_t *pn_error(void);
-    
-/**
- * Free an error object.
- */
-PN_EXTERN void pn_error_free(pn_error_t *error);
-
-/**
- * Reset the error to a "no error" state with code == 0.
- */
-PN_EXTERN void pn_error_clear(pn_error_t *error);
-
-/**
- * Set the error code and text. Makes a copy of text.
- */
-PN_EXTERN int pn_error_set(pn_error_t *error, int code, const char *text);
-
-/**
- * Set the code and set the text using a printf-style formatted
- * string.
- */
-PN_EXTERN int pn_error_vformat(pn_error_t *error, int code, const char *fmt, va_list ap);
-
-/**
- * Set the code and set the text using a printf-style formatted
- * string.
- */
-PN_EXTERN int pn_error_format(pn_error_t *error, int code, const char *fmt, ...);
-
-/**
- * Get the the error code.
- */
-PN_EXTERN int pn_error_code(pn_error_t *error);
-
-/**
- * Get the error text.  The returned pointer is owned by the
- * pn_error_t.
- */
-PN_EXTERN const char *pn_error_text(pn_error_t *error);
-
-/**
- * Copy the src error.
- */    
-PN_EXTERN int pn_error_copy(pn_error_t *error, pn_error_t *src);
-
-/**
- * @cond INTERNAL
- */    
-#define PN_RETURN_IF_ERROR(x) \
-do {\
-int r = (x);\
-if (r < 0) return r; \
-} while (0)
-/**
- * @endcond
- */
-    
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* error.h */
diff --git a/proton-c/include/proton/event.h b/proton-c/include/proton/event.h
deleted file mode 100644
index 4a88368..0000000
--- a/proton-c/include/proton/event.h
+++ /dev/null
@@ -1,579 +0,0 @@
-#ifndef PROTON_EVENT_H
-#define PROTON_EVENT_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/type_compat.h>
-#include <proton/object.h>
-#include <stddef.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- *
- * @copybrief event
- *
- * @addtogroup event
- * @{
- */
-
-/**
- * Notification of a state change in the protocol engine.
- *
- * The AMQP endpoint state modeled by the protocol engine is captured
- * by the following object types: @link pn_delivery_t Deliveries
- * @endlink, @link pn_link_t Links @endlink, @link pn_session_t
- * Sessions @endlink, @link pn_connection_t Connections @endlink, and
- * @link pn_transport_t Transports @endlink. These objects are related
- * as follows:
- *
- * - @link pn_delivery_t Deliveries @endlink always have a single
- *   parent Link
- * - @link pn_link_t Links @endlink always have a single parent
- *   Session
- * - @link pn_session_t Sessions @endlink always have a single parent
- *   Connection
- * - @link pn_connection_t Connections @endlink optionally have at
- *   most one associated Transport
- * - @link pn_transport_t Transports @endlink optionally have at most
- *   one associated Connection
- *
- * Every event has a type (see ::pn_event_type_t) that identifies what
- * sort of state change has occurred along with a pointer to the
- * object whose state has changed (as well as its associated objects).
- *
- * Events are accessed by creating a @link pn_collector_t Collector
- * @endlink with ::pn_collector() and registering it with the @link
- * pn_connection_t Connection @endlink of interest through use of
- * ::pn_connection_collect(). Once a collector has been registered,
- * ::pn_collector_peek() and ::pn_collector_pop() are used to access
- * and process events.
- */
-typedef struct pn_event_t pn_event_t;
-
-/**
- * An event type.
- */
-typedef enum {
-  /**
-   * Defined as a programming convenience. No event of this type will
-   * ever be generated.
-   */
-  PN_EVENT_NONE = 0,
-
-  /**
-   * A reactor has been started. Events of this type point to the reactor.
-   */
-  PN_REACTOR_INIT,
-
-  /**
-   * A reactor has no more events to process. Events of this type
-   * point to the reactor.
-   */
-  PN_REACTOR_QUIESCED,
-
-  /**
-   * A reactor has been stopped. Events of this type point to the reactor.
-   */
-  PN_REACTOR_FINAL,
-
-  /**
-   * A timer event has occurred.
-   */
-  PN_TIMER_TASK,
-
-  /**
-   * The connection has been created. This is the first event that
-   * will ever be issued for a connection. Events of this type point
-   * to the relevant connection.
-   */
-  PN_CONNECTION_INIT,
-
-  /**
-   * The connection has been bound to a transport. This event is
-   * issued when the ::pn_transport_bind() operation is invoked.
-   */
-  PN_CONNECTION_BOUND,
-
-  /**
-   * The connection has been unbound from its transport. This event is
-   * issued when the ::pn_transport_unbind() operation is invoked.
-   */
-  PN_CONNECTION_UNBOUND,
-
-  /**
-   * The local connection endpoint has been closed. Events of this
-   * type point to the relevant connection.
-   */
-  PN_CONNECTION_LOCAL_OPEN,
-
-  /**
-   * The remote endpoint has opened the connection. Events of this
-   * type point to the relevant connection.
-   */
-  PN_CONNECTION_REMOTE_OPEN,
-
-  /**
-   * The local connection endpoint has been closed. Events of this
-   * type point to the relevant connection.
-   */
-  PN_CONNECTION_LOCAL_CLOSE,
-
-  /**
-   *  The remote endpoint has closed the connection. Events of this
-   *  type point to the relevant connection.
-   */
-  PN_CONNECTION_REMOTE_CLOSE,
-
-  /**
-   * The connection has been freed and any outstanding processing has
-   * been completed. This is the final event that will ever be issued
-   * for a connection.
-   */
-  PN_CONNECTION_FINAL,
-
-  /**
-   * The session has been created. This is the first event that will
-   * ever be issued for a session.
-   */
-  PN_SESSION_INIT,
-
-  /**
-   * The local session endpoint has been opened. Events of this type
-   * point ot the relevant session.
-   */
-  PN_SESSION_LOCAL_OPEN,
-
-  /**
-   * The remote endpoint has opened the session. Events of this type
-   * point to the relevant session.
-   */
-  PN_SESSION_REMOTE_OPEN,
-
-  /**
-   * The local session endpoint has been closed. Events of this type
-   * point ot the relevant session.
-   */
-  PN_SESSION_LOCAL_CLOSE,
-
-  /**
-   * The remote endpoint has closed the session. Events of this type
-   * point to the relevant session.
-   */
-  PN_SESSION_REMOTE_CLOSE,
-
-  /**
-   * The session has been freed and any outstanding processing has
-   * been completed. This is the final event that will ever be issued
-   * for a session.
-   */
-  PN_SESSION_FINAL,
-
-  /**
-   * The link has been created. This is the first event that will ever
-   * be issued for a link.
-   */
-  PN_LINK_INIT,
-
-  /**
-   * The local link endpoint has been opened. Events of this type
-   * point ot the relevant link.
-   */
-  PN_LINK_LOCAL_OPEN,
-
-  /**
-   * The remote endpoint has opened the link. Events of this type
-   * point to the relevant link.
-   */
-  PN_LINK_REMOTE_OPEN,
-
-  /**
-   * The local link endpoint has been closed. Events of this type
-   * point ot the relevant link.
-   */
-  PN_LINK_LOCAL_CLOSE,
-
-  /**
-   * The remote endpoint has closed the link. Events of this type
-   * point to the relevant link.
-   */
-  PN_LINK_REMOTE_CLOSE,
-
-  /**
-   * The local link endpoint has been detached. Events of this type
-   * point to the relevant link.
-   */
-  PN_LINK_LOCAL_DETACH,
-
-  /**
-   * The remote endpoint has detached the link. Events of this type
-   * point to the relevant link.
-   */
-  PN_LINK_REMOTE_DETACH,
-
-  /**
-   * The flow control state for a link has changed. Events of this
-   * type point to the relevant link.
-   */
-  PN_LINK_FLOW,
-
-  /**
-   * The link has been freed and any outstanding processing has been
-   * completed. This is the final event that will ever be issued for a
-   * link. Events of this type point to the relevant link.
-   */
-  PN_LINK_FINAL,
-
-  /**
-   * A delivery has been created or updated. Events of this type point
-   * to the relevant delivery.
-   */
-  PN_DELIVERY,
-
-  /**
-   * The transport has new data to read and/or write. Events of this
-   * type point to the relevant transport.
-   */
-  PN_TRANSPORT,
-
-  /**
-   * The transport has authenticated, if this is received by a server
-   * the associated transport has authenticated an incoming connection
-   * and pn_transport_get_user() can be used to obtain the authenticated
-   * user.
-   */
-  PN_TRANSPORT_AUTHENTICATED,
-
-  /**
-   * Indicates that a transport error has occurred. Use
-   * ::pn_transport_condition() to access the details of the error
-   * from the associated transport.
-   */
-  PN_TRANSPORT_ERROR,
-
-  /**
-   * Indicates that the "head" or writing end of the transport has been closed. This
-   * means the transport will never produce more bytes for output to
-   * the network. Events of this type point to the relevant transport.
-   */
-  PN_TRANSPORT_HEAD_CLOSED,
-
-  /**
-   * The write side of the transport is closed, it will no longer produce bytes
-   * to write to external IO. Synonynm for PN_TRANSPORT_HEAD_CLOSED
-   */
-  PN_TRANSPORT_WRITE_CLOSED = PN_TRANSPORT_HEAD_CLOSED,
-
-  /**
-   * Indicates that the tail of the transport has been closed. This
-   * means the transport will never be able to process more bytes from
-   * the network. Events of this type point to the relevant transport.
-   */
-  PN_TRANSPORT_TAIL_CLOSED,
-
-  /**
-   * The read side of the transport is closed, it will no longer read bytes
-   * from external IO. Synonynm for PN_TRANSPORT_TAIL_CLOSED
-   */
-  PN_TRANSPORT_READ_CLOSED = PN_TRANSPORT_TAIL_CLOSED,
-
-  /**
-   * Indicates that the both the head and tail of the transport are
-   * closed. Events of this type point to the relevant transport.
-   */
-  PN_TRANSPORT_CLOSED,
-
-  PN_SELECTABLE_INIT,
-  PN_SELECTABLE_UPDATED,
-  PN_SELECTABLE_READABLE,
-  PN_SELECTABLE_WRITABLE,
-  PN_SELECTABLE_ERROR,
-  PN_SELECTABLE_EXPIRED,
-  PN_SELECTABLE_FINAL,
-
-  /**
-   * pn_connection_wake() was called.
-   * Events of this type point to the @ref pn_connection_t.
-   */
-  PN_CONNECTION_WAKE,
-
-  /**
-   * Indicates the listener is ready to call pn_listener_accept() 
-   * Events of this type point to the @ref pn_listener_t.
-   */
-  PN_LISTENER_ACCEPT,
-
-  /**
-   * Indicates the listener has closed. pn_listener_condition() provides error information.
-   * Events of this type point to the @ref pn_listener_t.
-   */
-  PN_LISTENER_CLOSE,
-
-  /**
-   * Indicates pn_proactor_interrupt() was called to interrupt a proactor thread
-   * Events of this type point to the @ref pn_proactor_t.
-   */
-  PN_PROACTOR_INTERRUPT,
-
-  /**
-   * Timeout set by pn_proactor_set_timeout() time limit expired.
-   * Events of this type point to the @ref pn_proactor_t.
-   */
-  PN_PROACTOR_TIMEOUT,
-
-  /**
-   * The proactor becaome inactive: all listeners and connections are closed and
-   * their events processed, the timeout is expired.
-   *
-   * Events of this type point to the @ref pn_proactor_t.
-   */
-  PN_PROACTOR_INACTIVE
-
-} pn_event_type_t;
-
-/**
- * Get a human readable name for an event type.
- *
- * @param[in] type an event type
- * @return a human readable name
- */
-PN_EXTERN const char *pn_event_type_name(pn_event_type_t type);
-
-/**
- * Construct a collector.
- *
- * A collector is used to register interest in events produced by one
- * or more ::pn_connection_t objects. Collectors are not currently
- * thread safe, so synchronization must be used if they are to be
- * shared between multiple connection objects.
- */
-PN_EXTERN pn_collector_t *pn_collector(void);
-
-/**
- * Free a collector.
- *
- * @param[in] collector a collector to free, or NULL
- */
-PN_EXTERN void pn_collector_free(pn_collector_t *collector);
-
-/**
- * Release a collector. Once in a released state a collector will
- * drain any internally queued events (thereby releasing any pointers
- * they may hold), shrink it's memory footprint to a minimum, and
- * discard any newly created events.
- *
- * @param[in] collector a collector object
- */
-PN_EXTERN void pn_collector_release(pn_collector_t *collector);
-
-/**
- * Place a new event on a collector.
- *
- * This operation will create a new event of the given type and
- * context and return a pointer to the newly created event. In some
- * cases an event of the given type and context can be elided. When
- * this happens, this operation will return a NULL pointer.
- *
- * @param[in] collector a collector object
- * @param[in] clazz class of the context
- * @param[in] context the event context
- * @param[in] type the event type
- *
- * @return a pointer to the newly created event or NULL if the event
- *         was elided
- */
-
-PN_EXTERN pn_event_t *pn_collector_put(pn_collector_t *collector,
-                                       const pn_class_t *clazz, void *context,
-                                       pn_event_type_t type);
-
-/**
- * Access the head event contained by a collector.
- *
- * This operation will continue to return the same event until it is
- * cleared by using ::pn_collector_pop. The pointer return by this
- * operation will be valid until ::pn_collector_pop is invoked or
- * ::pn_collector_free is called, whichever happens sooner.
- *
- * @param[in] collector a collector object
- * @return a pointer to the head event contained in the collector
- */
-PN_EXTERN pn_event_t *pn_collector_peek(pn_collector_t *collector);
-
-/**
- * Clear the head event on a collector.
- *
- * @param[in] collector a collector object
- * @return true if the event was popped, false if the collector is empty
- */
-PN_EXTERN bool pn_collector_pop(pn_collector_t *collector);
-
-/**
- * Return the next event to be handled.
- *
- * Returns the head event if it has not previously been returned by
- * pn_collector_next(), otherwise does pn_collector_pop() and returns
- * the new head event.
- *
- * The returned pointer is valid till the next call of pn_collector_pop(),
- * pn_collector_next(), pn_collector_release() or pn_collector_free()
- *
- * @param[in] collector a collector object
- * @return the next event.
- */
-PN_EXTERN pn_event_t *pn_collector_next(pn_collector_t *collector);
-
-/**
- * Return the same event as the previous call to pn_collector_next()
- *
- * The returned pointer is valid till the next call of pn_collector_pop(),
- * pn_collector_next(), pn_collector_release() or pn_collector_free()
- *
- * @param[in] collector a collector object
- * @return a pointer to the event returned by previous call to pn_collector_next()
- */
-PN_EXTERN pn_event_t *pn_collector_prev(pn_collector_t *collector);
-
-/**
- * Check if there are more events after the current event. If this
- * returns true, then pn_collector_peek() will return an event even
- * after pn_collector_pop() is called.
- *
- * @param[in] collector a collector object
- * @return true if the collector has more than the current event
- */
-PN_EXTERN  bool pn_collector_more(pn_collector_t *collector);
-
-/**
- * Get the type of an event.
- *
- * @param[in] event an event object
- * @return the type of the event
- */
-PN_EXTERN pn_event_type_t pn_event_type(pn_event_t *event);
-
-/**
- * Get the class associated with the event context.
- *
- * @param[in] event an event object
- * @return the class associated with the event context
- */
-PN_EXTERN const pn_class_t *pn_event_class(pn_event_t *event);
-
-/**
- * Get the context associated with an event.
- */
-PN_EXTERN void *pn_event_context(pn_event_t *event);
-
-/**
- * Get the connection associated with an event.
- *
- * @param[in] event an event object
- * @return the connection associated with the event (or NULL)
- */
-PN_EXTERN pn_connection_t *pn_event_connection(pn_event_t *event);
-
-/**
- * Get the session associated with an event.
- *
- * @param[in] event an event object
- * @return the session associated with the event (or NULL)
- */
-PN_EXTERN pn_session_t *pn_event_session(pn_event_t *event);
-
-/**
- * Get the link associated with an event.
- *
- * @param[in] event an event object
- * @return the link associated with the event (or NULL)
- */
-PN_EXTERN pn_link_t *pn_event_link(pn_event_t *event);
-
-/**
- * Get the delivery associated with an event.
- *
- * @param[in] event an event object
- * @return the delivery associated with the event (or NULL)
- */
-PN_EXTERN pn_delivery_t *pn_event_delivery(pn_event_t *event);
-
-/**
- * Get the transport associated with an event.
- *
- * @param[in] event an event object
- * @return the transport associated with the event (or NULL)
- */
-PN_EXTERN pn_transport_t *pn_event_transport(pn_event_t *event);
-
-/**
- * Get any attachments associated with an event.
- *
- * @param[in] event an event object
- * @return the record holding the attachments
- */
-PN_EXTERN pn_record_t *pn_event_attachments(pn_event_t *event);
-
-/**
- * **Experimental** - A batch of events to handle. Call
- * pn_event_batch_next() in a loop until it returns NULL to handle
- * them.
- */
-typedef struct pn_event_batch_t pn_event_batch_t;
-
-/* NOTE: there is deliberately no peek(), more() or other look-ahead on an event
- * batch. We want to know exactly which events have been handled, next() only
- * allows the user to get each event exactly once, in order.
- */
-
-/**
- * **Experimental** - Remove the next event from the batch and return
- *  it. NULL means the batch is empty. The returned event pointer is
- *  valid until pn_event_batch_next() is called again on the same
- *  batch.
- */
-PN_EXTERN pn_event_t *pn_event_batch_next(pn_event_batch_t *batch);
-
-/**
- * @cond INTERNAL
- *
- * pn_event_batch_next() can be re-implemented for different behaviors in different contextxs.
- */
-struct pn_event_batch_t {
-  pn_event_t *(*next_event)(pn_event_batch_t *batch);
-};
-/**
- * @endcond
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-/**
- * @}
- */
-
-#endif /* event.h */
diff --git a/proton-c/include/proton/handlers.h b/proton-c/include/proton/handlers.h
deleted file mode 100644
index feff0fe..0000000
--- a/proton-c/include/proton/handlers.h
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef PROTON_HANDLERS_H
-#define PROTON_HANDLERS_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/type_compat.h>
-#include <proton/reactor.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @cond INTERNAL
- */
-
-typedef pn_handler_t pn_handshaker_t;
-typedef pn_handler_t pn_iohandler_t;
-typedef pn_handler_t pn_flowcontroller_t;
-
-PNX_EXTERN pn_handshaker_t *pn_handshaker(void);
-PNX_EXTERN pn_iohandler_t *pn_iohandler(void);
-PNX_EXTERN pn_flowcontroller_t *pn_flowcontroller(int window);
-
-/**
- * @endcond
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* handlers.h */
diff --git a/proton-c/include/proton/import_export.h b/proton-c/include/proton/import_export.h
deleted file mode 100644
index 6547a07..0000000
--- a/proton-c/include/proton/import_export.h
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef PROTON_IMPORT_EXPORT_H
-#define PROTON_IMPORT_EXPORT_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/**
- * @cond INTERNAL
- */
-
-//
-// Compiler specific mechanisms for managing the import and export of
-// symbols between shared objects.
-//
-// PN_EXPORT         - Export declaration
-// PN_IMPORT         - Import declaration
-//
-
-#if defined(WIN32) && !defined(PROTON_DECLARE_STATIC)
-  //
-  // Import and Export definitions for Windows:
-  //
-#  define PN_EXPORT __declspec(dllexport)
-#  define PN_IMPORT __declspec(dllimport)
-#else
-  //
-  // Non-Windows (Linux, etc.) definitions:
-  //
-#  define PN_EXPORT __attribute ((visibility ("default")))
-#  define PN_IMPORT
-#endif
-
-
-// For core proton library symbols
-#if defined(qpid_proton_core_EXPORTS) || defined(qpid_proton_EXPORTS)
-#  define PN_EXTERN PN_EXPORT
-#else
-#  define PN_EXTERN PN_IMPORT
-#endif
-
-// For extra proton symbols
-#if defined(qpid_proton_EXPORTS)
-#  define PNX_EXTERN PN_EXPORT
-#else
-#  define PNX_EXTERN PN_IMPORT
-#endif
-
-/**
- * @endcond
- */
-
-#endif /* import_export.h */
diff --git a/proton-c/include/proton/link.h b/proton-c/include/proton/link.h
deleted file mode 100644
index d52e6e7..0000000
--- a/proton-c/include/proton/link.h
+++ /dev/null
@@ -1,688 +0,0 @@
-#ifndef PROTON_LINK_H
-#define PROTON_LINK_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/type_compat.h>
-#include <proton/condition.h>
-#include <proton/terminus.h>
-#include <proton/types.h>
-#include <proton/object.h>
-#include <stddef.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- *
- * @copybrief link
- *
- * @addtogroup link
- * @{
- */
-
-/**
- * Construct a new sender on a session.
- *
- * Each sending link between two AMQP containers must be uniquely
- * named. Note that this uniqueness cannot be enforced at the API
- * level, so some consideration should be taken in choosing link
- * names.
- *
- * @param[in] session the session object
- * @param[in] name the name of the link
- * @return a newly constructed sender link or NULL on error
- */
-PN_EXTERN pn_link_t *pn_sender(pn_session_t *session, const char *name);
-
-/**
- * Construct a new receiver on a session.
- *
- * Each receiving link between two AMQP containers must be uniquely
- * named. Note that this uniqueness cannot be enforced at the API
- * level, so some consideration should be taken in choosing link
- * names.
- *
- * @param[in] session the session object
- * @param[in] name the name of the link
- * @return a newly constructed receiver link or NULL on error
- */
-PN_EXTERN pn_link_t *pn_receiver(pn_session_t *session, const char *name);
-
-/**
- * Free a link object.
- *
- * When a link object is freed, all ::pn_delivery_t objects associated
- * with the session are also freed. Freeing a link will settle any
- * unsettled deliveries on the link.
- *
- * @param[in] link a link object to free (or NULL)
- */
-PN_EXTERN void pn_link_free(pn_link_t *link);
-
-/**
- * @deprecated
- *
- * Get the application context that is associated with a link object.
- *
- * The application context for a link may be set using
- * ::pn_link_set_context.
- *
- * @param[in] link the link whose context is to be returned.
- * @return the application context for the link object
- */
-PN_EXTERN void *pn_link_get_context(pn_link_t *link);
-
-/**
- * @deprecated
- *
- * Set a new application context for a link object.
- *
- * The application context for a link object may be retrieved using
- * ::pn_link_get_context.
- *
- * @param[in] link the link object
- * @param[in] context the application context
- */
-PN_EXTERN void pn_link_set_context(pn_link_t *link, void *context);
-
-/**
- * Get the attachments that are associated with a link object.
- *
- * @param[in] link the link whose attachments are to be returned.
- * @return the attachments for the link object
- */
-PN_EXTERN pn_record_t *pn_link_attachments(pn_link_t *link);
-
-/**
- * Get the name of a link.
- *
- * @param[in] link a link object
- * @return the name of the link
- */
-PN_EXTERN const char *pn_link_name(pn_link_t *link);
-
-/**
- * Test if a link is a sender.
- *
- * @param[in] link a link object
- * @return true if and only if the link is a sender
- */
-PN_EXTERN bool pn_link_is_sender(pn_link_t *link);
-
-/**
- * Test if a link is a receiver.
- *
- * @param[in] link a link object
- * @return true if and only if the link is a receiver
- */
-PN_EXTERN bool pn_link_is_receiver(pn_link_t *link);
-
-/**
- * Get the endpoint state flags for a link.
- *
- * @param[in] link the link
- * @return the link's state flags
- */
-PN_EXTERN pn_state_t pn_link_state(pn_link_t *link);
-
-/**
- * @deprecated
- *
- * Get additional error information associated with the link.
- *
- * Whenever a link operation fails (i.e. returns an error code),
- * additional error details can be obtained using this function. The
- * error object that is returned may also be used to clear the error
- * condition.
- *
- * The pointer returned by this operation is valid until the
- * link object is freed.
- *
- * @param[in] link the link object
- * @return the link's error object
- */
-PN_EXTERN pn_error_t *pn_link_error(pn_link_t *link);
-
-/**
- * Get the local condition associated with a link endpoint.
- *
- * The ::pn_condition_t object retrieved may be modified prior to
- * closing a link in order to indicate a particular condition
- * exists when the link closes. This is normally used to
- * communicate error conditions to the remote peer, however it may
- * also be used in non error cases. See ::pn_condition_t for more
- * details.
- *
- * The pointer returned by this operation is valid until the link
- * object is freed.
- *
- * @param[in] link the link object
- * @return the link's local condition object
- */
-PN_EXTERN pn_condition_t *pn_link_condition(pn_link_t *link);
-
-/**
- * Get the remote condition associated with a link endpoint.
- *
- * The ::pn_condition_t object retrieved may be examined in order to
- * determine whether the remote peer was indicating some sort of
- * exceptional condition when the remote link endpoint was
- * closed. The ::pn_condition_t object returned may not be modified.
- *
- * The pointer returned by this operation is valid until the
- * link object is freed.
- *
- * @param[in] link the link object
- * @return the link's remote condition object
- */
-PN_EXTERN pn_condition_t *pn_link_remote_condition(pn_link_t *link);
-
-/**
- * Get the parent session for a link object.
- *
- * This operation retrieves the parent ::pn_session_t object that
- * contains the given ::pn_link_t object.
- *
- * @param[in] link the link object
- * @return the parent session object
- */
-PN_EXTERN pn_session_t *pn_link_session(pn_link_t *link);
-
-/**
- * Retrieve the first link that matches the given state mask.
- *
- * Examines the state of each link owned by the connection and returns
- * the first link that matches the given state mask. If state contains
- * both local and remote flags, then an exact match against those
- * flags is performed. If state contains only local or only remote
- * flags, then a match occurs if any of the local or remote flags are
- * set respectively. state==0 matches all links.
- *
- * @param[in] connection to be searched for matching Links
- * @param[in] state mask to match
- * @return the first link owned by the connection that matches the
- * mask, else NULL if no links match
- */
-PN_EXTERN pn_link_t *pn_link_head(pn_connection_t *connection, pn_state_t state);
-
-/**
- * Retrieve the next link that matches the given state mask.
- *
- * When used with pn_link_head, the application can access all links
- * on the connection that match the given state. See pn_link_head for
- * description of match behavior.
- *
- * @param[in] link the previous link obtained from pn_link_head or
- *                 pn_link_next
- * @param[in] state mask to match
- * @return the next session owned by the connection that matches the
- * mask, else NULL if no sessions match
- */
-PN_EXTERN pn_link_t *pn_link_next(pn_link_t *link, pn_state_t state);
-
-/**
- * Open a link.
- *
- * Once this operation has completed, the PN_LOCAL_ACTIVE state flag
- * will be set.
- *
- * @param[in] link a link object
- */
-PN_EXTERN void pn_link_open(pn_link_t *link);
-
-/**
- * Close a link.
- *
- * Once this operation has completed, the PN_LOCAL_CLOSED state flag
- * will be set. This may be called without calling
- * ::pn_link_open, in this case it is equivalent to calling
- * ::pn_link_open followed by ::pn_link_close.
- *
- * @param[in] link a link object
- */
-PN_EXTERN void pn_link_close(pn_link_t *link);
-
-/**
- * Detach a link.
- *
- * @param[in] link a link object
- */
-PN_EXTERN void pn_link_detach(pn_link_t *link);
-
-/**
- * Access the locally defined source definition for a link.
- *
- * The pointer returned by this operation is valid until the link
- * object is freed.
- *
- * @param[in] link a link object
- * @return a pointer to a source terminus
- */
-PN_EXTERN pn_terminus_t *pn_link_source(pn_link_t *link);
-
-/**
- * Access the locally defined target definition for a link.
- *
- * The pointer returned by this operation is valid until the link
- * object is freed.
- *
- * @param[in] link a link object
- * @return a pointer to a target terminus
- */
-PN_EXTERN pn_terminus_t *pn_link_target(pn_link_t *link);
-
-/**
- * Access the remotely defined source definition for a link.
- *
- * The pointer returned by this operation is valid until the link
- * object is freed. The remotely defined terminus will be empty until
- * the link is remotely opened as indicated by the PN_REMOTE_ACTIVE
- * flag.
- *
- * @param[in] link a link object
- * @return a pointer to the remotely defined source terminus
- */
-PN_EXTERN pn_terminus_t *pn_link_remote_source(pn_link_t *link);
-
-/**
- * Access the remotely defined target definition for a link.
- *
- * The pointer returned by this operation is valid until the link
- * object is freed. The remotely defined terminus will be empty until
- * the link is remotely opened as indicated by the PN_REMOTE_ACTIVE
- * flag.
- *
- * @param[in] link a link object
- * @return a pointer to the remotely defined target terminus
- */
-PN_EXTERN pn_terminus_t *pn_link_remote_target(pn_link_t *link);
-
-/**
- * Get the current delivery for a link.
- *
- * Each link maintains a sequence of deliveries in the order they were
- * created, along with a pointer to the *current* delivery. All
- * send/recv operations on a link take place on the *current*
- * delivery. If a link has no current delivery, the current delivery
- * is automatically initialized to the next delivery created on the
- * link. Once initialized, the current delivery remains the same until
- * it is changed through use of ::pn_link_advance or until it is
- * settled via ::pn_delivery_settle.
- *
- * @param[in] link a link object
- * @return the current delivery for the link, or NULL if there is none
- */
-PN_EXTERN pn_delivery_t *pn_link_current(pn_link_t *link);
-
-/**
- * Advance the current delivery of a link to the next delivery on the
- * link.
- *
- * For sending links this operation is used to finish sending message
- * data for the current outgoing delivery and move on to the next
- * outgoing delivery (if any).
- *
- * For receiving links, this operation is used to finish accessing
- * message data from the current incoming delivery and move on to the
- * next incoming delivery (if any).
- *
- * Each link maintains a sequence of deliveries in the order they were
- * created, along with a pointer to the *current* delivery. The
- * pn_link_advance operation will modify the *current* delivery on the
- * link to point to the next delivery in the sequence. If there is no
- * next delivery in the sequence, the current delivery will be set to
- * NULL. This operation will return true if invoking it caused the
- * value of the current delivery to change, even if it was set to
- * NULL.
- *
- * @param[in] link a link object
- * @return true if the current delivery was changed
- */
-PN_EXTERN bool pn_link_advance(pn_link_t *link);
-
-/**
- * Get the credit balance for a link.
- *
- * Links use a credit based flow control scheme. Every receiver
- * maintains a credit balance that corresponds to the number of
- * deliveries that the receiver can accept at any given moment. As
- * more capacity becomes available at the receiver (see
- * ::pn_link_flow), it adds credit to this balance and communicates
- * the new balance to the sender. Whenever a delivery is
- * sent/received, the credit balance maintained by the link is
- * decremented by one. Once the credit balance at the sender reaches
- * zero, the sender must pause sending until more credit is obtained
- * from the receiver.
- *
- * Note that a sending link may still be used to send deliveries even
- * if pn_link_credit reaches zero, however those deliveries will end
- * up being buffered by the link until enough credit is obtained from
- * the receiver to send them over the wire. In this case the balance
- * reported by ::pn_link_credit will go negative.
- *
- * @param[in] link a link object
- * @return the credit balance for the link
- */
-PN_EXTERN int pn_link_credit(pn_link_t *link);
-
-/**
- * Get the number of queued deliveries for a link.
- *
- * Links may queue deliveries for a number of reasons, for example
- * there may be insufficient credit to send them to the receiver (see
- * ::pn_link_credit), or they simply may not have yet had a chance to
- * be written to the wire. This operation will return the number of
- * queued deliveries on a link.
- *
- * @param[in] link a link object
- * @return the number of queued deliveries for the link
- */
-PN_EXTERN int pn_link_queued(pn_link_t *link);
-
-/**
- * Get the remote view of the credit for a link.
- *
- * The remote view of the credit for a link differs from local view of
- * credit for a link by the number of queued deliveries. In other
- * words ::pn_link_remote_credit is defined to be ::pn_link_credit -
- * ::pn_link_queued.
- *
- * @param[in] link a link object
- * @return the remote view of the credit for a link
- */
-PN_EXTERN int pn_link_remote_credit(pn_link_t *link);
-
-/**
- * Get the drain flag for a link.
- *
- * If a link is in drain mode, then the sending endpoint of a link
- * must immediately use up all available credit on the link. If this
- * is not possible, the excess credit must be returned by invoking
- * ::pn_link_drained. Only the receiving endpoint can set the drain
- * mode. See ::pn_link_set_drain for details.
- *
- * @param[in] link a link object
- * @return true if and only if the link is in drain mode
- */
-PN_EXTERN bool pn_link_get_drain(pn_link_t *link);
-
-/**
- * Drain excess credit for a link.
- *
- * When a link is in drain mode, the sender must use all excess credit
- * immediately, and release any excess credit back to the receiver if
- * there are no deliveries available to send.
- *
- * When invoked on a sending link that is in drain mode, this
- * operation will release all excess credit back to the receiver and
- * return the number of credits released back to the sender. If the
- * link is not in drain mode, this operation is a noop.
- *
- * When invoked on a receiving link, this operation will return and
- * reset the number of credits the sender has released back to the
- * receiver.
- *
- * @param[in] link a link object
- * @return the number of credits drained
- */
-PN_EXTERN int pn_link_drained(pn_link_t *link);
-
-/**
- * Get the available deliveries hint for a link.
- *
- * The available count for a link provides a hint as to the number of
- * deliveries that might be able to be sent if sufficient credit were
- * issued by the receiving link endpoint. See ::pn_link_offered for
- * more details.
- *
- * @param[in] link a link object
- * @return the available deliveries hint
- */
-PN_EXTERN int pn_link_available(pn_link_t *link);
-
-/**
- * Describes the permitted/expected settlement behaviours of a sending
- * link.
- *
- * The sender settle mode describes the permitted and expected
- * behaviour of a sending link with respect to settling of deliveries.
- * See ::pn_delivery_settle for more details.
- */
-typedef enum {
-  PN_SND_UNSETTLED = 0, /**< The sender will send all deliveries
-                           initially unsettled. */
-  PN_SND_SETTLED = 1, /**< The sender will send all deliveries settled
-                         to the receiver. */
-  PN_SND_MIXED = 2 /**< The sender may send a mixure of settled and
-                      unsettled deliveries. */
-} pn_snd_settle_mode_t;
-
-/**
- * Describes the permitted/expected settlement behaviours of a
- * receiving link.
- *
- * The receiver settle mode describes the permitted and expected
- * behaviour of a receiving link with respect to settling of
- * deliveries. See ::pn_delivery_settle for more details.
- */
-typedef enum {
-  PN_RCV_FIRST = 0,  /**< The receiver will settle deliveries
-                        regardless of what the sender does. */
-  PN_RCV_SECOND = 1  /**< The receiver will only settle deliveries
-                        after the sender settles. */
-} pn_rcv_settle_mode_t;
-
-/**
- * Get the local sender settle mode for a link.
- *
- * @param[in] link a link object
- * @return the local sender settle mode
- */
-PN_EXTERN pn_snd_settle_mode_t pn_link_snd_settle_mode(pn_link_t *link);
-
-/**
- * Get the local receiver settle mode for a link.
- *
- * @param[in] link a link object
- * @return the local receiver settle mode
- */
-PN_EXTERN pn_rcv_settle_mode_t pn_link_rcv_settle_mode(pn_link_t *link);
-
-/**
- * Set the local sender settle mode for a link.
- *
- * @param[in] link a link object
- * @param[in] mode the sender settle mode
- */
-PN_EXTERN void pn_link_set_snd_settle_mode(pn_link_t *link, pn_snd_settle_mode_t mode);
-
-/**
- * Set the local receiver settle mode for a link.
- *
- * @param[in] link a link object
- * @param[in] mode the receiver settle mode
- */
-PN_EXTERN void pn_link_set_rcv_settle_mode(pn_link_t *link, pn_rcv_settle_mode_t mode);
-
-/**
- * Get the remote sender settle mode for a link.
- *
- * @param[in] link a link object
- * @return the remote sender settle mode
- */
-PN_EXTERN pn_snd_settle_mode_t pn_link_remote_snd_settle_mode(pn_link_t *link);
-
-/**
- * Get the remote receiver settle mode for a link.
- *
- * @param[in] link a link object
- * @return the remote receiver settle mode
- */
-PN_EXTERN pn_rcv_settle_mode_t pn_link_remote_rcv_settle_mode(pn_link_t *link);
-
-/**
- * Get the number of unsettled deliveries for a link.
- *
- * @param[in] link a link object
- * @return the number of unsettled deliveries
- */
-PN_EXTERN int pn_link_unsettled(pn_link_t *link);
-
-/**
- * Get the first unsettled delivery for a link.
- *
- " @param[in] link a link object
- * @return a pointer to the first unsettled delivery on the link
- */
-PN_EXTERN pn_delivery_t *pn_unsettled_head(pn_link_t *link);
-
-/**
- * Get the next unsettled delivery on a link.
- *
- * @param[in] delivery a delivery object
- * @return the next unsettled delivery on the link
- */
-PN_EXTERN pn_delivery_t *pn_unsettled_next(pn_delivery_t *delivery);
-
-/**
- * Signal the availability of deliveries for a link.
- *
- * @param[in] sender a sender link object
- * @param[in] credit the number of deliveries potentially available
- * for transfer
- */
-PN_EXTERN void pn_link_offered(pn_link_t *sender, int credit);
-
-/**
- * Send message data for the current delivery on a link.
- *
- * @param[in] sender a sender link object
- * @param[in] bytes the start of the message data
- * @param[in] n the number of bytes of message data
- * @return the number of bytes sent, or an error code
- */
-PN_EXTERN ssize_t pn_link_send(pn_link_t *sender, const char *bytes, size_t n);
-
-//PN_EXTERN void pn_link_abort(pn_sender_t *sender);
-
-/**
- * Grant credit for incoming deliveries on a receiver.
- *
- * @param[in] receiver a receiving link object
- * @param[in] credit the amount to increment the link credit
- */
-PN_EXTERN void pn_link_flow(pn_link_t *receiver, int credit);
-
-/**
- * Grant credit for incoming deliveries on a receiver, and set drain
- * mode to true.
- *
- * Use ::pn_link_set_drain to set the drain mode explicitly.
- *
- * @param[in] receiver a receiving link object
- * @param[in] credit the amount to increment the link credit
- */
-PN_EXTERN void pn_link_drain(pn_link_t *receiver, int credit);
-
-/**
- * Set the drain mode on a link.
- *
- * @param[in] receiver a receiving link object
- * @param[in] drain the drain mode
- */
-PN_EXTERN void pn_link_set_drain(pn_link_t *receiver, bool drain);
-
-/**
- * Receive message data for the current delivery on a link.
- *
- * Use ::pn_delivery_pending on the current delivery to figure out how
- * much buffer space is needed.
- *
- * Note that the link API can be used to stream large messages across
- * the network, so just because there is no data to read does not
- * imply the message is complete. To ensure the entirety of the
- * message data has been read, either invoke ::pn_link_recv until
- * PN_EOS is returned, or verify that ::pn_delivery_partial is false,
- * and ::pn_delivery_pending is 0.
- *
- * @param[in] receiver a receiving link object
- * @param[in] bytes a pointer to an empty buffer
- * @param[in] n the buffer capacity
- * @return the number of bytes received, PN_EOS, or an error code
- */
-PN_EXTERN ssize_t pn_link_recv(pn_link_t *receiver, char *bytes, size_t n);
-
-/**
- * Check if a link is currently draining.
- *
- * A link is defined to be draining when drain mode is set to true,
- * and the sender still has excess credit.
- *
- * @param[in] receiver a receiving link object
- * @return true if the link is currently draining, false otherwise
- */
-PN_EXTERN bool pn_link_draining(pn_link_t *receiver);
-
-/**
- * **Experimental** - Get the maximum message size for a link.
- *
- * A zero maximum message size means the size is unlimited.
- *
- * @param[in] link a link object
- * @return the maximum message size for a link.
- */
-PN_EXTERN uint64_t pn_link_max_message_size(pn_link_t *link);
-
-/**
- * **Experimental** - Set the maximum message size for a link.
- *
- * A zero maximum message size means the size is unlimited.
- *
- * @param[in] link a link object
- * @param[in] size the maximum message size for the link
- */
-PN_EXTERN void pn_link_set_max_message_size(pn_link_t *link, uint64_t size);
-
-/**
- * **Experimental** - Get the remote view of the maximum message size for a link.
- *
- * A zero maximum message size means the size is unlimited.
- *
- * @param[in] link a link object
- * @return the remote view of the maximum message size for a link
- */
-PN_EXTERN uint64_t pn_link_remote_max_message_size(pn_link_t *link);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* link.h */
-
diff --git a/proton-c/include/proton/listener.h b/proton-c/include/proton/listener.h
deleted file mode 100644
index 8b70c9a..0000000
--- a/proton-c/include/proton/listener.h
+++ /dev/null
@@ -1,122 +0,0 @@
-#ifndef PROTON_LISTENER_H
-#define PROTON_LISTENER_H 1
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <proton/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- *
- * **Experimental** - A listener for incoming connections for the @ref
- * proactor.
- *
- * @addtogroup proactor
- * @{
- */
-
-/**
- * @cond INTERNAL
- */
-typedef struct pn_proactor_t pn_proactor_t;
-typedef struct pn_condition_t pn_condition_t;
-/**
- * @endcond
- */
-
-/**
- * A listener accepts connections.
- */
-typedef struct pn_listener_t pn_listener_t;
-
-/**
- * Create a listener.
- *
- * You can use pn_listener_set_context() or pn_listener_attachments() to set
- * application data that can be accessed when accepting connections.
- *
- * You must pass the returned listener to pn_proactor_listen(), the proactor
- * will free the listener when it is no longer active.
- */
-PN_EXTERN pn_listener_t *pn_listener(void);
-
-/**
- * Asynchronously accept a connection using the listener.
- *
- * @param[in] connection the listener takes ownership, do not free.
- */
-PN_EXTERN int pn_listener_accept(pn_listener_t*, pn_connection_t *connection);
-
-/**
- * Get the error condition for a listener.
- */
-PN_EXTERN pn_condition_t *pn_listener_condition(pn_listener_t *l);
-
-/**
- * @cond INTERNAL
- */
-    
-/**
- * @deprecated
- *
- * Get the application context that is associated with a listener.
- */
-PN_EXTERN void *pn_listener_get_context(pn_listener_t *listener);
-
-/**
- * @deprecated
- *
- * Set a new application context for a listener.
- */
-PN_EXTERN void pn_listener_set_context(pn_listener_t *listener, void *context);
-
-/**
- * @endcond
- */
-    
-/**
- * Get the attachments that are associated with a listener object.
- */
-PN_EXTERN pn_record_t *pn_listener_attachments(pn_listener_t *listener);
-
-/**
- * Close the listener (thread safe).
- */
-PN_EXTERN void pn_listener_close(pn_listener_t *l);
-
-/**
- * The proactor associated with a listener.
- */
-PN_EXTERN pn_proactor_t *pn_listener_proactor(pn_listener_t *c);
-
-
-/**
- *@}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* listener.h */
diff --git a/proton-c/include/proton/log.h b/proton-c/include/proton/log.h
deleted file mode 100644
index 35538f7..0000000
--- a/proton-c/include/proton/log.h
+++ /dev/null
@@ -1,71 +0,0 @@
-#ifndef LOG_H
-#define LOG_H
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <proton/import_export.h>
-#include <proton/type_compat.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @cond INTERNAL
- */
-    
-/**
- * @file
- *
- * Control log messages that are not associated with a transport.
- * See pn_transport_trace for transport-related logging.
- */
-
-/**
- * Callback for customized logging.
- */
-typedef void (*pn_logger_t)(const char *message);
-
-/**
- * Enable/disable global logging.
- *
- * By default, logging is enabled by envionment variable PN_TRACE_LOG.
- * Calling this function overrides the environment setting.
- */
-PN_EXTERN void pn_log_enable(bool enabled);
-
-/**
- * Set the logger.
- *
- * By default a logger that prints to stderr is installed.
- *  
- * @param logger is called with each log messsage if logging is enabled.
- * Passing 0 disables logging regardless of pn_log_enable() or environment settings.
- */
-PN_EXTERN void pn_log_logger(pn_logger_t logger);
-
-/**
- * @endcond
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/proton-c/include/proton/message.h b/proton-c/include/proton/message.h
deleted file mode 100644
index 5c310b0..0000000
--- a/proton-c/include/proton/message.h
+++ /dev/null
@@ -1,754 +0,0 @@
-#ifndef PROTON_MESSAGE_H
-#define PROTON_MESSAGE_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/types.h>
-#include <proton/codec.h>
-#include <proton/error.h>
-#include <proton/type_compat.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- *
- * @copybrief message
- *
- * @addtogroup message
- * @{
- */
-
-/**
- * An AMQP Message object.
- *
- * An AMQP Message object is a mutable holder of message content that
- * may be used to generate and encode or decode and access AMQP
- * formatted message data.
- */
-typedef struct pn_message_t pn_message_t;
-
-/**
- * Default priority for messages.
- */
-#define PN_DEFAULT_PRIORITY (4)
-
-/**
- * Construct a new ::pn_message_t.
- *
- * Every message that is constructed must be freed using
- * ::pn_message_free().
- *
- * @return pointer to a new ::pn_message_t
- */
-PN_EXTERN pn_message_t * pn_message(void);
-
-/**
- * Free a previously constructed ::pn_message_t.
- *
- * @param[in] msg pointer to a ::pn_message_t or NULL
- */
-PN_EXTERN void           pn_message_free(pn_message_t *msg);
-
-/**
- * Clears the content of a ::pn_message_t.
- *
- * When pn_message_clear returns, the supplied ::pn_message_t will be
- * emptied of all content and effectively returned to the same state
- * as if it was just created.
- *
- * @param[in] msg pointer to the ::pn_message_t to be cleared
- */
-PN_EXTERN void           pn_message_clear(pn_message_t *msg);
-
-/**
- * Access the error code of a message.
- *
- * Every operation on a message that can result in an error will set
- * the message's error code in case of error. The pn_message_errno()
- * call will access the error code of the most recent failed
- * operation.
- *
- * @param[in] msg a message
- * @return the message's error code
- */
-PN_EXTERN int            pn_message_errno(pn_message_t *msg);
-
-/**
- * Access the error information for a message.
- *
- * Every operation on a message that can result in an error will
- * update the error information held by its error descriptor should
- * that operation fail. The pn_message_error() call will access the
- * error information of the most recent failed operation. The pointer
- * returned by this call is valid until the message is freed.
- *
- * @param[in] msg a message
- * @return the message's error descriptor
- */
-PN_EXTERN pn_error_t    *pn_message_error(pn_message_t *msg);
-
-/**
- * Get the inferred flag for a message.
- *
- * The inferred flag for a message indicates how the message content
- * is encoded into AMQP sections. If inferred is true then binary and
- * list values in the body of the message will be encoded as AMQP DATA
- * and AMQP SEQUENCE sections, respectively. If inferred is false,
- * then all values in the body of the message will be encoded as AMQP
- * VALUE sections regardless of their type. Use
- * ::pn_message_set_inferred to set the value.
- *
- * @param[in] msg a message object
- * @return the value of the inferred flag for the message
- */
-PN_EXTERN bool           pn_message_is_inferred(pn_message_t *msg);
-
-/**
- * Set the inferred flag for a message.
- *
- * See ::pn_message_is_inferred() for a description of what the
- * inferred flag is.
- *
- * @param[in] msg a message object
- * @param[in] inferred the new value of the inferred flag
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int            pn_message_set_inferred(pn_message_t *msg, bool inferred);
-
-// standard message headers and properties
-
-/**
- * Get the durable flag for a message.
- *
- * The durable flag indicates that any parties taking responsibility
- * for the message must durably store the content.
- *
- * @param[in] msg a message object
- * @return the value of the durable flag
- */
-PN_EXTERN bool           pn_message_is_durable            (pn_message_t *msg);
-
-/**
- * Set the durable flag for a message.
- *
- * See ::pn_message_is_durable() for a description of the durable
- * flag.
- *
- * @param[in] msg a message object
- * @param[in] durable the new value of the durable flag
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int            pn_message_set_durable           (pn_message_t *msg, bool durable);
-
-/**
- * Get the priority for a message.
- *
- * The priority of a message impacts ordering guarantees. Within a
- * given ordered context, higher priority messages may jump ahead of
- * lower priority messages.
- *
- * @param[in] msg a message object
- * @return the message priority
- */
-PN_EXTERN uint8_t        pn_message_get_priority          (pn_message_t *msg);
-
-/**
- * Set the priority for a message.
- *
- * See ::pn_message_get_priority() for details on message priority.
- *
- * @param[in] msg a message object
- * @param[in] priority the new priority for the message
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int            pn_message_set_priority          (pn_message_t *msg, uint8_t priority);
-
-/**
- * Get the ttl for a message.
- *
- * The ttl for a message determines how long a message is considered
- * live. When a message is held for retransmit, the ttl is
- * decremented. Once the ttl reaches zero, the message is considered
- * dead. Once a message is considered dead it may be dropped. Use
- * ::pn_message_set_ttl() to set the ttl for a message.
- *
- * @param[in] msg a message object
- * @return the ttl in milliseconds
- */
-PN_EXTERN pn_millis_t    pn_message_get_ttl               (pn_message_t *msg);
-
-/**
- * Set the ttl for a message.
- *
- * See ::pn_message_get_ttl() for a detailed description of message ttl.
- *
- * @param[in] msg a message object
- * @param[in] ttl the new value for the message ttl
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int            pn_message_set_ttl               (pn_message_t *msg, pn_millis_t ttl);
-
-/**
- * Get the first acquirer flag for a message.
- *
- * When set to true, the first acquirer flag for a message indicates
- * that the recipient of the message is the first recipient to acquire
- * the message, i.e. there have been no failed delivery attempts to
- * other acquirers. Note that this does not mean the message has not
- * been delivered to, but not acquired, by other recipients.
- *
- * @param[in] msg a message object
- * @return the first acquirer flag for the message
- */
-PN_EXTERN bool           pn_message_is_first_acquirer     (pn_message_t *msg);
-
-/**
- * Set the first acquirer flag for a message.
- *
- * See ::pn_message_is_first_acquirer() for details on the first
- * acquirer flag.
- *
- * @param[in] msg a message object
- * @param[in] first the new value for the first acquirer flag
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int            pn_message_set_first_acquirer    (pn_message_t *msg, bool first);
-
-/**
- * Get the delivery count for a message.
- *
- * The delivery count field tracks how many attempts have been made to
- * delivery a message. Use ::pn_message_set_delivery_count() to set
- * the delivery count for a message.
- *
- * @param[in] msg a message object
- * @return the delivery count for the message
- */
-PN_EXTERN uint32_t       pn_message_get_delivery_count    (pn_message_t *msg);
-
-/**
- * Set the delivery count for a message.
- *
- * See ::pn_message_get_delivery_count() for details on what the
- * delivery count means.
- *
- * @param[in] msg a message object
- * @param[in] count the new delivery count
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int            pn_message_set_delivery_count    (pn_message_t *msg, uint32_t count);
-
-/**
- * Get/set the id for a message.
- *
- * The message id provides a globally unique identifier for a message.
- * A message id can be an a string, an unsigned long, a uuid or a
- * binary value. This operation returns a pointer to a ::pn_data_t
- * that can be used to access and/or modify the value of the message
- * id. The pointer is valid until the message is freed. See
- * ::pn_data_t for details on how to get/set the value.
- *
- * @param[in] msg a message object
- * @return pointer to a ::pn_data_t holding the id
- */
-PN_EXTERN pn_data_t *    pn_message_id                    (pn_message_t *msg);
-
-/**
- * Get the id for a message.
- *
- * The message id provides a globally unique identifier for a message.
- * A message id can be an a string, an unsigned long, a uuid or a
- * binary value. This operation returns the value of the id using the
- * ::pn_atom_t descriminated union. See ::pn_atom_t for details on how
- * to access the value.
- *
- * @param[in] msg a message object
- * @return the message id
- */
-PN_EXTERN pn_atom_t      pn_message_get_id                (pn_message_t *msg);
-
-/**
- * Set the id for a message.
- *
- * See ::pn_message_get_id() for more details on the meaning of the
- * message id. Note that only string, unsigned long, uuid, or binary
- * values are permitted.
- *
- * @param[in] msg a message object
- * @param[in] id the new value of the message id
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int            pn_message_set_id                (pn_message_t *msg, pn_atom_t id);
-
-/**
- * Get the user id for a message.
- *
- * The pointer referenced by the ::pn_bytes_t struct will be valid
- * until any one of the following operations occur:
- *
- *  - ::pn_message_free()
- *  - ::pn_message_clear()
- *  - ::pn_message_set_user_id()
- *
- * @param[in] msg a message object
- * @return a pn_bytes_t referencing the message's user_id
- */
-PN_EXTERN pn_bytes_t     pn_message_get_user_id           (pn_message_t *msg);
-
-/**
- * Set the user id for a message.
- *
- * This operation copies the bytes referenced by the provided
- * ::pn_bytes_t struct.
- *
- * @param[in] msg a message object
- * @param[in] user_id the new user_id for the message
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int            pn_message_set_user_id           (pn_message_t *msg, pn_bytes_t user_id);
-
-/**
- * Get the address for a message.
- *
- * This operation will return NULL if no address has been set or if
- * the address has been set to NULL. The pointer returned by this
- * operation is valid until any one of the following operations occur:
- *
- *  - ::pn_message_free()
- *  - ::pn_message_clear()
- *  - ::pn_message_set_address()
- *
- * @param[in] msg a message object
- * @return a pointer to the address of the message (or NULL)
- */
-PN_EXTERN const char *   pn_message_get_address           (pn_message_t *msg);
-
-/**
- * Set the address for a message.
- *
- * The supplied address pointer must either be NULL or reference a NUL
- * terminated string. When the pointer is NULL, the address of the
- * message is set to NULL. When the pointer is non NULL, the contents
- * are copied into the message.
- *
- * @param[in] msg a message object
- * @param[in] address a pointer to the new address (or NULL)
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int            pn_message_set_address           (pn_message_t *msg, const char *address);
-
-/**
- * Get the subject for a message.
- *
- * This operation will return NULL if no subject has been set or if
- * the subject has been set to NULL. The pointer returned by this
- * operation is valid until any one of the following operations occur:
- *
- *  - ::pn_message_free()
- *  - ::pn_message_clear()
- *  - ::pn_message_set_subject()
- *
- * @param[in] msg a message object
- * @return a pointer to the subject of the message (or NULL)
- */
-PN_EXTERN const char *   pn_message_get_subject           (pn_message_t *msg);
-
-/**
- * Set the subject for a message.
- *
- * The supplied subject pointer must either be NULL or reference a NUL
- * terminated string. When the pointer is NULL, the subject is set to
- * NULL. When the pointer is non NULL, the contents are copied into
- * the message.
- *
- * @param[in] msg a message object
- * @param[in] subject a pointer to the new subject (or NULL)
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int            pn_message_set_subject           (pn_message_t *msg, const char *subject);
-
-/**
- * Get the reply_to for a message.
- *
- * This operation will return NULL if no reply_to has been set or if
- * the reply_to has been set to NULL. The pointer returned by this
- * operation is valid until any one of the following operations occur:
- *
- *  - ::pn_message_free()
- *  - ::pn_message_clear()
- *  - ::pn_message_set_reply_to()
- *
- * @param[in] msg a message object
- * @return a pointer to the reply_to of the message (or NULL)
- */
-PN_EXTERN const char *   pn_message_get_reply_to          (pn_message_t *msg);
-
-/**
- * Set the reply_to for a message.
- *
- * The supplied reply_to pointer must either be NULL or reference a NUL
- * terminated string. When the pointer is NULL, the reply_to is set to
- * NULL. When the pointer is non NULL, the contents are copied into
- * the message.
- *
- * @param[in] msg a message object
- * @param[in] reply_to a pointer to the new reply_to (or NULL)
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int            pn_message_set_reply_to          (pn_message_t *msg, const char *reply_to);
-
-/**
- * Get/set the correlation id for a message.
- *
- * A correlation id can be an a string, an unsigned long, a uuid or a
- * binary value. This operation returns a pointer to a ::pn_data_t
- * that can be used to access and/or modify the value of the
- * correlation id. The pointer is valid until the message is freed.
- * See ::pn_data_t for details on how to get/set the value.
- *
- * @param[in] msg a message object
- * @return pointer to a ::pn_data_t holding the correlation id
- */
-PN_EXTERN pn_data_t *    pn_message_correlation_id        (pn_message_t *msg);
-
-/**
- * Get the correlation id for a message.
- *
- * A correlation id can be an a string, an unsigned long, a uuid or a
- * binary value. This operation returns the value of the id using the
- * ::pn_atom_t descriminated union. See ::pn_atom_t for details on how
- * to access the value.
- *
- * @param[in] msg a message object
- * @return the message id
- */
-PN_EXTERN pn_atom_t      pn_message_get_correlation_id    (pn_message_t *msg);
-
-/**
- * Set the correlation id for a message.
- *
- * See ::pn_message_get_correlation_id() for more details on the
- * meaning of the correlation id. Note that only string, unsigned
- * long, uuid, or binary values are permitted.
- *
- * @param[in] msg a message object
- * @param[in] id the new value of the message id
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int            pn_message_set_correlation_id    (pn_message_t *msg, pn_atom_t id);
-
-/**
- * Get the content_type for a message.
- *
- * This operation will return NULL if no content_type has been set or if
- * the content_type has been set to NULL. The pointer returned by this
- * operation is valid until any one of the following operations occur:
- *
- *  - ::pn_message_free()
- *  - ::pn_message_clear()
- *  - ::pn_message_set_content_type()
- *
- * @param[in] msg a message object
- * @return a pointer to the content_type of the message (or NULL)
- */
-PN_EXTERN const char *   pn_message_get_content_type      (pn_message_t *msg);
-
-/**
- * Set the content_type for a message.
- *
- * The supplied content_type pointer must either be NULL or reference a NUL
- * terminated string. When the pointer is NULL, the content_type is set to
- * NULL. When the pointer is non NULL, the contents are copied into
- * the message.
- *
- * @param[in] msg a message object
- * @param[in] type a pointer to the new content_type (or NULL)
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int            pn_message_set_content_type      (pn_message_t *msg, const char *type);
-
-/**
- * Get the content_encoding for a message.
- *
- * This operation will return NULL if no content_encoding has been set or if
- * the content_encoding has been set to NULL. The pointer returned by this
- * operation is valid until any one of the following operations occur:
- *
- *  - ::pn_message_free()
- *  - ::pn_message_clear()
- *  - ::pn_message_set_content_encoding()
- *
- * @param[in] msg a message object
- * @return a pointer to the content_encoding of the message (or NULL)
- */
-PN_EXTERN const char *   pn_message_get_content_encoding  (pn_message_t *msg);
-
-/**
- * Set the content_encoding for a message.
- *
- * The supplied content_encoding pointer must either be NULL or reference a NUL
- * terminated string. When the pointer is NULL, the content_encoding is set to
- * NULL. When the pointer is non NULL, the contents are copied into
- * the message.
- *
- * @param[in] msg a message object
- * @param[in] encoding a pointer to the new content_encoding (or NULL)
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int            pn_message_set_content_encoding  (pn_message_t *msg, const char *encoding);
-
-/**
- * Get the expiry time for a message.
- *
- * A zero value for the expiry time indicates that the message will
- * never expire. This is the default value.
- *
- * @param[in] msg a message object
- * @return the expiry time for the message
- */
-PN_EXTERN pn_timestamp_t pn_message_get_expiry_time       (pn_message_t *msg);
-
-/**
- * Set the expiry time for a message.
- *
- * See ::pn_message_get_expiry_time() for more details.
- *
- * @param[in] msg a message object
- * @param[in] time the new expiry time for the message
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int            pn_message_set_expiry_time       (pn_message_t *msg, pn_timestamp_t time);
-
-/**
- * Get the creation time for a message.
- *
- * A zero value for the creation time indicates that the creation time
- * has not been set. This is the default value.
- *
- * @param[in] msg a message object
- * @return the creation time for the message
- */
-PN_EXTERN pn_timestamp_t pn_message_get_creation_time     (pn_message_t *msg);
-
-/**
- * Set the creation time for a message.
- *
- * See ::pn_message_get_creation_time() for more details.
- *
- * @param[in] msg a message object
- * @param[in] time the new creation time for the message
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int            pn_message_set_creation_time     (pn_message_t *msg, pn_timestamp_t time);
-
-/**
- * Get the group_id for a message.
- *
- * This operation will return NULL if no group_id has been set or if
- * the group_id has been set to NULL. The pointer returned by this
- * operation is valid until any one of the following operations occur:
- *
- *  - ::pn_message_free()
- *  - ::pn_message_clear()
- *  - ::pn_message_set_group_id()
- *
- * @param[in] msg a message object
- * @return a pointer to the group_id of the message (or NULL)
- */
-PN_EXTERN const char *   pn_message_get_group_id          (pn_message_t *msg);
-
-/**
- * Set the group_id for a message.
- *
- * The supplied group_id pointer must either be NULL or reference a NUL
- * terminated string. When the pointer is NULL, the group_id is set to
- * NULL. When the pointer is non NULL, the contents are copied into
- * the message.
- *
- * @param[in] msg a message object
- * @param[in] group_id a pointer to the new group_id (or NULL)
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int            pn_message_set_group_id          (pn_message_t *msg, const char *group_id);
-
-/**
- * Get the group sequence for a message.
- *
- * The group sequence of a message identifies the relative ordering of
- * messages within a group. The default value for the group sequence
- * of a message is zero.
- *
- * @param[in] msg a message object
- * @return the group sequence for the message
- */
-PN_EXTERN pn_sequence_t  pn_message_get_group_sequence    (pn_message_t *msg);
-
-/**
- * Set the group sequence for a message.
- *
- * See ::pn_message_get_group_sequence() for details on what the group
- * sequence means.
- *
- * @param[in] msg a message object
- * @param[in] n the new group sequence for the message
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int            pn_message_set_group_sequence    (pn_message_t *msg, pn_sequence_t n);
-
-/**
- * Get the reply_to_group_id for a message.
- *
- * This operation will return NULL if no reply_to_group_id has been set or if
- * the reply_to_group_id has been set to NULL. The pointer returned by this
- * operation is valid until any one of the following operations occur:
- *
- *  - ::pn_message_free()
- *  - ::pn_message_clear()
- *  - ::pn_message_set_reply_to_group_id()
- *
- * @param[in] msg a message object
- * @return a pointer to the reply_to_group_id of the message (or NULL)
- */
-PN_EXTERN const char *   pn_message_get_reply_to_group_id (pn_message_t *msg);
-
-/**
- * Set the reply_to_group_id for a message.
- *
- * The supplied reply_to_group_id pointer must either be NULL or reference a NUL
- * terminated string. When the pointer is NULL, the reply_to_group_id is set to
- * NULL. When the pointer is non NULL, the contents are copied into
- * the message.
- *
- * @param[in] msg a message object
- * @param[in] reply_to_group_id a pointer to the new reply_to_group_id (or NULL)
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int            pn_message_set_reply_to_group_id (pn_message_t *msg, const char *reply_to_group_id);
-
-/**
- * Get/set the delivery instructions for a message.
- *
- * This operation returns a pointer to a ::pn_data_t representing the
- * content of the delivery instructions section of a message. The
- * pointer is valid until the message is freed and may be used to both
- * access and modify the content of the delivery instructions section
- * of a message.
- *
- * The ::pn_data_t must either be empty or consist of a symbol keyed
- * map in order to be considered valid delivery instructions.
- *
- * @param[in] msg a message object
- * @return a pointer to the delivery instructions
- */
-PN_EXTERN pn_data_t *pn_message_instructions(pn_message_t *msg);
-
-/**
- * Get/set the annotations for a message.
- *
- * This operation returns a pointer to a ::pn_data_t representing the
- * content of the annotations section of a message. The pointer is
- * valid until the message is freed and may be used to both access and
- * modify the content of the annotations section of a message.
- *
- * The ::pn_data_t must either be empty or consist of a symbol keyed
- * map in order to be considered valid message annotations.
- *
- * @param[in] msg a message object
- * @return a pointer to the message annotations
- */
-PN_EXTERN pn_data_t *pn_message_annotations(pn_message_t *msg);
-
-/**
- * Get/set the properties for a message.
- *
- * This operation returns a pointer to a ::pn_data_t representing the
- * content of the properties section of a message. The pointer is
- * valid until the message is freed and may be used to both access and
- * modify the content of the properties section of a message.
- *
- * The ::pn_data_t must either be empty or consist of a string keyed
- * map in order to be considered valid message properties.
- *
- * @param[in] msg a message object
- * @return a pointer to the message properties
- */
-PN_EXTERN pn_data_t *pn_message_properties(pn_message_t *msg);
-
-/**
- * Get/set the body of a message.
- *
- * This operation returns a pointer to a ::pn_data_t representing the
- * body of a message. The pointer is valid until the message is freed
- * and may be used to both access and modify the content of the
- * message body.
- *
- * @param[in] msg a message object
- * @return a pointer to the message body
- */
-PN_EXTERN pn_data_t *pn_message_body(pn_message_t *msg);
-
-/**
- * Decode/load message content from AMQP formatted binary data.
- *
- * Upon invoking this operation, any existing message content will be
- * cleared and replaced with the content from the provided binary
- * data.
- *
- * @param[in] msg a message object
- * @param[in] bytes the start of the encoded AMQP data
- * @param[in] size the size of the encoded AMQP data
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_message_decode(pn_message_t *msg, const char *bytes, size_t size);
-
-/**
- * Encode/save message content as AMQP formatted binary data.
- *
- * If the buffer space provided is insufficient to store the content
- * held in the message, the operation will fail and return a
- * PN_OVERFLOW error code.
- *
- * @param[in] msg a message object
- * @param[in] bytes the start of empty buffer space
- * @param[in] size the amount of empty buffer space
- * @param[out] size the amount of data written
- * @return zero on success or an error code on failure
- */
-PN_EXTERN int pn_message_encode(pn_message_t *msg, char *bytes, size_t *size);
-
-/**
- * Save message content into a pn_data_t object data. The data object will first be cleared.
- */
-PN_EXTERN int pn_message_data(pn_message_t *msg, pn_data_t *data);
-
-/** @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* message.h */
diff --git a/proton-c/include/proton/messenger.h b/proton-c/include/proton/messenger.h
deleted file mode 100644
index 74c3fc6..0000000
--- a/proton-c/include/proton/messenger.h
+++ /dev/null
@@ -1,1060 +0,0 @@
-#ifndef PROTON_MESSENGER_H
-#define PROTON_MESSENGER_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/message.h>
-#include <proton/selectable.h>
-#include <proton/link.h>
-#include <proton/transport.h>
-#include <proton/ssl.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- *
- * @copybrief messenger
- *
- * @deprecated
- *
- * @addtogroup messenger
- * @{
- */
-
-/**
- * A ::pn_messenger_t provides a high level interface for sending and
- * receiving messages (See ::pn_message_t).
- *
- * Every messenger contains a single logical queue of incoming
- * messages and a single logical queue of outgoing messages. The
- * messages in these queues may be destined for, or originate from, a
- * variety of addresses.
- *
- * The messenger interface is single-threaded. All methods except one
- * (::pn_messenger_interrupt()) are intended to be used by one thread
- * at a time.
- *
- *
- * Address Syntax
- * ==============
- *
- * An address has the following form::
- *
- *   [ amqp[s]:// ] [user[:password]@] domain [/[name]]
- *
- * Where domain can be one of::
- *
- *   host | host:port | ip | ip:port | name
- *
- * The following are valid examples of addresses:
- *
- *  - example.org
- *  - example.org:1234
- *  - amqp://example.org
- *  - amqps://example.org
- *  - example.org/incoming
- *  - amqps://example.org/outgoing
- *  - amqps://fred:trustno1@example.org
- *  - 127.0.0.1:1234
- *  - amqps://127.0.0.1:1234
- *
- * Sending & Receiving Messages
- * ============================
- *
- * The messenger API works in conjuction with the ::pn_message_t API.
- * A ::pn_message_t is a mutable holder of message content.
- *
- * The ::pn_messenger_put() operation copies content from the supplied
- * ::pn_message_t to the outgoing queue, and may send queued messages
- * if it can do so without blocking. The ::pn_messenger_send()
- * operation blocks until it has sent the requested number of
- * messages, or until a timeout interrupts the attempt.
- *
- *
- *   pn_messenger_t *messenger = pn_messenger(NULL);
- *   pn_message_t *message = pn_message();
- *   char subject[1024];
- *   for (int i = 0; i < 3; i++) {
- *     pn_message_set_address(message, "amqp://host/queue");
- *     sprintf(subject, "Hello World! %i", i);
- *     pn_message_set_subject(message, subject);
- *     pn_messenger_put(messenger, message)
- *   pn_messenger_send(messenger);
- *
- * Similarly, the ::pn_messenger_recv() method receives messages into
- * the incoming queue, and may block as it attempts to receive up to
- * the requested number of messages, or until the timeout is reached.
- * It may receive fewer than the requested number. The
- * ::pn_messenger_get() method pops the eldest message off the
- * incoming queue and copies its content into the supplied
- * ::pn_message_t object. It will not block.
- *
- *
- *   pn_messenger_t *messenger = pn_messenger(NULL);
- *   pn_message_t *message = pn_message()
- *   pn_messenger_recv(messenger):
- *   while (pn_messenger_incoming(messenger) > 0) {
- *     pn_messenger_get(messenger, message);
- *     printf("%s", message.subject);
- *   }
- *
- *   Output:
- *     Hello World 0
- *     Hello World 1
- *     Hello World 2
- *
- * The blocking flag allows you to turn off blocking behavior
- * entirely, in which case ::pn_messenger_send() and
- * ::pn_messenger_recv() will do whatever they can without blocking,
- * and then return. You can then look at the number of incoming and
- * outgoing messages to see how much outstanding work still remains.
- *
- * Authentication Mechanims
- * ========================
- *
- * The messenger API authenticates using some specific mechanisms. In prior versions
- * of Proton the only authentication mechanism available was the PLAIN mechanism
- * which transports the user's password over the network unencrypted. The Proton versions
- * 0.10 and newer support other more secure mechanisms which avoid sending the users's
- * password over the network unencrypted. For backwards compatibility the 0.10 version
- * of the messenger API will also allow the use of the unencrypted PLAIN mechanism. From the
- * 0.11 version and onwards you will need to set the flag PN_FLAGS_ALLOW_INSECURE_MECHS to
- * carry on using the unencrypted PLAIN mechanism.
- *
- * The code for this looks like:
- *
- *   ...
- *   pn_messenger_set_flags(messenger, PN_FLAGS_ALLOW_INSECURE_MECHS);
- *   ...
- *
- * Note that the use of the PLAIN mechanism over an SSL connection is allowed as the
- * password is not sent unencrypted.
- */
-typedef struct pn_messenger_t pn_messenger_t;
-
-/**
- * A subscription is a request for incoming messages.
- *
- * @todo currently the subscription API is under developed, this
- * should allow more explicit control over subscription properties and
- * behaviour
- */
-typedef struct pn_subscription_t pn_subscription_t;
-
-/**
- * Trackers provide a lightweight handle used to track the status of
- * incoming and outgoing deliveries.
- */
-typedef int64_t pn_tracker_t;
-
-/**
- * Describes all the possible states for a message associated with a
- * given tracker.
- */
-typedef enum {
-  PN_STATUS_UNKNOWN = 0, /**< The tracker is unknown. */
-  PN_STATUS_PENDING = 1, /**< The message is in flight. For outgoing
-                            messages, use ::pn_messenger_buffered to
-                            see if it has been sent or not. */
-  PN_STATUS_ACCEPTED = 2, /**< The message was accepted. */
-  PN_STATUS_REJECTED = 3, /**< The message was rejected. */
-  PN_STATUS_RELEASED = 4, /**< The message was released. */
-  PN_STATUS_MODIFIED = 5, /**< The message was modified. */
-  PN_STATUS_ABORTED = 6, /**< The message was aborted. */
-  PN_STATUS_SETTLED = 7 /**< The remote party has settled the message. */
-} pn_status_t;
-
-/**
- * Construct a new ::pn_messenger_t with the given name. The name is
- * global. If a NULL name is supplied, a UUID based name will be
- * chosen.
- *
- * @param[in] name the name of the messenger or NULL
- *
- * @return pointer to a new ::pn_messenger_t
- */
-PNX_EXTERN pn_messenger_t *pn_messenger(const char *name);
-
-/**
- * Get the name of a messenger.
- *
- * @param[in] messenger a messenger object
- * @return the name of the messenger
- */
-PNX_EXTERN const char *pn_messenger_name(pn_messenger_t *messenger);
-
-/**
- * Sets the path that will be used to get the certificate that will be
- * used to identify this messenger to its peers. The validity of the
- * path is not checked by this function.
- *
- * @param[in] messenger the messenger
- * @param[in] certificate a path to a certificate file
- * @return an error code of zero if there is no error
- */
-PNX_EXTERN int pn_messenger_set_certificate(pn_messenger_t *messenger, const char *certificate);
-
-/**
- * Get the certificate path. This value may be set by
- * pn_messenger_set_certificate. The default certificate path is null.
- *
- * @param[in] messenger the messenger
- * @return the certificate file path
- */
-PNX_EXTERN const char *pn_messenger_get_certificate(pn_messenger_t *messenger);
-
-/**
- * Set path to the private key that was used to sign the certificate.
- * See ::pn_messenger_set_certificate
- *
- * @param[in] messenger a messenger object
- * @param[in] private_key a path to a private key file
- * @return an error code of zero if there is no error
- */
-PNX_EXTERN int pn_messenger_set_private_key(pn_messenger_t *messenger, const char *private_key);
-
-/**
- * Gets the private key file for a messenger.
- *
- * @param[in] messenger a messenger object
- * @return the messenger's private key file path
- */
-PNX_EXTERN const char *pn_messenger_get_private_key(pn_messenger_t *messenger);
-
-/**
- * Sets the private key password for a messenger.
- *
- * @param[in] messenger a messenger object
- * @param[in] password the password for the private key file
- *
- * @return an error code of zero if there is no error
- */
-PNX_EXTERN int pn_messenger_set_password(pn_messenger_t *messenger, const char *password);
-
-/**
- * Gets the private key file password for a messenger.
- *
- * @param[in] messenger a messenger object
- * @return password for the private key file
- */
-PNX_EXTERN const char *pn_messenger_get_password(pn_messenger_t *messenger);
-
-/**
- * Sets the trusted certificates database for a messenger.
- *
- * The messenger will use this database to validate the certificate
- * provided by the peer.
- *
- * @param[in] messenger a messenger object
- * @param[in] cert_db a path to the certificates database
- *
- * @return an error code of zero if there is no error
- */
-PNX_EXTERN int pn_messenger_set_trusted_certificates(pn_messenger_t *messenger, const char *cert_db);
-
-/**
- * Gets the trusted certificates database for a messenger.
- *
- * @param[in] messenger a messenger object
- * @return path to the trusted certificates database
- */
-PNX_EXTERN const char *pn_messenger_get_trusted_certificates(pn_messenger_t *messenger);
-
-/**
- * Set the default timeout for a messenger.
- *
- * Any messenger call that blocks during execution will stop blocking
- * and return control when this timeout is reached, if you have set it
- * to a value greater than zero. The timeout is expressed in
- * milliseconds.
- *
- * @param[in] messenger a messenger object
- * @param[in] timeout a new timeout for the messenger, in milliseconds
- * @return an error code or zero if there is no error
- */
-PNX_EXTERN int pn_messenger_set_timeout(pn_messenger_t *messenger, int timeout);
-
-/**
- * Gets the timeout for a messenger object.
- *
- * See ::pn_messenger_set_timeout() for details.
- *
- * @param[in] messenger a messenger object
- * @return the timeout for the messenger, in milliseconds
- */
-PNX_EXTERN int pn_messenger_get_timeout(pn_messenger_t *messenger);
-
-/**
- * Check if a messenger is in blocking mode.
- *
- * @param[in] messenger a messenger object
- * @return true if blocking has been enabled, false otherwise
- */
-PNX_EXTERN bool pn_messenger_is_blocking(pn_messenger_t *messenger);
-
-/**
- * Enable or disable blocking behavior for a messenger during calls to
- * ::pn_messenger_send and ::pn_messenger_recv.
- *
- * @param[in] messenger a messenger object
- * @param[in] blocking the value of the blocking flag
- * @return an error code or zero if there is no error
- */
-PNX_EXTERN int pn_messenger_set_blocking(pn_messenger_t *messenger, bool blocking);
-
-/**
- * Check if a messenger is in passive mode.
- *
- * A messenger that is in passive mode will never attempt to perform
- * I/O internally, but instead will make all internal file descriptors
- * accessible through ::pn_messenger_selectable() to be serviced
- * externally. This can be useful for integrating messenger into an
- * external event loop.
- *
- * @param[in] messenger a messenger object
- * @return true if the messenger is in passive mode, false otherwise
- */
-PNX_EXTERN bool pn_messenger_is_passive(pn_messenger_t *messenger);
-
-/**
- * Set the passive mode for a messenger.
- *
- * See ::pn_messenger_is_passive() for details on passive mode.
- *
- * @param[in] messenger a messenger object
- * @param[in] passive true to enable passive mode, false to disable
- * passive mode
- * @return an error code or zero on success
- */
-PNX_EXTERN int pn_messenger_set_passive(pn_messenger_t *messenger, bool passive);
-
-/** Frees a Messenger.
- *
- * @param[in] messenger the messenger to free (or NULL), no longer
- *                      valid on return
- */
-PNX_EXTERN void pn_messenger_free(pn_messenger_t *messenger);
-
-/**
- * Get the code for a messenger's most recent error.
- *
- * The error code is initialized to zero at messenger creation. The
- * error number is "sticky" i.e. error codes are not reset to 0 at the
- * end of successful API calls. You can use ::pn_messenger_error to
- * access the messenger's error object and clear explicitly if
- * desired.
- *
- * @param[in] messenger the messenger to check for errors
- * @return an error code or zero if there is no error
- * @see error.h
- */
-PNX_EXTERN int pn_messenger_errno(pn_messenger_t *messenger);
-
-/**
- * Get a messenger's error object.
- *
- * Returns a pointer to a pn_error_t that is valid until the messenger
- * is freed. The pn_error_* API allows you to access the text, error
- * number, and lets you set or clear the error code explicitly.
- *
- * @param[in] messenger the messenger to check for errors
- * @return a pointer to the messenger's error descriptor
- * @see error.h
- */
-PNX_EXTERN pn_error_t *pn_messenger_error(pn_messenger_t *messenger);
-
-/**
- * Get the size of a messenger's outgoing window.
- *
- * The size of the outgoing window limits the number of messages whose
- * status you can check with a tracker. A message enters this window
- * when you call pn_messenger_put on the message. For example, if your
- * outgoing window size is 10, and you call pn_messenger_put 12 times,
- * new status information will no longer be available for the first 2
- * messages.
- *
- * The default outgoing window size is 0.
- *
- * @param[in] messenger a messenger object
- * @return the outgoing window for the messenger
- */
-PNX_EXTERN int pn_messenger_get_outgoing_window(pn_messenger_t *messenger);
-
-/**
- * Set the size of a messenger's outgoing window.
- *
- * See ::pn_messenger_get_outgoing_window() for details.
- *
- * @param[in] messenger a messenger object
- * @param[in] window the number of deliveries to track
- * @return an error or zero on success
- * @see error.h
- */
-PNX_EXTERN int pn_messenger_set_outgoing_window(pn_messenger_t *messenger, int window);
-
-/**
- * Get the size of a messenger's incoming window.
- *
- * The size of a messenger's incoming window limits the number of
- * messages that can be accepted or rejected using trackers. Messages
- * *do not* enter this window when they have been received
- * (::pn_messenger_recv) onto you incoming queue. Messages only enter
- * this window only when you access them using pn_messenger_get. If
- * your incoming window size is N, and you get N+1 messages without
- * explicitly accepting or rejecting the oldest message, then it will
- * be implicitly accepted when it falls off the edge of the incoming
- * window.
- *
- * The default incoming window size is 0.
- *
- * @param[in] messenger a messenger object
- * @return the incoming window for the messenger
- */
-PNX_EXTERN int pn_messenger_get_incoming_window(pn_messenger_t *messenger);
-
-/**
- * Set the size of a messenger's incoming window.
- *
- * See ::pn_messenger_get_incoming_window() for details.
- *
- * @param[in] messenger a messenger object
- * @param[in] window the number of deliveries to track
- * @return an error or zero on success
- * @see error.h
- */
-PNX_EXTERN int pn_messenger_set_incoming_window(pn_messenger_t *messenger,
-                                               int window);
-
-/**
- * Currently a no-op placeholder. For future compatibility, do not
- * send or receive messages before starting the messenger.
- *
- * @param[in] messenger the messenger to start
- * @return an error code or zero on success
- * @see error.h
- */
-PNX_EXTERN int pn_messenger_start(pn_messenger_t *messenger);
-
-/**
- * Stops a messenger.
- *
- * Stopping a messenger will perform an orderly shutdown of all
- * underlying connections. This may require some time. If the
- * messenger is in non blocking mode (see ::pn_messenger_is_blocking),
- * this operation will return PN_INPROGRESS if it cannot finish
- * immediately. In that case, you can use ::pn_messenger_stopped() to
- * determine when the messenger has finished stopping.
- *
- * @param[in] messenger the messenger to stop
- * @return an error code or zero on success
- * @see error.h
- */
-PNX_EXTERN int pn_messenger_stop(pn_messenger_t *messenger);
-
-/**
- * Returns true if a messenger is in the stopped state. This function
- * does not block.
- *
- * @param[in] messenger the messenger to stop
- *
- */
-PNX_EXTERN bool pn_messenger_stopped(pn_messenger_t *messenger);
-
-/**
- * Subscribes a messenger to messages from the specified source.
- *
- * @param[in] messenger the messenger to subscribe
- * @param[in] source
- * @return a subscription
- */
-PNX_EXTERN pn_subscription_t *pn_messenger_subscribe(pn_messenger_t *messenger, const char *source);
-
-/**
- * Subscribes a messenger to messages from the specified source with the given
- * timeout for the subscription's lifetime.
- *
- * @param[in] messenger the messenger to subscribe
- * @param[in] source
- * @param[in] timeout the maximum time to keep the subscription alive once the
- *            link is closed.
- * @return a subscription
- */
-PNX_EXTERN pn_subscription_t *
-pn_messenger_subscribe_ttl(pn_messenger_t *messenger, const char *source,
-                           pn_seconds_t timeout);
-
-/**
- * Get a link based on link name and whether the link is a sender or receiver
- *
- * @param[in] messenger the messenger to get the link from
- * @param[in] address the link address that identifies the link to receive
- * @param[in] sender true if the link is a sender, false if the link is a
- *            receiver
- * @return a link, or NULL if no link matches the address / sender parameters
- */
-PNX_EXTERN pn_link_t *pn_messenger_get_link(pn_messenger_t *messenger,
-                                           const char *address, bool sender);
-
-/**
- * Get a subscription's application context.
- *
- * See ::pn_subscription_set_context().
- *
- * @param[in] sub a subscription object
- * @return the subscription's application context
- */
-PNX_EXTERN void *pn_subscription_get_context(pn_subscription_t *sub);
-
-/**
- * Set an application context for a subscription.
- *
- * @param[in] sub a subscription object
- * @param[in] context the application context for the subscription
- */
-PNX_EXTERN void pn_subscription_set_context(pn_subscription_t *sub, void *context);
-
-/**
- * Get the source address of a subscription.
- *
- * @param[in] sub a subscription object
- * @return the subscription's source address
- */
-PNX_EXTERN const char *pn_subscription_address(pn_subscription_t *sub);
-
-/**
- * Puts a message onto the messenger's outgoing queue. The message may
- * also be sent if transmission would not cause blocking. This call
- * will not block.
- *
- * @param[in] messenger a messenger object
- * @param[in] msg a message to put on the messenger's outgoing queue
- * @return an error code or zero on success
- * @see error.h
- */
-PNX_EXTERN int pn_messenger_put(pn_messenger_t *messenger, pn_message_t *msg);
-
-/**
- * Track the status of a delivery.
- *
- * Get the current status of the delivery associated with the supplied
- * tracker. This may return PN_STATUS_UNKOWN if the tracker has fallen
- * outside the incoming/outgoing tracking windows of the messenger.
- *
- * @param[in] messenger the messenger
- * @param[in] tracker the tracker identifying the delivery
- * @return a status code for the delivery
- */
-PNX_EXTERN pn_status_t pn_messenger_status(pn_messenger_t *messenger, pn_tracker_t tracker);
-
-/**
- * Get delivery information about a delivery.
- *
- * Returns the delivery information associated with the supplied tracker.
- * This may return NULL if the tracker has fallen outside the
- * incoming/outgoing tracking windows of the messenger.
- *
- * @param[in] messenger the messenger
- * @param[in] tracker the tracker identifying the delivery
- * @return a pn_delivery_t representing the delivery.
- */
-PNX_EXTERN pn_delivery_t *pn_messenger_delivery(pn_messenger_t *messenger,
-                                               pn_tracker_t tracker);
-
-/**
- * Check if the delivery associated with a given tracker is still
- * waiting to be sent.
- *
- * Note that returning false does not imply that the delivery was
- * actually sent over the wire.
- *
- * @param[in] messenger the messenger
- * @param[in] tracker the tracker identifying the delivery
- *
- * @return true if the delivery is still buffered
- */
-PNX_EXTERN bool pn_messenger_buffered(pn_messenger_t *messenger, pn_tracker_t tracker);
-
-/**
- * Frees a Messenger from tracking the status associated with a given
- * tracker. Use the PN_CUMULATIVE flag to indicate everything up to
- * (and including) the given tracker.
- *
- * @param[in] messenger the Messenger
- * @param[in] tracker identifies a delivery
- * @param[in] flags 0 or PN_CUMULATIVE
- *
- * @return an error code or zero on success
- * @see error.h
- */
-PNX_EXTERN int pn_messenger_settle(pn_messenger_t *messenger, pn_tracker_t tracker, int flags);
-
-/**
- * Get a tracker for the outgoing message most recently given to
- * pn_messenger_put.
- *
- * This tracker may be used with pn_messenger_status to determine the
- * delivery status of the message, as long as the message is still
- * within your outgoing window.
- *
- * @param[in] messenger the messenger
- *
- * @return a pn_tracker_t or an undefined value if pn_messenger_get
- *         has never been called for the given messenger
- */
-PNX_EXTERN pn_tracker_t pn_messenger_outgoing_tracker(pn_messenger_t *messenger);
-
-/**
- * Sends or receives any outstanding messages queued for a messenger.
- * This will block for the indicated timeout.
- *
- * @param[in] messenger the Messenger
- * @param[in] timeout the maximum time to block in milliseconds, -1 ==
- * forever, 0 == do not block
- *
- * @return 0 if no work to do, < 0 if error, or 1 if work was done.
- */
-PNX_EXTERN int pn_messenger_work(pn_messenger_t *messenger, int timeout);
-
-/**
- * Interrupt a messenger object that may be blocking in another
- * thread.
- *
- * The messenger interface is single-threaded. This is the only
- * messenger function intended to be concurrently called from another
- * thread. It will interrupt any messenger function which is currently
- * blocking and cause it to return with a status of ::PN_INTR.
- *
- * @param[in] messenger the Messenger to interrupt
- */
-PNX_EXTERN int pn_messenger_interrupt(pn_messenger_t *messenger);
-
-/**
- * Send messages from a messenger's outgoing queue.
- *
- * If a messenger is in blocking mode (see
- * ::pn_messenger_is_blocking()), this operation will block until N
- * messages have been sent from the outgoing queue. A value of -1 for
- * N means "all messages in the outgoing queue". See below for a full
- * definition of what sent from the outgoing queue means.
- *
- * Any blocking will end once the messenger's configured timeout (if
- * any) has been reached. When this happens an error code of
- * ::PN_TIMEOUT is returned.
- *
- * If the messenger is in non blocking mode, this call will return an
- * error code of ::PN_INPROGRESS if it is unable to send the requested
- * number of messages without blocking.
- *
- * A message is considered to be sent from the outgoing queue when its
- * status has been fully determined. This does not necessarily mean
- * the message was successfully sent to the final recipient though,
- * for example of the receiver rejects the message, the final status
- * will be ::PN_STATUS_REJECTED. Similarly, if a message is sent to an
- * invalid address, it may be removed from the outgoing queue without
- * ever even being transmitted. In this case the final status will be
- * ::PN_STATUS_ABORTED.
- *
- * @param[in] messenger a messenger object
- * @param[in] n the number of messages to send
- *
- * @return an error code or zero on success
- * @see error.h
- */
-PNX_EXTERN int pn_messenger_send(pn_messenger_t *messenger, int n);
-
-/**
- * Retrieve messages into a messenger's incoming queue.
- *
- * Instructs a messenger to receive up to @c limit messages into the
- * incoming message queue of a messenger. If @c limit is -1, the
- * messenger will receive as many messages as it can buffer
- * internally. If the messenger is in blocking mode, this call will
- * block until at least one message is available in the incoming
- * queue.
- *
- * Each call to pn_messenger_recv replaces the previous receive
- * operation, so pn_messenger_recv(messenger, 0) will cancel any
- * outstanding receive.
- *
- * After receiving messages onto your incoming queue use
- * ::pn_messenger_get() to access message content.
- *
- * @param[in] messenger the messenger
- * @param[in] limit the maximum number of messages to receive or -1 to
- *                  to receive as many messages as it can buffer
- *                  internally.
- * @return an error code or zero on success
- * @see error.h
- */
-PNX_EXTERN int pn_messenger_recv(pn_messenger_t *messenger, int limit);
-
-/**
- * Get the capacity of the incoming message queue of a messenger.
- *
- * Note this count does not include those messages already available
- * on the incoming queue (@see pn_messenger_incoming()). Rather it
- * returns the number of incoming queue entries available for
- * receiving messages.
- *
- * @param[in] messenger the messenger
- */
-PNX_EXTERN int pn_messenger_receiving(pn_messenger_t *messenger);
-
-/**
- * Get the next message from the head of a messenger's incoming queue.
- *
- * The get operation copies the message data from the head of the
- * messenger's incoming queue into the provided ::pn_message_t object.
- * If provided ::pn_message_t pointer is NULL, the head essage will be
- * discarded. This operation will return ::PN_EOS if there are no
- * messages left on the incoming queue.
- *
- * @param[in] messenger a messenger object
- * @param[out] message upon return contains the message from the head of the queue
- * @return an error code or zero on success
- * @see error.h
- */
-PNX_EXTERN int pn_messenger_get(pn_messenger_t *messenger, pn_message_t *message);
-
-/**
- * Get a tracker for the message most recently retrieved by
- * ::pn_messenger_get().
- *
- * A tracker for an incoming message allows you to accept or reject
- * the associated message. It can also be used for cumulative
- * accept/reject operations for the associated message and all prior
- * messages as well.
- *
- * @param[in] messenger a messenger object
- * @return a pn_tracker_t or an undefined value if pn_messenger_get
- *         has never been called for the given messenger
- */
-PNX_EXTERN pn_tracker_t pn_messenger_incoming_tracker(pn_messenger_t *messenger);
-
-/**
- * Get the subscription of the message most recently retrieved by ::pn_messenger_get().
- *
- * This operation will return NULL if ::pn_messenger_get() has never
- * been succesfully called.
- *
- * @param[in] messenger a messenger object
- * @return a pn_subscription_t or NULL
- */
-PNX_EXTERN pn_subscription_t *pn_messenger_incoming_subscription(pn_messenger_t *messenger);
-
-/**
- * Indicates that an accept or reject should operate cumulatively.
- */
-#define PN_CUMULATIVE (0x1)
-
-/**
- * Signal successful processing of message(s).
- *
- * With no flags this operation will signal the sender that the
- * message referenced by the tracker was accepted. If the
- * PN_CUMULATIVE flag is set, this operation will also reject all
- * pending messages prior to the message indicated by the tracker.
- *
- * Note that when a message is accepted or rejected multiple times,
- * either explicitly, or implicitly through use of the ::PN_CUMULATIVE
- * flag, only the first outcome applies. For example if a sequence of
- * three messages are received: M1, M2, M3, and M2 is rejected, and M3
- * is cumulatively accepted, M2 will remain rejected and only M1 and
- * M3 will be considered accepted.
- *
- * @param[in] messenger a messenger object
- * @param[in] tracker an incoming tracker
- * @param[in] flags 0 or PN_CUMULATIVE
- * @return an error code or zero on success
- * @see error.h
- */
-PNX_EXTERN int pn_messenger_accept(pn_messenger_t *messenger, pn_tracker_t tracker, int flags);
-
-/**
- * Signal unsuccessful processing of message(s).
- *
- * With no flags this operation will signal the sender that the
- * message indicated by the tracker was rejected. If the PN_CUMULATIVE
- * flag is used this operation will also reject all pending messages
- * prior to the message indicated by the tracker.
- *
- * Note that when a message is accepted or rejected multiple times,
- * either explicitly, or implicitly through use of the ::PN_CUMULATIVE
- * flag, only the first outcome applies. For example if a sequence of
- * three messages are received: M1, M2, M3, and M2 is accepted, and M3
- * is cumulatively rejected, M2 will remain accepted and only M1 and
- * M3 will be considered rejected.
- *
- * @param[in] messenger a messenger object
- * @param[in] tracker an incoming tracker
- * @param[in] flags 0 or PN_CUMULATIVE
- * @return an error code or zero on success
- * @see error.h
- */
-PNX_EXTERN int pn_messenger_reject(pn_messenger_t *messenger, pn_tracker_t tracker, int flags);
-
-/**
- * Get  link for the message referenced by the given tracker.
- *
- * @param[in] messenger a messenger object
- * @param[in] tracker a tracker object
- * @return a pn_link_t or NULL if the link could not be determined.
- */
-PNX_EXTERN pn_link_t *pn_messenger_tracker_link(pn_messenger_t *messenger,
-                                               pn_tracker_t tracker);
-
-/**
- * Get the number of messages in the outgoing message queue of a
- * messenger.
- *
- * @param[in] messenger a messenger object
- * @return the outgoing queue depth
- */
-PNX_EXTERN int pn_messenger_outgoing(pn_messenger_t *messenger);
-
-/**
- * Get the number of messages in the incoming message queue of a messenger.
- *
- * @param[in] messenger a messenger object
- * @return the incoming queue depth
- */
-PNX_EXTERN int pn_messenger_incoming(pn_messenger_t *messenger);
-
-//! Adds a routing rule to a Messenger's internal routing table.
-//!
-//! The route procedure may be used to influence how a messenger will
-//! internally treat a given address or class of addresses. Every call
-//! to the route procedure will result in messenger appending a routing
-//! rule to its internal routing table.
-//!
-//! Whenever a message is presented to a messenger for delivery, it
-//! will match the address of this message against the set of routing
-//! rules in order. The first rule to match will be triggered, and
-//! instead of routing based on the address presented in the message,
-//! the messenger will route based on the address supplied in the rule.
-//!
-//! The pattern matching syntax supports two types of matches, a '%'
-//! will match any character except a '/', and a '*' will match any
-//! character including a '/'.
-//!
-//! A routing address is specified as a normal AMQP address, however it
-//! may additionally use substitution variables from the pattern match
-//! that triggered the rule.
-//!
-//! Any message sent to "foo" will be routed to "amqp://foo.com":
-//!
-//!   pn_messenger_route("foo", "amqp://foo.com");
-//!
-//! Any message sent to "foobar" will be routed to
-//! "amqp://foo.com/bar":
-//!
-//!   pn_messenger_route("foobar", "amqp://foo.com/bar");
-//!
-//! Any message sent to bar/&lt;path&gt; will be routed to the corresponding
-//! path within the amqp://bar.com domain:
-//!
-//!   pn_messenger_route("bar/*", "amqp://bar.com/$1");
-//!
-//! Route all messages over TLS:
-//!
-//!   pn_messenger_route("amqp:*", "amqps:$1")
-//!
-//! Supply credentials for foo.com:
-//!
-//!   pn_messenger_route("amqp://foo.com/*", "amqp://user:password@foo.com/$1");
-//!
-//! Supply credentials for all domains:
-//!
-//!   pn_messenger_route("amqp://*", "amqp://user:password@$1");
-//!
-//! Route all addresses through a single proxy while preserving the
-//! original destination:
-//!
-//!   pn_messenger_route("amqp://%/*", "amqp://user:password@proxy/$1/$2");
-//!
-//! Route any address through a single broker:
-//!
-//!   pn_messenger_route("*", "amqp://user:password@broker/$1");
-//!
-//! @param[in] messenger the Messenger
-//! @param[in] pattern a glob pattern
-//! @param[in] address an address indicating alternative routing
-//!
-//! @return an error code or zero on success
-//! @see error.h
-PNX_EXTERN int pn_messenger_route(pn_messenger_t *messenger, const char *pattern,
-                                 const char *address);
-
-/**
- * Rewrite message addresses prior to transmission.
- *
- * This operation is similar to pn_messenger_route, except that the
- * destination of the message is determined before the message address
- * is rewritten.
- *
- * The outgoing address is only rewritten after routing has been
- * finalized.  If a message has an outgoing address of
- * "amqp://0.0.0.0:5678", and a rewriting rule that changes its
- * outgoing address to "foo", it will still arrive at the peer that
- * is listening on "amqp://0.0.0.0:5678", but when it arrives there,
- * the receiver will see its outgoing address as "foo".
- *
- * The default rewrite rule removes username and password from
- * addresses before they are transmitted.
- *
- * @param[in] messenger a messenger object
- * @param[in] pattern a glob pattern to select messages
- * @param[in] address an address indicating outgoing address rewrite
- * @return an error code or zero on success
- */
-PNX_EXTERN int pn_messenger_rewrite(pn_messenger_t *messenger, const char *pattern,
-                                   const char *address);
-
-/**
- * Extract selectables from a passive messenger.
- *
- * A messenger that is in passive mode (see
- * ::pn_messenger_is_passive()) will never attempt to perform any I/O
- * internally, but instead make its internal file descriptors
- * available for external processing via the
- * ::pn_messenger_selectable() operation.
- *
- * An application wishing to perform I/O on behalf of a passive
- * messenger must extract all available selectables by calling this
- * operation until it returns NULL. The selectable interface may then
- * be used by the application to perform I/O outside the messenger.
- *
- * All selectables returned by this operation must be serviced until
- * they reach a terminal state and then freed. See
- * `pn_selectable_is_terminal()` for more details.
- *
- * By default any given selectable will only ever be returned once by
- * this operation, however if the selectable's registered flag is set
- * to true (see `pn_selectable_set_registered()`), then the selectable
- * will be returned whenever its interest set may have changed.
- *
- * @param[in] messenger a messenger object
- * @return the next selectable, or NULL if there are none left
- */
-PNX_EXTERN pn_selectable_t *pn_messenger_selectable(pn_messenger_t *messenger);
-
-/**
- * Get the nearest deadline for selectables associated with a messenger.
- *
- * @param[in] messenger a messenger object
- * @return the nearest deadline
- */
-PNX_EXTERN pn_timestamp_t pn_messenger_deadline(pn_messenger_t *messenger);
-
-#define PN_FLAGS_CHECK_ROUTES                                                   \
-  (0x1) /**< Messenger flag to indicate that a call                             \
-             to pn_messenger_start should check that                            \
-             any defined routes are valid */
-
-#define PN_FLAGS_ALLOW_INSECURE_MECHS                                           \
-  (0x2) /**< Messenger flag to indicate that the PLAIN                          \
-             mechanism is allowed on an unencrypted                             \
-             connection */
-
-/**
- * Sets control flags to enable additional function for the Messenger.
- *
- * @param[in] messenger the messenger
- * @param[in] flags 0 or PN_FLAGS_CHECK_ROUTES
- *
- * @return an error code of zero if there is no error
- */
-PNX_EXTERN int pn_messenger_set_flags(pn_messenger_t *messenger,
-                                     const int flags);
-
-/**
- * Gets the flags for a Messenger.
- *
- * @param[in] messenger the messenger
- * @return The flags set for the messenger
- */
-PNX_EXTERN int pn_messenger_get_flags(pn_messenger_t *messenger);
-
-/**
- * Set the local sender settle mode for the underlying link.
- *
- * @param[in] messenger the messenger
- * @param[in] mode the sender settle mode
- */
-PNX_EXTERN int pn_messenger_set_snd_settle_mode(pn_messenger_t *messenger,
-                                               const pn_snd_settle_mode_t mode);
-
-/**
- * Set the local receiver settle mode for the underlying link.
- *
- * @param[in] messenger the messenger
- * @param[in] mode the receiver settle mode
- */
-PNX_EXTERN int pn_messenger_set_rcv_settle_mode(pn_messenger_t *messenger,
-                                               const pn_rcv_settle_mode_t mode);
-
-/**
- * Set the tracer associated with a messenger.
- *
- * @param[in] messenger a messenger object
- * @param[in] tracer the tracer callback
- */
-PNX_EXTERN void pn_messenger_set_tracer(pn_messenger_t *messenger,
-                                       pn_tracer_t tracer);
-
-/**
- * Gets the remote idle timeout for the specified remote service address
- *
- * @param[in] messenger a messenger object
- * @param[in] address of remote service whose idle timeout is required
- * @return the timeout in milliseconds or -1 if an error occurs
- */
-PNX_EXTERN pn_millis_t
-    pn_messenger_get_remote_idle_timeout(pn_messenger_t *messenger,
-                                         const char *address);
-
-/**
- * Sets the SSL peer authentiacation mode required when a trust
- * certificate is used.
- *
- * @param[in] messenger a messenger object
- * @param[in] mode the mode required (see pn_ssl_verify_mode_t
- *             enum for valid values)
- * @return 0 if successful or -1 if an error occurs
- */
-PNX_EXTERN int
-pn_messenger_set_ssl_peer_authentication_mode(pn_messenger_t *messenger,
-                                              const pn_ssl_verify_mode_t mode);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* messenger.h */
diff --git a/proton-c/include/proton/object.h b/proton-c/include/proton/object.h
deleted file mode 100644
index e7efd94..0000000
--- a/proton-c/include/proton/object.h
+++ /dev/null
@@ -1,345 +0,0 @@
-#ifndef PROTON_OBJECT_H
-#define PROTON_OBJECT_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/cid.h>
-#include <proton/types.h>
-#include <stdarg.h>
-#include <proton/type_compat.h>
-#include <stddef.h>
-#include <proton/import_export.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @cond INTERNAL
- */
-
-typedef void* pn_handle_t;
-typedef intptr_t pn_shandle_t;
-
-typedef struct pn_class_t pn_class_t;
-typedef struct pn_string_t pn_string_t;
-typedef struct pn_list_t pn_list_t;
-typedef struct pn_map_t pn_map_t;
-typedef struct pn_hash_t pn_hash_t;
-typedef void *(*pn_iterator_next_t)(void *state);
-typedef struct pn_iterator_t pn_iterator_t;
-typedef struct pn_record_t pn_record_t;
-
-struct pn_class_t {
-  const char *name;
-  const pn_cid_t cid;
-  void *(*newinst)(const pn_class_t *, size_t);
-  void (*initialize)(void *);
-  void (*incref)(void *);
-  void (*decref)(void *);
-  int (*refcount)(void *);
-  void (*finalize)(void *);
-  void (*free)(void *);
-  const pn_class_t *(*reify)(void *);
-  uintptr_t (*hashcode)(void *);
-  intptr_t (*compare)(void *, void *);
-  int (*inspect)(void *, pn_string_t *);
-};
-
-// Hack alert: Declare these as arrays so we can treat the name
-// of the single object as the address
-PN_EXTERN extern const pn_class_t PN_OBJECT[];
-PN_EXTERN extern const pn_class_t PN_VOID[];
-PN_EXTERN extern const pn_class_t PN_WEAKREF[];
-
-#define PN_CLASSDEF(PREFIX)                                               \
-static void PREFIX ## _initialize_cast(void *object) {                    \
-  PREFIX ## _initialize((PREFIX ## _t *) object);                         \
-}                                                                         \
-                                                                          \
-static void PREFIX ## _finalize_cast(void *object) {                      \
-  PREFIX ## _finalize((PREFIX ## _t *) object);                           \
-}                                                                         \
-                                                                          \
-static uintptr_t PREFIX ## _hashcode_cast(void *object) {                 \
-  uintptr_t (*fp)(PREFIX ## _t *) = PREFIX ## _hashcode;                  \
-  if (fp) {                                                               \
-    return fp((PREFIX ## _t *) object);                                   \
-  } else {                                                                \
-    return (uintptr_t) object;                                            \
-  }                                                                       \
-}                                                                         \
-                                                                          \
-static intptr_t PREFIX ## _compare_cast(void *a, void *b) {               \
-  intptr_t (*fp)(PREFIX ## _t *, PREFIX ## _t *) = PREFIX ## _compare;    \
-  if (fp) {                                                               \
-    return fp((PREFIX ## _t *) a, (PREFIX ## _t *) b);                    \
-  } else {                                                                \
-    return (intptr_t) a - (intptr_t) b;                                   \
-  }                                                                       \
-}                                                                         \
-                                                                          \
-static int PREFIX ## _inspect_cast(void *object, pn_string_t *str) {      \
-  int (*fp)(PREFIX ## _t *, pn_string_t *) = PREFIX ## _inspect;          \
-  if (fp) {                                                               \
-    return fp((PREFIX ## _t *) object, str);                              \
-  } else {                                                                \
-    return pn_string_addf(str, "%s<%p>", #PREFIX, object);                \
-  }                                                                       \
-}                                                                         \
-                                                                          \
-const pn_class_t *PREFIX ## __class(void) {                               \
-  static const pn_class_t clazz = {                                       \
-    #PREFIX,                                                              \
-    CID_ ## PREFIX,                                                       \
-    pn_object_new,                                                        \
-    PREFIX ## _initialize_cast,                                           \
-    pn_object_incref,                                                     \
-    pn_object_decref,                                                     \
-    pn_object_refcount,                                                   \
-    PREFIX ## _finalize_cast,                                             \
-    pn_object_free,                                                       \
-    pn_object_reify,                                                      \
-    PREFIX ## _hashcode_cast,                                             \
-    PREFIX ## _compare_cast,                                              \
-    PREFIX ## _inspect_cast                                               \
-  };                                                                      \
-  return &clazz;                                                          \
-}                                                                         \
-                                                                          \
-PREFIX ## _t *PREFIX ## _new(void) {                                      \
-  return (PREFIX ## _t *) pn_class_new(PREFIX ## __class(),               \
-                                       sizeof(PREFIX ## _t));             \
-}
-
-#define PN_CLASS(PREFIX) {                      \
-    #PREFIX,                                    \
-    CID_ ## PREFIX,                             \
-    pn_object_new,                              \
-    PREFIX ## _initialize,                      \
-    pn_object_incref,                           \
-    pn_object_decref,                           \
-    pn_object_refcount,                         \
-    PREFIX ## _finalize,                        \
-    pn_object_free,                             \
-    pn_object_reify,                            \
-    PREFIX ## _hashcode,                        \
-    PREFIX ## _compare,                         \
-    PREFIX ## _inspect                          \
-}
-
-#define PN_METACLASS(PREFIX) {                  \
-    #PREFIX,                                    \
-    CID_ ## PREFIX,                             \
-    PREFIX ## _new,                             \
-    PREFIX ## _initialize,                      \
-    PREFIX ## _incref,                          \
-    PREFIX ## _decref,                          \
-    PREFIX ## _refcount,                        \
-    PREFIX ## _finalize,                        \
-    PREFIX ## _free,                            \
-    PREFIX ## _reify,                           \
-    PREFIX ## _hashcode,                        \
-    PREFIX ## _compare,                         \
-    PREFIX ## _inspect                          \
-}
-
-/* Class to identify a plain C struct in a pn_event_t. No refcounting or memory management. */
-#define PN_STRUCT_CLASSDEF(PREFIX, CID)                                 \
-  const pn_class_t *PREFIX ## __class(void);                            \
-  static const pn_class_t *PREFIX ## _reify(void *p) { return PREFIX ## __class(); } \
-  const pn_class_t *PREFIX  ##  __class(void) {                         \
-  static const pn_class_t clazz = {                                     \
-    #PREFIX,                                                            \
-    CID,                                                                \
-    NULL, /*_new*/                                                      \
-    NULL, /*_initialize*/                                               \
-    pn_void_incref,                                                     \
-    pn_void_decref,                                                     \
-    pn_void_refcount,                                                   \
-    NULL, /* _finalize */                                               \
-    NULL, /* _free */                                                   \
-    PREFIX ## _reify,                                                   \
-    pn_void_hashcode,                                                   \
-    pn_void_compare,                                                    \
-    pn_void_inspect                                                     \
-    };                                                                  \
-  return &clazz;                                                        \
-  }
-
-PN_EXTERN pn_cid_t pn_class_id(const pn_class_t *clazz);
-PN_EXTERN const char *pn_class_name(const pn_class_t *clazz);
-PN_EXTERN void *pn_class_new(const pn_class_t *clazz, size_t size);
-
-/* pn_incref, pn_decref and pn_refcount are for internal use by the proton
-   library, the should not be called by application code. Application code
-   should use the appropriate pn_*_free function (pn_link_free, pn_session_free
-   etc.) when it is finished with a proton value. Proton values should only be
-   used when handling a pn_event_t that refers to them.
-*/
-PN_EXTERN void *pn_class_incref(const pn_class_t *clazz, void *object);
-PN_EXTERN int pn_class_refcount(const pn_class_t *clazz, void *object);
-PN_EXTERN int pn_class_decref(const pn_class_t *clazz, void *object);
-
-PN_EXTERN void pn_class_free(const pn_class_t *clazz, void *object);
-
-PN_EXTERN const pn_class_t *pn_class_reify(const pn_class_t *clazz, void *object);
-PN_EXTERN uintptr_t pn_class_hashcode(const pn_class_t *clazz, void *object);
-PN_EXTERN intptr_t pn_class_compare(const pn_class_t *clazz, void *a, void *b);
-PN_EXTERN bool pn_class_equals(const pn_class_t *clazz, void *a, void *b);
-PN_EXTERN int pn_class_inspect(const pn_class_t *clazz, void *object, pn_string_t *dst);
-
-PN_EXTERN void *pn_void_new(const pn_class_t *clazz, size_t size);
-PN_EXTERN void pn_void_incref(void *object);
-PN_EXTERN void pn_void_decref(void *object);
-PN_EXTERN int pn_void_refcount(void *object);
-PN_EXTERN uintptr_t pn_void_hashcode(void *object);
-PN_EXTERN intptr_t pn_void_compare(void *a, void *b);
-PN_EXTERN int pn_void_inspect(void *object, pn_string_t *dst);
-
-PN_EXTERN void *pn_object_new(const pn_class_t *clazz, size_t size);
-PN_EXTERN const pn_class_t *pn_object_reify(void *object);
-PN_EXTERN void pn_object_incref(void *object);
-PN_EXTERN int pn_object_refcount(void *object);
-PN_EXTERN void pn_object_decref(void *object);
-PN_EXTERN void pn_object_free(void *object);
-
-PN_EXTERN void *pn_incref(void *object);
-PN_EXTERN int pn_decref(void *object);
-PN_EXTERN int pn_refcount(void *object);
-PN_EXTERN void pn_free(void *object);
-PN_EXTERN const pn_class_t *pn_class(void* object);
-PN_EXTERN uintptr_t pn_hashcode(void *object);
-PN_EXTERN intptr_t pn_compare(void *a, void *b);
-PN_EXTERN bool pn_equals(void *a, void *b);
-PN_EXTERN int pn_inspect(void *object, pn_string_t *dst);
-
-#define PN_REFCOUNT (0x1)
-
-PN_EXTERN pn_list_t *pn_list(const pn_class_t *clazz, size_t capacity);
-PN_EXTERN size_t pn_list_size(pn_list_t *list);
-PN_EXTERN void *pn_list_get(pn_list_t *list, int index);
-PN_EXTERN void pn_list_set(pn_list_t *list, int index, void *value);
-PN_EXTERN int pn_list_add(pn_list_t *list, void *value);
-PN_EXTERN void *pn_list_pop(pn_list_t *list);
-PN_EXTERN ssize_t pn_list_index(pn_list_t *list, void *value);
-PN_EXTERN bool pn_list_remove(pn_list_t *list, void *value);
-PN_EXTERN void pn_list_del(pn_list_t *list, int index, int n);
-PN_EXTERN void pn_list_clear(pn_list_t *list);
-PN_EXTERN void pn_list_iterator(pn_list_t *list, pn_iterator_t *iter);
-PN_EXTERN void pn_list_minpush(pn_list_t *list, void *value);
-PN_EXTERN void *pn_list_minpop(pn_list_t *list);
-
-#define PN_REFCOUNT_KEY (0x2)
-#define PN_REFCOUNT_VALUE (0x4)
-
-PN_EXTERN pn_map_t *pn_map(const pn_class_t *key, const pn_class_t *value,
-                           size_t capacity, float load_factor);
-PN_EXTERN size_t pn_map_size(pn_map_t *map);
-PN_EXTERN int pn_map_put(pn_map_t *map, void *key, void *value);
-PN_EXTERN void *pn_map_get(pn_map_t *map, void *key);
-PN_EXTERN void pn_map_del(pn_map_t *map, void *key);
-PN_EXTERN pn_handle_t pn_map_head(pn_map_t *map);
-PN_EXTERN pn_handle_t pn_map_next(pn_map_t *map, pn_handle_t entry);
-PN_EXTERN void *pn_map_key(pn_map_t *map, pn_handle_t entry);
-PN_EXTERN void *pn_map_value(pn_map_t *map, pn_handle_t entry);
-
-PN_EXTERN pn_hash_t *pn_hash(const pn_class_t *clazz, size_t capacity, float load_factor);
-PN_EXTERN size_t pn_hash_size(pn_hash_t *hash);
-PN_EXTERN int pn_hash_put(pn_hash_t *hash, uintptr_t key, void *value);
-PN_EXTERN void *pn_hash_get(pn_hash_t *hash, uintptr_t key);
-PN_EXTERN void pn_hash_del(pn_hash_t *hash, uintptr_t key);
-PN_EXTERN pn_handle_t pn_hash_head(pn_hash_t *hash);
-PN_EXTERN pn_handle_t pn_hash_next(pn_hash_t *hash, pn_handle_t entry);
-PN_EXTERN uintptr_t pn_hash_key(pn_hash_t *hash, pn_handle_t entry);
-PN_EXTERN void *pn_hash_value(pn_hash_t *hash, pn_handle_t entry);
-
-PN_EXTERN pn_string_t *pn_string(const char *bytes);
-PN_EXTERN pn_string_t *pn_stringn(const char *bytes, size_t n);
-PN_EXTERN const char *pn_string_get(pn_string_t *string);
-PN_EXTERN size_t pn_string_size(pn_string_t *string);
-PN_EXTERN int pn_string_set(pn_string_t *string, const char *bytes);
-PN_EXTERN int pn_string_setn(pn_string_t *string, const char *bytes, size_t n);
-PN_EXTERN ssize_t pn_string_put(pn_string_t *string, char *dst);
-PN_EXTERN void pn_string_clear(pn_string_t *string);
-PN_EXTERN int pn_string_format(pn_string_t *string, const char *format, ...)
-#ifdef __GNUC__
-  __attribute__ ((format (printf, 2, 3)))
-#endif
-    ;
-PN_EXTERN int pn_string_vformat(pn_string_t *string, const char *format, va_list ap);
-PN_EXTERN int pn_string_addf(pn_string_t *string, const char *format, ...)
-#ifdef __GNUC__
-  __attribute__ ((format (printf, 2, 3)))
-#endif
-    ;
-PN_EXTERN int pn_string_vaddf(pn_string_t *string, const char *format, va_list ap);
-PN_EXTERN int pn_string_grow(pn_string_t *string, size_t capacity);
-PN_EXTERN char *pn_string_buffer(pn_string_t *string);
-PN_EXTERN size_t pn_string_capacity(pn_string_t *string);
-PN_EXTERN int pn_string_resize(pn_string_t *string, size_t size);
-PN_EXTERN int pn_string_copy(pn_string_t *string, pn_string_t *src);
-
-PN_EXTERN pn_iterator_t *pn_iterator(void);
-PN_EXTERN void *pn_iterator_start(pn_iterator_t *iterator,
-                                  pn_iterator_next_t next, size_t size);
-PN_EXTERN void *pn_iterator_next(pn_iterator_t *iterator);
-
-#define PN_LEGCTX ((pn_handle_t) 0)
-
-/**
-   PN_HANDLE is a trick to define a unique identifier by using the address of a static variable.
-   You MUST NOT use it in a .h file, since it must be defined uniquely in one compilation unit.
-   Your .h file can provide access to the handle (if needed) via a function. For example:
-
-       /// my_thing.h
-       pn_handle_t get_my_thing(void);
-
-       /// my_thing.c
-       PN_HANDLE(MY_THING);
-       pn_handle_t get_my_thing(void) { return MY_THING; }
-
-   Note that the name "MY_THING" is not exported and is not required to be
-   unique except in the .c file. The linker will guarantee that the *address* of
-   MY_THING, as returned by get_my_thing() *is* unique across the entire linked
-   executable.
- */
-#define PN_HANDLE(name) \
-  static const char _PN_HANDLE_ ## name = 0; \
-  static const pn_handle_t name = ((pn_handle_t) &_PN_HANDLE_ ## name);
-
-PN_EXTERN pn_record_t *pn_record(void);
-PN_EXTERN void pn_record_def(pn_record_t *record, pn_handle_t key, const pn_class_t *clazz);
-PN_EXTERN bool pn_record_has(pn_record_t *record, pn_handle_t key);
-PN_EXTERN void *pn_record_get(pn_record_t *record, pn_handle_t key);
-PN_EXTERN void pn_record_set(pn_record_t *record, pn_handle_t key, void *value);
-PN_EXTERN void pn_record_clear(pn_record_t *record);
-
-/**
- * @endcond
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* object.h */
diff --git a/proton-c/include/proton/parser.h b/proton-c/include/proton/parser.h
deleted file mode 100644
index a95ca86..0000000
--- a/proton-c/include/proton/parser.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef PROTON_PARSER_H
-#define PROTON_PARSER_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/codec.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @cond INTERNAL
- */
-
-typedef struct pn_parser_t pn_parser_t;
-
-PN_EXTERN pn_parser_t *pn_parser(void);
-PN_EXTERN int pn_parser_parse(pn_parser_t *parser, const char *str, pn_data_t *data);
-PN_EXTERN int pn_parser_errno(pn_parser_t *parser);
-PN_EXTERN const char *pn_parser_error(pn_parser_t *parser);
-PN_EXTERN void pn_parser_free(pn_parser_t *parser);
-
-/**
- * @endcond
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* parser.h */
diff --git a/proton-c/include/proton/proactor.h b/proton-c/include/proton/proactor.h
deleted file mode 100644
index b8fb16a..0000000
--- a/proton-c/include/proton/proactor.h
+++ /dev/null
@@ -1,200 +0,0 @@
-#ifndef PROTON_PROACTOR_H
-#define PROTON_PROACTOR_H 1
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <proton/types.h>
-#include <proton/import_export.h>
-#include <proton/listener.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @cond INTERNAL
- */
-typedef struct pn_condition_t pn_condition_t;
-/**
- * @endcond
- */
-
-/**
- * @file
- *
- * **Experimental** - Multithreaded IO
- *
- * The proactor associates a @ref connection with a @ref transport,
- * either by making an outgoing connection or accepting an incoming
- * one.  It delivers @ref event "events" to application threads for
- * handling.
- *
- * ## Multi-threading
- *
- * The @ref proactor is thread-safe, but the protocol engine is not.
- * The proactor ensures that each @ref connection and its associated
- * values (@ref session, @ref link etc.) is handle sequentially, even
- * if there are multiple application threads. See pn_proactor_wait().
- *
- * @addtogroup proactor
- * @{
- */
-
-/**
- * The proactor, see pn_proactor()
- */
-typedef struct pn_proactor_t pn_proactor_t;
-
-/**
- * Create a proactor. Must be freed with pn_proactor_free()
- */
-pn_proactor_t *pn_proactor(void);
-
-/**
- * Free the proactor. Abort any open network connections and clean up all
- * associated resources.
- */
-void pn_proactor_free(pn_proactor_t *proactor);
-
-/**
- * Connect connection to host/port. Connection and transport events will be
- * returned by pn_proactor_wait()
- *
- * @param[in] proactor the proactor object
- * @param[in] connection the proactor takes ownership, do not free
- * @param[in] host address to connect on
- * @param[in] port port to connect to
- *
- * @return error on immediate error, e.g. an allocation failure.
- * Other errors are indicated by connection or transport events via
- * pn_proactor_wait()
- */
-int pn_proactor_connect(pn_proactor_t *proactor, pn_connection_t *connection,
-                        const char *host, const char *port);
-
-/**
- * Start listening with listener.  pn_proactor_wait() will return a
- * PN_LISTENER_ACCEPT event when a connection can be accepted.
- *
- * @param[in] proactor the proactor object
- * @param[in] listener proactor takes ownership of listener, do not free
- * @param[in] host address to listen on
- * @param[in] port port to listen on
- * @param[in] backlog number of connection requests to queue
- *
- * @return error on immediate error, e.g. an allocation failure.
- * Other errors are indicated by pn_listener_condition() on the
- * PN_LISTENER_CLOSE event.
- */
-int pn_proactor_listen(pn_proactor_t *proactor, pn_listener_t *listener,
-                       const char *host, const char *port, int backlog);
-
-/**
- * Wait for events to handle.
- *
- * Handle events in the returned batch by calling
- * pn_event_batch_next() until it returns NULL. You must call
- * pn_proactor_done() when you are finished with the batch.
- *
- * If you call pn_proactor_done() before finishing the batch, the
- * remaining events will be returned again by another call
- * pn_proactor_wait().  This is less efficient, but allows you to
- * handle part of a batch and then hand off the rest to another
- * thread.
- *
- * @note Thread-safe: can be called concurrently. Events in a single
- * batch must be handled in sequence, but batches returned by separate
- * calls to pn_proactor_wait() can be handled concurrently.
- */
-pn_event_batch_t *pn_proactor_wait(pn_proactor_t *proactor);
-
-/**
- * Call when done handling a batch of events.
- *
- * Must be called exactly once to match each call to
- * pn_proactor_wait().
- *
- * @note Thread-safe: may be called from any thread provided the
- * exactly once rule is respected.
- */
-void pn_proactor_done(pn_proactor_t *proactor, pn_event_batch_t *events);
-
-/**
- * Cause PN_PROACTOR_INTERRUPT to be returned to exactly one call of
- * pn_proactor_wait().
- *
- * If threads are blocked in pn_proactor_wait(), one of them will be
- * interrupted, otherwise the interrupt will be returned by a future
- * call to pn_proactor_wait(). Calling pn_proactor_interrupt() N times
- * will return PN_PROACTOR_INTERRUPT to N current or future calls of
- * pn_proactor_wait()
- *
- * @note Thread-safe.
- */
-void pn_proactor_interrupt(pn_proactor_t *proactor);
-
-/**
- * Cause PN_PROACTOR_TIMEOUT to be returned to a thread calling wait()
- * after timeout milliseconds. Thread-safe.
- *
- * Note that calling pn_proactor_set_timeout() again before the
- * PN_PROACTOR_TIMEOUT is delivered will cancel the previous timeout
- * and deliver an event only after the new
- * timeout. `pn_proactor_set_timeout(0)` will cancel the timeout
- * without setting a new one.
- */
-void pn_proactor_set_timeout(pn_proactor_t *proactor, pn_millis_t timeout);
-
-/**
- * Cause a PN_CONNECTION_WAKE event to be returned by the proactor, even if
- * there are no IO events pending for the connection.
- *
- * @note Thread-safe: this is the only pn_connection_ function that
- * can be called concurrently.
- *
- * Wakes can be "coalesced" - if several pn_connection_wake() calls happen
- * concurrently, there may be only one PN_CONNECTION_WAKE event.
- */
-void pn_connection_wake(pn_connection_t *connection);
-
-/**
- * Return the proactor associated with a connection or NULL.
- */
-pn_proactor_t *pn_connection_proactor(pn_connection_t *connection);
-
-/**
- * Return the proactor associated with an event or NULL.
- */
-pn_proactor_t *pn_event_proactor(pn_event_t *event);
-
-/**
- * Return the listener associated with an event or NULL.
- */
-pn_listener_t *pn_event_listener(pn_event_t *event);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* proactor.h */
diff --git a/proton-c/include/proton/reactor.h b/proton-c/include/proton/reactor.h
deleted file mode 100644
index 8d229ab..0000000
--- a/proton-c/include/proton/reactor.h
+++ /dev/null
@@ -1,188 +0,0 @@
-#ifndef PROTON_REACTOR_H
-#define PROTON_REACTOR_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/type_compat.h>
-#include <proton/error.h>
-#include <proton/event.h>
-#include <proton/selectable.h>
-#include <proton/ssl.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @cond INTERNAL
- */
-
-typedef struct pn_reactor_t pn_reactor_t;
-typedef struct pn_acceptor_t pn_acceptor_t;
-typedef struct pn_timer_t pn_timer_t;
-typedef struct pn_task_t pn_task_t;
-
-PNX_EXTERN pn_handler_t *pn_handler(void (*dispatch)(pn_handler_t *, pn_event_t *, pn_event_type_t));
-PNX_EXTERN pn_handler_t *pn_handler_new(void (*dispatch)(pn_handler_t *, pn_event_t *, pn_event_type_t), size_t size,
-                                       void (*finalize)(pn_handler_t *));
-PNX_EXTERN void pn_handler_free(pn_handler_t *handler);
-PNX_EXTERN void *pn_handler_mem(pn_handler_t *handler);
-PNX_EXTERN void pn_handler_add(pn_handler_t *handler, pn_handler_t *child);
-PNX_EXTERN void pn_handler_clear(pn_handler_t *handler);
-PNX_EXTERN void pn_handler_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type);
-
-PNX_EXTERN pn_reactor_t *pn_reactor(void);
-PNX_EXTERN pn_record_t *pn_reactor_attachments(pn_reactor_t *reactor);
-PNX_EXTERN pn_millis_t pn_reactor_get_timeout(pn_reactor_t *reactor);
-PNX_EXTERN void pn_reactor_set_timeout(pn_reactor_t *reactor, pn_millis_t timeout);
-PNX_EXTERN pn_timestamp_t pn_reactor_mark(pn_reactor_t *reactor);
-PNX_EXTERN pn_timestamp_t pn_reactor_now(pn_reactor_t *reactor);
-PNX_EXTERN void pn_reactor_yield(pn_reactor_t *reactor);
-PNX_EXTERN void pn_reactor_free(pn_reactor_t *reactor);
-PNX_EXTERN pn_collector_t *pn_reactor_collector(pn_reactor_t *reactor);
-PNX_EXTERN pn_handler_t *pn_reactor_get_global_handler(pn_reactor_t *reactor);
-PNX_EXTERN void pn_reactor_set_global_handler(pn_reactor_t *reactor, pn_handler_t *handler);
-PNX_EXTERN pn_handler_t *pn_reactor_get_handler(pn_reactor_t *reactor);
-PNX_EXTERN void pn_reactor_set_handler(pn_reactor_t *reactor, pn_handler_t *handler);
-PNX_EXTERN pn_list_t *pn_reactor_children(pn_reactor_t *reactor);
-PNX_EXTERN pn_selectable_t *pn_reactor_selectable(pn_reactor_t *reactor);
-PNX_EXTERN void pn_reactor_update(pn_reactor_t *reactor, pn_selectable_t *selectable);
-PNX_EXTERN pn_acceptor_t *pn_reactor_acceptor(pn_reactor_t *reactor, const char *host, const char *port,
-                                             pn_handler_t *handler);
-PNX_EXTERN pn_error_t *pn_reactor_error(pn_reactor_t *reactor);
-
-/**
- * Create an outgoing connection that will be managed by the reactor.
- *
- * The reator's pn_iohandler will create a socket connection to the host
- * once the connection is opened.
- *
- * @param[in] reactor the reactor that will own the connection.
- * @param[in] host the address of the remote host. e.g. "localhost"
- * @param[in] port the port to connect to. e.g. "5672"
- * @param[in] handler the handler that will process all events generated by
- * this connection.
- * @return a connection object
- */
-PNX_EXTERN pn_connection_t *pn_reactor_connection_to_host(pn_reactor_t *reactor,
-                                                         const char *host,
-                                                         const char *port,
-                                                         pn_handler_t *handler);
-
-/**
- * Create an outgoing connection that will be managed by the reactor.
- *
- * The host address for the connection must be set via
- * ::pn_reactor_set_connection_host() prior to opening the connection.
- * Typically this can be done by the handler when processing the
- * ::PN_CONNECTION_INIT event.
- *
- * @param[in] reactor the reactor that will own the connection.
- * @param[in] handler the handler that will process all events generated by
- * this connection.
- * @return a connection object
- * @deprecated Use ::pn_reactor_connection_to_host() instead.
- */
-PNX_EXTERN pn_connection_t *pn_reactor_connection(pn_reactor_t *reactor,
-                                                 pn_handler_t *handler);
-
-/**
- * Change the host address used by an outgoing reactor connection.
- *
- * The address is used by the reactor's iohandler to create an outgoing socket
- * connection.  This must be set prior to (re)opening the connection.
- *
- * @param[in] reactor the reactor that owns the connection.
- * @param[in] connection the connection created by the reactor.
- * @param[in] host the network address or DNS name of the host to connect to.
- * @param[in] port the network port to use. Optional - default is "5672"
- */
-PNX_EXTERN void pn_reactor_set_connection_host(pn_reactor_t *reactor,
-                                              pn_connection_t *connection,
-                                              const char *host,
-                                              const char *port);
-/**
- * Retrieve the peer host address for a reactor connection.
- *
- * This may be used to retrieve the host address used by the reactor to
- * establish the outgoing socket connection.  In the case of an accepted
- * connection the returned value is the address of the remote.
- *
- * @note Note that the returned address may be in numeric IP format.
- *
- * The pointer returned by this operation is valid until either the address is
- * changed via ::pn_reactor_set_connection_host() or the connection object
- * is freed.
- *
- * @param[in] reactor the reactor that owns the connection.
- * @param[in] connection the reactor connection
- * @return a C string containing the address in URL format or NULL if no
- * address available.  ::pn_url_parse() may be used to create a Proton pn_url_t
- * instance from the returned value.
- */
-PNX_EXTERN const char *pn_reactor_get_connection_address(pn_reactor_t *reactor,
-                                                        pn_connection_t *connection);
-
-PNX_EXTERN int pn_reactor_wakeup(pn_reactor_t *reactor);
-PNX_EXTERN void pn_reactor_start(pn_reactor_t *reactor);
-PNX_EXTERN bool pn_reactor_quiesced(pn_reactor_t *reactor);
-PNX_EXTERN bool pn_reactor_process(pn_reactor_t *reactor);
-PNX_EXTERN void pn_reactor_stop(pn_reactor_t *reactor);
-PNX_EXTERN void pn_reactor_run(pn_reactor_t *reactor);
-PNX_EXTERN pn_task_t *pn_reactor_schedule(pn_reactor_t *reactor, int delay, pn_handler_t *handler);
-
-
-PNX_EXTERN void pn_acceptor_set_ssl_domain(pn_acceptor_t *acceptor, pn_ssl_domain_t *domain);
-PNX_EXTERN void pn_acceptor_close(pn_acceptor_t *acceptor);
-PNX_EXTERN pn_acceptor_t *pn_connection_acceptor(pn_connection_t *connection);
-
-PNX_EXTERN pn_timer_t *pn_timer(pn_collector_t *collector);
-PNX_EXTERN pn_timestamp_t pn_timer_deadline(pn_timer_t *timer);
-PNX_EXTERN void pn_timer_tick(pn_timer_t *timer, pn_timestamp_t now);
-PNX_EXTERN pn_task_t *pn_timer_schedule(pn_timer_t *timer, pn_timestamp_t deadline);
-PNX_EXTERN int pn_timer_tasks(pn_timer_t *timer);
-
-PNX_EXTERN pn_record_t *pn_task_attachments(pn_task_t *task);
-PNX_EXTERN void pn_task_cancel(pn_task_t *task);
-
-PNX_EXTERN pn_reactor_t *pn_class_reactor(const pn_class_t *clazz, void *object);
-PNX_EXTERN pn_reactor_t *pn_object_reactor(void *object);
-PNX_EXTERN pn_reactor_t *pn_event_reactor(pn_event_t *event);
-
-PNX_EXTERN pn_handler_t *pn_record_get_handler(pn_record_t *record);
-PNX_EXTERN void pn_record_set_handler(pn_record_t *record, pn_handler_t *handler);
-
-/**
- * Get the root handler the current event was dispatched to.
- */
-PNX_EXTERN pn_handler_t *pn_event_root(pn_event_t *event);
-
-/**
- * @endcond
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* reactor.h */
diff --git a/proton-c/include/proton/sasl.h b/proton-c/include/proton/sasl.h
deleted file mode 100644
index 671ffec..0000000
--- a/proton-c/include/proton/sasl.h
+++ /dev/null
@@ -1,212 +0,0 @@
-#ifndef PROTON_SASL_H
-#define PROTON_SASL_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/type_compat.h>
-#include <proton/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- *
- * @copybrief sasl
- *
- * @addtogroup sasl
- * @{
- */
-
-/**
- * The SASL layer is responsible for establishing an authenticated
- * and/or encrypted tunnel over which AMQP frames are passed between
- * peers. The peer acting as the SASL Client must provide
- * authentication credentials. The peer acting as the SASL Server must
- * provide authentication against the received credentials.
- */
-typedef struct pn_sasl_t pn_sasl_t;
-
-/**
- * The result of the SASL negotiation.
- */
-typedef enum {
-  PN_SASL_NONE = -1,  /** negotiation not completed */
-  PN_SASL_OK = 0,     /** authentication succeeded */
-  PN_SASL_AUTH = 1,   /** failed due to bad credentials */
-  PN_SASL_SYS = 2,    /** failed due to a system error */
-  PN_SASL_PERM = 3,   /** failed due to unrecoverable error */
-  PN_SASL_TEMP = 4    /** failed due to transient error */
-} pn_sasl_outcome_t;
-
-/**
- * Construct an Authentication and Security Layer object.
- *
- * This will return the SASL layer object for the supplied transport
- * object. If there is currently no SASL layer one will be created.
- *
- * On the client side of an AMQP connection this will have the effect
- * of ensuring that the AMQP SASL layer is used for that connection.
- *
- * @return an object representing the SASL layer.
- */
-PN_EXTERN pn_sasl_t *pn_sasl(pn_transport_t *transport);
-
-/**
- * Do we support extended SASL negotiation
- *
- * Do we support extended SASL negotiation?
- * All implementations of Proton support ANONYMOUS and EXTERNAL on both
- * client and server sides and PLAIN on the client side.
- *
- * Extended SASL implememtations use an external library (Cyrus SASL)
- * to support other mechanisms beyond these basic ones.
- *
- * @return true if we support extended SASL negotiation, false if we only support basic negotiation.
- */
-PN_EXTERN bool pn_sasl_extended(void);
-
-/**
- * Set the outcome of SASL negotiation
- *
- * Used by the server to set the result of the negotiation process.
- *
- * @todo
- */
-PN_EXTERN void pn_sasl_done(pn_sasl_t *sasl, pn_sasl_outcome_t outcome);
-
-/**
- * Retrieve the outcome of SASL negotiation.
- *
- * @todo
- */
-PN_EXTERN pn_sasl_outcome_t pn_sasl_outcome(pn_sasl_t *sasl);
-
-/**
- * Retrieve the authenticated user
- *
- * This is usually used at the the server end to find the name of the authenticated user.
- * On the client it will merely return whatever user was passed in to the
- * pn_transport_set_user_password() API.
- *
- * If pn_sasl_outcome() returns a value other than PN_SASL_OK, then there will be no user to return.
- * The returned value is only reliable after the PN_TRANSPORT_AUTHENTICATED event has been received.
- *
- * @param[in] sasl the sasl layer
- *
- * @return
- * If the SASL layer was not negotiated then 0 is returned
- * If the ANONYMOUS mechanism is used then the user will be "anonymous"
- * Otherwise a string containing the user is returned.
- */
-PN_EXTERN const char *pn_sasl_get_user(pn_sasl_t *sasl);
-
-/**
- * Return the selected SASL mechanism
- *
- * The returned value is only reliable after the PN_TRANSPORT_AUTHENTICATED event has been received.
- *
- * @param[in] sasl the SASL layer
- *
- * @return The authentication mechanism selected by the SASL layer
- */
-PN_EXTERN const char *pn_sasl_get_mech(pn_sasl_t *sasl);
-
-/**
- * SASL mechanisms that are to be considered for authentication
- *
- * This can be used on either the client or the server to restrict the SASL
- * mechanisms that may be used to the mechanisms on the list.
- *
- * @param[in] sasl the SASL layer
- * @param[in] mechs space separated list of mechanisms that are allowed for authentication
- */
-PN_EXTERN void pn_sasl_allowed_mechs(pn_sasl_t *sasl, const char *mechs);
-
-/**
- * Boolean to allow use of clear text authentication mechanisms
- *
- * By default the SASL layer is configured not to allow mechanisms that disclose
- * the clear text of the password over an unencrypted AMQP connection. This specifically
- * will disallow the use of the PLAIN mechanism without using SSL encryption.
- *
- * This default is to avoid disclosing password information accidentally over an
- * insecure network.
- *
- * If you actually wish to use a clear text password unencrypted then you can use this
- * API to set allow_insecure_mechs to true.
- *
- * @param[in] sasl the SASL layer
- * @param[in] insecure set this to true to allow unencrypted PLAIN authentication.
- *
- */
-PN_EXTERN void pn_sasl_set_allow_insecure_mechs(pn_sasl_t *sasl, bool insecure);
-
-/**
- * Return the current value for allow_insecure_mechs
- *
- * @param[in] sasl the SASL layer
- */
-PN_EXTERN bool pn_sasl_get_allow_insecure_mechs(pn_sasl_t *sasl);
-
-/**
- * Set the sasl configuration name
- *
- * This is used to construct the SASL configuration filename. In the current implementation
- * it ".conf" is added to the name and the file is looked for in the configuration directory.
- *
- * If not set it will default to "proton-server" for a sasl server and "proton-client"
- * for a client.
- *
- * @param[in] sasl the SASL layer
- * @param[in] name the configuration name
- */
-PN_EXTERN void pn_sasl_config_name(pn_sasl_t *sasl, const char *name);
-
-/**
- * Set the sasl configuration path
- *
- * This is used to tell SASL where to look for the configuration file.
- * In the current implementation it can be a colon separated list of directories.
- *
- * The environment variable PN_SASL_CONFIG_PATH can also be used to set this path,
- * but if both methods are used then this pn_sasl_config_path() will take precedence.
- *
- * If not set the underlying implementation default will be used.
- * for a client.
- *
- * @param[in] sasl the SASL layer
- * @param[in] path the configuration path
- */
-PN_EXTERN void pn_sasl_config_path(pn_sasl_t *sasl, const char *path);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* sasl.h */
diff --git a/proton-c/include/proton/selectable.h b/proton-c/include/proton/selectable.h
deleted file mode 100644
index 8c0a4db..0000000
--- a/proton-c/include/proton/selectable.h
+++ /dev/null
@@ -1,271 +0,0 @@
-#ifndef PROTON_SELECTABLE_H
-#define PROTON_SELECTABLE_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/object.h>
-#include <proton/event.h>
-#include <proton/type_compat.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @cond INTERNAL
- */
-
-/**
- * An iterator for selectables.
- */
-typedef pn_iterator_t pn_selectables_t;
-
-/**
- * A ::pn_socket_t provides an abstract handle to an IO stream.  The
- * pipe version is uni-directional.  The network socket version is
- * bi-directional.  Both are non-blocking.
- *
- * pn_socket_t handles from pn_pipe() may only be used with
- * pn_read(), pn_write(), pn_close() and pn_selector_select().
- *
- * pn_socket_t handles from pn_listen(), pn_accept() and
- * pn_connect() must perform further IO using Proton functions.
- * Mixing Proton io.h functions with native IO functions on the same
- * handles will result in undefined behavior.
- *
- * pn_socket_t handles may only be used with a single pn_io_t during
- * their lifetime.
- */
-#if defined(_WIN32) && ! defined(__CYGWIN__)
-#ifdef _WIN64
-typedef unsigned __int64 pn_socket_t;
-#else
-typedef unsigned int pn_socket_t;
-#endif
-#define PN_INVALID_SOCKET (pn_socket_t)(~0)
-#else
-typedef int pn_socket_t;
-#define PN_INVALID_SOCKET (-1)
-#endif
-
-/**
- * A selectable object provides an interface that can be used to
- * incorporate proton's I/O into third party event loops.
- *
- * Every selectable is associated with exactly one file descriptor.
- * Selectables may be interested in three kinds of events, read
- * events, write events, and timer events. 
- *
- * When a read, write, or timer event occurs, the selectable must be
- * notified by calling ::pn_selectable_readable(),
- * ::pn_selectable_writable(), and ::pn_selectable_expired() as
- * appropriate.
- *
- * Once a selectable reaches a terminal state (see
- * ::pn_selectable_is_terminal()), it will never be interested in
- * events of any kind. When this occurs it should be removed from the
- * external event loop and discarded using ::pn_selectable_free().
- */
-typedef struct pn_selectable_t pn_selectable_t;
-
-/**
- * Construct a new selectables iterator.
- *
- * @return a pointer to a new selectables iterator
- */
-PNX_EXTERN pn_selectables_t *pn_selectables(void);
-
-/**
- * Get the next selectable from an iterator.
- *
- * @param[in] selectables a selectable iterator
- * @return the next selectable from the iterator
- */
-PNX_EXTERN pn_selectable_t *pn_selectables_next(pn_selectables_t *selectables);
-
-/**
- * Free a selectables iterator.
- *
- * @param[in] selectables a selectables iterator (or NULL)
- */
-PNX_EXTERN void pn_selectables_free(pn_selectables_t *selectables);
-
-PNX_EXTERN pn_selectable_t *pn_selectable(void);
-
-PNX_EXTERN void pn_selectable_on_readable(pn_selectable_t *sel, void (*readable)(pn_selectable_t *));
-PNX_EXTERN void pn_selectable_on_writable(pn_selectable_t *sel, void (*writable)(pn_selectable_t *));
-PNX_EXTERN void pn_selectable_on_expired(pn_selectable_t *sel, void (*expired)(pn_selectable_t *));
-PNX_EXTERN void pn_selectable_on_error(pn_selectable_t *sel, void (*error)(pn_selectable_t *));
-PNX_EXTERN void pn_selectable_on_release(pn_selectable_t *sel, void (*release)(pn_selectable_t *));
-PNX_EXTERN void pn_selectable_on_finalize(pn_selectable_t *sel, void (*finalize)(pn_selectable_t *));
-
-PNX_EXTERN pn_record_t *pn_selectable_attachments(pn_selectable_t *sel);
-
-/**
- * Get the file descriptor associated with a selectable.
- *
- * @param[in] selectable a selectable object
- * @return the file descriptor associated with the selectable
- */
-PNX_EXTERN pn_socket_t pn_selectable_get_fd(pn_selectable_t *selectable);
-
-/**
- * Set the file descriptor associated with a selectable.
- *
- * @param[in] selectable a selectable object
- * @param[in] fd the file descriptor
- */
-PNX_EXTERN void pn_selectable_set_fd(pn_selectable_t *selectable, pn_socket_t fd);
-
-/**
- * Check if a selectable is interested in readable events.
- *
- * @param[in] selectable a selectable object
- * @return true iff the selectable is interested in read events
- */
-PNX_EXTERN bool pn_selectable_is_reading(pn_selectable_t *selectable);
-
-PNX_EXTERN void pn_selectable_set_reading(pn_selectable_t *sel, bool reading);
-
-/**
- * Check if a selectable is interested in writable events.
- *
- * @param[in] selectable a selectable object
- * @return true iff the selectable is interested in writable events
- */
-PNX_EXTERN bool pn_selectable_is_writing(pn_selectable_t *selectable);
-
-  PNX_EXTERN void pn_selectable_set_writing(pn_selectable_t *sel, bool writing);
-
-/**
- * Get the next deadline for a selectable.
- *
- * A selectable with a deadline is interested in being notified when
- * that deadline expires. Zero indicates there is currently no
- * deadline.
- *
- * @param[in] selectable a selectable object
- * @return the next deadline or zero
- */
-PNX_EXTERN pn_timestamp_t pn_selectable_get_deadline(pn_selectable_t *selectable);
-
-PNX_EXTERN void pn_selectable_set_deadline(pn_selectable_t *sel, pn_timestamp_t deadline);
-
-/**
- * Notify a selectable that the file descriptor is readable.
- *
- * @param[in] selectable a selectable object
- */
-PNX_EXTERN void pn_selectable_readable(pn_selectable_t *selectable);
-
-/**
- * Notify a selectable that the file descriptor is writable.
- *
- * @param[in] selectable a selectable object
- */
-PNX_EXTERN void pn_selectable_writable(pn_selectable_t *selectable);
-
-/**
- * Notify a selectable that there is an error on the file descriptor.
- *
- * @param[in] selectable a selectable object
- */
-PNX_EXTERN void pn_selectable_error(pn_selectable_t *selectable);
-
-/**
- * Notify a selectable that its deadline has expired.
- *
- * @param[in] selectable a selectable object
- */
-PNX_EXTERN void pn_selectable_expired(pn_selectable_t *selectable);
-
-/**
- * Check if a selectable is registered.
- *
- * This flag is set via ::pn_selectable_set_registered() and can be
- * used for tracking whether a given selectable has been registerd
- * with an external event loop.
- *
- * @param[in] selectable
- * @return true if the selectable is registered
- */
-PNX_EXTERN bool pn_selectable_is_registered(pn_selectable_t *selectable);
-
-/**
- * Set the registered flag for a selectable.
- *
- * See ::pn_selectable_is_registered() for details.
- *
- * @param[in] selectable a selectable object
- * @param[in] registered the registered flag
- */
-PNX_EXTERN void pn_selectable_set_registered(pn_selectable_t *selectable, bool registered);
-
-/**
- * Check if a selectable is in the terminal state.
- *
- * A selectable that is in the terminal state will never be interested
- * in being notified of events of any kind ever again. Once a
- * selectable reaches this state it should be removed from any
- * external I/O loops and freed in order to reclaim any resources
- * associated with it.
- *
- * @param[in] selectable a selectable object
- * @return true if the selectable is in the terminal state, false otherwise
- */
-PNX_EXTERN bool pn_selectable_is_terminal(pn_selectable_t *selectable);
-
-/**
- * Terminate a selectable.
- *
- * @param[in] selectable a selectable object
- */
-PNX_EXTERN void pn_selectable_terminate(pn_selectable_t *selectable);
-
-PNX_EXTERN void pn_selectable_release(pn_selectable_t *selectable);
-
-/**
- * Free a selectable object.
- *
- * @param[in] selectable a selectable object (or NULL)
- */
-PNX_EXTERN void pn_selectable_free(pn_selectable_t *selectable);
-
-/**
- * Configure a selectable with a set of callbacks that emit readable,
- * writable, and expired events into the supplied collector.
- *
- * @param[in] selectable a selectable objet
- * @param[in] collector a collector object
- */
-PNX_EXTERN void pn_selectable_collect(pn_selectable_t *selectable, pn_collector_t *collector);
-
-/**
- * @endcond
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* selectable.h */
diff --git a/proton-c/include/proton/session.h b/proton-c/include/proton/session.h
deleted file mode 100644
index 8c78db4..0000000
--- a/proton-c/include/proton/session.h
+++ /dev/null
@@ -1,297 +0,0 @@
-#ifndef PROTON_SESSION_H
-#define PROTON_SESSION_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/type_compat.h>
-#include <proton/types.h>
-#include <proton/object.h>
-#include <proton/error.h>
-#include <proton/condition.h>
-#include <stddef.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- *
- * @copybrief session
- *
- * @addtogroup session
- * @{
- */
-
-/**
- * Factory for creating a new session on a given connection object.
- *
- * Creates a new session object and adds it to the set of sessions
- * maintained by the connection object.
- *
- * @param[in] connection the connection object
- * @return a pointer to the new session
- */
-PN_EXTERN pn_session_t *pn_session(pn_connection_t *connection);
-
-/**
- * Free a session object.
- *
- * When a session is freed it will no longer be retained by the
- * connection once any internal references to the session are no
- * longer needed. Freeing a session will free all links on that
- * session and settle any deliveries on those links.
- *
- * @param[in] session the session object to free (or NULL)
- */
-PN_EXTERN void pn_session_free(pn_session_t *session);
-
-/**
- * @deprecated
- *
- * Get the application context that is associated with a session
- * object.
- *
- * The application context for a session may be set using
- * ::pn_session_set_context.
- *
- * @param[in] session the session whose context is to be returned.
- * @return the application context for the session object
- */
-PN_EXTERN void *pn_session_get_context(pn_session_t *session);
-
-/**
- * @deprecated
- *
- * Set a new application context for a session object.
- *
- * The application context for a session object may be retrieved
- * using ::pn_session_get_context.
- *
- * @param[in] session the session object
- * @param[in] context the application context
- */
-PN_EXTERN void pn_session_set_context(pn_session_t *session, void *context);
-
-/**
- * Get the attachments that are associated with a session object.
- *
- * @param[in] session the session whose attachments are to be returned.
- * @return the attachments for the session object
- */
-PN_EXTERN pn_record_t *pn_session_attachments(pn_session_t *session);
-
-/**
- * Get the endpoint state flags for a session.
- *
- * @param[in] session the session object
- * @return the session's state flags
- */
-PN_EXTERN pn_state_t pn_session_state(pn_session_t *session);
-
-/**
- * @deprecated
- *
- * Get additional error information associated with the session.
- *
- * Whenever a session operation fails (i.e. returns an error code),
- * additional error details can be obtained using this function. The
- * error object that is returned may also be used to clear the error
- * condition.
- *
- * The pointer returned by this operation is valid until the
- * session object is freed.
- *
- * @param[in] session the session object
- * @return the session's error object
- */
-PN_EXTERN pn_error_t *pn_session_error(pn_session_t *session);
-
-/**
- * Get the local condition associated with the session endpoint.
- *
- * The ::pn_condition_t object retrieved may be modified prior to
- * closing the session in order to indicate a particular condition
- * exists when the session closes. This is normally used to
- * communicate error conditions to the remote peer, however it may
- * also be used in non error cases. See ::pn_condition_t for more
- * details.
- *
- * The pointer returned by this operation is valid until the session
- * object is freed.
- *
- * @param[in] session the session object
- * @return the session's local condition object
- */
-PN_EXTERN pn_condition_t *pn_session_condition(pn_session_t *session);
-
-/**
- * Get the remote condition associated with the session endpoint.
- *
- * The ::pn_condition_t object retrieved may be examined in order to
- * determine whether the remote peer was indicating some sort of
- * exceptional condition when the remote session endpoint was
- * closed. The ::pn_condition_t object returned may not be modified.
- *
- * The pointer returned by this operation is valid until the
- * session object is freed.
- *
- * @param[in] session the session object
- * @return the session's remote condition object
- */
-PN_EXTERN pn_condition_t *pn_session_remote_condition(pn_session_t *session);
-
-/**
- * Get the parent connection for a session object.
- *
- * This operation retrieves the parent pn_connection_t object that
- * contains the given pn_session_t object.
- *
- * @param[in] session the session object
- * @return the parent connection object
- */
-PN_EXTERN pn_connection_t *pn_session_connection(pn_session_t *session);
-
-/**
- * Open a session.
- *
- * Once this operation has completed, the PN_LOCAL_ACTIVE state flag
- * will be set.
- *
- * @param[in] session the session object
- */
-PN_EXTERN void pn_session_open(pn_session_t *session);
-
-/**
- * Close a session.
- *
- * Once this operation has completed, the PN_LOCAL_CLOSED state flag
- * will be set. This may be called without calling
- * ::pn_session_open, in this case it is equivalent to calling
- * ::pn_session_open followed by ::pn_session_close.
- *
- * @param[in] session the session object
- */
-PN_EXTERN void pn_session_close(pn_session_t *session);
-
-/**
- * Get the incoming capacity of the session measured in bytes.
- *
- * The incoming capacity of a session determines how much incoming
- * message data the session will buffer. Note that if this value is
- * less than the negotiated frame size of the transport, it will be
- * rounded up to one full frame.
- *
- * @param[in] session the session object
- * @return the incoming capacity of the session in bytes
- */
-PN_EXTERN size_t pn_session_get_incoming_capacity(pn_session_t *session);
-
-/**
- * Set the incoming capacity for a session object.
- *
- * The incoming capacity of a session determines how much incoming
- * message data the session will buffer. Note that if this value is
- * less than the negotiated frame size of the transport, it will be
- * rounded up to one full frame.
- *
- * @param[in] session the session object
- * @param[in] capacity the incoming capacity for the session
- */
-PN_EXTERN void pn_session_set_incoming_capacity(pn_session_t *session, size_t capacity);
-
-/**
- * Get the outgoing window for a session object.
- *
- * @param[in] session the session object
- * @return  the outgoing window for the session
- */
-PN_EXTERN size_t pn_session_get_outgoing_window(pn_session_t *session);
-
-/**
- * Set the outgoing window for a session object.
- *
- * @param[in] session the session object
- * @param[in] window the outgoing window for the session
- */
-PN_EXTERN void pn_session_set_outgoing_window(pn_session_t *session, size_t window);
-
-/**
- * Get the number of outgoing bytes currently buffered by a session.
- *
- * @param[in] session the session object
- * @return the number of outgoing bytes currently buffered
- */
-PN_EXTERN size_t pn_session_outgoing_bytes(pn_session_t *session);
-
-/**
- * Get the number of incoming bytes currently buffered by a session.
- *
- * @param[in] session the session object
- * @return the number of incoming bytes currently buffered
- */
-PN_EXTERN size_t pn_session_incoming_bytes(pn_session_t *session);
-
-/**
- * Retrieve the first session from a given connection that matches the
- * specified state mask.
- *
- * Examines the state of each session owned by the connection, and
- * returns the first session that matches the given state mask. If
- * state contains both local and remote flags, then an exact match
- * against those flags is performed. If state contains only local or
- * only remote flags, then a match occurs if any of the local or
- * remote flags are set respectively.
- *
- * @param[in] connection to be searched for matching sessions
- * @param[in] state mask to match
- * @return the first session owned by the connection that matches the
- * mask, else NULL if no sessions match
- */
-PN_EXTERN pn_session_t *pn_session_head(pn_connection_t *connection, pn_state_t state);
-
-/**
- * Retrieve the next session from a given connection that matches the
- * specified state mask.
- *
- * When used with ::pn_session_head, application can access all
- * sessions on the connection that match the given state. See
- * ::pn_session_head for description of match behavior.
- *
- * @param[in] session the previous session obtained from
- *                    ::pn_session_head or ::pn_session_next
- * @param[in] state mask to match.
- * @return the next session owned by the connection that matches the
- * mask, else NULL if no sessions match
- */
-PN_EXTERN pn_session_t *pn_session_next(pn_session_t *session, pn_state_t state);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* session.h */
diff --git a/proton-c/include/proton/ssl.h b/proton-c/include/proton/ssl.h
deleted file mode 100644
index 4e5a0ca..0000000
--- a/proton-c/include/proton/ssl.h
+++ /dev/null
@@ -1,433 +0,0 @@
-#ifndef PROTON_SSL_H
-#define PROTON_SSL_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/type_compat.h>
-#include <proton/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- *
- * @copybrief ssl
- *
- * @addtogroup ssl
- * @{
- */
-
-/**    
- * API for using SSL with the Transport Layer.
- *
- * A Transport may be configured to use SSL for encryption and/or authentication.  A
- * Transport can be configured as either an "SSL client" or an "SSL server".  An SSL
- * client is the party that proactively establishes a connection to an SSL server.  An SSL
- * server is the party that accepts a connection request from a remote SSL client.
- *
- * This SSL implementation defines the following objects:
-
- * @li A top-level object that stores the configuration used by one or more SSL
- * sessions (pn_ssl_domain_t).
- * @li A per-connection SSL session object that performs the encryption/authentication
- * associated with the transport (pn_ssl_t).
- * @li The encryption parameters negotiated for the SSL session (pn_ssl_state_t).
- *
- * A pn_ssl_domain_t object must be created and configured before an SSL session can be
- * established.  The pn_ssl_domain_t is used to construct an SSL session (pn_ssl_t).  The
- * session "adopts" its configuration from the pn_ssl_domain_t that was used to create it.
- * For example, pn_ssl_domain_t can be configured as either a "client" or a "server".  SSL
- * sessions constructed from this domain will perform the corresponding role (either
- * client or server).
- *
- * If either an SSL server or client needs to identify itself with the remote node, it
- * must have its SSL certificate configured (see ::pn_ssl_domain_set_credentials()).
- *
- * If either an SSL server or client needs to verify the identity of the remote node, it
- * must have its database of trusted CAs configured (see ::pn_ssl_domain_set_trusted_ca_db()).
- *
- * An SSL server connection may allow the remote client to connect without SSL (eg. "in
- * the clear"), see ::pn_ssl_domain_allow_unsecured_client().
- *
- * The level of verification required of the remote may be configured (see
- * ::pn_ssl_domain_set_peer_authentication)
- *
- * Support for SSL Client Session resume is provided (see ::pn_ssl_init,
- * ::pn_ssl_resume_status).
- */
-typedef struct pn_ssl_domain_t pn_ssl_domain_t;
-
-/**
- * @see pn_ssl
- */
-typedef struct pn_ssl_t pn_ssl_t;
-
-/**
- * Determines the type of SSL endpoint.
- */
-typedef enum {
-  PN_SSL_MODE_CLIENT = 1, /**< Local connection endpoint is an SSL client */
-  PN_SSL_MODE_SERVER      /**< Local connection endpoint is an SSL server */
-} pn_ssl_mode_t;
-
-/**
- * Indicates whether an SSL session has been resumed.
- */
-typedef enum {
-  PN_SSL_RESUME_UNKNOWN,        /**< Session resume state unknown/not supported */
-  PN_SSL_RESUME_NEW,            /**< Session renegotiated - not resumed */
-  PN_SSL_RESUME_REUSED          /**< Session resumed from previous session. */
-} pn_ssl_resume_status_t;
-
-/**
- * Tests for SSL implementation present
- *
- *  @return true if we support SSL, false if not
- */
-PN_EXTERN bool pn_ssl_present( void );
-
-/**
- * Create an SSL configuration domain
- *
- * This method allocates an SSL domain object.  This object is used to hold the SSL
- * configuration for one or more SSL sessions.  The SSL session object (pn_ssl_t) is
- * allocated from this object.
- *
- * @param[in] mode the role, client or server, assumed by all SSL sessions created
- * with this domain.
- * @return a pointer to the SSL domain, if SSL support is present.
- */
-PN_EXTERN pn_ssl_domain_t *pn_ssl_domain(pn_ssl_mode_t mode);
-
-/**
- * Release an SSL configuration domain
- *
- * This method frees an SSL domain object allocated by ::pn_ssl_domain.
- * @param[in] domain the domain to destroy.
- */
-PN_EXTERN void pn_ssl_domain_free(pn_ssl_domain_t *domain);
-
-/**
- * Set the certificate that identifies the local node to the remote.
- *
- * This certificate establishes the identity for the local node for all SSL sessions
- * created from this domain.  It will be sent to the remote if the remote needs to verify
- * the identity of this node.  This may be used for both SSL servers and SSL clients (if
- * client authentication is required by the server).
- *
- * @note This setting effects only those pn_ssl_t objects created after this call
- * returns.  pn_ssl_t objects created before invoking this method will use the domain's
- * previous setting.
- *
- * @param[in] domain the ssl domain that will use this certificate.
- * @param[in] credential_1 specifier for the file/database containing the identifying
- * certificate. For Openssl users, this is a PEM file. For Windows SChannel users, this is
- * the PKCS#12 file or system store.
- * @param[in] credential_2 an optional key to access the identifying certificate. For
- * Openssl users, this is an optional PEM file containing the private key used to sign the
- * certificate. For Windows SChannel users, this is the friendly name of the
- * self-identifying certificate if there are multiple certificates in the store.
- * @param[in] password the password used to sign the key, else NULL if key is not
- * protected.
- * @return 0 on success
- */
-PN_EXTERN int pn_ssl_domain_set_credentials(pn_ssl_domain_t *domain,
-                                            const char *credential_1,
-                                            const char *credential_2,
-                                            const char *password);
-
-/**
- * Configure the set of trusted CA certificates used by this domain to verify peers.
- *
- * If the local SSL client/server needs to verify the identity of the remote, it must
- * validate the signature of the remote's certificate.  This function sets the database of
- * trusted CAs that will be used to verify the signature of the remote's certificate.
- *
- * @note This setting effects only those pn_ssl_t objects created after this call
- * returns.  pn_ssl_t objects created before invoking this method will use the domain's
- * previous setting.
- *
- * @param[in] domain the ssl domain that will use the database.
- * @param[in] certificate_db database of trusted CAs, used to authenticate the peer.
- * @return 0 on success
- */
-PN_EXTERN int pn_ssl_domain_set_trusted_ca_db(pn_ssl_domain_t *domain,
-                                const char *certificate_db);
-
-/**
- * Determines the level of peer validation.
- *
- * ANONYMOUS_PEER does not require a valid certificate, and permits
- * use of ciphers that do not provide authentication.
- *
- * VERIFY_PEER will only connect to those peers that provide a valid
- * identifying certificate signed by a trusted CA and are using an
- * authenticated cipher.
- *
- * VERIFY_PEER_NAME is like VERIFY_PEER, but also requires the peer's
- * identity as contained in the certificate to be valid (see
- * ::pn_ssl_set_peer_hostname).
- *
- * ANONYMOUS_PEER is configured by default.
- */
-typedef enum {
-  PN_SSL_VERIFY_NULL = 0,   /**< internal use only */
-  PN_SSL_VERIFY_PEER,       /**< require peer to provide a valid identifying certificate */
-  PN_SSL_ANONYMOUS_PEER,    /**< do not require a certificate nor cipher authorization */
-  PN_SSL_VERIFY_PEER_NAME   /**< require valid certificate and matching name */
-} pn_ssl_verify_mode_t;
-
-/**
- * Configure the level of verification used on the peer certificate.
- *
- * This method controls how the peer's certificate is validated, if at all.  By default,
- * neither servers nor clients attempt to verify their peers (PN_SSL_ANONYMOUS_PEER).
- * Once certificates and trusted CAs are configured, peer verification can be enabled.
- *
- * @note In order to verify a peer, a trusted CA must be configured. See
- * ::pn_ssl_domain_set_trusted_ca_db().
- *
- * @note Servers must provide their own certificate when verifying a peer.  See
- * ::pn_ssl_domain_set_credentials().
- *
- * @note This setting effects only those pn_ssl_t objects created after this call
- * returns.  pn_ssl_t objects created before invoking this method will use the domain's
- * previous setting.
- *
- * @param[in] domain the ssl domain to configure.
- * @param[in] mode the level of validation to apply to the peer
- * @param[in] trusted_CAs path to a database of trusted CAs that the server will advertise
- * to the peer client if the server has been configured to verify its peer.
- * @return 0 on success
- */
-PN_EXTERN int pn_ssl_domain_set_peer_authentication(pn_ssl_domain_t *domain,
-                                                    const pn_ssl_verify_mode_t mode,
-                                                    const char *trusted_CAs);
-
-/**
- * Permit a server to accept connection requests from non-SSL clients.
- *
- * This configures the server to "sniff" the incoming client data stream, and dynamically
- * determine whether SSL/TLS is being used.  This option is disabled by default: only
- * clients using SSL/TLS are accepted.
- *
- * @param[in] domain the domain (server) that will accept the client connections.
- * @return 0 on success
- */
-PN_EXTERN int pn_ssl_domain_allow_unsecured_client(pn_ssl_domain_t *domain);
-
-/**
- * Create a new SSL session object associated with a transport.
- *
- * A transport must have an SSL object in order to "speak" SSL over its connection. This
- * method allocates an SSL object associates it with the transport.
- *
- * @param[in] transport the transport that will own the new SSL session.
- * @return a pointer to the SSL object configured for this transport.  Returns NULL if
- * no SSL session is associated with the transport.
- */
-PN_EXTERN pn_ssl_t *pn_ssl(pn_transport_t *transport);
-
-/**
- * Initialize an SSL session.
- *
- * This method configures an SSL object using the configuration provided by the given
- * domain.
- *
- * @param[in] ssl the ssl session to configured.
- * @param[in] domain the ssl domain used to configure the SSL session.
- * @param[in] session_id if supplied, attempt to resume a previous SSL
- * session that used the same session_id.  If no previous SSL session
- * is available, a new session will be created using the session_id
- * and stored for future session restore (see ::::pn_ssl_resume_status).
- * @return 0 on success, else an error code.
- */
-PN_EXTERN int pn_ssl_init(pn_ssl_t *ssl,
-                          pn_ssl_domain_t *domain,
-                          const char *session_id);
-
-/**
- * Get the name of the Cipher that is currently in use.
- *
- * Gets a text description of the cipher that is currently active, or
- * returns FALSE if SSL is not active (no cipher).  Note that the
- * cipher in use may change over time due to renegotiation or other
- * changes to the SSL state.
- *
- * @param[in] ssl the ssl client/server to query.
- * @param[in,out] buffer buffer of size bytes to hold cipher name
- * @param[in] size maximum number of bytes in buffer.
- * @return True if cipher name written to buffer, False if no cipher in use.
- */
-PN_EXTERN bool pn_ssl_get_cipher_name(pn_ssl_t *ssl, char *buffer, size_t size);
-
-/**
- * Get the SSF (security strength factor) of the Cipher that is currently in use.
- *
- * @param[in] ssl the ssl client/server to query.
- * @return the ssf, note that 0 means no security.
- */
-PN_EXTERN int pn_ssl_get_ssf(pn_ssl_t *ssl);
-
-/**
- * Get the name of the SSL protocol that is currently in use.
- *
- * Gets a text description of the SSL protocol that is currently active, or returns FALSE if SSL
- * is not active.  Note that the protocol may change over time due to renegotiation.
- *
- * @param[in] ssl the ssl client/server to query.
- * @param[in,out] buffer buffer of size bytes to hold the version identifier
- * @param[in] size maximum number of bytes in buffer.
- * @return True if the version information was written to buffer, False if SSL connection
- * not ready.
- */
-PN_EXTERN bool pn_ssl_get_protocol_name(pn_ssl_t *ssl, char *buffer, size_t size);
-
-/**
- * Check whether the state has been resumed.
- *
- * Used for client session resume.  When called on an active session, indicates whether
- * the state has been resumed from a previous session.
- *
- * @note This is a best-effort service - there is no guarantee that the remote server will
- * accept the resumed parameters.  The remote server may choose to ignore these
- * parameters, and request a re-negotiation instead.
- *
- * @param[in] ssl the ssl session to check
- * @return status code indicating whether or not the session has been resumed.
- */
-PN_EXTERN pn_ssl_resume_status_t pn_ssl_resume_status(pn_ssl_t *ssl);
-
-/**
- * Set the expected identity of the remote peer.
- *
- * By default, SSL will use the hostname associated with the connection that
- * the transport is bound to (see ::pn_connection_set_hostname).  This method
- * allows the caller to override that default.
- *
- * The hostname is used for two purposes: 1) when set on an SSL client, it is sent to the
- * server during the handshake (if Server Name Indication is supported), and 2) it is used
- * to check against the identifying name provided in the peer's certificate. If the
- * supplied name does not exactly match a SubjectAltName (type DNS name), or the
- * CommonName entry in the peer's certificate, the peer is considered unauthenticated
- * (potential imposter), and the SSL connection is aborted.
- *
- * @note Verification of the hostname is only done if PN_SSL_VERIFY_PEER_NAME is enabled.
- * See ::pn_ssl_domain_set_peer_authentication.
- *
- * @param[in] ssl the ssl session.
- * @param[in] hostname the expected identity of the remote. Must conform to the syntax as
- * given in RFC1034, Section 3.5.
- * @return 0 on success.
- */
-PN_EXTERN int pn_ssl_set_peer_hostname(pn_ssl_t *ssl, const char *hostname);
-
-/**
- * Access the configured peer identity.
- *
- * Return the expected identity of the remote peer, as set by ::pn_ssl_set_peer_hostname.
- *
- * @param[in] ssl the ssl session.
- * @param[out] hostname buffer to hold the null-terminated name string. If null, no string
- * is written.
- * @param[in,out] bufsize on input set to the number of octets in hostname. On output, set
- * to the number of octets needed to hold the value of hostname plus a null byte.  Zero if
- * no hostname set.
- * @return 0 on success.
- */
-PN_EXTERN int pn_ssl_get_peer_hostname(pn_ssl_t *ssl, char *hostname, size_t *bufsize);
-
-/**
- * Get the subject from the peers certificate.
- *
- * @param[in] ssl the ssl client/server to query.
- * @return A null terminated string representing the full subject,
- * which is valid until the ssl object is destroyed.
- */
-PN_EXTERN const char* pn_ssl_get_remote_subject(pn_ssl_t *ssl);
-
-/**
- * Enumeration identifying the sub fields of the subject field in the ssl certificate.
- */
-typedef enum {
-  PN_SSL_CERT_SUBJECT_COUNTRY_NAME,
-  PN_SSL_CERT_SUBJECT_STATE_OR_PROVINCE,
-  PN_SSL_CERT_SUBJECT_CITY_OR_LOCALITY,
-  PN_SSL_CERT_SUBJECT_ORGANIZATION_NAME,
-  PN_SSL_CERT_SUBJECT_ORGANIZATION_UNIT,
-  PN_SSL_CERT_SUBJECT_COMMON_NAME
-} pn_ssl_cert_subject_subfield;
-
-/**
- * Enumeration identifying hashing algorithm.
- */
-typedef enum {
-  PN_SSL_SHA1,   /* Produces hash that is 20 bytes long */
-  PN_SSL_SHA256, /* Produces hash that is 32 bytes long */
-  PN_SSL_SHA512, /* Produces hash that is 64 bytes long */
-  PN_SSL_MD5     /* Produces hash that is 16 bytes long */
-} pn_ssl_hash_alg;
-
-/**
- * Get the fingerprint of the certificate. The certificate fingerprint (as displayed in the Fingerprints section when
- * looking at a certificate with say the Firefox browser) is the hexadecimal hash of the entire certificate.
- * The fingerprint is not part of the certificate, rather it is computed from the certificate and can be used to uniquely identify a certificate.
- * @param[in] ssl0 the ssl client/server to query
- * @param[in] fingerprint char pointer. The certificate fingerprint (in hex format) will be populated in this array.
- *            If sha1 is the digest name, the fingerprint is 41 characters long (40 + 1 '\0' character), 65 characters long for
- *            sha256 and 129 characters long for sha512 and 33 characters for md5.
- * @param[in] fingerprint_length - Must be at >= 33 for md5, >= 41 for sha1, >= 65 for sha256 and >=129 for sha512.
- * @param[in] hash_alg the hash algorithm to use. Must be of type pn_ssl_hash_alg (currently supports sha1, sha256, sha512 and md5)
- * @return error code - Returns 0 on success. Return a value less than zero if there were any errors. Upon execution of this function,
- *                      char *fingerprint will contain the appropriate null terminated hex fingerprint
- */
-PN_EXTERN int pn_ssl_get_cert_fingerprint(pn_ssl_t *ssl0,
-                                          char *fingerprint,
-                                          size_t fingerprint_length,
-                                          pn_ssl_hash_alg hash_alg);
-
-/**
- * Returns a char pointer that contains the value of the sub field of the subject field in the ssl certificate. The subject field usually contains the following sub fields -
- * C = ISO3166 two character country code
- * ST = state or province
- * L = Locality; generally means city
- * O = Organization - Company Name
- * OU = Organization Unit - division or unit
- * CN = CommonName
- * @param[in] ssl0 the ssl client/server to query
- * @param[in] field The enumeration pn_ssl_cert_subject_subfield representing the required sub field.
- * @return A null terminated string which contains the requested sub field value which is valid until the ssl object is destroyed.
- */
-PN_EXTERN const char* pn_ssl_get_remote_subject_subfield(pn_ssl_t *ssl0, pn_ssl_cert_subject_subfield field);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ssl.h */
diff --git a/proton-c/include/proton/terminus.h b/proton-c/include/proton/terminus.h
deleted file mode 100644
index c18fb3e..0000000
--- a/proton-c/include/proton/terminus.h
+++ /dev/null
@@ -1,309 +0,0 @@
-#ifndef PROTON_TERMINUS_H
-#define PROTON_TERMINUS_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/type_compat.h>
-#include <proton/codec.h>
-#include <stddef.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- *
- * @copybrief terminus
- *
- * @addtogroup terminus
- * @{
- */
-
-/**
- * Encapsulates the endpoint state associated with an AMQP Terminus.
- *
- * An AMQP Terminus acts as either a source or target for messages,
- * but never both. Every AMQP link is associated with both a source
- * terminus and a target terminus that is negotiated during link
- * establishment. A terminus consists of an AMQP address, along with a
- * number of other properties defining the quality of service and
- * behaviour of the link.
- */
-typedef struct pn_terminus_t pn_terminus_t;
-
-/**
- * Type of an AMQP terminus.
- */
-typedef enum {
-  PN_UNSPECIFIED = 0, /**< indicates a nonexistent terminus, may used
-                         as a source or target */
-  PN_SOURCE = 1, /**< indicates a source of messages */
-  PN_TARGET = 2, /**< indicates a target for messages */
-  PN_COORDINATOR = 3 /**< a special target identifying a transaction
-                        coordinator */
-} pn_terminus_type_t;
-
-/**
- * Durability mode of an AMQP terminus.
- *
- * An AMQP terminus may provide durable storage for its state, thereby
- * permitting link recovery in the event of endpoint failures. This
- * durability may be applied to the configuration of the terminus
- * only, or to all delivery state as well.
- */
-typedef enum {
-  PN_NONDURABLE = 0, /**< indicates a non durable terminus */
-  PN_CONFIGURATION = 1, /**< indicates a terminus with durably held
-                           configuration, but not delivery state */
-  PN_DELIVERIES = 2 /**< indicates a terminus with both durably held
-                       configuration and durably held delivery
-                       state. */
-} pn_durability_t;
-
-/**
- * Expiry policy of an AMQP terminus.
- *
- * An orphaned terminus can only exist for the timeout configured by
- * ::pn_terminus_set_timeout. The expiry policy determins when a
- * terminus is considered orphaned, i.e. when the expiry timer starts
- * counting down.
- */
-typedef enum {
-  PN_EXPIRE_WITH_LINK, /**< the terminus is orphaned when the parent link is closed */
-  PN_EXPIRE_WITH_SESSION, /**< the terminus is orphaned when the parent session is closed */
-  PN_EXPIRE_WITH_CONNECTION, /**< the terminus is orphaned when the parent connection is closed */
-  PN_EXPIRE_NEVER /**< the terminus is never considered orphaned */
-} pn_expiry_policy_t;
-
-/**
- * Distribution mode of an AMQP terminus.
- *
- * The distribution mode of a source terminus defines the behaviour
- * when multiple receiving links provide addresses that resolve to the
- * same node.
- */
-typedef enum {
-  PN_DIST_MODE_UNSPECIFIED = 0, /**< the behaviour is defined by the node */
-  PN_DIST_MODE_COPY = 1, /**< the receiver gets all messages */
-  PN_DIST_MODE_MOVE = 2 /**< the receiver competes for messages */
-} pn_distribution_mode_t;
-
-/**
- * Get the type of a terminus object.
- *
- * @param[in] terminus a terminus object
- * @return the terminus type
- */
-PN_EXTERN pn_terminus_type_t pn_terminus_get_type(pn_terminus_t *terminus);
-
-/**
- * Set the type of a terminus object.
- *
- * @param[in] terminus a terminus object
- * @param[in] type the terminus type
- * @return 0 on success or an error code on failure
- */
-PN_EXTERN int pn_terminus_set_type(pn_terminus_t *terminus, pn_terminus_type_t type);
-
-/**
- * Get the address of a terminus object.
- *
- * The pointer returned by this operation is valid until
- * ::pn_terminus_set_address is called or until the terminus is freed
- * due to its parent link being freed.
- *
- * @param[in] terminus a terminus object
- * @return a pointer to the address
- */
-PN_EXTERN const char *pn_terminus_get_address(pn_terminus_t *terminus);
-
-/**
- * Set the address of a terminus object.
- *
- * @param[in] terminus a terminus object
- * @param[in] address an AMQP address string
- * @return 0 on success or an error code on failure
- */
-PN_EXTERN int pn_terminus_set_address(pn_terminus_t *terminus, const char *address);
-
-/**
- * Get the distribution mode of a terminus object.
- *
- * @param[in] terminus a terminus object
- * @return the distribution mode of the terminus
- */
-PN_EXTERN pn_distribution_mode_t pn_terminus_get_distribution_mode(const pn_terminus_t *terminus);
-
-/**
- * Set the distribution mode of a terminus object.
- *
- * @param[in] terminus a terminus object
- * @param[in] mode the distribution mode for the terminus
- * @return 0 on success or an error code on failure
- */
-PN_EXTERN int pn_terminus_set_distribution_mode(pn_terminus_t *terminus, pn_distribution_mode_t mode);
-
-/**
- * Get the durability mode of a terminus object.
- *
- * @param[in] terminus a terminus object
- * @return the terminus durability mode
- */
-PN_EXTERN pn_durability_t pn_terminus_get_durability(pn_terminus_t *terminus);
-
-/**
- * Set the durability mode of a terminus object.
- *
- * @param[in] terminus a terminus object
- * @param[in] durability the terminus durability mode
- * @return 0 on success or an error code on failure
- */
-PN_EXTERN int pn_terminus_set_durability(pn_terminus_t *terminus,
-                                         pn_durability_t durability);
-
-/**
- * Get the expiry policy of a terminus object.
- *
- * @param[in] terminus a terminus object
- * @return the expiry policy of the terminus
- */
-PN_EXTERN pn_expiry_policy_t pn_terminus_get_expiry_policy(pn_terminus_t *terminus);
-
-/**
- * Set the expiry policy of a terminus object.
- *
- * @param[in] terminus a terminus object
- * @param[in] policy the expiry policy for the terminus
- * @return 0 on success or an error code on failure
- */
-PN_EXTERN int pn_terminus_set_expiry_policy(pn_terminus_t *terminus, pn_expiry_policy_t policy);
-
-/**
- * Get the timeout of a terminus object.
- *
- * @param[in] terminus a terminus object
- * @return the timeout of the terminus
- */
-PN_EXTERN pn_seconds_t pn_terminus_get_timeout(pn_terminus_t *terminus);
-
-/**
- * Set the timeout of a terminus object.
- *
- * @param[in] terminus a terminus object
- * @param[in] timeout the timeout for the terminus
- * @return 0 on success or an error code on failure
- */
-PN_EXTERN int pn_terminus_set_timeout(pn_terminus_t *terminus, pn_seconds_t timeout);
-
-/**
- * Get the dynamic flag for a terminus object.
- *
- * @param[in] terminus a terminus object
- * @return true if the dynamic flag is set for the terminus, false otherwise
- */
-PN_EXTERN bool pn_terminus_is_dynamic(pn_terminus_t *terminus);
-
-/**
- * Set the dynamic flag for a terminus object.
- *
- * @param[in] terminus a terminus object
- * @param[in] dynamic the dynamic flag for the terminus
- * @return 0 on success or an error code on failure
- */
-PN_EXTERN int pn_terminus_set_dynamic(pn_terminus_t *terminus, bool dynamic);
-
-/**
- * Access/modify the AMQP properties data for a terminus object.
- *
- * This operation will return a pointer to a ::pn_data_t object that
- * is valid until the terminus object is freed due to its parent link
- * being freed. Any data contained by the ::pn_data_t object will be
- * sent as the AMQP properties for the parent terminus object. Note
- * that this MUST take the form of a symbol keyed map to be valid.
- *
- * @param[in] terminus a terminus object
- * @return a pointer to a pn_data_t representing the terminus properties
- */
-PN_EXTERN pn_data_t *pn_terminus_properties(pn_terminus_t *terminus);
-
-/**
- * Access/modify the AMQP capabilities data for a terminus object.
- *
- * This operation will return a pointer to a ::pn_data_t object that
- * is valid until the terminus object is freed due to its parent link
- * being freed. Any data contained by the ::pn_data_t object will be
- * sent as the AMQP capabilities for the parent terminus object. Note
- * that this MUST take the form of an array of symbols to be valid.
- *
- * @param[in] terminus a terminus object
- * @return a pointer to a pn_data_t representing the terminus capabilities
- */
-PN_EXTERN pn_data_t *pn_terminus_capabilities(pn_terminus_t *terminus);
-
-/**
- * Access/modify the AMQP outcomes for a terminus object.
- *
- * This operation will return a pointer to a ::pn_data_t object that
- * is valid until the terminus object is freed due to its parent link
- * being freed. Any data contained by the ::pn_data_t object will be
- * sent as the AMQP outcomes for the parent terminus object. Note
- * that this MUST take the form of an array of symbols to be valid.
- *
- * @param[in] terminus a terminus object
- * @return a pointer to a pn_data_t representing the terminus outcomes
- */
-PN_EXTERN pn_data_t *pn_terminus_outcomes(pn_terminus_t *terminus);
-
-/**
- * Access/modify the AMQP filter set for a terminus object.
- *
- * This operation will return a pointer to a ::pn_data_t object that
- * is valid until the terminus object is freed due to its parent link
- * being freed. Any data contained by the ::pn_data_t object will be
- * sent as the AMQP filter set for the parent terminus object. Note
- * that this MUST take the form of a symbol keyed map to be valid.
- *
- * @param[in] terminus a source terminus object
- * @return a pointer to a pn_data_t representing the terminus filter set
- */
-PN_EXTERN pn_data_t *pn_terminus_filter(pn_terminus_t *terminus);
-
-/**
- * Copy a terminus object.
- *
- * @param[in] terminus the terminus object to be copied into
- * @param[in] src the terminus to be copied from
- * @return 0 on success or an error code on failure
- */
-PN_EXTERN int pn_terminus_copy(pn_terminus_t *terminus, pn_terminus_t *src);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* terminus.h */
diff --git a/proton-c/include/proton/transport.h b/proton-c/include/proton/transport.h
deleted file mode 100644
index 09fbb03..0000000
--- a/proton-c/include/proton/transport.h
+++ /dev/null
@@ -1,674 +0,0 @@
-#ifndef PROTON_TRANSPORT_H
-#define PROTON_TRANSPORT_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/type_compat.h>
-#include <proton/condition.h>
-#include <stddef.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- *
- * @copybrief transport
- *
- * @addtogroup transport
- * @{
- */
-
-/**
- * Holds the trace flags for an AMQP transport.
- *
- * The trace flags for an AMQP transport control what sort of
- * information is logged by an AMQP transport. The following bits can
- * be set:
- *
- * - ::PN_TRACE_OFF
- * - ::PN_TRACE_RAW
- * - ::PN_TRACE_FRM
- * - ::PN_TRACE_DRV
- * - ::PN_TRACE_EVT
- *
- */
-typedef int pn_trace_t;
-
-/**
- * Callback for customizing logging behaviour.
- */
-typedef void (*pn_tracer_t)(pn_transport_t *transport, const char *message);
-
-/**
- * Turn logging off entirely.
- */
-#define PN_TRACE_OFF (0)
-
-/**
- * Log raw binary data into/out of the transport.
- */
-#define PN_TRACE_RAW (1)
-
-/**
- * Log frames into/out of the transport.
- */
-#define PN_TRACE_FRM (2)
-
-/**
- * Log driver related events, e.g. initialization, end of stream, etc.
- */
-#define PN_TRACE_DRV (4)
-
-/**
- * Log events
- */
-#define PN_TRACE_EVT (8)
-
-/**
- * Factory for creating a transport.
- * A transport is used by a connection to interface with the network.
- * There can only be one connection associated with a transport. See
- * pn_transport_bind().
- *
- * Initially a transport is configured to be a client transport. Use pn_transport_set_server()
- * to configure the transport as a server transport.
- *
- * A client transport initiates outgoing connections.
- *
- * A client transport must be configured with the protocol layers to use and cannot
- * configure itself automatically.
- *
- * A server transport accepts incoming connections. It can automatically
- * configure itself to include the various protocol layers depending on
- * the incoming protocol headers.
- *
- * @return pointer to new transport
- */
-PN_EXTERN pn_transport_t *pn_transport(void);
-
-/**
- * Configure a transport as a server
- *
- * @param[in] transport a transport object
- */
-PN_EXTERN void pn_transport_set_server(pn_transport_t *transport);
-
-/**
- * Free a transport object.
- *
- * When a transport is freed, it is automatically unbound from its
- * associated connection.
- *
- * @param[in] transport a transport object or NULL
- */
-PN_EXTERN void pn_transport_free(pn_transport_t *transport);
-
-/**
- * Retrieve the authenticated user.
- *
- * This is usually used at the the server end to find the name of the
- * authenticated user.  On the client it will merely return whatever
- * user was passed in to the pn_connection_set_user() API of the bound
- * connection.
- *
- * The returned value is only reliable after the
- * PN_TRANSPORT_AUTHENTICATED event has been received.
- *
- * @param[in] transport the transport
- *
- * @return If a the user is anonymous (either no SASL layer is
- * negotiated or the SASL ANONYMOUS mechanism is used) then the user
- * will be "anonymous" Otherwise a string containing the user is
- * returned.
- */
-PN_EXTERN const char *pn_transport_get_user(pn_transport_t *transport);
-
-/**
- * Set whether a non-authenticated transport connection is allowed.
- *
- * There are several ways within the AMQP protocol suite to get
- * unauthenticated connections:
- *
- * - Use no SASL layer (with either no TLS or TLS without client certificates)
- * - Use a SASL layer but the ANONYMOUS mechanism
- *
- * The default if this option is not set is to allow unauthenticated connections.
- *
- * @param[in] transport the transport
- * @param[in] required boolean is true when authenticated connections are required
- */
-PN_EXTERN void pn_transport_require_auth(pn_transport_t *transport, bool required);
-
-/**
- * Tell whether the transport connection is authenticated
- *
- * Note that this property may not be stable until the PN_CONNECTION_REMOTE_OPEN
- * event is received.
- *
- * @param[in] transport the transport
- * @return bool representing authentication
- */
-PN_EXTERN bool pn_transport_is_authenticated(pn_transport_t *transport);
-
-/**
- * Set whether a non encrypted transport connection is allowed
- *
- * There are several ways within the AMQP protocol suite to get encrypted connections:
- * - Use TLS
- * - Use a SASL with a mechanism that supports saecurity layers
- *
- * The default if this option is not set is to allow unencrypted connections.
- *
- * @param[in] transport the transport
- * @param[in] required boolean is true when encrypted connections are required
- */
-PN_EXTERN void pn_transport_require_encryption(pn_transport_t *transport, bool required);
-
-/**
- * Tell whether the transport connection is encrypted
- *
- * Note that this property may not be stable until the PN_CONNECTION_REMOTE_OPEN
- * event is received.
- *
- * @param[in] transport the transport
- * @return bool representing encryption
- */
-PN_EXTERN bool pn_transport_is_encrypted(pn_transport_t *transport);
-
-/**
- * Get additional information about the condition of the transport.
- *
- * When a PN_TRANSPORT_ERROR event occurs, this operation can be used
- * to access the details of the error condtion.
- *
- * The pointer returned by this operation is valid until the
- * transport object is freed.
- *
- * @param[in] transport the transport object
- * @return the transport's condition object
- */
-PN_EXTERN pn_condition_t *pn_transport_condition(pn_transport_t *transport);
-
-/**
- * @deprecated
- */
-PN_EXTERN pn_error_t *pn_transport_error(pn_transport_t *transport);
-
-/**
- * Binds the transport to an AMQP connection.
- *
- * @return an error code, or 0 on success
- */
-PN_EXTERN int pn_transport_bind(pn_transport_t *transport, pn_connection_t *connection);
-
-/**
- * Unbinds a transport from its AMQP connection.
- *
- * @return an error code, or 0 on success
- */
-PN_EXTERN int pn_transport_unbind(pn_transport_t *transport);
-
-/**
- * Update a transports trace flags.
- *
- * The trace flags for a transport control what sort of information is
- * logged. See ::pn_trace_t for more details.
- *
- * @param[in] transport a transport object
- * @param[in] trace the trace flags
- *
- * @internal XXX Deprecate!
- */
-PN_EXTERN void pn_transport_trace(pn_transport_t *transport, pn_trace_t trace);
-
-/**
- * Set the tracing function used by a transport.
- *
- * The tracing function is called to perform logging. Overriding this
- * function allows embedding applications to divert the engine's
- * logging to a place of their choice.
- *
- * @param[in] transport a transport object
- * @param[in] tracer the tracing function
- *
- * @internal XXX Deprecate!
- */
-PN_EXTERN void pn_transport_set_tracer(pn_transport_t *transport, pn_tracer_t tracer);
-
-/**
- * Get the tracing function used by a transport.
- *
- * @param[in] transport a transport object
- * @return the tracing function used by a transport
- *
- * @internal XXX Deprecate!
- */
-PN_EXTERN pn_tracer_t pn_transport_get_tracer(pn_transport_t *transport);
-
-/**
- * @deprecated
- *
- * Get the application context that is associated with a transport object.
- *
- * The application context for a transport may be set using
- * ::pn_transport_set_context.
- *
- * @param[in] transport the transport whose context is to be returned.
- * @return the application context for the transport object
- */
-PN_EXTERN void *pn_transport_get_context(pn_transport_t *transport);
-
-/**
- * @deprecated
- *
- * Set a new application context for a transport object.
- *
- * The application context for a transport object may be retrieved using
- * ::pn_transport_get_context.
- *
- * @param[in] transport the transport object
- * @param[in] context the application context
- */
-PN_EXTERN void pn_transport_set_context(pn_transport_t *transport, void *context);
-
-/**
- * Get the attachments that are associated with a transport object.
- *
- * @param[in] transport the transport whose attachments are to be returned.
- * @return the attachments for the transport object
- */
-PN_EXTERN pn_record_t *pn_transport_attachments(pn_transport_t *transport);
-
-/**
- * Log a message using a transport's logging mechanism.
- *
- * This can be useful in a debugging context as the log message will
- * be prefixed with the transport's identifier.
- *
- * @param[in] transport a transport object
- * @param[in] message the message to be logged
- *
- * @internal XXX Deprecate!
- */
-PN_EXTERN void pn_transport_log(pn_transport_t *transport, const char *message);
-
-/**
- * Log a printf formatted message using a transport's logging
- * mechanism.
- *
- * This can be useful in a debugging context as the log message will
- * be prefixed with the transport's identifier.
- *
- * @param[in] transport a transport object
- * @param[in] fmt the printf formatted message to be logged
- * @param[in] ap a vector containing the format arguments
- *
- * @internal XXX Deprecate!
- */
-PN_EXTERN void pn_transport_vlogf(pn_transport_t *transport, const char *fmt, va_list ap);
-
-/**
- * Log a printf formatted message using a transport's logging
- * mechanism.
- *
- * This can be useful in a debugging context as the log message will
- * be prefixed with the transport's identifier.
- *
- * @param[in] transport a transport object
- * @param[in] fmt the printf formatted message to be logged
- *
- * @internal XXX Deprecate!
- */
-PN_EXTERN void pn_transport_logf(pn_transport_t *transport, const char *fmt, ...);
-
-/**
- * Get the maximum allowed channel for a transport.
- * This will be the minimum of
- *   1. limit imposed by this proton implementation
- *   2. limit imposed by remote peer
- *   3. limit imposed by this application, using pn_transport_set_channel_max()
- *
- * @param[in] transport a transport object
- * @return the maximum allowed channel
- *
- * @internal XXX Deprecate!
- */
-PN_EXTERN uint16_t pn_transport_get_channel_max(pn_transport_t *transport);
-
-/**
- * Set the maximum allowed channel number for a transport.
- * Note that this is the maximum channel number allowed, giving a
- * valid channel number range of [0..channel_max]. Therefore the
- * maximum number of simultaineously active channels will be
- * channel_max plus 1.
- * You can call this function more than once to raise and lower
- * the limit your application imposes on max channels for this
- * transport.  However, smaller limits may be imposed by this
- * library, or by the remote peer.
- * After the OPEN frame has been sent to the remote peer,
- * further calls to this function will have no effect.
- *
- * @param[in] transport a transport object
- * @param[in] channel_max the maximum allowed channel
- * @return PN_OK, or PN_STATE_ERR if it is too late to change channel_max
- *
- * @internal XXX Deprecate!
- */
-PN_EXTERN int pn_transport_set_channel_max(pn_transport_t *transport, uint16_t channel_max);
-
-/**
- * Get the maximum allowed channel of a transport's remote peer.
- *
- * @param[in] transport a transport object
- * @return the maximum allowed channel of the transport's remote peer
- *
- * @internal XXX Deprecate!
- */
-PN_EXTERN uint16_t pn_transport_remote_channel_max(pn_transport_t *transport);
-
-/**
- * Get the maximum frame size of a transport.
- *
- * @param[in] transport a transport object
- * @return the maximum frame size of the transport object
- *
- * @internal XXX Deprecate!
- */
-PN_EXTERN uint32_t pn_transport_get_max_frame(pn_transport_t *transport);
-
-/**
- * Set the maximum frame size of a transport.
- *
- * @param[in] transport a transport object
- * @param[in] size the maximum frame size for the transport object
- *
- * @internal XXX Deprecate!
- */
-PN_EXTERN void pn_transport_set_max_frame(pn_transport_t *transport, uint32_t size);
-
-/**
- * Get the maximum frame size of a transport's remote peer.
- *
- * @param[in] transport a transport object
- * @return the maximum frame size of the transport's remote peer
- *
- * @internal XXX Deprecate!
- */
-PN_EXTERN uint32_t pn_transport_get_remote_max_frame(pn_transport_t *transport);
-
-/**
- * Get the idle timeout for a transport.
- *
- * A zero idle timeout means heartbeats are disabled.
- *
- * @param[in] transport a transport object
- * @return the transport's idle timeout
- *
- * @internal XXX Deprecate!
- */
-PN_EXTERN pn_millis_t pn_transport_get_idle_timeout(pn_transport_t *transport);
-
-/**
- * Set the idle timeout for a transport.
- *
- * A zero idle timeout means heartbeats are disabled.
- *
- * @param[in] transport a transport object
- * @param[in] timeout the idle timeout for the transport object
- *
- * @internal XXX Deprecate!
- */
-PN_EXTERN void pn_transport_set_idle_timeout(pn_transport_t *transport, pn_millis_t timeout);
-
-/**
- * Get the idle timeout for a transport's remote peer.
- *
- * A zero idle timeout means heartbeats are disabled.
- *
- * @param[in] transport a transport object
- * @return the idle timeout for the transport's remote peer
- *
- * @internal XXX Deprecate!
- */
-PN_EXTERN pn_millis_t pn_transport_get_remote_idle_timeout(pn_transport_t *transport);
-
-/**
- * @deprecated
- */
-PN_EXTERN ssize_t pn_transport_input(pn_transport_t *transport, const char *bytes, size_t available);
-
-/**
- * @deprecated
- */
-PN_EXTERN ssize_t pn_transport_output(pn_transport_t *transport, char *bytes, size_t size);
-
-/**
- * Get the amount of free space for input following the transport's
- * tail pointer.
- *
- * If the engine is in an exceptional state such as encountering an
- * error condition or reaching the end of stream state, a negative
- * value will be returned indicating the condition. If an error is
- * indicated, futher details can be obtained from
- * ::pn_transport_error. Calls to ::pn_transport_process may alter the
- * value of this pointer. See ::pn_transport_process for details.
- *
- * @param[in] transport the transport
- * @return the free space in the transport, PN_EOS or error code if < 0
- */
-PN_EXTERN ssize_t pn_transport_capacity(pn_transport_t *transport);
-
-/**
- * Get the transport's tail pointer.
- *
- * The amount of free space following this pointer is reported by
- * ::pn_transport_capacity. Calls to ::pn_transport_process may alther
- * the value of this pointer. See ::pn_transport_process for details.
- *
- * @param[in] transport the transport
- * @return a pointer to the transport's input buffer, NULL if no capacity available.
- */
-PN_EXTERN char *pn_transport_tail(pn_transport_t *transport);
-
-/**
- * Pushes the supplied bytes into the tail of the transport.
- *
- * This is equivalent to copying @c size bytes afther the tail pointer
- * and then calling ::pn_transport_process with an argument of @c
- * size. Only some of the bytes will be copied if there is
- * insufficienty capacity available. Use ::pn_transport_capacity to
- * determine how much capacity the transport has.
- *
- * @param[in] transport the transport
- * @param[in] src the start of the data to push into the transport
- * @param[in] size the amount of data to push into the transport
- *
- * @return the number of bytes pushed on success, or error code if < 0
- */
-PN_EXTERN ssize_t pn_transport_push(pn_transport_t *transport, const char *src, size_t size);
-
-/**
- * Process input data following the tail pointer.
- *
- * Calling this function will cause the transport to consume @c size
- * bytes of input occupying the free space following the tail pointer.
- * Calls to this function may change the value of ::pn_transport_tail,
- * as well as the amount of free space reported by
- * ::pn_transport_capacity.
- *
- * @param[in] transport the transport
- * @param[in] size the amount of data written to the transport's input buffer
- * @return 0 on success, or error code if < 0
- */
-PN_EXTERN int pn_transport_process(pn_transport_t *transport, size_t size);
-
-/**
- * Indicate that the input has reached End Of Stream (EOS).
- *
- * This tells the transport that no more input will be forthcoming.
- *
- * @param[in] transport the transport
- * @return 0 on success, or error code if < 0
- */
-PN_EXTERN int pn_transport_close_tail(pn_transport_t *transport);
-
-/**
- * Get the number of pending output bytes following the transport's
- * head pointer.
- *
- * If the engine is in an exceptional state such as encountering an
- * error condition or reaching the end of stream state, a negative
- * value will be returned indicating the condition. If an error is
- * indicated, further details can be obtained from
- * ::pn_transport_error. Calls to ::pn_transport_pop may alter the
- * value of this pointer. See ::pn_transport_pop for details.
- *
- * @param[in] transport the transport
- * @return the number of pending output bytes, or an error code
- */
-PN_EXTERN ssize_t pn_transport_pending(pn_transport_t *transport);
-
-/**
- * Get the transport's head pointer.
- *
- * This pointer references queued output data. The
- * ::pn_transport_pending function reports how many bytes of output
- * data follow this pointer. Calls to ::pn_transport_pop may alter
- * this pointer and any data it references. See ::pn_transport_pop for
- * details.
- *
- * @param[in] transport the transport
- * @return a pointer to the transport's output buffer, or NULL if no pending output.
- */
-PN_EXTERN const char *pn_transport_head(pn_transport_t *transport);
-
-/**
- * Copies @c size bytes from the head of the transport to the @c dst
- * pointer.
- *
- * It is an error to call this with a value of @c size that is greater
- * than the value reported by ::pn_transport_pending.
- *
- * @param[in] transport the transport
- * @param[out] dst the destination buffer
- * @param[in] size the capacity of the destination buffer
- * @return number of bytes copied on success, or error code if < 0
- */
-PN_EXTERN ssize_t pn_transport_peek(pn_transport_t *transport, char *dst, size_t size);
-
-/**
- * Removes @c size bytes of output from the pending output queue
- * following the transport's head pointer.
- *
- * Calls to this function may alter the transport's head pointer as
- * well as the number of pending bytes reported by
- * ::pn_transport_pending.
- *
- * @param[in] transport the transport
- * @param[in] size the number of bytes to remove
- */
-PN_EXTERN void pn_transport_pop(pn_transport_t *transport, size_t size);
-
-/**
- * Indicate that the output has closed.
- *
- * This tells the transport that no more output will be popped.
- *
- * @param[in] transport the transport
- * @return 0 on success, or error code if < 0
- */
-PN_EXTERN int pn_transport_close_head(pn_transport_t *transport);
-
-/**
- * Check if a transport has buffered data.
- *
- * @param[in] transport a transport object
- * @return true if the transport has buffered data, false otherwise
- */
-PN_EXTERN bool pn_transport_quiesced(pn_transport_t *transport);
-
-/**
- * Check if a transport is closed.
- *
- * A transport is defined to be closed when both the tail and the head
- * are closed. In other words, when both ::pn_transport_capacity() < 0
- * and ::pn_transport_pending() < 0.
- *
- * @param[in] transport a transport object
- * @return true if the transport is closed, false otherwise
- */
-PN_EXTERN bool pn_transport_closed(pn_transport_t *transport);
-
-/**
- * Process any pending transport timer events.
- *
- * This method should be called after all pending input has been
- * processed by the transport (see ::pn_transport_input), and before
- * generating output (see ::pn_transport_output). It returns the
- * deadline for the next pending timer event, if any are present.
- *
- * @param[in] transport the transport to process.
- * @param[in] now the current time
- *
- * @return if non-zero, then the expiration time of the next pending timer event for the
- * transport.  The caller must invoke pn_transport_tick again at least once at or before
- * this deadline occurs.
- */
-PN_EXTERN pn_timestamp_t pn_transport_tick(pn_transport_t *transport, pn_timestamp_t now);
-
-/**
- * Get the number of frames output by a transport.
- *
- * @param[in] transport a transport object
- * @return the number of frames output by the transport
- */
-PN_EXTERN uint64_t pn_transport_get_frames_output(const pn_transport_t *transport);
-
-/**
- * Get the number of frames input by a transport.
- *
- * @param[in] transport a transport object
- * @return the number of frames input by the transport
- */
-PN_EXTERN uint64_t pn_transport_get_frames_input(const pn_transport_t *transport);
-
-/**
- * Access the AMQP Connection associated with the transport.
- *
- * @param[in] transport a transport object
- * @return the connection context for the transport, or NULL if
- *         none
- */
-PN_EXTERN pn_connection_t *pn_transport_connection(pn_transport_t *transport);
-
-#ifdef __cplusplus
-}
-#endif
-
-/**
- * @}
- */
-
-#endif /* transport.h */
diff --git a/proton-c/include/proton/type_compat.h b/proton-c/include/proton/type_compat.h
deleted file mode 100644
index fe96994..0000000
--- a/proton-c/include/proton/type_compat.h
+++ /dev/null
@@ -1,150 +0,0 @@
-#ifndef PROTON_TYPE_COMPAT_H
-#define PROTON_TYPE_COMPAT_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/**
- * @cond INTERNAL
- */
-
-// Get Boolean
-#if !defined(__cplusplus) && !defined(__bool_true_false_are_defined)
-# if __STDC_VERSION__ >= 199901L || __GNUC__ >= 3 || _MSC_VER >=1800
-#  include <stdbool.h>
-# else
-// Need to get bool/true/false manually
-#  if _MSC_VER
-#   define bool char
-#   define false 0
-#   define true 1
-#   define __bool_true_false_are_defined
-#  else
-#   error "No definitions for bool/true/false"
-#  endif
-# endif
-#endif
-/*
- * Handle special cases for stdint.h and the definition for ssize_t.
- * Third party libraries (e.g. Boost) may provide competing solutions.
- *
- * The effects of this include file may be controlled by overrides:
- *  PN_DEFINE_STDINT/PN_NODEFINE_STDINT   : turn on/off definition of int64_t etc.
- *  PN_DEFINE_SSIZE_T/PN_NODEFINE_SSIZE_T : turn on/off definition of ssize_t
- *  PN_INCLUDE_STDINT/PN_NOINCLUDE_STDINT : include (or not) stdint.h
- */
-
-// Honor positive overrides
-#if defined(PN_DEFINE_STDINT)
-# define PNI_DEFINE_STDINT
-#endif
-#if defined(PN_INCLUDE_STDINT)
-# define PNI_INCLUDE_STDINT)
-#endif
-#if defined(PN_DEFINE_SSIZE_T)
-# define PNI_DEFINE_SSIZE_T
-#endif
-
-// Determinine default action
-#ifndef _MSC_VER
-// Not Windows and not using Visual Studio
-
-/* MBED_BUILD_TIMESTAMP is used to detect whether Proton is being built on www.mbed.org with
-the ARM compiler. In that case ssize_t needs to be defined in this file. */
-#if defined(MBED_BUILD_TIMESTAMP)
-#  define PNI_DEFINE_SSIZE_T
-#else
-#include <sys/types.h>
-#endif /* defined(MBED_LIBRARY_VERSION) */
-
-# ifndef PNI_INCLUDE_STDINT
-#  define PNI_INCLUDE_STDINT
-# endif
-#else
-// all versions of Visual Studio
-# ifndef PNI_DEFINE_SSIZE_T
-// ssize_t def is needed, unless third party definition interferes, e.g. python/swig
-#  ifndef Py_CONFIG_H
-#   define PNI_DEFINE_SSIZE_T
-#  endif
-# endif
-
-# if (_MSC_VER < 1600)
-// VS 2008 and earlier
-#  ifndef PNI_DEFINE_STDINT
-#   define PNI_DEFINE_STDINT
-#  endif
-# else
-// VS 2010 and newer
-#  ifndef PNI_INCLUDE_STDINT
-#   define PNI_INCLUDE_STDINT
-#  endif
-
-# endif // (_MSC_VER < 1600)
-#endif //_MSC_VER
-
-// Honor negative overrides
-#ifdef PN_NODEFINE_SSIZE_T
-# undef PNI_DEFINE_SSIZE_T
-#endif
-#ifdef PN_NODEFINE_STDINT
-# undef PNI_DEFINE_STDINT
-#endif
-#ifdef PN_NOINCLUDE_STDINT
-# undef PNI_INCLUDE_STDINT
-#endif
-
-#ifdef PNI_INCLUDE_STDINT
-# include <stdint.h>
-#endif
-
-#ifdef PNI_DEFINE_SSIZE_T
-# ifdef _MSC_VER
-#  include <BaseTsd.h>
-typedef SSIZE_T ssize_t;
-# else
-typedef intptr_t ssize_t;
-# endif
-#endif // PNI_DEFINE_SSIZE_T
-
-#ifdef PNI_DEFINE_STDINT
-# ifdef _MSC_VER
-
-typedef signed __int8 int8_t;
-typedef signed __int16 int16_t;
-typedef signed __int32 int32_t;
-typedef signed __int64 int64_t;
-
-typedef unsigned __int8 uint8_t;
-typedef unsigned __int16 uint16_t;
-typedef unsigned __int32 uint32_t;
-typedef unsigned __int64 uint64_t;
-
-# else // _MSC_VER
-#  error stdint.h definitions not kown
-# endif
-#endif // PNI_DEFINE_SSIZE_T
-
-/**
- * @endcond
- */
-
-#endif /* type_compat.h */
diff --git a/proton-c/include/proton/types.h b/proton-c/include/proton/types.h
deleted file mode 100644
index c28beac..0000000
--- a/proton-c/include/proton/types.h
+++ /dev/null
@@ -1,437 +0,0 @@
-#ifndef PROTON_TYPES_H
-#define PROTON_TYPES_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <stddef.h>
-#include <proton/type_compat.h>
-
-/**
- * @file
- *
- * @copybrief types
- *
- * @defgroup core Core
- * @brief Core protocol entities and event handling
- *
- * @defgroup connection Connection
- * @brief A channel for communication between two peers on a network
- * @ingroup core
- *
- * @defgroup session Session
- * @brief A container of links
- * @ingroup core
- *
- * @defgroup link Link
- * @brief A channel for transferring messages
- * @ingroup core
- *
- * @defgroup terminus Terminus
- * @brief A source or target for messages
- * @ingroup core
- *
- * @defgroup message Message
- * @brief A mutable holder of application content
- * @ingroup core
- *
- * @defgroup delivery Delivery
- * @brief A message transfer
- * @ingroup core
- *
- * @defgroup condition Condition
- * @brief An endpoint error state
- * @ingroup core
- *
- * @defgroup event Event
- * @brief Protocol and transport events
- * @ingroup core
- *
- * @defgroup transport Transport
- * @brief A network channel supporting an AMQP connection
- * @ingroup core
- *
- * @defgroup sasl SASL
- * @brief SASL secure transport layer
- * @ingroup core
- *
- * @defgroup ssl SSL
- * @brief SSL secure transport layer
- * @ingroup core
- *
- * @defgroup error Error
- * @brief A Proton API error
- * @ingroup core
- *
- * @defgroup types Types
- * @brief AMQP and API data types
- *
- * @defgroup amqp_types AMQP data types
- * @brief AMQP data types
- * @ingroup types
- *
- * @defgroup api_types API data types
- * @brief Additional data types used in the API
- * @ingroup types
- *
- * @defgroup codec Codec
- * @brief AMQP data encoding and decoding
- *
- * @defgroup data Data
- * @brief A data structure for AMQP data
- * @ingroup codec
- *
- * @defgroup io IO
- * @brief IO integration interfaces
- *
- * @defgroup proactor Proactor
- * @brief **Experimental** - Multithreaded IO
- * @ingroup io
- *
- * @defgroup connection_driver Connection driver
- * @brief **Experimental** - Low-level IO integration
- * @ingroup io
- *
- * @defgroup messenger Messenger
- * @deprecated
- * @brief **Deprecated** - The Messenger API
- *
- * @defgroup url URL
- * @deprecated
- * @brief **Deprecated** - A URL parser
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * A sequence number.
- *
- * @ingroup api_types
- */
-typedef int32_t  pn_sequence_t;
-
-/**
- * A span of time in milliseconds.
- *
- * @ingroup api_types
- */
-typedef uint32_t pn_millis_t;
-
-/**
- * The maximum value for @ref pn_millis_t.
- *
- * @ingroup api_types
- */
-#define PN_MILLIS_MAX (~0U)
-
-/**
- * A span of time in seconds.
- *
- * @ingroup api_types
- */
-typedef uint32_t pn_seconds_t;
-
-/**
- * A 64-bit timestamp in milliseconds since the Unix epoch.
- *
- * @ingroup amqp_types
- */
-typedef int64_t pn_timestamp_t;
-
-/**
- * A 32-bit Unicode code point.
- *
- * @ingroup amqp_types
- */
-typedef uint32_t pn_char_t;
-
-/**
- * A 32-bit decimal floating-point number.
- *
- * @ingroup amqp_types
- */
-typedef uint32_t pn_decimal32_t;
-
-/**
- * A 64-bit decimal floating-point number.
- *
- * @ingroup amqp_types
- */
-typedef uint64_t pn_decimal64_t;
-
-/**
- * A 128-bit decimal floating-point number.
- *
- * @ingroup amqp_types
- */
-typedef struct {
-  char bytes[16];
-} pn_decimal128_t;
-
-/**
- * A 16-byte universally unique identifier.
- *
- * @ingroup amqp_types
- */
-typedef struct {
-  char bytes[16];
-} pn_uuid_t;
-
-/**
- * A const byte buffer.
- *
- * @ingroup api_types
- */
-typedef struct pn_bytes_t {
-  size_t size;
-  const char *start;
-} pn_bytes_t;
-
-/**
- * Create a @ref pn_bytes_t
- *
- * @ingroup api_types
- */
-PN_EXTERN pn_bytes_t pn_bytes(size_t size, const char *start);
-
-static const pn_bytes_t pn_bytes_null = { 0, NULL };
-
-/**
- * A non-const byte buffer.
- *
- * @ingroup api_types
- */
-typedef struct pn_rwbytes_t {
-  size_t size;
-  char *start;
-} pn_rwbytes_t;
-
-/**
- * Create a @ref pn_rwbytes_t
- *
- * @ingroup api_types
- */
-PN_EXTERN pn_rwbytes_t pn_rwbytes(size_t size, char *start);
-
-static const pn_bytes_t pn_rwbytes_null = { 0, NULL };
-
-/**
- * Holds the state flags for an AMQP endpoint.
- *
- * A pn_state_t is an integral value with flags that encode both the
- * local and remote state of an AMQP Endpoint (@link pn_connection_t
- * Connection @endlink, @link pn_session_t Session @endlink, or @link
- * pn_link_t Link @endlink). The local portion of the state may be
- * accessed using ::PN_LOCAL_MASK, and the remote portion may be
- * accessed using ::PN_REMOTE_MASK. Individual bits may be accessed
- * using ::PN_LOCAL_UNINIT, ::PN_LOCAL_ACTIVE, ::PN_LOCAL_CLOSED, and
- * ::PN_REMOTE_UNINIT, ::PN_REMOTE_ACTIVE, ::PN_REMOTE_CLOSED.
- *
- * Every AMQP endpoint (@link pn_connection_t Connection @endlink,
- * @link pn_session_t Session @endlink, or @link pn_link_t Link
- * @endlink) starts out in an uninitialized state and then proceeds
- * linearly to an active and then closed state. This lifecycle occurs
- * at both endpoints involved, and so the state model for an endpoint
- * includes not only the known local state, but also the last known
- * state of the remote endpoint.
- *
- * @ingroup connection
- */
-typedef int pn_state_t;
-
-/**
- * An AMQP Connection object.
- *
- * A pn_connection_t object encapsulates all of the endpoint state
- * associated with an AMQP Connection. A pn_connection_t object
- * contains zero or more ::pn_session_t objects, which in turn contain
- * zero or more ::pn_link_t objects. Each ::pn_link_t object contains
- * an ordered sequence of ::pn_delivery_t objects. A link is either a
- * sender or a receiver but never both.
- *
- * @ingroup connection
- */
-typedef struct pn_connection_t pn_connection_t;
-
-/**
- * An AMQP Session object.
- *
- * A pn_session_t object encapsulates all of the endpoint state
- * associated with an AMQP Session. A pn_session_t object contains
- * zero or more ::pn_link_t objects.
- *
- * @ingroup session
- */
-typedef struct pn_session_t pn_session_t;
-
-/**
- * An AMQP Link object.
- *
- * A pn_link_t object encapsulates all of the endpoint state
- * associated with an AMQP Link. A pn_link_t object contains an
- * ordered sequence of ::pn_delivery_t objects representing in-flight
- * deliveries. A pn_link_t may be either sender or a receiver but
- * never both.
- *
- * A pn_link_t object maintains a pointer to the *current* delivery
- * within the ordered sequence of deliveries contained by the link
- * (See ::pn_link_current). The *current* delivery is the target of a
- * number of operations associated with the link, such as sending
- * (::pn_link_send) and receiving (::pn_link_recv) message data.
- *
- * @ingroup link
- */
-typedef struct pn_link_t pn_link_t;
-
-/**
- * An AMQP Delivery object.
- *
- * A pn_delivery_t object encapsulates all of the endpoint state
- * associated with an AMQP Delivery. Every delivery exists within the
- * context of a ::pn_link_t object.
- *
- * The AMQP model for settlement is based on the lifecycle of a
- * delivery at an endpoint. At each end of a link, a delivery is
- * created, it exists for some period of time, and finally it is
- * forgotten, aka settled. Note that because this lifecycle happens
- * independently at both the sender and the receiver, there are
- * actually four events of interest in the combined lifecycle of a
- * given delivery:
- *
- *   - created at sender
- *   - created at receiver
- *   - settled at sender
- *   - settled at receiver
- *
- * Because the sender and receiver are operating concurrently, these
- * events can occur in a variety of different orders, and the order of
- * these events impacts the types of failures that may occur when
- * transferring a delivery. Eliminating scenarios where the receiver
- * creates the delivery first, we have the following possible
- * sequences of interest:
- *
- * Sender presettles (aka at-most-once):
- * -------------------------------------
- *
- *   1. created at sender
- *   2. settled at sender
- *   3. created at receiver
- *   4. settled at receiver
- *
- * In this configuration the sender settles (i.e. forgets about) the
- * delivery before it even reaches the receiver, and if anything
- * should happen to the delivery in-flight, there is no way to
- * recover, hence the "at most once" semantics.
- *
- * Receiver settles first (aka at-least-once):
- * -------------------------------------------
- *
- *   1. created at sender
- *   2. created at receiver
- *   3. settled at receiver
- *   4. settled at sender
- *
- * In this configuration the receiver settles the delivery first, and
- * the sender settles once it sees the receiver has settled. Should
- * anything happen to the delivery in-flight, the sender can resend,
- * however the receiver may have already forgotten the delivery and so
- * it could interpret the resend as a new delivery, hence the "at
- * least once" semantics.
- *
- * Receiver settles second (aka exactly-once):
- * -------------------------------------------
- *
- *   1. created at sender
- *   2. created at receiver
- *   3. settled at sender
- *   4. settled at receiver
- *
- * In this configuration the receiver settles only once it has seen
- * that the sender has settled. This provides the sender the option to
- * retransmit, and the receiver has the option to recognize (and
- * discard) duplicates, allowing for exactly once semantics.
- *
- * Note that in the last scenario the sender needs some way to know
- * when it is safe to settle. This is where delivery state comes in.
- * In addition to these lifecycle related events surrounding
- * deliveries there is also the notion of a delivery state that can
- * change over the lifetime of a delivery, e.g. it might start out as
- * nothing, transition to ::PN_RECEIVED and then transition to
- * ::PN_ACCEPTED. In the first two scenarios the delivery state isn't
- * required, however in final scenario the sender would typically
- * trigger settlement based on seeing the delivery state transition to
- * a terminal state like ::PN_ACCEPTED or ::PN_REJECTED.
- *
- * In practice settlement is controlled by application policy, so
- * there may well be more options here, e.g. a sender might not settle
- * strictly based on what has happened at the receiver, it might also
- * choose to impose some time limit and settle after that period has
- * expired, or it could simply have a sliding window of the last N
- * deliveries and settle the oldest whenever a new one comes along.
- *
- * @ingroup delivery
- */
-typedef struct pn_delivery_t pn_delivery_t;
-
-/**
- * An event collector.
- *
- * A pn_collector_t may be used to register interest in being notified
- * of high level events that can occur to the various objects
- * representing AMQP endpoint state. See ::pn_event_t for more
- * details.
- *
- * @ingroup event
- */
-typedef struct pn_collector_t pn_collector_t;
-
-/**
- * An AMQP Transport object.
- *
- * A pn_transport_t encapsulates the transport related state of all
- * AMQP endpoint objects associated with a physical network connection
- * at a given point in time.
- *
- * @ingroup transport
- */
-
-typedef struct pn_transport_t pn_transport_t;
-
-/**
- * @cond INTERNAL
- *
- * An event handler
- *
- * A pn_handler_t is target of ::pn_event_t dispatched by the pn_reactor_t
- */
-typedef struct pn_handler_t pn_handler_t;
-/**
- * @endcond
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* types.h */
diff --git a/proton-c/include/proton/url.h b/proton-c/include/proton/url.h
deleted file mode 100644
index e898aba..0000000
--- a/proton-c/include/proton/url.h
+++ /dev/null
@@ -1,129 +0,0 @@
-#ifndef PROTON_URL_H
-#define PROTON_URL_H 1
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <proton/import_export.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- *
- * @copybrief url
- * @deprecated
- *
- * @addtogroup url
- * @{
- */
-
-/**
- * A parsed URL
- */
-typedef struct pn_url_t pn_url_t;
-
-/**
- * Create an empty URL
- */
-PNX_EXTERN pn_url_t *pn_url(void);
-
-/**
- * Parse a string URL as a pn_url_t.
- *
- * URL syntax:
- *
- *     [ <scheme> :// ] [ <user> [ : <password> ] @ ] <host> [ : <port> ] [ / <path> ]
- *
- * `scheme`, `user`, `password`, `port` cannot contain any of '@', ':', '/'
- *
- * If the first character of `host` is '[' then it can contain any character up
- * to ']' (this is to allow IPv6 literal syntax). Otherwise it also cannot
- * contain '@', ':', '/'
- *
- * `path` can contain any character
- *
- * @param[in] url A URL string.
- * @return The parsed pn_url_t or NULL if url is not a valid URL string.
- */
-PNX_EXTERN pn_url_t *pn_url_parse(const char *url);
-
-/**
- * Free a URL */
-PNX_EXTERN void pn_url_free(pn_url_t *url);
-
-/**
- * Clear the contents of the URL.
- */
-PNX_EXTERN void pn_url_clear(pn_url_t *url);
-
-/**
- * Return the string form of a URL.
- *
- * The returned string is owned by the pn_url_t and will become
- * invalid if it is modified.
- */
-PNX_EXTERN const char *pn_url_str(pn_url_t *url);
-
-/**
- * @name Getters for parts of the URL.
- *
- * Values belong to the URL. May return NULL if the value is not set.
- *
- * @{
- */
-PNX_EXTERN const char *pn_url_get_scheme(pn_url_t *url);
-PNX_EXTERN const char *pn_url_get_username(pn_url_t *url);
-PNX_EXTERN const char *pn_url_get_password(pn_url_t *url);
-PNX_EXTERN const char *pn_url_get_host(pn_url_t *url);
-PNX_EXTERN const char *pn_url_get_port(pn_url_t *url);
-PNX_EXTERN const char *pn_url_get_path(pn_url_t *url);
-/**
- * @}
- */
-
-/**
- * @name Setters for parts of the URL.
- *
- * Values are copied. Value can be NULL to indicate the part is not
- * set.
- *
- * @{
- */
-PNX_EXTERN void pn_url_set_scheme(pn_url_t *url, const char *scheme);
-PNX_EXTERN void pn_url_set_username(pn_url_t *url, const char *username);
-PNX_EXTERN void pn_url_set_password(pn_url_t *url, const char *password);
-PNX_EXTERN void pn_url_set_host(pn_url_t *url, const char *host);
-PNX_EXTERN void pn_url_set_port(pn_url_t *url, const char *port);
-PNX_EXTERN void pn_url_set_path(pn_url_t *url, const char *path);
-/**
- * @}
- */
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* url.h */
diff --git a/proton-c/include/proton/version.h.in b/proton-c/include/proton/version.h.in
deleted file mode 100644
index 133b0bb..0000000
--- a/proton-c/include/proton/version.h.in
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef _PROTON_VERSION_H
-#define _PROTON_VERSION_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#define PN_VERSION_MAJOR @PN_VERSION_MAJOR@
-#define PN_VERSION_MINOR @PN_VERSION_MINOR@
-#define PN_VERSION_POINT @PN_VERSION_POINT@
-
-#endif /* version.h */
diff --git a/proton-c/mllib/__init__.py b/proton-c/mllib/__init__.py
deleted file mode 100644
index c0362cd..0000000
--- a/proton-c/mllib/__init__.py
+++ /dev/null
@@ -1,85 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-"""
-This module provides document parsing and transformation utilities for XML.
-"""
-
-from __future__ import absolute_import
-
-import os, sys
-import xml.sax, types
-from xml.sax.handler import ErrorHandler
-from xml.sax.xmlreader import InputSource
-
-try:
-    from io import StringIO
-except ImportError:
-    from cStringIO import StringIO
-
-if sys.version_info[0] == 2:
-    import types
-    CLASS_TYPES = (type, types.ClassType)
-else:
-    CLASS_TYPES = (type,)
-
-from . import dom
-from . import transforms
-from . import parsers
-
-def transform(node, *args):
-  result = node
-  for t in args:
-    if isinstance(t, CLASS_TYPES):
-      t = t()
-    result = result.dispatch(t)
-  return result
-
-class Resolver:
-
-  def __init__(self, path):
-    self.path = path
-
-  def resolveEntity(self, publicId, systemId):
-    for p in self.path:
-      fname = os.path.join(p, systemId)
-      if os.path.exists(fname):
-        source = InputSource(systemId)
-        source.setByteStream(open(fname))
-        return source
-    return InputSource(systemId)
-
-def xml_parse(filename, path=()):
-  if sys.version_info[0:2] == (2,3):
-    # XXX: this is for older versions of python
-    source = "file://%s" % os.path.abspath(filename)
-  else:
-    source = filename
-  h = parsers.XMLParser()
-  p = xml.sax.make_parser()
-  p.setContentHandler(h)
-  p.setErrorHandler(ErrorHandler())
-  p.setEntityResolver(Resolver(path))
-  p.parse(source)
-  return h.parser.tree
-
-def sexp(node):
-  s = transforms.Sexp()
-  node.dispatch(s)
-  return s.out
diff --git a/proton-c/mllib/dom.py b/proton-c/mllib/dom.py
deleted file mode 100644
index 9421504..0000000
--- a/proton-c/mllib/dom.py
+++ /dev/null
@@ -1,316 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-"""
-Simple DOM for both SGML and XML documents.
-"""
-
-from __future__ import division
-from __future__ import generators
-from __future__ import nested_scopes
-from __future__ import absolute_import
-
-import sys
-if sys.version_info[0] == 2:
-    STRING_TYPES = (basestring,)
-else:
-    STRING_TYPES = (str,)
-
-class Container:
-
-  def __init__(self):
-    self.children = []
-
-  def add(self, child):
-    child.parent = self
-    self.children.append(child)
-
-  def extend(self, children):
-    for child in children:
-      child.parent = self
-      self.children.append(child)
-
-class Component:
-
-  def __init__(self):
-    self.parent = None
-
-  def index(self):
-    if self.parent:
-      return self.parent.children.index(self)
-    else:
-      return 0
-
-  def _line(self, file, line, column):
-    self.file = file
-    self.line = line
-    self.column = column
-
-class DispatchError(Exception):
-
-  def __init__(self, scope, f):
-    msg = "no such attribtue"
-
-class Dispatcher:
-
-  def is_type(self, type):
-    cls = self
-    while cls != None:
-      if cls.type == type:
-        return True
-      cls = cls.base
-    return False
-
-  def dispatch(self, f, attrs = ""):
-    cls = self
-    while cls != None:
-      if hasattr(f, cls.type):
-        return getattr(f, cls.type)(self)
-      else:
-        cls = cls.base
-
-    cls = self
-    while cls != None:
-      if attrs:
-        sep = ", "
-        if cls.base == None:
-          sep += "or "
-      else:
-        sep = ""
-      attrs += "%s'%s'" % (sep, cls.type)
-      cls = cls.base
-
-    raise AttributeError("'%s' object has no attribute %s" %
-                         (f.__class__.__name__, attrs))
-
-class Node(Container, Component, Dispatcher):
-
-  type = "node"
-  base = None
-
-  def __init__(self):
-    Container.__init__(self)
-    Component.__init__(self)
-    self.query = Query([self])
-
-  def __getitem__(self, name):
-    for nd in self.query[name]:
-      return nd
-
-  def text(self):
-    from . import transforms
-    return self.dispatch(transforms.Text())
-
-  def tag(self, name, *attrs, **kwargs):
-    t = Tag(name, *attrs, **kwargs)
-    self.add(t)
-    return t
-
-  def data(self, s):
-    d = Data(s)
-    self.add(d)
-    return d
-
-  def entity(self, s):
-    e = Entity(s)
-    self.add(e)
-    return e
-
-class Tree(Node):
-
-  type = "tree"
-  base = Node
-
-class Tag(Node):
-
-  type = "tag"
-  base = Node
-
-  def __init__(self, _name, *attrs, **kwargs):
-    Node.__init__(self)
-    self.name = _name
-    self.attrs = list(attrs)
-    self.attrs.extend(kwargs.items())
-    self.singleton = False
-
-  def get_attr(self, name):
-    for k, v in self.attrs:
-      if name == k:
-        return v
-
-  def _idx(self, attr):
-    idx = 0
-    for k, v in self.attrs:
-      if k == attr:
-        return idx
-      idx += 1
-    return None
-
-  def set_attr(self, name, value):
-    idx = self._idx(name)
-    if idx is None:
-      self.attrs.append((name, value))
-    else:
-      self.attrs[idx] = (name, value)
-
-  def dispatch(self, f):
-    try:
-      attr = "do_" + self.name
-      method = getattr(f, attr)
-    except AttributeError:
-      return Dispatcher.dispatch(self, f, "'%s'" % attr)
-    return method(self)
-
-class Leaf(Component, Dispatcher):
-
-  type = "leaf"
-  base = None
-
-  def __init__(self, data):
-    assert isinstance(data, STRING_TYPES)
-    self.data = data
-
-class Data(Leaf):
-  type = "data"
-  base = Leaf
-
-class Entity(Leaf):
-  type = "entity"
-  base = Leaf
-
-class Character(Leaf):
-  type = "character"
-  base = Leaf
-
-class Comment(Leaf):
-  type = "comment"
-  base = Leaf
-
-###################
-## Query Classes ##
-###########################################################################
-
-class Adder:
-
-  def __add__(self, other):
-    return Sum(self, other)
-
-class Sum(Adder):
-
-  def __init__(self, left, right):
-    self.left = left
-    self.right = right
-
-  def __iter__(self):
-    for x in self.left:
-      yield x
-    for x in self.right:
-      yield x
-
-class View(Adder):
-
-  def __init__(self, source):
-    self.source = source
-
-class Filter(View):
-
-  def __init__(self, predicate, source):
-    View.__init__(self, source)
-    self.predicate = predicate
-
-  def __iter__(self):
-    for nd in self.source:
-      if self.predicate(nd): yield nd
-
-class Flatten(View):
-
-  def __iter__(self):
-    sources = [iter(self.source)]
-    while sources:
-      try:
-        nd = next(sources[-1])
-        if isinstance(nd, Tree):
-          sources.append(iter(nd.children))
-        else:
-          yield nd
-      except StopIteration:
-        sources.pop()
-
-class Children(View):
-
-  def __iter__(self):
-    for nd in self.source:
-      for child in nd.children:
-        yield child
-
-class Attributes(View):
-
-  def __iter__(self):
-    for nd in self.source:
-      for a in nd.attrs:
-        yield a
-
-class Values(View):
-
-  def __iter__(self):
-    for name, value in self.source:
-      yield value
-
-def flatten_path(path):
-  if isinstance(path, STRING_TYPES):
-    for part in path.split("/"):
-      yield part
-  elif callable(path):
-    yield path
-  else:
-    for p in path:
-      for fp in flatten_path(p):
-        yield fp
-
-class Query(View):
-
-  def __iter__(self):
-    for nd in self.source:
-      yield nd
-
-  def __getitem__(self, path):
-    query = self.source
-    for p in flatten_path(path):
-      if callable(p):
-        select = Query
-        pred = p
-        source = query
-      elif isinstance(p, STRING_TYPES):
-        if p[0] == "@":
-          select = Values
-          pred = lambda x, n=p[1:]: x[0] == n
-          source = Attributes(query)
-        elif p[0] == "#":
-          select = Query
-          pred = lambda x, t=p[1:]: x.is_type(t)
-          source = Children(query)
-        else:
-          select = Query
-          pred = lambda x, n=p: isinstance(x, Tag) and x.name == n
-          source = Flatten(Children(query))
-      else:
-        raise ValueError(p)
-      query = select(Filter(pred, source))
-
-    return query
diff --git a/proton-c/mllib/parsers.py b/proton-c/mllib/parsers.py
deleted file mode 100644
index 72d44ab..0000000
--- a/proton-c/mllib/parsers.py
+++ /dev/null
@@ -1,107 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-"""
-Parsers for XML to dom.
-"""
-from __future__ import absolute_import
-
-import xml.sax.handler
-from .dom import *
-
-class Parser:
-
-  def __init__(self):
-    self.tree = Tree()
-    self.node = self.tree
-    self.nodes = []
-
-  def line(self, id, lineno, colno):
-    while self.nodes:
-      n = self.nodes.pop()
-      n._line(id, lineno, colno)
-
-  def add(self, node):
-    self.node.add(node)
-    self.nodes.append(node)
-
-  def start(self, name, attrs):
-    tag = Tag(name, *attrs)
-    self.add(tag)
-    self.node = tag
-
-  def end(self, name):
-    self.balance(name)
-    self.node = self.node.parent
-
-  def data(self, data):
-    children = self.node.children
-    if children and isinstance(children[-1], Data):
-      children[-1].data += data
-    else:
-      self.add(Data(data))
-
-  def comment(self, comment):
-    self.add(Comment(comment))
-
-  def entity(self, ref):
-    self.add(Entity(ref))
-
-  def character(self, ref):
-    self.add(Character(ref))
-
-  def balance(self, name = None):
-    while self.node != self.tree and name != self.node.name:
-      self.node.parent.extend(self.node.children)
-      del self.node.children[:]
-      self.node.singleton = True
-      self.node = self.node.parent
-
-
-class XMLParser(xml.sax.handler.ContentHandler):
-
-  def __init__(self):
-    self.parser = Parser()
-    self.locator = None
-
-  def line(self):
-    if self.locator != None:
-      self.parser.line(self.locator.getSystemId(),
-                       self.locator.getLineNumber(),
-                       self.locator.getColumnNumber())
-
-  def setDocumentLocator(self, locator):
-    self.locator = locator
-
-  def startElement(self, name, attrs):
-    self.parser.start(name, attrs.items())
-    self.line()
-
-  def endElement(self, name):
-    self.parser.end(name)
-    self.line()
-
-  def characters(self, content):
-    self.parser.data(content)
-    self.line()
-
-  def skippedEntity(self, name):
-    self.parser.entity(name)
-    self.line()
-
diff --git a/proton-c/mllib/transforms.py b/proton-c/mllib/transforms.py
deleted file mode 100644
index 910b507..0000000
--- a/proton-c/mllib/transforms.py
+++ /dev/null
@@ -1,168 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-"""
-Useful transforms for dom objects.
-"""
-from __future__ import absolute_import
-
-from . import dom
-try:
-    from io import StringIO
-except ImportError:
-    from cStringIO import StringIO
-
-class Visitor:
-
-  def descend(self, node):
-    for child in node.children:
-      child.dispatch(self)
-
-  def node(self, node):
-    self.descend(node)
-
-  def leaf(self, leaf):
-    pass
-
-class Identity:
-
-  def descend(self, node):
-    result = []
-    for child in node.children:
-      result.append(child.dispatch(self))
-    return result
-
-  def default(self, tag):
-    result = dom.Tag(tag.name, *tag.attrs)
-    result.extend(self.descend(tag))
-    return result
-
-  def tree(self, tree):
-    result = dom.Tree()
-    result.extend(self.descend(tree))
-    return result
-
-  def tag(self, tag):
-    return self.default(tag)
-
-  def leaf(self, leaf):
-    return leaf.__class__(leaf.data)
-
-class Sexp(Identity):
-
-  def __init__(self):
-    self.stack = []
-    self.level = 0
-    self.out = ""
-
-  def open(self, s):
-    self.out += "(%s" % s
-    self.level += len(s) + 1
-    self.stack.append(s)
-
-  def line(self, s = ""):
-    self.out = self.out.rstrip()
-    self.out += "\n" + " "*self.level + s
-
-  def close(self):
-    s = self.stack.pop()
-    self.level -= len(s) + 1
-    self.out = self.out.rstrip()
-    self.out += ")"
-
-  def tree(self, tree):
-    self.open("+ ")
-    for child in tree.children:
-      self.line(); child.dispatch(self)
-    self.close()
-
-  def tag(self, tag):
-    self.open("Node(%s) " % tag.name)
-    for child in tag.children:
-      self.line(); child.dispatch(self)
-    self.close()
-
-  def leaf(self, leaf):
-    self.line("%s(%s)" % (leaf.__class__.__name__, leaf.data))
-
-class Output:
-
-  def descend(self, node):
-    out = StringIO()
-    for child in node.children:
-      out.write(child.dispatch(self))
-    return out.getvalue()
-
-  def default(self, tag):
-    out = StringIO()
-    out.write("<%s" % tag.name)
-    for k, v in tag.attrs:
-      out.write(' %s="%s"' % (k, v))
-    out.write(">")
-    out.write(self.descend(tag))
-    if not tag.singleton:
-      out.write("</%s>" % tag.name)
-    return out.getvalue()
-
-  def tree(self, tree):
-    return self.descend(tree)
-
-  def tag(self, tag):
-    return self.default(tag)
-
-  def data(self, leaf):
-    return leaf.data
-
-  def entity(self, leaf):
-    return "&%s;" % leaf.data
-
-  def character(self, leaf):
-    raise Exception("TODO")
-
-  def comment(self, leaf):
-    return "<!-- %s -->" % leaf.data
-
-class Empty(Output):
-
-  def tag(self, tag):
-    return self.descend(tag)
-
-  def data(self, leaf):
-    return ""
-
-  def entity(self, leaf):
-    return ""
-
-  def character(self, leaf):
-    return ""
-
-  def comment(self, leaf):
-    return ""
-
-class Text(Empty):
-
-  def data(self, leaf):
-    return leaf.data
-
-  def entity(self, leaf):
-    return "&%s;" % leaf.data
-
-  def character(self, leaf):
-    # XXX: is this right?
-    return "&#%s;" % leaf.data
diff --git a/proton-c/soversion.cmake b/proton-c/soversion.cmake
deleted file mode 100644
index 665edca..0000000
--- a/proton-c/soversion.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-set (PN_LIB_SOMAJOR 11)
-set (PN_LIB_SOMINOR "0.0")
diff --git a/proton-c/src/ProtonConfig.cmake.in b/proton-c/src/ProtonConfig.cmake.in
deleted file mode 100644
index 5e50d7c..0000000
--- a/proton-c/src/ProtonConfig.cmake.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Name: Proton
-# Description: Qpid Proton C library
-# Version: @PN_VERSION@
-# URL: http://qpid.apache.org/proton/
-
-set (Proton_VERSION       @PN_VERSION@)
-
-set (Proton_INCLUDE_DIRS  @INCLUDEDIR@)
-set (Proton_LIBRARIES     optimized @LIBDIR@/@PROTONLIB@ debug @LIBDIR@/@PROTONLIBDEBUG@)
-
-set (ProtonCore_INCLUDE_DIRS  @INCLUDEDIR@)
-set (ProtonCore_LIBRARIES     optimized @LIBDIR@/@PROTONCORELIB@ debug @LIBDIR@/@PROTONCORELIBDEBUG@)
-
-set (Proton_FOUND True)
diff --git a/proton-c/src/compiler/msvc/snprintf.c b/proton-c/src/compiler/msvc/snprintf.c
deleted file mode 100644
index f9c14eb..0000000
--- a/proton-c/src/compiler/msvc/snprintf.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "platform/platform.h"
-
-#include <stdarg.h>
-#include <stdio.h>
-
-// [v]snprintf on Windows only matches C99 when no errors or overflow.
-int pni_vsnprintf(char *buf, size_t count, const char *fmt, va_list ap) {
-  if (fmt == NULL)
-    return -1;
-  if ((buf == NULL) && (count > 0))
-    return -1;
-  if (count > 0) {
-    int n = vsnprintf_s(buf, count, _TRUNCATE, fmt, ap);
-    if (n >= 0)  // no overflow
-      return n;  // same as C99
-    buf[count-1] = '\0';
-  }
-  // separate call to get needed buffer size on overflow
-  int n = _vscprintf(fmt, ap);
-  if (n >= (int) count)
-    return n;
-  return -1;
-}
-
-int pni_snprintf(char *buf, size_t count, const char *fmt, ...) {
-  va_list ap;
-  va_start(ap, fmt);
-  int n = pni_vsnprintf(buf, count, fmt, ap);
-  va_end(ap);
-  return n;
-}
diff --git a/proton-c/src/core/autodetect.c b/proton-c/src/core/autodetect.c
deleted file mode 100644
index 00f6d98..0000000
--- a/proton-c/src/core/autodetect.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "autodetect.h"
-
-#define SASL_HEADER ("AMQP\x03\x01\x00\x00")
-#define SSL_HEADER  ("AMQP\x02\x01\x00\x00")
-#define AMQP_HEADER ("AMQP\x00\x01\x00\x00")
-
-#define SASL_HEADER_LEN 8
-
-/*
- * SSLv2 Client Hello format
- * http://www.mozilla.org/projects/security/pki/nss/ssl/draft02.html
- *
- * Bytes 0-1: RECORD-LENGTH
- * Byte    2: MSG-CLIENT-HELLO (1)
- * Byte    3: CLIENT-VERSION-MSB
- * Byte    4: CLIENT-VERSION-LSB
- *
- * Allowed versions:
- * 2.0 - SSLv2
- * 3.0 - SSLv3
- * 3.1 - TLS 1.0
- * 3.2 - TLS 1.1
- * 3.3 - TLS 1.2
- *
- * The version sent in the Client-Hello is the latest version supported by
- * the client. NSS may send version 3.x in an SSLv2 header for
- * maximum compatibility.
- */
-/*
- * SSLv3/TLS Client Hello format
- * RFC 2246
- *
- * Byte    0: ContentType (handshake - 22)
- * Bytes 1-2: ProtocolVersion {major, minor}
- *
- * Allowed versions:
- * 3.0 - SSLv3
- * 3.1 - TLS 1.0
- * 3.2 - TLS 1.1
- * 3.3 - TLS 1.2
- */
-/*
- * AMQP 1.0 Header
- *
- * Bytes 0-3: "AMQP"
- * Byte    4: 0==AMQP, 2==SSL, 3==SASL
- * Byte    5: 1
- * Bytes 6-7: 0
- */
-/*
- * AMQP Pre 1.0 Header
- *
- * Bytes 0-3: 'AMQP'
- * Byte    4: 1
- * Byte    5: 1
- * Byte    6: 0 (major version)
- * Byte    7: Minor version
- */
-pni_protocol_type_t pni_sniff_header(const char *buf, size_t len)
-{
-  if (len < 3) return PNI_PROTOCOL_INSUFFICIENT;
-  bool isSSL3Handshake = buf[0]==22 &&            // handshake
-                         buf[1]==3  && buf[2]<=3; // SSL 3.0 & TLS 1.0-1.2 (v3.1-3.3)
-  if (isSSL3Handshake) return PNI_PROTOCOL_SSL;
-
-  bool isFirst3AMQP = buf[0]=='A' && buf[1]=='M' && buf[2]=='Q';
-  bool isFirst3SSL2CLientHello = buf[2]==1;       // Client Hello
-  if (!isFirst3AMQP && !isFirst3SSL2CLientHello) return PNI_PROTOCOL_UNKNOWN;
-
-
-  if (len < 4) return PNI_PROTOCOL_INSUFFICIENT;
-  bool isAMQP = isFirst3AMQP && buf[3]=='P';
-  bool isFirst4SSL2ClientHello = isFirst3SSL2CLientHello && (buf[3]==2 || buf[3]==3);
-  if (!isAMQP && !isFirst4SSL2ClientHello) return PNI_PROTOCOL_UNKNOWN;
-
-  if (len < 5) return PNI_PROTOCOL_INSUFFICIENT;
-  bool isSSL2Handshake = buf[2] == 1 &&   // MSG-CLIENT-HELLO
-      ((buf[3] == 3 && buf[4] <= 3) ||    // SSL 3.0 & TLS 1.0-1.2 (v3.1-3.3)
-       (buf[3] == 2 && buf[4] == 0));     // SSL 2
-  if (isSSL2Handshake) return PNI_PROTOCOL_SSL;
-
-  bool isFirst5OldAMQP = isAMQP && buf[4]==1;
-  bool isFirst5AMQP = isAMQP && (buf[4]==0 || buf[4]==2 || buf[4]==3);
-  if (!isFirst5AMQP && !isFirst5OldAMQP) return PNI_PROTOCOL_UNKNOWN;
-
-  if (len < 6) return PNI_PROTOCOL_INSUFFICIENT;
-
-  // Both old and new versions of AMQP have 1 in byte 5
-  if (buf[5]!=1) return PNI_PROTOCOL_UNKNOWN;
-
-  // From here on it must be some sort of AMQP
-  if (len < 8) return PNI_PROTOCOL_INSUFFICIENT;
-  if (buf[6]==0 && buf[7]==0) {
-    // AM<QP 1.0
-      if (buf[4]==0) return PNI_PROTOCOL_AMQP1;
-      if (buf[4]==2) return PNI_PROTOCOL_AMQP_SSL;
-      if (buf[4]==3) return PNI_PROTOCOL_AMQP_SASL;
-  }
-  return PNI_PROTOCOL_AMQP_OTHER;
-}
-
-const char* pni_protocol_name(pni_protocol_type_t p)
-{
-  static const char* names[] = {
-  "Insufficient data to determine protocol",
-  "Unknown protocol",
-  "SSL/TLS connection",
-  "AMQP TLS layer",
-  "AMQP SASL layer",
-  "AMQP 1.0 layer",
-  "Pre standard AMQP connection"
-  };
-  return names[p];
-}
diff --git a/proton-c/src/core/autodetect.h b/proton-c/src/core/autodetect.h
deleted file mode 100644
index 12cb7d8..0000000
--- a/proton-c/src/core/autodetect.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef PROTON_AUTODETECT_H
-#define PROTON_AUTODETECT_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/types.h"
-
-typedef enum {
-  PNI_PROTOCOL_INSUFFICIENT,
-  PNI_PROTOCOL_UNKNOWN,
-  PNI_PROTOCOL_SSL,
-  PNI_PROTOCOL_AMQP_SSL,
-  PNI_PROTOCOL_AMQP_SASL,
-  PNI_PROTOCOL_AMQP1,
-  PNI_PROTOCOL_AMQP_OTHER
-} pni_protocol_type_t;
-
-pni_protocol_type_t pni_sniff_header(const char *data, size_t len);
-const char* pni_protocol_name(pni_protocol_type_t p);
-
-#endif
diff --git a/proton-c/src/core/buffer.c b/proton-c/src/core/buffer.c
deleted file mode 100644
index c3015f4..0000000
--- a/proton-c/src/core/buffer.c
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/error.h>
-#ifndef __cplusplus
-#include <stdbool.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#include "buffer.h"
-#include "util.h"
-
-struct pn_buffer_t {
-  size_t capacity;
-  size_t start;
-  size_t size;
-  char *bytes;
-};
-
-pn_buffer_t *pn_buffer(size_t capacity)
-{
-  pn_buffer_t *buf = (pn_buffer_t *) malloc(sizeof(pn_buffer_t));
-  if (buf != NULL) {
-    buf->capacity = capacity;
-    buf->start = 0;
-    buf->size = 0;
-    if (capacity > 0) {
-        buf->bytes = (char *)malloc(capacity);
-        if (buf->bytes == NULL) {
-            free(buf);
-            buf = NULL;
-        }
-    }
-    else {
-        buf->bytes = NULL;
-    }
-  }
-  return buf;
-}
-
-void pn_buffer_free(pn_buffer_t *buf)
-{
-  if (buf) {
-    free(buf->bytes);
-    free(buf);
-  }
-}
-
-size_t pn_buffer_size(pn_buffer_t *buf)
-{
-  return buf->size;
-}
-
-size_t pn_buffer_capacity(pn_buffer_t *buf)
-{
-  return buf->capacity;
-}
-
-size_t pn_buffer_available(pn_buffer_t *buf)
-{
-  return buf->capacity - buf->size;
-}
-
-static size_t pni_buffer_head(pn_buffer_t *buf)
-{
-  return buf->start;
-}
-
-static size_t pni_buffer_tail(pn_buffer_t *buf)
-{
-  size_t tail = buf->start + buf->size;
-  if (tail >= buf->capacity)
-    tail -= buf->capacity;
-  return tail;
-}
-
-static bool pni_buffer_wrapped(pn_buffer_t *buf)
-{
-  return buf->size && pni_buffer_head(buf) >= pni_buffer_tail(buf);
-}
-
-static size_t pni_buffer_tail_space(pn_buffer_t *buf)
-{
-  if (pni_buffer_wrapped(buf)) {
-    return pn_buffer_available(buf);
-  } else {
-    return buf->capacity - pni_buffer_tail(buf);
-  }
-}
-
-static size_t pni_buffer_head_space(pn_buffer_t *buf)
-{
-  if (pni_buffer_wrapped(buf)) {
-    return pn_buffer_available(buf);
-  } else {
-    return pni_buffer_head(buf);
-  }
-}
-
-static size_t pni_buffer_head_size(pn_buffer_t *buf)
-{
-  if (pni_buffer_wrapped(buf)) {
-    return buf->capacity - pni_buffer_head(buf);
-  } else {
-    return pni_buffer_tail(buf) - pni_buffer_head(buf);
-  }
-}
-
-static size_t pni_buffer_tail_size(pn_buffer_t *buf)
-{
-  if (pni_buffer_wrapped(buf)) {
-    return pni_buffer_tail(buf);
-  } else {
-    return 0;
-  }
-}
-
-int pn_buffer_ensure(pn_buffer_t *buf, size_t size)
-{
-  size_t old_capacity = buf->capacity;
-  size_t old_head = pni_buffer_head(buf);
-  bool wrapped = pni_buffer_wrapped(buf);
-
-  while (pn_buffer_available(buf) < size) {
-    buf->capacity = 2*(buf->capacity ? buf->capacity : 16);
-  }
-
-  if (buf->capacity != old_capacity) {
-    char* new_bytes = (char *)realloc(buf->bytes, buf->capacity);
-    if (new_bytes) {
-      buf->bytes = new_bytes;
-
-      if (wrapped) {
-          size_t n = old_capacity - old_head;
-          memmove(buf->bytes + buf->capacity - n, buf->bytes + old_head, n);
-          buf->start = buf->capacity - n;
-      }
-    }
-  }
-
-  return 0;
-}
-
-int pn_buffer_append(pn_buffer_t *buf, const char *bytes, size_t size)
-{
-  int err = pn_buffer_ensure(buf, size);
-  if (err) return err;
-
-  size_t tail = pni_buffer_tail(buf);
-  size_t tail_space = pni_buffer_tail_space(buf);
-  size_t n = pn_min(tail_space, size);
-
-  memmove(buf->bytes + tail, bytes, n);
-  memmove(buf->bytes, bytes + n, size - n);
-
-  buf->size += size;
-
-  return 0;
-}
-
-int pn_buffer_prepend(pn_buffer_t *buf, const char *bytes, size_t size)
-{
-  int err = pn_buffer_ensure(buf, size);
-  if (err) return err;
-
-  size_t head = pni_buffer_head(buf);
-  size_t head_space = pni_buffer_head_space(buf);
-  size_t n = pn_min(head_space, size);
-
-  memmove(buf->bytes + head - n, bytes + size - n, n);
-  memmove(buf->bytes + buf->capacity - (size - n), bytes, size - n);
-
-  if (buf->start >= size) {
-    buf->start -= size;
-  } else {
-    buf->start = buf->capacity - (size - buf->start);
-  }
-
-  buf->size += size;
-
-  return 0;
-}
-
-static size_t pni_buffer_index(pn_buffer_t *buf, size_t index)
-{
-  size_t result = buf->start + index;
-  if (result >= buf->capacity) result -= buf->capacity;
-  return result;
-}
-
-size_t pn_buffer_get(pn_buffer_t *buf, size_t offset, size_t size, char *dst)
-{
-  size = pn_min(size, buf->size);
-  size_t start = pni_buffer_index(buf, offset);
-  size_t stop = pni_buffer_index(buf, offset + size);
-
-  if (size == 0) return 0;
-
-  size_t sz1;
-  size_t sz2;
-
-  if (start >= stop) {
-    sz1 = buf->capacity - start;
-    sz2 = stop;
-  } else {
-    sz1 = stop - start;
-    sz2 = 0;
-  }
-
-  memmove(dst, buf->bytes + start, sz1);
-  memmove(dst + sz1, buf->bytes, sz2);
-
-  return sz1 + sz2;
-}
-
-int pn_buffer_trim(pn_buffer_t *buf, size_t left, size_t right)
-{
-  if (left + right > buf->size) return PN_ARG_ERR;
-
-  buf->start += left;
-  if (buf->start >= buf->capacity)
-    buf->start -= buf->capacity;
-
-  buf->size -= left + right;
-
-  return 0;
-}
-
-void pn_buffer_clear(pn_buffer_t *buf)
-{
-  buf->start = 0;
-  buf->size = 0;
-}
-
-static void pn_buffer_rotate (pn_buffer_t *buf, size_t sz) {
-  if (sz == 0) return;
-
-  unsigned c = 0, v = 0;
-  for (; c < buf->capacity; v++) {
-    unsigned t = v, tp = v + sz;
-    char tmp = buf->bytes[v];
-    c++;
-    while (tp != v) {
-      buf->bytes[t] = buf->bytes[tp];
-      t = tp;
-      tp += sz;
-      if (tp >= buf->capacity) tp -= buf->capacity;
-      c++;
-    }
-    buf->bytes[t] = tmp;
-  }
-}
-
-int pn_buffer_defrag(pn_buffer_t *buf)
-{
-  pn_buffer_rotate(buf, buf->start);
-  buf->start = 0;
-  return 0;
-}
-
-pn_bytes_t pn_buffer_bytes(pn_buffer_t *buf)
-{
-  if (buf) {
-    pn_buffer_defrag(buf);
-    return pn_bytes(buf->size, buf->bytes);
-  } else {
-    return pn_bytes(0, NULL);
-  }
-}
-
-pn_rwbytes_t pn_buffer_memory(pn_buffer_t *buf)
-{
-  if (buf) {
-    pn_buffer_defrag(buf);
-    pn_rwbytes_t r = {buf->size, buf->bytes};
-    return r;
-  } else {
-    pn_rwbytes_t r = {0, NULL};
-    return r;
-  }
-}
-
-int pn_buffer_print(pn_buffer_t *buf)
-{
-  printf("pn_buffer(\"");
-  pn_print_data(buf->bytes + pni_buffer_head(buf), pni_buffer_head_size(buf));
-  pn_print_data(buf->bytes, pni_buffer_tail_size(buf));
-  printf("\")");
-  return 0;
-}
diff --git a/proton-c/src/core/buffer.h b/proton-c/src/core/buffer.h
deleted file mode 100644
index da557ef..0000000
--- a/proton-c/src/core/buffer.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef PROTON_BUFFER_H
-#define PROTON_BUFFER_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct pn_buffer_t pn_buffer_t;
-
-pn_buffer_t *pn_buffer(size_t capacity);
-void pn_buffer_free(pn_buffer_t *buf);
-size_t pn_buffer_size(pn_buffer_t *buf);
-size_t pn_buffer_capacity(pn_buffer_t *buf);
-size_t pn_buffer_available(pn_buffer_t *buf);
-int pn_buffer_ensure(pn_buffer_t *buf, size_t size);
-int pn_buffer_append(pn_buffer_t *buf, const char *bytes, size_t size);
-int pn_buffer_prepend(pn_buffer_t *buf, const char *bytes, size_t size);
-size_t pn_buffer_get(pn_buffer_t *buf, size_t offset, size_t size, char *dst);
-int pn_buffer_trim(pn_buffer_t *buf, size_t left, size_t right);
-void pn_buffer_clear(pn_buffer_t *buf);
-int pn_buffer_defrag(pn_buffer_t *buf);
-pn_bytes_t pn_buffer_bytes(pn_buffer_t *buf);
-pn_rwbytes_t pn_buffer_memory(pn_buffer_t *buf);
-int pn_buffer_print(pn_buffer_t *buf);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* buffer.h */
diff --git a/proton-c/src/core/codec.c b/proton-c/src/core/codec.c
deleted file mode 100644
index 67769ad..0000000
--- a/proton-c/src/core/codec.c
+++ /dev/null
@@ -1,2141 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/object.h>
-#include <proton/codec.h>
-#include <proton/error.h>
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include "encodings.h"
-#define DEFINE_FIELDS
-#include "protocol.h"
-#include "platform/platform_fmt.h"
-#include "util.h"
-#include "decoder.h"
-#include "encoder.h"
-#include "data.h"
-#include "log_private.h"
-
-const char *pn_type_name(pn_type_t type)
-{
-  switch (type)
-  {
-  case PN_NULL: return "PN_NULL";
-  case PN_BOOL: return "PN_BOOL";
-  case PN_UBYTE: return "PN_UBYTE";
-  case PN_BYTE: return "PN_BYTE";
-  case PN_USHORT: return "PN_USHORT";
-  case PN_SHORT: return "PN_SHORT";
-  case PN_UINT: return "PN_UINT";
-  case PN_INT: return "PN_INT";
-  case PN_CHAR: return "PN_CHAR";
-  case PN_ULONG: return "PN_ULONG";
-  case PN_LONG: return "PN_LONG";
-  case PN_TIMESTAMP: return "PN_TIMESTAMP";
-  case PN_FLOAT: return "PN_FLOAT";
-  case PN_DOUBLE: return "PN_DOUBLE";
-  case PN_DECIMAL32: return "PN_DECIMAL32";
-  case PN_DECIMAL64: return "PN_DECIMAL64";
-  case PN_DECIMAL128: return "PN_DECIMAL128";
-  case PN_UUID: return "PN_UUID";
-  case PN_BINARY: return "PN_BINARY";
-  case PN_STRING: return "PN_STRING";
-  case PN_SYMBOL: return "PN_SYMBOL";
-  case PN_DESCRIBED: return "PN_DESCRIBED";
-  case PN_ARRAY: return "PN_ARRAY";
-  case PN_LIST: return "PN_LIST";
-  case PN_MAP: return "PN_MAP";
-  default: break;
-  }
-
-  return "<UNKNOWN>";
-}
-
-static inline void pni_atom_init(pn_atom_t *atom, pn_type_t type)
-{
-  memset(atom, 0, sizeof(pn_atom_t));
-  atom->type = type;
-}
-
-// data
-
-static void pn_data_finalize(void *object)
-{
-  pn_data_t *data = (pn_data_t *) object;
-  free(data->nodes);
-  pn_buffer_free(data->buf);
-  pn_free(data->str);
-  pn_error_free(data->error);
-  pn_free(data->decoder);
-  pn_free(data->encoder);
-}
-
-static const pn_fields_t *pni_node_fields(pn_data_t *data, pni_node_t *node)
-{
-  if (!node) return NULL;
-  if (node->atom.type != PN_DESCRIBED) return NULL;
-
-  pni_node_t *descriptor = pn_data_node(data, node->down);
-
-  if (!descriptor || descriptor->atom.type != PN_ULONG) {
-    return NULL;
-  }
-
-  if (descriptor->atom.u.as_ulong >= FIELD_MIN && descriptor->atom.u.as_ulong <= FIELD_MAX) {
-    const pn_fields_t *f = &FIELDS[descriptor->atom.u.as_ulong-FIELD_MIN];
-    return (f->name_index!=0) ? f : NULL;
-  } else {
-    return NULL;
-  }
-}
-
-static int pni_node_index(pn_data_t *data, pni_node_t *node)
-{
-  int count = 0;
-  while (node) {
-    node = pn_data_node(data, node->prev);
-    count++;
-  }
-  return count - 1;
-}
-
-int pni_inspect_atom(pn_atom_t *atom, pn_string_t *str)
-{
-  switch (atom->type) {
-  case PN_NULL:
-    return pn_string_addf(str, "null");
-  case PN_BOOL:
-    return pn_string_addf(str, atom->u.as_bool ? "true" : "false");
-  case PN_UBYTE:
-    return pn_string_addf(str, "%" PRIu8, atom->u.as_ubyte);
-  case PN_BYTE:
-    return pn_string_addf(str, "%" PRIi8, atom->u.as_byte);
-  case PN_USHORT:
-    return pn_string_addf(str, "%" PRIu16, atom->u.as_ushort);
-  case PN_SHORT:
-    return pn_string_addf(str, "%" PRIi16, atom->u.as_short);
-  case PN_UINT:
-    return pn_string_addf(str, "%" PRIu32, atom->u.as_uint);
-  case PN_INT:
-    return pn_string_addf(str, "%" PRIi32, atom->u.as_int);
-  case PN_CHAR:
-    return pn_string_addf(str, "%c",  atom->u.as_char);
-  case PN_ULONG:
-    return pn_string_addf(str, "%" PRIu64, atom->u.as_ulong);
-  case PN_LONG:
-    return pn_string_addf(str, "%" PRIi64, atom->u.as_long);
-  case PN_TIMESTAMP:
-    return pn_string_addf(str, "%" PRIi64, atom->u.as_timestamp);
-  case PN_FLOAT:
-    return pn_string_addf(str, "%g", atom->u.as_float);
-  case PN_DOUBLE:
-    return pn_string_addf(str, "%g", atom->u.as_double);
-  case PN_DECIMAL32:
-    return pn_string_addf(str, "D32(%" PRIu32 ")", atom->u.as_decimal32);
-  case PN_DECIMAL64:
-    return pn_string_addf(str, "D64(%" PRIu64 ")", atom->u.as_decimal64);
-  case PN_DECIMAL128:
-    return pn_string_addf(str, "D128(%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
-                          "%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
-                          "%02hhx%02hhx)",
-                          atom->u.as_decimal128.bytes[0],
-                          atom->u.as_decimal128.bytes[1],
-                          atom->u.as_decimal128.bytes[2],
-                          atom->u.as_decimal128.bytes[3],
-                          atom->u.as_decimal128.bytes[4],
-                          atom->u.as_decimal128.bytes[5],
-                          atom->u.as_decimal128.bytes[6],
-                          atom->u.as_decimal128.bytes[7],
-                          atom->u.as_decimal128.bytes[8],
-                          atom->u.as_decimal128.bytes[9],
-                          atom->u.as_decimal128.bytes[10],
-                          atom->u.as_decimal128.bytes[11],
-                          atom->u.as_decimal128.bytes[12],
-                          atom->u.as_decimal128.bytes[13],
-                          atom->u.as_decimal128.bytes[14],
-                          atom->u.as_decimal128.bytes[15]);
-  case PN_UUID:
-    return pn_string_addf(str, "UUID(%02hhx%02hhx%02hhx%02hhx-"
-                          "%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-"
-                          "%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx)",
-                          atom->u.as_uuid.bytes[0],
-                          atom->u.as_uuid.bytes[1],
-                          atom->u.as_uuid.bytes[2],
-                          atom->u.as_uuid.bytes[3],
-                          atom->u.as_uuid.bytes[4],
-                          atom->u.as_uuid.bytes[5],
-                          atom->u.as_uuid.bytes[6],
-                          atom->u.as_uuid.bytes[7],
-                          atom->u.as_uuid.bytes[8],
-                          atom->u.as_uuid.bytes[9],
-                          atom->u.as_uuid.bytes[10],
-                          atom->u.as_uuid.bytes[11],
-                          atom->u.as_uuid.bytes[12],
-                          atom->u.as_uuid.bytes[13],
-                          atom->u.as_uuid.bytes[14],
-                          atom->u.as_uuid.bytes[15]);
-  case PN_BINARY:
-  case PN_STRING:
-  case PN_SYMBOL:
-    {
-      int err;
-      const char *pfx;
-      pn_bytes_t bin = atom->u.as_bytes;
-      bool quote;
-      switch (atom->type) {
-      case PN_BINARY:
-        pfx = "b";
-        quote = true;
-        break;
-      case PN_STRING:
-        pfx = "";
-        quote = true;
-        break;
-      case PN_SYMBOL:
-        pfx = ":";
-        quote = false;
-        for (unsigned i = 0; i < bin.size; i++) {
-          if (!isalpha(bin.start[i])) {
-            quote = true;
-            break;
-          }
-        }
-        break;
-      default:
-        assert(false);
-        return PN_ERR;
-      }
-
-      if ((err = pn_string_addf(str, "%s", pfx))) return err;
-      if (quote) if ((err = pn_string_addf(str, "\""))) return err;
-      if ((err = pn_quote(str, bin.start, bin.size))) return err;
-      if (quote) if ((err = pn_string_addf(str, "\""))) return err;
-      return 0;
-    }
-  case PN_LIST:
-    return pn_string_addf(str, "<list>");
-  case PN_MAP:
-    return pn_string_addf(str, "<map>");
-  case PN_ARRAY:
-    return pn_string_addf(str, "<array>");
-  case PN_DESCRIBED:
-    return pn_string_addf(str, "<described>");
-  default:
-    return pn_string_addf(str, "<undefined: %i>", atom->type);
-  }
-}
-
-int pni_inspect_enter(void *ctx, pn_data_t *data, pni_node_t *node)
-{
-  pn_string_t *str = (pn_string_t *) ctx;
-  pn_atom_t *atom = (pn_atom_t *) &node->atom;
-
-  pni_node_t *parent = pn_data_node(data, node->parent);
-  const pn_fields_t *fields = pni_node_fields(data, parent);
-  pni_node_t *grandparent = parent ? pn_data_node(data, parent->parent) : NULL;
-  const pn_fields_t *grandfields = pni_node_fields(data, grandparent);
-  int index = pni_node_index(data, node);
-
-  int err;
-
-  if (grandfields) {
-    if (atom->type == PN_NULL) {
-      return 0;
-    }
-    const char *name = (index < grandfields->field_count)
-        ? FIELD_STRINGPOOL.STRING0+FIELD_FIELDS[grandfields->first_field_index+index]
-        : NULL;
-    if (name) {
-      err = pn_string_addf(str, "%s=", name);
-      if (err) return err;
-    }
-  }
-
-  switch (atom->type) {
-  case PN_DESCRIBED:
-    return pn_string_addf(str, "@");
-  case PN_ARRAY:
-    // XXX: need to fix for described arrays
-    return pn_string_addf(str, "@%s[", pn_type_name(node->type));
-  case PN_LIST:
-    return pn_string_addf(str, "[");
-  case PN_MAP:
-    return pn_string_addf(str, "{");
-  default:
-    if (fields && index == 0) {
-      err = pn_string_addf(str, "%s", FIELD_STRINGPOOL.STRING0+FIELD_NAME[fields->name_index]);
-      if (err) return err;
-      err = pn_string_addf(str, "(");
-      if (err) return err;
-      err = pni_inspect_atom(atom, str);
-      if (err) return err;
-      return pn_string_addf(str, ")");
-    } else {
-      return pni_inspect_atom(atom, str);
-    }
-  }
-}
-
-pni_node_t *pni_next_nonnull(pn_data_t *data, pni_node_t *node)
-{
-  while (node) {
-    node = pn_data_node(data, node->next);
-    if (node && node->atom.type != PN_NULL) {
-      return node;
-    }
-  }
-
-  return NULL;
-}
-
-int pni_inspect_exit(void *ctx, pn_data_t *data, pni_node_t *node)
-{
-  pn_string_t *str = (pn_string_t *) ctx;
-  pni_node_t *parent = pn_data_node(data, node->parent);
-  pni_node_t *grandparent = parent ? pn_data_node(data, parent->parent) : NULL;
-  const pn_fields_t *grandfields = pni_node_fields(data, grandparent);
-  pni_node_t *next = pn_data_node(data, node->next);
-  int err;
-
-  switch (node->atom.type) {
-  case PN_ARRAY:
-  case PN_LIST:
-    err = pn_string_addf(str, "]");
-    if (err) return err;
-    break;
-  case PN_MAP:
-    err = pn_string_addf(str, "}");
-    if (err) return err;
-    break;
-  default:
-    break;
-  }
-
-  if (!grandfields || node->atom.type != PN_NULL) {
-    if (next) {
-      int index = pni_node_index(data, node);
-      if (parent && parent->atom.type == PN_MAP && (index % 2) == 0) {
-        err = pn_string_addf(str, "=");
-      } else if (parent && parent->atom.type == PN_DESCRIBED && index == 0) {
-        err = pn_string_addf(str, " ");
-        if (err) return err;
-      } else {
-        if (!grandfields || pni_next_nonnull(data, node)) {
-          err = pn_string_addf(str, ", ");
-          if (err) return err;
-        }
-      }
-    }
-  }
-
-  return 0;
-}
-
-static int pn_data_inspect(void *obj, pn_string_t *dst)
-{
-  pn_data_t *data = (pn_data_t *) obj;
-
-  return pni_data_traverse(data, pni_inspect_enter, pni_inspect_exit, dst);
-}
-
-#define pn_data_initialize NULL
-#define pn_data_hashcode NULL
-#define pn_data_compare NULL
-
-pn_data_t *pn_data(size_t capacity)
-{
-  static const pn_class_t clazz = PN_CLASS(pn_data);
-  pn_data_t *data = (pn_data_t *) pn_class_new(&clazz, sizeof(pn_data_t));
-  data->capacity = capacity;
-  data->size = 0;
-  data->nodes = capacity ? (pni_node_t *) malloc(capacity * sizeof(pni_node_t)) : NULL;
-  data->buf = pn_buffer(64);
-  data->parent = 0;
-  data->current = 0;
-  data->base_parent = 0;
-  data->base_current = 0;
-  data->decoder = pn_decoder();
-  data->encoder = pn_encoder();
-  data->error = pn_error();
-  data->str = pn_string(NULL);
-  return data;
-}
-
-void pn_data_free(pn_data_t *data)
-{
-  pn_free(data);
-}
-
-int pn_data_errno(pn_data_t *data)
-{
-  return pn_error_code(data->error);
-}
-
-pn_error_t *pn_data_error(pn_data_t *data)
-{
-  return data->error;
-}
-
-size_t pn_data_size(pn_data_t *data)
-{
-  return data ? data->size : 0;
-}
-
-void pn_data_clear(pn_data_t *data)
-{
-  if (data) {
-    data->size = 0;
-    data->parent = 0;
-    data->current = 0;
-    data->base_parent = 0;
-    data->base_current = 0;
-    pn_buffer_clear(data->buf);
-  }
-}
-
-static int pni_data_grow(pn_data_t *data)
-{
-  size_t capacity = data->capacity ? data->capacity : 2;
-  if (capacity >= PNI_NID_MAX) return PN_OUT_OF_MEMORY;
-  else if (capacity < PNI_NID_MAX/2) capacity *= 2;
-  else capacity = PNI_NID_MAX;
-
-  pni_node_t *new_nodes = (pni_node_t *)realloc(data->nodes, capacity * sizeof(pni_node_t));
-  if (new_nodes == NULL) return PN_OUT_OF_MEMORY;
-  data->capacity = capacity;
-  data->nodes = new_nodes;
-  return 0;
-}
-
-static ssize_t pni_data_intern(pn_data_t *data, const char *start, size_t size)
-{
-  size_t offset = pn_buffer_size(data->buf);
-  int err = pn_buffer_append(data->buf, start, size);
-  if (err) return err;
-  err = pn_buffer_append(data->buf, "\0", 1);
-  if (err) return err;
-  return offset;
-}
-
-static pn_bytes_t *pni_data_bytes(pn_data_t *data, pni_node_t *node)
-{
-  switch (node->atom.type) {
-  case PN_BINARY:
-  case PN_STRING:
-  case PN_SYMBOL:
-    return &node->atom.u.as_bytes;
-  default: return NULL;
-  }
-}
-
-static void pni_data_rebase(pn_data_t *data, char *base)
-{
-  for (unsigned i = 0; i < data->size; i++) {
-    pni_node_t *node = &data->nodes[i];
-    if (node->data) {
-      pn_bytes_t *bytes = pni_data_bytes(data, node);
-      bytes->start = base + node->data_offset;
-    }
-  }
-}
-
-static int pni_data_intern_node(pn_data_t *data, pni_node_t *node)
-{
-  pn_bytes_t *bytes = pni_data_bytes(data, node);
-  if (!bytes) return 0;
-  size_t oldcap = pn_buffer_capacity(data->buf);
-  ssize_t offset = pni_data_intern(data, bytes->start, bytes->size);
-  if (offset < 0) return offset;
-  node->data = true;
-  node->data_offset = offset;
-  node->data_size = bytes->size;
-  pn_rwbytes_t buf = pn_buffer_memory(data->buf);
-  bytes->start = buf.start + offset;
-
-  if (pn_buffer_capacity(data->buf) != oldcap) {
-    pni_data_rebase(data, buf.start);
-  }
-
-  return 0;
-}
-
-int pn_data_vfill(pn_data_t *data, const char *fmt, va_list ap)
-{
-  int err = 0;
-  const char *begin = fmt;
-  while (*fmt) {
-    char code = *(fmt++);
-    if (!code) return 0;
-
-    switch (code) {
-    case 'n':
-      err = pn_data_put_null(data);
-      break;
-    case 'o':
-      err = pn_data_put_bool(data, va_arg(ap, int));
-      break;
-    case 'B':
-      err = pn_data_put_ubyte(data, va_arg(ap, unsigned int));
-      break;
-    case 'b':
-      err = pn_data_put_byte(data, va_arg(ap, int));
-      break;
-    case 'H':
-      err = pn_data_put_ushort(data, va_arg(ap, unsigned int));
-      break;
-    case 'h':
-      err = pn_data_put_short(data, va_arg(ap, int));
-      break;
-    case 'I':
-      err = pn_data_put_uint(data, va_arg(ap, uint32_t));
-      break;
-    case 'i':
-      err = pn_data_put_int(data, va_arg(ap, uint32_t));
-      break;
-    case 'L':
-      err = pn_data_put_ulong(data, va_arg(ap, uint64_t));
-      break;
-    case 'l':
-      err = pn_data_put_long(data, va_arg(ap, int64_t));
-      break;
-    case 't':
-      err = pn_data_put_timestamp(data, va_arg(ap, pn_timestamp_t));
-      break;
-    case 'f':
-      err = pn_data_put_float(data, va_arg(ap, double));
-      break;
-    case 'd':
-      err = pn_data_put_double(data, va_arg(ap, double));
-      break;
-    case 'z':
-      {
-	// For maximum portability, caller must pass these as two separate args, not a single struct
-        size_t size = va_arg(ap, size_t);
-        char *start = va_arg(ap, char *);
-        if (start) {
-          err = pn_data_put_binary(data, pn_bytes(size, start));
-        } else {
-          err = pn_data_put_null(data);
-        }
-      }
-      break;
-    case 'S':
-    case 's':
-      {
-        char *start = va_arg(ap, char *);
-        size_t size;
-        if (start) {
-          size = strlen(start);
-          if (code == 'S') {
-            err = pn_data_put_string(data, pn_bytes(size, start));
-          } else {
-            err = pn_data_put_symbol(data, pn_bytes(size, start));
-          }
-        } else {
-          err = pn_data_put_null(data);
-        }
-      }
-      break;
-    case 'D':
-      err = pn_data_put_described(data);
-      pn_data_enter(data);
-      break;
-    case 'T':
-      {
-        pni_node_t *parent = pn_data_node(data, data->parent);
-        if (parent->atom.type == PN_ARRAY) {
-          parent->type = (pn_type_t) va_arg(ap, int);
-        } else {
-          return pn_error_format(data->error, PN_ERR, "naked type");
-        }
-      }
-      break;
-    case '@':
-      {
-        bool described;
-        if (*(fmt + 1) == 'D') {
-          fmt++;
-          described = true;
-        } else {
-          described = false;
-        }
-        err = pn_data_put_array(data, described, (pn_type_t) 0);
-        pn_data_enter(data);
-      }
-      break;
-    case '[':
-      if (fmt < (begin + 2) || *(fmt - 2) != 'T') {
-        err = pn_data_put_list(data);
-        if (err) return err;
-        pn_data_enter(data);
-      }
-      break;
-    case '{':
-      err = pn_data_put_map(data);
-      if (err) return err;
-      pn_data_enter(data);
-      break;
-    case '}':
-    case ']':
-      if (!pn_data_exit(data))
-        return pn_error_format(data->error, PN_ERR, "exit failed");
-      break;
-    case '?':
-      if (!va_arg(ap, int)) {
-        err = pn_data_put_null(data);
-        if (err) return err;
-        pn_data_enter(data);
-      }
-      break;
-    case '*':
-      {
-        int count = va_arg(ap, int);
-        void *ptr = va_arg(ap, void *);
-
-        char c = *(fmt++);
-
-        switch (c)
-        {
-        case 's':
-          {
-            char **sptr = (char **) ptr;
-            for (int i = 0; i < count; i++)
-            {
-              char *sym = *(sptr++);
-              err = pn_data_fill(data, "s", sym);
-              if (err) return err;
-            }
-          }
-          break;
-        default:
-          pn_logf("unrecognized * code: 0x%.2X '%c'", code, code);
-          return PN_ARG_ERR;
-        }
-      }
-      break;
-    case 'C':
-      {
-        pn_data_t *src = va_arg(ap, pn_data_t *);
-        if (src && pn_data_size(src) > 0) {
-          err = pn_data_appendn(data, src, 1);
-          if (err) return err;
-        } else {
-          err = pn_data_put_null(data);
-          if (err) return err;
-        }
-      }
-      break;
-    default:
-      pn_logf("unrecognized fill code: 0x%.2X '%c'", code, code);
-      return PN_ARG_ERR;
-    }
-
-    if (err) return err;
-
-    pni_node_t *parent = pn_data_node(data, data->parent);
-    while (parent) {
-      if (parent->atom.type == PN_DESCRIBED && parent->children == 2) {
-        pn_data_exit(data);
-        parent = pn_data_node(data, data->parent);
-      } else if (parent->atom.type == PN_NULL && parent->children == 1) {
-        pn_data_exit(data);
-        pni_node_t *current = pn_data_node(data, data->current);
-        current->down = 0;
-        current->children = 0;
-        parent = pn_data_node(data, data->parent);
-      } else {
-        break;
-      }
-    }
-  }
-
-  return 0;
-}
-
-
-int pn_data_fill(pn_data_t *data, const char *fmt, ...)
-{
-  va_list ap;
-  va_start(ap, fmt);
-  int err = pn_data_vfill(data, fmt, ap);
-  va_end(ap);
-  return err;
-}
-
-static bool pn_scan_next(pn_data_t *data, pn_type_t *type, bool suspend)
-{
-  if (suspend) return false;
-  bool found = pn_data_next(data);
-  if (found) {
-    *type = pn_data_type(data);
-    return true;
-  } else {
-    pni_node_t *parent = pn_data_node(data, data->parent);
-    if (parent && parent->atom.type == PN_DESCRIBED) {
-      pn_data_exit(data);
-      return pn_scan_next(data, type, suspend);
-    } else {
-      *type = PN_INVALID;
-      return false;
-    }
-  }
-}
-
-static pni_node_t *pni_data_peek(pn_data_t *data);
-
-int pn_data_vscan(pn_data_t *data, const char *fmt, va_list ap)
-{
-  pn_data_rewind(data);
-  bool *scanarg = NULL;
-  bool at = false;
-  int level = 0;
-  int count_level = -1;
-  int resume_count = 0;
-
-  while (*fmt) {
-    char code = *(fmt++);
-
-    bool found = false;
-    pn_type_t type;
-
-    bool scanned = false;
-    bool suspend = resume_count > 0;
-
-    switch (code) {
-    case 'n':
-      found = pn_scan_next(data, &type, suspend);
-      if (found && type == PN_NULL) {
-        scanned = true;
-      } else {
-        scanned = false;
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case 'o':
-      {
-        bool *value = va_arg(ap, bool *);
-        found = pn_scan_next(data, &type, suspend);
-        if (found && type == PN_BOOL) {
-          *value = pn_data_get_bool(data);
-          scanned = true;
-        } else {
-          *value = 0;
-          scanned = false;
-        }
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case 'B':
-      {
-        uint8_t *value = va_arg(ap, uint8_t *);
-        found = pn_scan_next(data, &type, suspend);
-        if (found && type == PN_UBYTE) {
-          *value = pn_data_get_ubyte(data);
-          scanned = true;
-        } else {
-          *value = 0;
-          scanned = false;
-        }
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case 'b':
-      {
-        int8_t *value = va_arg(ap, int8_t *);
-        found = pn_scan_next(data, &type, suspend);
-        if (found && type == PN_BYTE) {
-          *value = pn_data_get_byte(data);
-          scanned = true;
-        } else {
-          *value = 0;
-          scanned = false;
-        }
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case 'H':
-      {
-        uint16_t *value = va_arg(ap, uint16_t *);
-        found = pn_scan_next(data, &type, suspend);
-        if (found && type == PN_USHORT) {
-          *value = pn_data_get_ushort(data);
-          scanned = true;
-        } else {
-          *value = 0;
-          scanned = false;
-        }
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case 'h':
-      {
-        int16_t *value = va_arg(ap, int16_t *);
-        found = pn_scan_next(data, &type, suspend);
-        if (found && type == PN_SHORT) {
-          *value = pn_data_get_short(data);
-          scanned = true;
-        } else {
-          *value = 0;
-          scanned = false;
-        }
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case 'I':
-      {
-        uint32_t *value = va_arg(ap, uint32_t *);
-        found = pn_scan_next(data, &type, suspend);
-        if (found && type == PN_UINT) {
-          *value = pn_data_get_uint(data);
-          scanned = true;
-        } else {
-          *value = 0;
-          scanned = false;
-        }
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case 'i':
-      {
-        int32_t *value = va_arg(ap, int32_t *);
-        found = pn_scan_next(data, &type, suspend);
-        if (found && type == PN_INT) {
-          *value = pn_data_get_int(data);
-          scanned = true;
-        } else {
-          *value = 0;
-          scanned = false;
-        }
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case 'c':
-      {
-        pn_char_t *value = va_arg(ap, pn_char_t *);
-        found = pn_scan_next(data, &type, suspend);
-        if (found && type == PN_CHAR) {
-          *value = pn_data_get_char(data);
-          scanned = true;
-        } else {
-          *value = 0;
-          scanned = false;
-        }
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case 'L':
-      {
-        uint64_t *value = va_arg(ap, uint64_t *);
-        found = pn_scan_next(data, &type, suspend);
-        if (found && type == PN_ULONG) {
-          *value = pn_data_get_ulong(data);
-          scanned = true;
-        } else {
-          *value = 0;
-          scanned = false;
-        }
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case 'l':
-      {
-        int64_t *value = va_arg(ap, int64_t *);
-        found = pn_scan_next(data, &type, suspend);
-        if (found && type == PN_LONG) {
-          *value = pn_data_get_long(data);
-          scanned = true;
-        } else {
-          *value = 0;
-          scanned = false;
-        }
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case 't':
-      {
-        pn_timestamp_t *value = va_arg(ap, pn_timestamp_t *);
-        found = pn_scan_next(data, &type, suspend);
-        if (found && type == PN_TIMESTAMP) {
-          *value = pn_data_get_timestamp(data);
-          scanned = true;
-        } else {
-          *value = 0;
-          scanned = false;
-        }
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case 'f':
-      {
-        float *value = va_arg(ap, float *);
-        found = pn_scan_next(data, &type, suspend);
-        if (found && type == PN_FLOAT) {
-          *value = pn_data_get_float(data);
-          scanned = true;
-        } else {
-          *value = 0;
-          scanned = false;
-        }
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case 'd':
-      {
-        double *value = va_arg(ap, double *);
-        found = pn_scan_next(data, &type, suspend);
-        if (found && type == PN_DOUBLE) {
-          *value = pn_data_get_double(data);
-          scanned = true;
-        } else {
-          *value = 0;
-          scanned = false;
-        }
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case 'z':
-      {
-        pn_bytes_t *bytes = va_arg(ap, pn_bytes_t *);
-        found = pn_scan_next(data, &type, suspend);
-        if (found && type == PN_BINARY) {
-          *bytes = pn_data_get_binary(data);
-          scanned = true;
-        } else {
-          bytes->start = 0;
-          bytes->size = 0;
-          scanned = false;
-        }
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case 'S':
-      {
-        pn_bytes_t *bytes = va_arg(ap, pn_bytes_t *);
-        found = pn_scan_next(data, &type, suspend);
-        if (found && type == PN_STRING) {
-          *bytes = pn_data_get_string(data);
-          scanned = true;
-        } else {
-          bytes->start = 0;
-          bytes->size = 0;
-          scanned = false;
-        }
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case 's':
-      {
-        pn_bytes_t *bytes = va_arg(ap, pn_bytes_t *);
-        found = pn_scan_next(data, &type, suspend);
-        if (found && type == PN_SYMBOL) {
-          *bytes = pn_data_get_symbol(data);
-          scanned = true;
-        } else {
-          bytes->start = 0;
-          bytes->size = 0;
-          scanned = false;
-        }
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case 'D':
-      found = pn_scan_next(data, &type, suspend);
-      if (found && type == PN_DESCRIBED) {
-        pn_data_enter(data);
-        scanned = true;
-      } else {
-        if (!suspend) {
-          resume_count = 3;
-          count_level = level;
-        }
-        scanned = false;
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case '@':
-      found = pn_scan_next(data, &type, suspend);
-      if (found && type == PN_ARRAY) {
-        pn_data_enter(data);
-        scanned = true;
-        at = true;
-      } else {
-        if (!suspend) {
-          resume_count = 3;
-          count_level = level;
-        }
-        scanned = false;
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case '[':
-      if (at) {
-        scanned = true;
-        at = false;
-      } else {
-        found = pn_scan_next(data, &type, suspend);
-        if (found && type == PN_LIST) {
-          pn_data_enter(data);
-          scanned = true;
-        } else {
-          if (!suspend) {
-            resume_count = 1;
-            count_level = level;
-          }
-          scanned = false;
-        }
-      }
-      level++;
-      break;
-    case '{':
-      found = pn_scan_next(data, &type, suspend);
-      if (found && type == PN_MAP) {
-        pn_data_enter(data);
-        scanned = true;
-      } else {
-        if (resume_count) {
-          resume_count = 1;
-          count_level = level;
-        }
-        scanned = false;
-      }
-      level++;
-      break;
-    case ']':
-    case '}':
-      level--;
-      if (!suspend && !pn_data_exit(data))
-        return pn_error_format(data->error, PN_ERR, "exit failed");
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case '.':
-      found = pn_scan_next(data, &type, suspend);
-      scanned = found;
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    case '?':
-      if (!*fmt || *fmt == '?')
-        return pn_error_format(data->error, PN_ARG_ERR, "codes must follow a ?");
-      scanarg = va_arg(ap, bool *);
-      break;
-    case 'C':
-      {
-        pn_data_t *dst = va_arg(ap, pn_data_t *);
-        if (!suspend) {
-          size_t old = pn_data_size(dst);
-          pni_node_t *next = pni_data_peek(data);
-          if (next && next->atom.type != PN_NULL) {
-            pn_data_narrow(data);
-            int err = pn_data_appendn(dst, data, 1);
-            pn_data_widen(data);
-            if (err) return err;
-            scanned = pn_data_size(dst) > old;
-          } else {
-            scanned = false;
-          }
-          pn_data_next(data);
-        } else {
-          scanned = false;
-        }
-      }
-      if (resume_count && level == count_level) resume_count--;
-      break;
-    default:
-      return pn_error_format(data->error, PN_ARG_ERR, "unrecognized scan code: 0x%.2X '%c'", code, code);
-    }
-
-    if (scanarg && code != '?') {
-      *scanarg = scanned;
-      scanarg = NULL;
-    }
-  }
-
-  return 0;
-}
-
-int pn_data_scan(pn_data_t *data, const char *fmt, ...)
-{
-  va_list ap;
-  va_start(ap, fmt);
-  int err = pn_data_vscan(data, fmt, ap);
-  va_end(ap);
-  return err;
-}
-
-static int pni_data_inspectify(pn_data_t *data)
-{
-  int err = pn_string_set(data->str, "");
-  if (err) return err;
-  return pn_data_inspect(data, data->str);
-}
-
-int pn_data_print(pn_data_t *data)
-{
-  int err = pni_data_inspectify(data);
-  if (err) return err;
-  printf("%s", pn_string_get(data->str));
-  return 0;
-}
-
-int pn_data_format(pn_data_t *data, char *bytes, size_t *size)
-{
-  int err = pni_data_inspectify(data);
-  if (err) return err;
-  if (pn_string_size(data->str) >= *size) {
-    return PN_OVERFLOW;
-  } else {
-    pn_string_put(data->str, bytes);
-    *size = pn_string_size(data->str);
-    return 0;
-  }
-}
-
-static size_t pni_data_id(pn_data_t *data, pni_node_t *node)
-{
-  return node - data->nodes + 1;
-}
-
-static pni_node_t *pni_data_new(pn_data_t *data)
-{
-  if ((data->capacity <= data->size) && (pni_data_grow(data) != 0)) return NULL;
-  pni_node_t *node = pn_data_node(data, ++(data->size));
-  node->next = 0;
-  node->down = 0;
-  node->children = 0;
-  return node;
-}
-
-void pn_data_rewind(pn_data_t *data)
-{
-  data->parent = data->base_parent;
-  data->current = data->base_current;
-}
-
-static pni_node_t *pni_data_current(pn_data_t *data)
-{
-  return pn_data_node(data, data->current);
-}
-
-void pn_data_narrow(pn_data_t *data)
-{
-  data->base_parent = data->parent;
-  data->base_current = data->current;
-}
-
-void pn_data_widen(pn_data_t *data)
-{
-  data->base_parent = 0;
-  data->base_current = 0;
-}
-
-pn_handle_t pn_data_point(pn_data_t *data)
-{
-  if (data->current) {
-    return (pn_handle_t)(uintptr_t)data->current;
-  } else {
-    return (pn_handle_t)(uintptr_t)-data->parent;
-  }
-}
-
-bool pn_data_restore(pn_data_t *data, pn_handle_t point)
-{
-  pn_shandle_t spoint = (pn_shandle_t) point;
-  if (spoint <= 0 && ((size_t) (-spoint)) <= data->size) {
-    data->parent = -((pn_shandle_t) point);
-    data->current = 0;
-    return true;
-  } else if (spoint && spoint <= data->size) {
-    data->current = spoint;
-    pni_node_t *current = pni_data_current(data);
-    data->parent = current->parent;
-    return true;
-  } else {
-    return false;
-  }
-}
-
-static pni_node_t *pni_data_peek(pn_data_t *data)
-{
-  pni_node_t *current = pni_data_current(data);
-  if (current) {
-    return pn_data_node(data, current->next);
-  }
-
-  pni_node_t *parent = pn_data_node(data, data->parent);
-  if (parent) {
-    return pn_data_node(data, parent->down);
-  }
-
-  return NULL;
-}
-
-bool pn_data_next(pn_data_t *data)
-{
-  pni_node_t *current = pni_data_current(data);
-  pni_node_t *parent = pn_data_node(data, data->parent);
-  size_t next;
-
-  if (current) {
-    next = current->next;
-  } else if (parent && parent->down) {
-    next = parent->down;
-  } else if (!parent && data->size) {
-    next = 1;
-  } else {
-    return false;
-  }
-
-  if (next) {
-    data->current = next;
-    return true;
-  } else {
-    return false;
-  }
-}
-
-bool pn_data_prev(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->prev) {
-    data->current = node->prev;
-    return true;
-  } else {
-    return false;
-  }
-}
-
-int pni_data_traverse(pn_data_t *data,
-                      int (*enter)(void *ctx, pn_data_t *data, pni_node_t *node),
-                      int (*exit)(void *ctx, pn_data_t *data, pni_node_t *node),
-                      void *ctx)
-{
-  pni_node_t *node = data->size ? pn_data_node(data, 1) : NULL;
-  while (node) {
-    pni_node_t *parent = pn_data_node(data, node->parent);
-
-    int err = enter(ctx, data, node);
-    if (err) return err;
-
-    size_t next = 0;
-    if (node->down) {
-      next = node->down;
-    } else if (node->next) {
-      err = exit(ctx, data, node);
-      if (err) return err;
-      next = node->next;
-    } else {
-      err = exit(ctx, data, node);
-      if (err) return err;
-      while (parent) {
-        err = exit(ctx, data, parent);
-        if (err) return err;
-        if (parent->next) {
-          next = parent->next;
-          break;
-        } else {
-          parent = pn_data_node(data, parent->parent);
-        }
-      }
-    }
-
-    node = pn_data_node(data, next);
-  }
-
-  return 0;
-}
-
-pn_type_t pn_data_type(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node) {
-    return node->atom.type;
-  } else {
-    return PN_INVALID;
-  }
-}
-
-pn_type_t pni_data_parent_type(pn_data_t *data)
-{
-  pni_node_t *node = pn_data_node(data, data->parent);
-  if (node) {
-    return node->atom.type;
-  } else {
-    return PN_INVALID;
-  }
-}
-
-size_t pn_data_siblings(pn_data_t *data)
-{
-  pni_node_t *node = pn_data_node(data, data->parent);
-  if (node) {
-    return node->children;
-  } else {
-    return 0;
-  }
-}
-
-bool pn_data_enter(pn_data_t *data)
-{
-  if (data->current) {
-    data->parent = data->current;
-    data->current = 0;
-    return true;
-  } else {
-    return false;
-  }
-}
-
-bool pn_data_exit(pn_data_t *data)
-{
-  if (data->parent) {
-    pni_node_t *parent = pn_data_node(data, data->parent);
-    data->current = data->parent;
-    data->parent = parent->parent;
-    return true;
-  } else {
-    return false;
-  }
-}
-
-bool pn_data_lookup(pn_data_t *data, const char *name)
-{
-  while (pn_data_next(data)) {
-    pn_type_t type = pn_data_type(data);
-
-    switch (type) {
-    case PN_STRING:
-    case PN_SYMBOL:
-      {
-        pn_bytes_t bytes = pn_data_get_bytes(data);
-        if (strlen(name) == bytes.size && !strncmp(name, bytes.start, bytes.size)) {
-          return pn_data_next(data);
-        }
-      }
-      break;
-    default:
-      break;
-    }
-
-    // skip the value
-    pn_data_next(data);
-  }
-
-  return false;
-}
-
-void pn_data_dump(pn_data_t *data)
-{
-  printf("{current=%" PN_ZI ", parent=%" PN_ZI "}\n", (size_t) data->current, (size_t) data->parent);
-  for (unsigned i = 0; i < data->size; i++)
-  {
-    pni_node_t *node = &data->nodes[i];
-    pn_string_set(data->str, "");
-    pni_inspect_atom((pn_atom_t *) &node->atom, data->str);
-    printf("Node %i: prev=%" PN_ZI ", next=%" PN_ZI ", parent=%" PN_ZI ", down=%" PN_ZI 
-           ", children=%" PN_ZI ", type=%s (%s)\n",
-           i + 1, (size_t) node->prev,
-           (size_t) node->next,
-           (size_t) node->parent,
-           (size_t) node->down,
-           (size_t) node->children,
-           pn_type_name(node->atom.type), pn_string_get(data->str));
-  }
-}
-
-static pni_node_t *pni_data_add(pn_data_t *data)
-{
-  pni_node_t *current = pni_data_current(data);
-  pni_node_t *parent = pn_data_node(data, data->parent);
-  pni_node_t *node;
-
-  if (current) {
-    if (current->next) {
-      node = pn_data_node(data, current->next);
-    } else {
-      node = pni_data_new(data);
-      if (!node) return NULL;
-
-      // refresh the pointers in case we grew
-      current = pni_data_current(data);
-      parent = pn_data_node(data, data->parent);
-      node->prev = data->current;
-      current->next = pni_data_id(data, node);
-      node->parent = data->parent;
-      if (parent) {
-        if (!parent->down) {
-          parent->down = pni_data_id(data, node);
-        }
-        parent->children++;
-      }
-    }
-  } else if (parent) {
-    if (parent->down) {
-      node = pn_data_node(data, parent->down);
-    } else {
-      node = pni_data_new(data);
-      if (!node) return NULL;
-
-      // refresh the pointers in case we grew
-      parent = pn_data_node(data, data->parent);
-      node->prev = 0;
-      node->parent = data->parent;
-      parent->down = pni_data_id(data, node);
-      parent->children++;
-    }
-  } else if (data->size) {
-    node = pn_data_node(data, 1);
-  } else {
-    node = pni_data_new(data);
-    if (!node) return NULL;
-
-    node->prev = 0;
-    node->parent = 0;
-  }
-
-  node->down = 0;
-  node->children = 0;
-  node->data = false;
-  node->data_offset = 0;
-  node->data_size = 0;
-  data->current = pni_data_id(data, node);
-  return node;
-}
-
-ssize_t pn_data_encode(pn_data_t *data, char *bytes, size_t size)
-{
-  return pn_encoder_encode(data->encoder, data, bytes, size);
-}
-
-ssize_t pn_data_encoded_size(pn_data_t *data)
-{
-  return pn_encoder_size(data->encoder, data);
-}
-
-ssize_t pn_data_decode(pn_data_t *data, const char *bytes, size_t size)
-{
-  return pn_decoder_decode(data->decoder, bytes, size, data);
-}
-
-int pn_data_put_list(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_LIST;
-  return 0;
-}
-
-int pn_data_put_map(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_MAP;
-  return 0;
-}
-
-int pn_data_put_array(pn_data_t *data, bool described, pn_type_t type)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_ARRAY;
-  node->described = described;
-  node->type = type;
-  return 0;
-}
-
-void pni_data_set_array_type(pn_data_t *data, pn_type_t type)
-{
-  pni_node_t *array = pni_data_current(data);
-  if (array) array->type = type;
-}
-
-int pn_data_put_described(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_DESCRIBED;
-  return 0;
-}
-
-int pn_data_put_null(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  pni_atom_init(&node->atom, PN_NULL);
-  return 0;
-}
-
-int pn_data_put_bool(pn_data_t *data, bool b)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_BOOL;
-  node->atom.u.as_bool = b;
-  return 0;
-}
-
-int pn_data_put_ubyte(pn_data_t *data, uint8_t ub)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_UBYTE;
-  node->atom.u.as_ubyte = ub;
-  return 0;
-}
-
-int pn_data_put_byte(pn_data_t *data, int8_t b)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_BYTE;
-  node->atom.u.as_byte = b;
-  return 0;
-}
-
-int pn_data_put_ushort(pn_data_t *data, uint16_t us)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_USHORT;
-  node->atom.u.as_ushort = us;
-  return 0;
-}
-
-int pn_data_put_short(pn_data_t *data, int16_t s)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_SHORT;
-  node->atom.u.as_short = s;
-  return 0;
-}
-
-int pn_data_put_uint(pn_data_t *data, uint32_t ui)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_UINT;
-  node->atom.u.as_uint = ui;
-  return 0;
-}
-
-int pn_data_put_int(pn_data_t *data, int32_t i)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_INT;
-  node->atom.u.as_int = i;
-  return 0;
-}
-
-int pn_data_put_char(pn_data_t *data, pn_char_t c)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_CHAR;
-  node->atom.u.as_char = c;
-  return 0;
-}
-
-int pn_data_put_ulong(pn_data_t *data, uint64_t ul)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_ULONG;
-  node->atom.u.as_ulong = ul;
-  return 0;
-}
-
-int pn_data_put_long(pn_data_t *data, int64_t l)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_LONG;
-  node->atom.u.as_long = l;
-  return 0;
-}
-
-int pn_data_put_timestamp(pn_data_t *data, pn_timestamp_t t)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_TIMESTAMP;
-  node->atom.u.as_timestamp = t;
-  return 0;
-}
-
-int pn_data_put_float(pn_data_t *data, float f)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_FLOAT;
-  node->atom.u.as_float = f;
-  return 0;
-}
-
-int pn_data_put_double(pn_data_t *data, double d)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_DOUBLE;
-  node->atom.u.as_double = d;
-  return 0;
-}
-
-int pn_data_put_decimal32(pn_data_t *data, pn_decimal32_t d)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_DECIMAL32;
-  node->atom.u.as_decimal32 = d;
-  return 0;
-}
-
-int pn_data_put_decimal64(pn_data_t *data, pn_decimal64_t d)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_DECIMAL64;
-  node->atom.u.as_decimal64 = d;
-  return 0;
-}
-
-int pn_data_put_decimal128(pn_data_t *data, pn_decimal128_t d)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_DECIMAL128;
-  memmove(node->atom.u.as_decimal128.bytes, d.bytes, 16);
-  return 0;
-}
-
-int pn_data_put_uuid(pn_data_t *data, pn_uuid_t u)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_UUID;
-  memmove(node->atom.u.as_uuid.bytes, u.bytes, 16);
-  return 0;
-}
-
-int pn_data_put_binary(pn_data_t *data, pn_bytes_t bytes)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_BINARY;
-  node->atom.u.as_bytes = bytes;
-  return pni_data_intern_node(data, node);
-}
-
-int pn_data_put_string(pn_data_t *data, pn_bytes_t string)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_STRING;
-  node->atom.u.as_bytes = string;
-  return pni_data_intern_node(data, node);
-}
-
-int pn_data_put_symbol(pn_data_t *data, pn_bytes_t symbol)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom.type = PN_SYMBOL;
-  node->atom.u.as_bytes = symbol;
-  return pni_data_intern_node(data, node);
-}
-
-int pn_data_put_atom(pn_data_t *data, pn_atom_t atom)
-{
-  pni_node_t *node = pni_data_add(data);
-  if (node == NULL) return PN_OUT_OF_MEMORY;
-  node->atom = atom;
-  return pni_data_intern_node(data, node);
-}
-
-size_t pn_data_get_list(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_LIST) {
-    return node->children;
-  } else {
-    return 0;
-  }
-}
-
-size_t pn_data_get_map(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_MAP) {
-    return node->children;
-  } else {
-    return 0;
-  }
-}
-
-size_t pn_data_get_array(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_ARRAY) {
-    if (node->described) {
-      return node->children - 1;
-    } else {
-      return node->children;
-    }
-  } else {
-    return 0;
-  }
-}
-
-bool pn_data_is_array_described(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_ARRAY) {
-    return node->described;
-  } else {
-    return false;
-  }
-}
-
-pn_type_t pn_data_get_array_type(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_ARRAY) {
-    return node->type;
-  } else {
-    return PN_INVALID;
-  }
-}
-
-bool pn_data_is_described(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  return node && node->atom.type == PN_DESCRIBED;
-}
-
-bool pn_data_is_null(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  return node && node->atom.type == PN_NULL;
-}
-
-bool pn_data_get_bool(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_BOOL) {
-    return node->atom.u.as_bool;
-  } else {
-    return false;
-  }
-}
-
-uint8_t pn_data_get_ubyte(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_UBYTE) {
-    return node->atom.u.as_ubyte;
-  } else {
-    return 0;
-  }
-}
-
-int8_t pn_data_get_byte(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_BYTE) {
-    return node->atom.u.as_byte;
-  } else {
-    return 0;
-  }
-}
-
-uint16_t pn_data_get_ushort(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_USHORT) {
-    return node->atom.u.as_ushort;
-  } else {
-    return 0;
-  }
-}
-
-int16_t pn_data_get_short(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_SHORT) {
-    return node->atom.u.as_short;
-  } else {
-    return 0;
-  }
-}
-
-uint32_t pn_data_get_uint(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_UINT) {
-    return node->atom.u.as_uint;
-  } else {
-    return 0;
-  }
-}
-
-int32_t pn_data_get_int(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_INT) {
-    return node->atom.u.as_int;
-  } else {
-    return 0;
-  }
-}
-
-pn_char_t pn_data_get_char(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_CHAR) {
-    return node->atom.u.as_char;
-  } else {
-    return 0;
-  }
-}
-
-uint64_t pn_data_get_ulong(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_ULONG) {
-    return node->atom.u.as_ulong;
-  } else {
-    return 0;
-  }
-}
-
-int64_t pn_data_get_long(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_LONG) {
-    return node->atom.u.as_long;
-  } else {
-    return 0;
-  }
-}
-
-pn_timestamp_t pn_data_get_timestamp(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_TIMESTAMP) {
-    return node->atom.u.as_timestamp;
-  } else {
-    return 0;
-  }
-}
-
-float pn_data_get_float(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_FLOAT) {
-    return node->atom.u.as_float;
-  } else {
-    return 0;
-  }
-}
-
-double pn_data_get_double(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_DOUBLE) {
-    return node->atom.u.as_double;
-  } else {
-    return 0;
-  }
-}
-
-pn_decimal32_t pn_data_get_decimal32(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_DECIMAL32) {
-    return node->atom.u.as_decimal32;
-  } else {
-    return 0;
-  }
-}
-
-pn_decimal64_t pn_data_get_decimal64(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_DECIMAL64) {
-    return node->atom.u.as_decimal64;
-  } else {
-    return 0;
-  }
-}
-
-pn_decimal128_t pn_data_get_decimal128(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_DECIMAL128) {
-    return node->atom.u.as_decimal128;
-  } else {
-    pn_decimal128_t t = {{0}};
-    return t;
-  }
-}
-
-pn_uuid_t pn_data_get_uuid(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_UUID) {
-    return node->atom.u.as_uuid;
-  } else {
-    pn_uuid_t t = {{0}};
-    return t;
-  }
-}
-
-pn_bytes_t pn_data_get_binary(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_BINARY) {
-    return node->atom.u.as_bytes;
-  } else {
-    pn_bytes_t t = {0};
-    return t;
-  }
-}
-
-pn_bytes_t pn_data_get_string(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_STRING) {
-    return node->atom.u.as_bytes;
-  } else {
-    pn_bytes_t t = {0};
-    return t;
-  }
-}
-
-pn_bytes_t pn_data_get_symbol(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && node->atom.type == PN_SYMBOL) {
-    return node->atom.u.as_bytes;
-  } else {
-    pn_bytes_t t = {0};
-    return t;
-  }
-}
-
-pn_bytes_t pn_data_get_bytes(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node && (node->atom.type == PN_BINARY ||
-               node->atom.type == PN_STRING ||
-               node->atom.type == PN_SYMBOL)) {
-    return node->atom.u.as_bytes;
-  } else {
-    pn_bytes_t t = {0};
-    return t;
-  }
-}
-
-pn_atom_t pn_data_get_atom(pn_data_t *data)
-{
-  pni_node_t *node = pni_data_current(data);
-  if (node) {
-    return *((pn_atom_t *) &node->atom);
-  } else {
-    pn_atom_t t = {PN_NULL, {0,}};
-    return t;
-  }
-}
-
-int pn_data_copy(pn_data_t *data, pn_data_t *src)
-{
-  pn_data_clear(data);
-  int err = pn_data_append(data, src);
-  pn_data_rewind(data);
-  return err;
-}
-
-int pn_data_append(pn_data_t *data, pn_data_t *src)
-{
-  return pn_data_appendn(data, src, -1);
-}
-
-int pn_data_appendn(pn_data_t *data, pn_data_t *src, int limit)
-{
-  int err = 0;
-  int level = 0, count = 0;
-  bool stop = false;
-  pn_handle_t point = pn_data_point(src);
-  pn_data_rewind(src);
-
-  while (true) {
-    while (!pn_data_next(src)) {
-      if (level > 0) {
-        pn_data_exit(data);
-        pn_data_exit(src);
-        level--;
-        continue;
-      }
-
-      if (!pn_data_next(src)) {
-        stop = true;
-      }
-      break;
-    }
-
-    if (stop) break;
-
-    if (level == 0 && count == limit)
-      break;
-
-    pn_type_t type = pn_data_type(src);
-    switch (type) {
-    case PN_NULL:
-      err = pn_data_put_null(data);
-      if (level == 0) count++;
-      break;
-    case PN_BOOL:
-      err = pn_data_put_bool(data, pn_data_get_bool(src));
-      if (level == 0) count++;
-      break;
-    case PN_UBYTE:
-      err = pn_data_put_ubyte(data, pn_data_get_ubyte(src));
-      if (level == 0) count++;
-      break;
-    case PN_BYTE:
-      err = pn_data_put_byte(data, pn_data_get_byte(src));
-      if (level == 0) count++;
-      break;
-    case PN_USHORT:
-      err = pn_data_put_ushort(data, pn_data_get_ushort(src));
-      if (level == 0) count++;
-      break;
-    case PN_SHORT:
-      err = pn_data_put_short(data, pn_data_get_short(src));
-      if (level == 0) count++;
-      break;
-    case PN_UINT:
-      err = pn_data_put_uint(data, pn_data_get_uint(src));
-      if (level == 0) count++;
-      break;
-    case PN_INT:
-      err = pn_data_put_int(data, pn_data_get_int(src));
-      if (level == 0) count++;
-      break;
-    case PN_CHAR:
-      err = pn_data_put_char(data, pn_data_get_char(src));
-      if (level == 0) count++;
-      break;
-    case PN_ULONG:
-      err = pn_data_put_ulong(data, pn_data_get_ulong(src));
-      if (level == 0) count++;
-      break;
-    case PN_LONG:
-      err = pn_data_put_long(data, pn_data_get_long(src));
-      if (level == 0) count++;
-      break;
-    case PN_TIMESTAMP:
-      err = pn_data_put_timestamp(data, pn_data_get_timestamp(src));
-      if (level == 0) count++;
-      break;
-    case PN_FLOAT:
-      err = pn_data_put_float(data, pn_data_get_float(src));
-      if (level == 0) count++;
-      break;
-    case PN_DOUBLE:
-      err = pn_data_put_double(data, pn_data_get_double(src));
-      if (level == 0) count++;
-      break;
-    case PN_DECIMAL32:
-      err = pn_data_put_decimal32(data, pn_data_get_decimal32(src));
-      if (level == 0) count++;
-      break;
-    case PN_DECIMAL64:
-      err = pn_data_put_decimal64(data, pn_data_get_decimal64(src));
-      if (level == 0) count++;
-      break;
-    case PN_DECIMAL128:
-      err = pn_data_put_decimal128(data, pn_data_get_decimal128(src));
-      if (level == 0) count++;
-      break;
-    case PN_UUID:
-      err = pn_data_put_uuid(data, pn_data_get_uuid(src));
-      if (level == 0) count++;
-      break;
-    case PN_BINARY:
-      err = pn_data_put_binary(data, pn_data_get_binary(src));
-      if (level == 0) count++;
-      break;
-    case PN_STRING:
-      err = pn_data_put_string(data, pn_data_get_string(src));
-      if (level == 0) count++;
-      break;
-    case PN_SYMBOL:
-      err = pn_data_put_symbol(data, pn_data_get_symbol(src));
-      if (level == 0) count++;
-      break;
-    case PN_DESCRIBED:
-      err = pn_data_put_described(data);
-      if (level == 0) count++;
-      if (err) { pn_data_restore(src, point); return err; }
-      pn_data_enter(data);
-      pn_data_enter(src);
-      level++;
-      break;
-    case PN_ARRAY:
-      err = pn_data_put_array(data, pn_data_is_array_described(src),
-                              pn_data_get_array_type(src));
-      if (level == 0) count++;
-      if (err) { pn_data_restore(src, point); return err; }
-      pn_data_enter(data);
-      pn_data_enter(src);
-      level++;
-      break;
-    case PN_LIST:
-      err = pn_data_put_list(data);
-      if (level == 0) count++;
-      if (err) { pn_data_restore(src, point); return err; }
-      pn_data_enter(data);
-      pn_data_enter(src);
-      level++;
-      break;
-    case PN_MAP:
-      err = pn_data_put_map(data);
-      if (level == 0) count++;
-      if (err) { pn_data_restore(src, point); return err; }
-      pn_data_enter(data);
-      pn_data_enter(src);
-      level++;
-      break;
-    default:
-      break;
-    }
-
-    if (err) { pn_data_restore(src, point); return err; }
-  }
-
-  pn_data_restore(src, point);
-
-  return 0;
-}
diff --git a/proton-c/src/core/config.h b/proton-c/src/core/config.h
deleted file mode 100644
index 5a2e7bc..0000000
--- a/proton-c/src/core/config.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*   http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied.  See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*
-*/
-
-#ifndef  _PROTON_SRC_CONFIG_H 
-#define  _PROTON_SRC_CONFIG_H 
-
-#ifndef PN_TRANSPORT_INITIAL_FRAME_SIZE
-# define PN_TRANSPORT_INITIAL_FRAME_SIZE (512) /* bytes */
-#endif
-
-#ifndef PN_SASL_MAX_BUFFSIZE
-# define PN_SASL_MAX_BUFFSIZE (32768) /* bytes */
-#endif
-
-#endif /*  _PROTON_SRC_CONFIG_H */
diff --git a/proton-c/src/core/connection_driver.c b/proton-c/src/core/connection_driver.c
deleted file mode 100644
index 3393e64..0000000
--- a/proton-c/src/core/connection_driver.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "engine-internal.h"
-#include <proton/condition.h>
-#include <proton/connection.h>
-#include <proton/connection_driver.h>
-#include <proton/transport.h>
-#include <string.h>
-
-struct driver_batch {
-  pn_event_batch_t batch;
-};
-
-static pn_event_t *batch_next(pn_event_batch_t *batch) {
-  pn_connection_driver_t *d =
-    (pn_connection_driver_t*)((char*)batch - offsetof(pn_connection_driver_t, batch));
-  pn_collector_t *collector = pn_connection_collector(d->connection);
-  pn_event_t *handled = pn_collector_prev(collector);
-  if (handled && pn_event_type(handled) == PN_CONNECTION_INIT) {
-      pn_transport_bind(d->transport, d->connection); /* Init event handled, auto-bind */
-  }
-  pn_event_t *next = pn_collector_next(collector);
-  if (next && d->transport->trace & PN_TRACE_EVT) {
-    pn_string_clear(d->transport->scratch);
-    pn_inspect(next, d->transport->scratch);
-    pn_transport_log(d->transport, pn_string_get(d->transport->scratch));
-  }
-  return next;
-}
-
-int pn_connection_driver_init(pn_connection_driver_t* d, pn_connection_t *c, pn_transport_t *t) {
-  memset(d, 0, sizeof(*d));
-  d->batch.next_event = &batch_next;
-  d->connection = c ? c : pn_connection();
-  d->transport = t ? t : pn_transport();
-  pn_collector_t *collector = pn_collector();
-  if (!d->connection || !d->transport || !collector) {
-    if (collector) pn_collector_free(collector);
-    pn_connection_driver_destroy(d);
-    return PN_OUT_OF_MEMORY;
-  }
-  pn_connection_collect(d->connection, collector);
-  return 0;
-}
-
-int pn_connection_driver_bind(pn_connection_driver_t *d) {
-  return pn_transport_bind(d->transport, d->connection);
-}
-
-void pn_connection_driver_destroy(pn_connection_driver_t *d) {
-  if (d->transport) {
-    pn_transport_unbind(d->transport);
-    pn_transport_free(d->transport);
-  }
-  if (d->connection) {
-    pn_collector_t *collector = pn_connection_collector(d->connection);
-    pn_connection_free(d->connection);
-    pn_collector_free(collector);
-  }
-  memset(d, 0, sizeof(*d));
-}
-
-pn_rwbytes_t pn_connection_driver_read_buffer(pn_connection_driver_t *d) {
-  ssize_t cap = pn_transport_capacity(d->transport);
-  return (cap > 0) ?  pn_rwbytes(cap, pn_transport_tail(d->transport)) : pn_rwbytes(0, 0);
-}
-
-void pn_connection_driver_read_done(pn_connection_driver_t *d, size_t n) {
-  if (n > 0) pn_transport_process(d->transport, n);
-}
-
-bool pn_connection_driver_read_closed(pn_connection_driver_t *d) {
-  return pn_transport_capacity(d->transport) < 0;
-}
-
-void pn_connection_driver_read_close(pn_connection_driver_t *d) {
-  if (!pn_connection_driver_read_closed(d)) {
-    pn_transport_close_tail(d->transport);
-  }
-}
-
-pn_bytes_t pn_connection_driver_write_buffer(pn_connection_driver_t *d) {
-  ssize_t pending = pn_transport_pending(d->transport);
-  return (pending > 0) ?
-    pn_bytes(pending, pn_transport_head(d->transport)) : pn_bytes_null;
-}
-
-void pn_connection_driver_write_done(pn_connection_driver_t *d, size_t n) {
-  if (n > 0)
-    pn_transport_pop(d->transport, n);
-}
-
-bool pn_connection_driver_write_closed(pn_connection_driver_t *d) {
-  return pn_transport_pending(d->transport) < 0;
-}
-
-void pn_connection_driver_write_close(pn_connection_driver_t *d) {
-  if (!pn_connection_driver_write_closed(d)) {
-    pn_transport_close_head(d->transport);
-  }
-}
-
-void pn_connection_driver_close(pn_connection_driver_t *d) {
-  pn_connection_driver_read_close(d);
-  pn_connection_driver_write_close(d);
-}
-
-pn_event_t* pn_connection_driver_next_event(pn_connection_driver_t *d) {
-  return pn_event_batch_next(&d->batch);
-}
-
-bool pn_connection_driver_has_event(pn_connection_driver_t *d) {
-  return pn_collector_peek(pn_connection_collector(d->connection));
-}
-
-bool pn_connection_driver_finished(pn_connection_driver_t *d) {
-  return pn_transport_closed(d->transport) && !pn_connection_driver_has_event(d);
-}
-
-void pn_connection_driver_verrorf(pn_connection_driver_t *d, const char *name, const char *fmt, va_list ap) {
-  pn_transport_t *t = d->transport;
-  pn_condition_t *cond = pn_transport_condition(t);
-  pn_string_vformat(t->scratch, fmt, ap);
-  pn_condition_set_name(cond, name);
-  pn_condition_set_description(cond, pn_string_get(t->scratch));
-}
-
-void pn_connection_driver_errorf(pn_connection_driver_t *d, const char *name, const char *fmt, ...) {
-  va_list ap;
-  va_start(ap, fmt);
-  pn_connection_driver_verrorf(d, name, fmt, ap);
-  va_end(ap);
-}
-
-void pn_connection_driver_log(pn_connection_driver_t *d, const char *msg) {
-  pn_transport_log(d->transport, msg);
-}
-
-void pn_connection_driver_vlogf(pn_connection_driver_t *d, const char *fmt, va_list ap) {
-  pn_transport_vlogf(d->transport, fmt, ap);
-}
-
-void pn_connection_driver_vlog(pn_connection_driver_t *d, const char *msg) {
-  pn_transport_log(d->transport, msg);
-}
-
-pn_connection_driver_t* pn_event_batch_connection_driver(pn_event_batch_t *batch) {
-  return (batch->next_event == batch_next) ?
-    (pn_connection_driver_t*)((char*)batch - offsetof(pn_connection_driver_t, batch)) :
-    NULL;
-}
diff --git a/proton-c/src/core/data.h b/proton-c/src/core/data.h
deleted file mode 100644
index 94dc7d6..0000000
--- a/proton-c/src/core/data.h
+++ /dev/null
@@ -1,75 +0,0 @@
-#ifndef _PROTON_DATA_H
-#define _PROTON_DATA_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/codec.h>
-#include "buffer.h"
-#include "decoder.h"
-#include "encoder.h"
-
-typedef uint16_t pni_nid_t;
-#define PNI_NID_MAX ((pni_nid_t)-1)
-
-typedef struct {
-  char *start;
-  size_t data_offset;
-  size_t data_size;
-  pn_atom_t atom;
-  pn_type_t type;
-  pni_nid_t next;
-  pni_nid_t prev;
-  pni_nid_t down;
-  pni_nid_t parent;
-  pni_nid_t children;
-  // for arrays
-  bool described;
-  bool data;
-  bool small;
-} pni_node_t;
-
-struct pn_data_t {
-  pni_node_t *nodes;
-  pn_buffer_t *buf;
-  pn_decoder_t *decoder;
-  pn_encoder_t *encoder;
-  pn_error_t *error;
-  pn_string_t *str;
-  pni_nid_t capacity;
-  pni_nid_t size;
-  pni_nid_t parent;
-  pni_nid_t current;
-  pni_nid_t base_parent;
-  pni_nid_t base_current;
-};
-
-static inline pni_node_t * pn_data_node(pn_data_t *data, pni_nid_t nd) 
-{
-  return nd ? (data->nodes + nd - 1) : NULL;
-}
-
-int pni_data_traverse(pn_data_t *data,
-                      int (*enter)(void *ctx, pn_data_t *data, pni_node_t *node),
-                      int (*exit)(void *ctx, pn_data_t *data, pni_node_t *node),
-                      void *ctx);
-
-#endif /* data.h */
diff --git a/proton-c/src/core/decoder.c b/proton-c/src/core/decoder.c
deleted file mode 100644
index b0c8d79..0000000
--- a/proton-c/src/core/decoder.c
+++ /dev/null
@@ -1,497 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/error.h>
-#include <proton/object.h>
-#include <proton/codec.h>
-#include "encodings.h"
-#include "decoder.h"
-
-#include <string.h>
-
-struct pn_decoder_t {
-  const char *input;
-  size_t size;
-  const char *position;
-  pn_error_t *error;
-};
-
-static void pn_decoder_initialize(void *obj)
-{
-  pn_decoder_t *decoder = (pn_decoder_t *) obj;
-  decoder->input = NULL;
-  decoder->size = 0;
-  decoder->position = NULL;
-  decoder->error = pn_error();
-}
-
-static void pn_decoder_finalize(void *obj) {
-  pn_decoder_t *decoder = (pn_decoder_t *) obj;
-  pn_error_free(decoder->error);
-}
-
-#define pn_decoder_hashcode NULL
-#define pn_decoder_compare NULL
-#define pn_decoder_inspect NULL
-
-pn_decoder_t *pn_decoder()
-{
-  static const pn_class_t clazz = PN_CLASS(pn_decoder);
-  return (pn_decoder_t *) pn_class_new(&clazz, sizeof(pn_decoder_t));
-}
-
-static inline uint8_t pn_decoder_readf8(pn_decoder_t *decoder)
-{
-  uint8_t r = decoder->position[0];
-  decoder->position++;
-  return r;
-}
-
-static inline uint16_t pn_decoder_readf16(pn_decoder_t *decoder)
-{
-  uint16_t a = (uint8_t) decoder->position[0];
-  uint16_t b = (uint8_t) decoder->position[1];
-  uint16_t r = a << 8
-    | b;
-  decoder->position += 2;
-  return r;
-}
-
-static inline uint32_t pn_decoder_readf32(pn_decoder_t *decoder)
-{
-  uint32_t a = (uint8_t) decoder->position[0];
-  uint32_t b = (uint8_t) decoder->position[1];
-  uint32_t c = (uint8_t) decoder->position[2];
-  uint32_t d = (uint8_t) decoder->position[3];
-  uint32_t r = a << 24
-    | b << 16
-    | c <<  8
-    | d;
-  decoder->position += 4;
-  return r;
-}
-
-static inline uint64_t pn_decoder_readf64(pn_decoder_t *decoder)
-{
-  uint64_t a = pn_decoder_readf32(decoder);
-  uint64_t b = pn_decoder_readf32(decoder);
-  return a << 32 | b;
-}
-
-static inline void pn_decoder_readf128(pn_decoder_t *decoder, void *dst)
-{
-  memmove(dst, decoder->position, 16);
-  decoder->position += 16;
-}
-
-static inline size_t pn_decoder_remaining(pn_decoder_t *decoder)
-{
-  return decoder->input + decoder->size - decoder->position;
-}
-
-typedef union {
-  uint32_t i;
-  uint32_t a[2];
-  uint64_t l;
-  float f;
-  double d;
-} conv_t;
-
-static inline pn_type_t pn_code2type(uint8_t code)
-{
-  switch (code)
-  {
-  case PNE_DESCRIPTOR:
-    return (pn_type_t) PN_ARG_ERR;
-  case PNE_NULL:
-    return PN_NULL;
-  case PNE_TRUE:
-  case PNE_FALSE:
-  case PNE_BOOLEAN:
-    return PN_BOOL;
-  case PNE_UBYTE:
-    return PN_UBYTE;
-  case PNE_BYTE:
-    return PN_BYTE;
-  case PNE_USHORT:
-    return PN_USHORT;
-  case PNE_SHORT:
-    return PN_SHORT;
-  case PNE_UINT0:
-  case PNE_SMALLUINT:
-  case PNE_UINT:
-    return PN_UINT;
-  case PNE_SMALLINT:
-  case PNE_INT:
-    return PN_INT;
-  case PNE_UTF32:
-    return PN_CHAR;
-  case PNE_FLOAT:
-    return PN_FLOAT;
-  case PNE_LONG:
-  case PNE_SMALLLONG:
-    return PN_LONG;
-  case PNE_MS64:
-    return PN_TIMESTAMP;
-  case PNE_DOUBLE:
-    return PN_DOUBLE;
-  case PNE_DECIMAL32:
-    return PN_DECIMAL32;
-  case PNE_DECIMAL64:
-    return PN_DECIMAL64;
-  case PNE_DECIMAL128:
-    return PN_DECIMAL128;
-  case PNE_UUID:
-    return PN_UUID;
-  case PNE_ULONG0:
-  case PNE_SMALLULONG:
-  case PNE_ULONG:
-    return PN_ULONG;
-  case PNE_VBIN8:
-  case PNE_VBIN32:
-    return PN_BINARY;
-  case PNE_STR8_UTF8:
-  case PNE_STR32_UTF8:
-    return PN_STRING;
-  case PNE_SYM8:
-  case PNE_SYM32:
-    return PN_SYMBOL;
-  case PNE_LIST0:
-  case PNE_LIST8:
-  case PNE_LIST32:
-    return PN_LIST;
-  case PNE_ARRAY8:
-  case PNE_ARRAY32:
-    return PN_ARRAY;
-  case PNE_MAP8:
-  case PNE_MAP32:
-    return PN_MAP;
-  default:
-    return (pn_type_t) PN_ARG_ERR;
-  }
-}
-
-static int pni_decoder_decode_type(pn_decoder_t *decoder, pn_data_t *data, uint8_t *code);
-static int pni_decoder_single(pn_decoder_t *decoder, pn_data_t *data);
-void pni_data_set_array_type(pn_data_t *data, pn_type_t type);
-
-static int pni_decoder_decode_value(pn_decoder_t *decoder, pn_data_t *data, uint8_t code)
-{
-  int err;
-  conv_t conv;
-  pn_decimal128_t dec128;
-  pn_uuid_t uuid;
-  size_t size;
-  size_t count;
-
-  switch (code)
-  {
-  case PNE_NULL:
-    err = pn_data_put_null(data);
-    break;
-  case PNE_TRUE:
-    err = pn_data_put_bool(data, true);
-    break;
-  case PNE_FALSE:
-    err = pn_data_put_bool(data, false);
-    break;
-  case PNE_BOOLEAN:
-    if (!pn_decoder_remaining(decoder)) return PN_UNDERFLOW;
-    err = pn_data_put_bool(data, pn_decoder_readf8(decoder) != 0);
-    break;
-  case PNE_UBYTE:
-    if (!pn_decoder_remaining(decoder)) return PN_UNDERFLOW;
-    err = pn_data_put_ubyte(data, pn_decoder_readf8(decoder));
-    break;
-  case PNE_BYTE:
-    if (!pn_decoder_remaining(decoder)) return PN_UNDERFLOW;
-    err = pn_data_put_byte(data, pn_decoder_readf8(decoder));
-    break;
-  case PNE_USHORT:
-    if (pn_decoder_remaining(decoder) < 2) return PN_UNDERFLOW;
-    err = pn_data_put_ushort(data, pn_decoder_readf16(decoder));
-    break;
-  case PNE_SHORT:
-    if (pn_decoder_remaining(decoder) < 2) return PN_UNDERFLOW;
-    err = pn_data_put_short(data, pn_decoder_readf16(decoder));
-    break;
-  case PNE_UINT:
-    if (pn_decoder_remaining(decoder) < 4) return PN_UNDERFLOW;
-    err = pn_data_put_uint(data, pn_decoder_readf32(decoder));
-    break;
-  case PNE_UINT0:
-    err = pn_data_put_uint(data, 0);
-    break;
-  case PNE_SMALLUINT:
-    if (!pn_decoder_remaining(decoder)) return PN_UNDERFLOW;
-    err = pn_data_put_uint(data, pn_decoder_readf8(decoder));
-    break;
-  case PNE_SMALLINT:
-    if (!pn_decoder_remaining(decoder)) return PN_UNDERFLOW;
-    err = pn_data_put_int(data, (int8_t)pn_decoder_readf8(decoder));
-    break;
-  case PNE_INT:
-    if (pn_decoder_remaining(decoder) < 4) return PN_UNDERFLOW;
-    err = pn_data_put_int(data, pn_decoder_readf32(decoder));
-    break;
-  case PNE_UTF32:
-    if (pn_decoder_remaining(decoder) < 4) return PN_UNDERFLOW;
-    err = pn_data_put_char(data, pn_decoder_readf32(decoder));
-    break;
-  case PNE_FLOAT:
-    if (pn_decoder_remaining(decoder) < 4) return PN_UNDERFLOW;
-    // XXX: this assumes the platform uses IEEE floats
-    conv.i = pn_decoder_readf32(decoder);
-    err = pn_data_put_float(data, conv.f);
-    break;
-  case PNE_DECIMAL32:
-    if (pn_decoder_remaining(decoder) < 4) return PN_UNDERFLOW;
-    err = pn_data_put_decimal32(data, pn_decoder_readf32(decoder));
-    break;
-  case PNE_ULONG:
-    if (pn_decoder_remaining(decoder) < 8) return PN_UNDERFLOW;
-    err = pn_data_put_ulong(data, pn_decoder_readf64(decoder));
-    break;
-  case PNE_LONG:
-    if (pn_decoder_remaining(decoder) < 8) return PN_UNDERFLOW;
-    err = pn_data_put_long(data, pn_decoder_readf64(decoder));
-    break;
-  case PNE_MS64:
-    if (pn_decoder_remaining(decoder) < 8) return PN_UNDERFLOW;
-    err = pn_data_put_timestamp(data, pn_decoder_readf64(decoder));
-    break;
-  case PNE_DOUBLE:
-    // XXX: this assumes the platform uses IEEE floats
-    if (pn_decoder_remaining(decoder) < 8) return PN_UNDERFLOW;
-    conv.l = pn_decoder_readf64(decoder);
-    err = pn_data_put_double(data, conv.d);
-    break;
-  case PNE_DECIMAL64:
-    if (pn_decoder_remaining(decoder) < 8) return PN_UNDERFLOW;
-    err = pn_data_put_decimal64(data, pn_decoder_readf64(decoder));
-    break;
-  case PNE_ULONG0:
-    err = pn_data_put_ulong(data, 0);
-    break;
-  case PNE_SMALLULONG:
-    if (!pn_decoder_remaining(decoder)) return PN_UNDERFLOW;
-    err = pn_data_put_ulong(data, pn_decoder_readf8(decoder));
-    break;
-  case PNE_SMALLLONG:
-    if (!pn_decoder_remaining(decoder)) return PN_UNDERFLOW;
-    err = pn_data_put_long(data, (int8_t)pn_decoder_readf8(decoder));
-    break;
-  case PNE_DECIMAL128:
-    if (pn_decoder_remaining(decoder) < 16) return PN_UNDERFLOW;
-    pn_decoder_readf128(decoder, &dec128);
-    err = pn_data_put_decimal128(data, dec128);
-    break;
-  case PNE_UUID:
-    if (pn_decoder_remaining(decoder) < 16) return PN_UNDERFLOW;
-    pn_decoder_readf128(decoder, &uuid);
-    err = pn_data_put_uuid(data, uuid);
-    break;
-  case PNE_VBIN8:
-  case PNE_STR8_UTF8:
-  case PNE_SYM8:
-  case PNE_VBIN32:
-  case PNE_STR32_UTF8:
-  case PNE_SYM32:
-    switch (code & 0xF0)
-    {
-    case 0xA0:
-      if (!pn_decoder_remaining(decoder)) return PN_UNDERFLOW;
-      size = pn_decoder_readf8(decoder);
-      break;
-    case 0xB0:
-      if (pn_decoder_remaining(decoder) < 4) return PN_UNDERFLOW;
-      size = pn_decoder_readf32(decoder);
-      break;
-    default:
-      return PN_ARG_ERR;
-    }
-
-    if (pn_decoder_remaining(decoder) < size) return PN_UNDERFLOW;
-
-    {
-      char *start = (char *) decoder->position;
-      pn_bytes_t bytes = {size, start};
-      switch (code & 0x0F)
-      {
-      case 0x0:
-        err = pn_data_put_binary(data, bytes);
-        break;
-      case 0x1:
-        err = pn_data_put_string(data, bytes);
-        break;
-      case 0x3:
-        err = pn_data_put_symbol(data, bytes);
-        break;
-      default:
-        return PN_ARG_ERR;
-      }
-    }
-
-    decoder->position += size;
-    break;
-  case PNE_LIST0:
-    err = pn_data_put_list(data);
-    break;
-  case PNE_ARRAY8:
-  case PNE_ARRAY32:
-  case PNE_LIST8:
-  case PNE_LIST32:
-  case PNE_MAP8:
-  case PNE_MAP32:
-    switch (code)
-    {
-    case PNE_ARRAY8:
-    case PNE_LIST8:
-    case PNE_MAP8:
-      if (pn_decoder_remaining(decoder) < 2) return PN_UNDERFLOW;
-      size = pn_decoder_readf8(decoder);
-      count = pn_decoder_readf8(decoder);
-      break;
-    case PNE_ARRAY32:
-    case PNE_LIST32:
-    case PNE_MAP32:
-      size = pn_decoder_readf32(decoder);
-      count = pn_decoder_readf32(decoder);
-      break;
-    default:
-      return PN_ARG_ERR;
-    }
-
-    switch (code)
-    {
-    case PNE_ARRAY8:
-    case PNE_ARRAY32:
-      {
-        uint8_t next = *decoder->position;
-        bool described = (next == PNE_DESCRIPTOR);
-        err = pn_data_put_array(data, described, (pn_type_t) 0);
-        if (err) return err;
-
-        pn_data_enter(data);
-        uint8_t acode;
-        int e = pni_decoder_decode_type(decoder, data, &acode);
-        if (e) return e;
-        pn_type_t type = pn_code2type(acode);
-        if ((int)type < 0) return (int)type;
-        for (size_t i = 0; i < count; i++)
-        {
-          e = pni_decoder_decode_value(decoder, data, acode);
-          if (e) return e;
-        }
-        pn_data_exit(data);
-
-        pni_data_set_array_type(data, type);
-      }
-      return 0;
-    case PNE_LIST8:
-    case PNE_LIST32:
-      err = pn_data_put_list(data);
-      if (err) return err;
-      break;
-    case PNE_MAP8:
-    case PNE_MAP32:
-      err = pn_data_put_map(data);
-      if (err) return err;
-      break;
-    default:
-      return PN_ARG_ERR;
-    }
-
-    pn_data_enter(data);
-    for (size_t i = 0; i < count; i++)
-    {
-      int e = pni_decoder_single(decoder, data);
-      if (e) return e;
-    }
-    pn_data_exit(data);
-
-    return 0;
-  default:
-    return pn_error_format(decoder->error, PN_ARG_ERR, "unrecognized typecode: %u", code);
-  }
-
-  return err;
-}
-
-pn_type_t pni_data_parent_type(pn_data_t *data);
-
-static int pni_decoder_decode_type(pn_decoder_t *decoder, pn_data_t *data, uint8_t *code)
-{
-  int err;
-
-  if (!pn_decoder_remaining(decoder)) {
-    return PN_UNDERFLOW;
-  }
-
-  uint8_t next = *decoder->position++;
-
-  if (next == PNE_DESCRIPTOR) {
-    if (pni_data_parent_type(data) != PN_ARRAY) {
-      err = pn_data_put_described(data);
-      if (err) return err;
-      // pni_decoder_single has the corresponding exit
-      pn_data_enter(data);
-    }
-    err = pni_decoder_single(decoder, data);
-    if (err) return err;
-    err = pni_decoder_decode_type(decoder, data, code);
-    if (err) return err;
-  } else {
-    *code = next;
-  }
-
-  return 0;
-}
-
-size_t pn_data_siblings(pn_data_t *data);
-
-int pni_decoder_single(pn_decoder_t *decoder, pn_data_t *data)
-{
-  uint8_t code;
-  int err = pni_decoder_decode_type(decoder, data, &code);
-  if (err) return err;
-  err = pni_decoder_decode_value(decoder, data, code);
-  if (err) return err;
-  if (pni_data_parent_type(data) == PN_DESCRIBED && pn_data_siblings(data) > 1) {
-    pn_data_exit(data);
-  }
-  return 0;
-}
-
-ssize_t pn_decoder_decode(pn_decoder_t *decoder, const char *src, size_t size, pn_data_t *dst)
-{
-  decoder->input = src;
-  decoder->size = size;
-  decoder->position = src;
-
-  int err = pni_decoder_single(decoder, dst);
-
-  if (err == PN_UNDERFLOW) 
-      return pn_error_format(pn_data_error(dst), PN_UNDERFLOW, "not enough data to decode");
-  if (err) return err;
-
-  return decoder->position - decoder->input;
-}
diff --git a/proton-c/src/core/decoder.h b/proton-c/src/core/decoder.h
deleted file mode 100644
index b7de898..0000000
--- a/proton-c/src/core/decoder.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef _PROTON_DECODER_H
-#define _PROTON_DECODER_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-typedef struct pn_decoder_t pn_decoder_t;
-
-pn_decoder_t *pn_decoder(void);
-ssize_t pn_decoder_decode(pn_decoder_t *decoder, const char *src, size_t size, pn_data_t *dst);
-
-#endif /* decoder.h */
diff --git a/proton-c/src/core/dispatch_actions.h b/proton-c/src/core/dispatch_actions.h
deleted file mode 100644
index ea2d8b2..0000000
--- a/proton-c/src/core/dispatch_actions.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef _PROTON_DISPATCH_ACTIONS_H
-#define _PROTON_DISPATCH_ACTIONS_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "dispatcher.h"
-
-#define AMQP_FRAME_TYPE (0)
-#define SASL_FRAME_TYPE (1)
-
-
-/* AMQP actions */
-int pn_do_open(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload);
-int pn_do_begin(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload);
-int pn_do_attach(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload);
-int pn_do_transfer(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload);
-int pn_do_flow(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload);
-int pn_do_disposition(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload);
-int pn_do_detach(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload);
-int pn_do_end(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload);
-int pn_do_close(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload);
-
-/* SASL actions */
-int pn_do_init(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload);
-int pn_do_mechanisms(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload);
-int pn_do_challenge(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload);
-int pn_do_response(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload);
-int pn_do_outcome(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload);
-
-#endif // _PROTON_DISPATCH_ACTIONS_H
diff --git a/proton-c/src/core/dispatcher.c b/proton-c/src/core/dispatcher.c
deleted file mode 100644
index 36f8cc9..0000000
--- a/proton-c/src/core/dispatcher.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "dispatcher.h"
-
-#include "framing.h"
-#include "protocol.h"
-#include "engine-internal.h"
-
-#include "dispatch_actions.h"
-
-int pni_bad_frame(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload) {
-  pn_transport_logf(transport, "Error dispatching frame: type: %d: Unknown performative", frame_type);
-  return PN_ERR;
-}
-
-int pni_bad_frame_type(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload) {
-    pn_transport_logf(transport, "Error dispatching frame: Unknown frame type: %d", frame_type);
-    return PN_ERR;
-}
-
-// We could use a table based approach here if we needed to dynamically
-// add new performatives
-static inline int pni_dispatch_action(pn_transport_t* transport, uint64_t lcode, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload)
-{
-  pn_action_t *action;
-  switch (frame_type) {
-  case AMQP_FRAME_TYPE:
-    /* Regular AMQP fames */
-    switch (lcode) {
-    case OPEN:            action = pn_do_open; break;
-    case BEGIN:           action = pn_do_begin; break;
-    case ATTACH:          action = pn_do_attach; break;
-    case FLOW:            action = pn_do_flow; break;
-    case TRANSFER:        action = pn_do_transfer; break;
-    case DISPOSITION:     action = pn_do_disposition; break;
-    case DETACH:          action = pn_do_detach; break;
-    case END:             action = pn_do_end; break;
-    case CLOSE:           action = pn_do_close; break;
-    default:              action = pni_bad_frame; break;
-    };
-    break;
-  case SASL_FRAME_TYPE:
-    /* SASL frames */
-    switch (lcode) {
-    case SASL_MECHANISMS: action = pn_do_mechanisms; break;
-    case SASL_INIT:       action = pn_do_init; break;
-    case SASL_CHALLENGE:  action = pn_do_challenge; break;
-    case SASL_RESPONSE:   action = pn_do_response; break;
-    case SASL_OUTCOME:    action = pn_do_outcome; break;
-    default:              action = pni_bad_frame; break;
-    };
-    break;
-  default:              action = pni_bad_frame_type; break;
-  };
-  return action(transport, frame_type, channel, args, payload);
-}
-
-static int pni_dispatch_frame(pn_transport_t * transport, pn_data_t *args, pn_frame_t frame)
-{
-  if (frame.size == 0) { // ignore null frames
-    if (transport->trace & PN_TRACE_FRM)
-      pn_transport_logf(transport, "%u <- (EMPTY FRAME)", frame.channel);
-    return 0;
-  }
-
-  ssize_t dsize = pn_data_decode(args, frame.payload, frame.size);
-  if (dsize < 0) {
-    pn_string_format(transport->scratch,
-                     "Error decoding frame: %s %s\n", pn_code(dsize),
-                     pn_error_text(pn_data_error(args)));
-    pn_quote(transport->scratch, frame.payload, frame.size);
-    pn_transport_log(transport, pn_string_get(transport->scratch));
-    return dsize;
-  }
-
-  uint8_t frame_type = frame.type;
-  uint16_t channel = frame.channel;
-  // XXX: assuming numeric -
-  // if we get a symbol we should map it to the numeric value and dispatch on that
-  uint64_t lcode;
-  bool scanned;
-  int e = pn_data_scan(args, "D?L.", &scanned, &lcode);
-  if (e) {
-    pn_transport_log(transport, "Scan error");
-    return e;
-  }
-  if (!scanned) {
-    pn_transport_log(transport, "Error dispatching frame");
-    return PN_ERR;
-  }
-  size_t payload_size = frame.size - dsize;
-  const char *payload_mem = payload_size ? frame.payload + dsize : NULL;
-  pn_bytes_t payload = {payload_size, payload_mem};
-
-  pn_do_trace(transport, channel, IN, args, payload_mem, payload_size);
-
-  int err = pni_dispatch_action(transport, lcode, frame_type, channel, args, &payload);
-
-  pn_data_clear(args);
-
-  return err;
-}
-
-ssize_t pn_dispatcher_input(pn_transport_t *transport, const char *bytes, size_t available, bool batch, bool *halt)
-{
-  size_t read = 0;
-
-  while (available && !*halt) {
-    pn_frame_t frame;
-
-    ssize_t n = pn_read_frame(&frame, bytes + read, available, transport->local_max_frame);
-    if (n > 0) {
-      read += n;
-      available -= n;
-      transport->input_frames_ct += 1;
-      int e = pni_dispatch_frame(transport, transport->args, frame);
-      if (e) return e;
-    } else if (n < 0) {
-      pn_do_error(transport, "amqp:connection:framing-error", "malformed frame");
-      return n;
-    } else {
-      break;
-    }
-
-    if (!batch) break;
-  }
-
-  return read;
-}
-
-ssize_t pn_dispatcher_output(pn_transport_t *transport, char *bytes, size_t size)
-{
-    int n = transport->available < size ? transport->available : size;
-    memmove(bytes, transport->output, n);
-    memmove(transport->output, transport->output + n, transport->available - n);
-    transport->available -= n;
-    // XXX: need to check for errors
-    return n;
-}
diff --git a/proton-c/src/core/dispatcher.h b/proton-c/src/core/dispatcher.h
deleted file mode 100644
index 29881b5..0000000
--- a/proton-c/src/core/dispatcher.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef _PROTON_DISPATCHER_H
-#define _PROTON_DISPATCHER_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#ifndef __cplusplus
-#include <stdbool.h>
-#endif
-
-#include "proton/codec.h"
-#include "proton/types.h"
-
-typedef int (pn_action_t)(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload);
-
-ssize_t pn_dispatcher_input(pn_transport_t* transport, const char* bytes, size_t available, bool batch, bool* halt);
-ssize_t pn_dispatcher_output(pn_transport_t *transport, char *bytes, size_t size);
-
-#endif /* dispatcher.h */
diff --git a/proton-c/src/core/encoder.c b/proton-c/src/core/encoder.c
deleted file mode 100644
index f8145fc..0000000
--- a/proton-c/src/core/encoder.c
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/error.h>
-#include <proton/object.h>
-#include <proton/codec.h>
-#include "encodings.h"
-#include "encoder.h"
-
-#include <string.h>
-
-#include "data.h"
-
-struct pn_encoder_t {
-  char *output;
-  size_t size;
-  char *position;
-  pn_error_t *error;
-};
-
-static void pn_encoder_initialize(void *obj)
-{
-  pn_encoder_t *encoder = (pn_encoder_t *) obj;
-  encoder->output = NULL;
-  encoder->size = 0;
-  encoder->position = NULL;
-  encoder->error = pn_error();
-}
-
-static void pn_encoder_finalize(void *obj) {
-  pn_encoder_t *encoder = (pn_encoder_t *) obj;
-  pn_error_free(encoder->error);
-}
-
-#define pn_encoder_hashcode NULL
-#define pn_encoder_compare NULL
-#define pn_encoder_inspect NULL
-
-pn_encoder_t *pn_encoder()
-{
-  static const pn_class_t clazz = PN_CLASS(pn_encoder);
-  return (pn_encoder_t *) pn_class_new(&clazz, sizeof(pn_encoder_t));
-}
-
-static uint8_t pn_type2code(pn_encoder_t *encoder, pn_type_t type)
-{
-  switch (type)
-  {
-  case PN_NULL: return PNE_NULL;
-  case PN_BOOL: return PNE_BOOLEAN;
-  case PN_UBYTE: return PNE_UBYTE;
-  case PN_BYTE: return PNE_BYTE;
-  case PN_USHORT: return PNE_USHORT;
-  case PN_SHORT: return PNE_SHORT;
-  case PN_UINT: return PNE_UINT;
-  case PN_INT: return PNE_INT;
-  case PN_CHAR: return PNE_UTF32;
-  case PN_FLOAT: return PNE_FLOAT;
-  case PN_LONG: return PNE_LONG;
-  case PN_TIMESTAMP: return PNE_MS64;
-  case PN_DOUBLE: return PNE_DOUBLE;
-  case PN_DECIMAL32: return PNE_DECIMAL32;
-  case PN_DECIMAL64: return PNE_DECIMAL64;
-  case PN_DECIMAL128: return PNE_DECIMAL128;
-  case PN_UUID: return PNE_UUID;
-  case PN_ULONG: return PNE_ULONG;
-  case PN_BINARY: return PNE_VBIN32;
-  case PN_STRING: return PNE_STR32_UTF8;
-  case PN_SYMBOL: return PNE_SYM32;
-  case PN_LIST: return PNE_LIST32;
-  case PN_ARRAY: return PNE_ARRAY32;
-  case PN_MAP: return PNE_MAP32;
-  case PN_DESCRIBED: return PNE_DESCRIPTOR;
-  default:
-    return pn_error_format(encoder->error, PN_ERR, "not a value type: %u\n", type);
-  }
-}
-
-static uint8_t pn_node2code(pn_encoder_t *encoder, pni_node_t *node)
-{
-  switch (node->atom.type) {
-  case PN_LONG:
-    if (-128 <= node->atom.u.as_long && node->atom.u.as_long <= 127) {
-      return PNE_SMALLLONG;
-    } else {
-      return PNE_LONG;
-    }
-  case PN_INT:
-    if (-128 <= node->atom.u.as_int && node->atom.u.as_int <= 127) {
-      return PNE_SMALLINT;
-    } else {
-      return PNE_INT;
-    }
-  case PN_ULONG:
-    if (node->atom.u.as_ulong < 256) {
-      return PNE_SMALLULONG;
-    } else {
-      return PNE_ULONG;
-    }
-  case PN_UINT:
-    if (node->atom.u.as_uint < 256) {
-      return PNE_SMALLUINT;
-    } else {
-      return PNE_UINT;
-    }
-  case PN_BOOL:
-    if (node->atom.u.as_bool) {
-      return PNE_TRUE;
-    } else {
-      return PNE_FALSE;
-    }
-  case PN_STRING:
-    if (node->atom.u.as_bytes.size < 256) {
-      return PNE_STR8_UTF8;
-    } else {
-      return PNE_STR32_UTF8;
-    }
-  case PN_SYMBOL:
-    if (node->atom.u.as_bytes.size < 256) {
-      return PNE_SYM8;
-    } else {
-      return PNE_SYM32;
-    }
-  case PN_BINARY:
-    if (node->atom.u.as_bytes.size < 256) {
-      return PNE_VBIN8;
-    } else {
-      return PNE_VBIN32;
-    }
-  default:
-    return pn_type2code(encoder, node->atom.type);
-  }
-}
-
-static size_t pn_encoder_remaining(pn_encoder_t *encoder) {
-  char * end = encoder->output + encoder->size;
-  if (end > encoder->position)
-    return end - encoder->position;
-  else
-    return 0;
-}
-
-static inline void pn_encoder_writef8(pn_encoder_t *encoder, uint8_t value)
-{
-  if (pn_encoder_remaining(encoder)) {
-    encoder->position[0] = value;
-  }
-  encoder->position++;
-}
-
-static inline void pn_encoder_writef16(pn_encoder_t *encoder, uint16_t value)
-{
-  if (pn_encoder_remaining(encoder) >= 2) {
-    encoder->position[0] = 0xFF & (value >> 8);
-    encoder->position[1] = 0xFF & (value     );
-  }
-  encoder->position += 2;
-}
-
-static inline void pn_encoder_writef32(pn_encoder_t *encoder, uint32_t value)
-{
-  if (pn_encoder_remaining(encoder) >= 4) {
-    encoder->position[0] = 0xFF & (value >> 24);
-    encoder->position[1] = 0xFF & (value >> 16);
-    encoder->position[2] = 0xFF & (value >>  8);
-    encoder->position[3] = 0xFF & (value      );
-  }
-  encoder->position += 4;
-}
-
-static inline void pn_encoder_writef64(pn_encoder_t *encoder, uint64_t value) {
-  if (pn_encoder_remaining(encoder) >= 8) {
-    encoder->position[0] = 0xFF & (value >> 56);
-    encoder->position[1] = 0xFF & (value >> 48);
-    encoder->position[2] = 0xFF & (value >> 40);
-    encoder->position[3] = 0xFF & (value >> 32);
-    encoder->position[4] = 0xFF & (value >> 24);
-    encoder->position[5] = 0xFF & (value >> 16);
-    encoder->position[6] = 0xFF & (value >>  8);
-    encoder->position[7] = 0xFF & (value      );
-  }
-  encoder->position += 8;
-}
-
-static inline void pn_encoder_writef128(pn_encoder_t *encoder, char *value) {
-  if (pn_encoder_remaining(encoder) >= 16) {
-    memmove(encoder->position, value, 16);
-  }
-  encoder->position += 16;
-}
-
-static inline void pn_encoder_writev8(pn_encoder_t *encoder, const pn_bytes_t *value)
-{
-  pn_encoder_writef8(encoder, value->size);
-  if (pn_encoder_remaining(encoder) >= value->size)
-    memmove(encoder->position, value->start, value->size);
-  encoder->position += value->size;
-}
-
-static inline void pn_encoder_writev32(pn_encoder_t *encoder, const pn_bytes_t *value)
-{
-  pn_encoder_writef32(encoder, value->size);
-  if (pn_encoder_remaining(encoder) >= value->size)
-    memmove(encoder->position, value->start, value->size);
-  encoder->position += value->size;
-}
-
-/* True if node is an element of an array - not the descriptor. */
-static bool pn_is_in_array(pn_data_t *data, pni_node_t *parent, pni_node_t *node) {
-  return (parent && parent->atom.type == PN_ARRAY) /* In array */
-    && !(parent->described && !node->prev); /* Not the descriptor */
-}
-
-/** True if node is the first element of an array, not the descriptor.
- *@pre pn_is_in_array(data, parent, node)
- */
-static bool pn_is_first_in_array(pn_data_t *data, pni_node_t *parent, pni_node_t *node) {
-  if (!node->prev) return !parent->described; /* First node */
-  return parent->described && (!pn_data_node(data, node->prev)->prev);
-}
-
-typedef union {
-  uint32_t i;
-  uint32_t a[2];
-  uint64_t l;
-  float f;
-  double d;
-} conv_t;
-
-static int pni_encoder_enter(void *ctx, pn_data_t *data, pni_node_t *node)
-{
-  pn_encoder_t *encoder = (pn_encoder_t *) ctx;
-  pni_node_t *parent = pn_data_node(data, node->parent);
-  pn_atom_t *atom = &node->atom;
-  uint8_t code;
-  conv_t c;
-
-  /** In an array we don't write the code before each element, only the first. */
-  if (pn_is_in_array(data, parent, node)) {
-    code = pn_type2code(encoder, parent->type);
-    if (pn_is_first_in_array(data, parent, node)) {
-      pn_encoder_writef8(encoder, code);
-    }
-  } else {
-    code = pn_node2code(encoder, node);
-    pn_encoder_writef8(encoder, code);
-  }
-
-  switch (code) {
-  case PNE_DESCRIPTOR:
-  case PNE_NULL:
-  case PNE_TRUE:
-  case PNE_FALSE: return 0;
-  case PNE_BOOLEAN: pn_encoder_writef8(encoder, atom->u.as_bool); return 0;
-  case PNE_UBYTE: pn_encoder_writef8(encoder, atom->u.as_ubyte); return 0;
-  case PNE_BYTE: pn_encoder_writef8(encoder, atom->u.as_byte); return 0;
-  case PNE_USHORT: pn_encoder_writef16(encoder, atom->u.as_ushort); return 0;
-  case PNE_SHORT: pn_encoder_writef16(encoder, atom->u.as_short); return 0;
-  case PNE_UINT0: return 0;
-  case PNE_SMALLUINT: pn_encoder_writef8(encoder, atom->u.as_uint); return 0;
-  case PNE_UINT: pn_encoder_writef32(encoder, atom->u.as_uint); return 0;
-  case PNE_SMALLINT: pn_encoder_writef8(encoder, atom->u.as_int); return 0;
-  case PNE_INT: pn_encoder_writef32(encoder, atom->u.as_int); return 0;
-  case PNE_UTF32: pn_encoder_writef32(encoder, atom->u.as_char); return 0;
-  case PNE_ULONG: pn_encoder_writef64(encoder, atom->u.as_ulong); return 0;
-  case PNE_SMALLULONG: pn_encoder_writef8(encoder, atom->u.as_ulong); return 0;
-  case PNE_LONG: pn_encoder_writef64(encoder, atom->u.as_long); return 0;
-  case PNE_SMALLLONG: pn_encoder_writef8(encoder, atom->u.as_long); return 0;
-  case PNE_MS64: pn_encoder_writef64(encoder, atom->u.as_timestamp); return 0;
-  case PNE_FLOAT: c.f = atom->u.as_float; pn_encoder_writef32(encoder, c.i); return 0;
-  case PNE_DOUBLE: c.d = atom->u.as_double; pn_encoder_writef64(encoder, c.l); return 0;
-  case PNE_DECIMAL32: pn_encoder_writef32(encoder, atom->u.as_decimal32); return 0;
-  case PNE_DECIMAL64: pn_encoder_writef64(encoder, atom->u.as_decimal64); return 0;
-  case PNE_DECIMAL128: pn_encoder_writef128(encoder, atom->u.as_decimal128.bytes); return 0;
-  case PNE_UUID: pn_encoder_writef128(encoder, atom->u.as_uuid.bytes); return 0;
-  case PNE_VBIN8: pn_encoder_writev8(encoder, &atom->u.as_bytes); return 0;
-  case PNE_VBIN32: pn_encoder_writev32(encoder, &atom->u.as_bytes); return 0;
-  case PNE_STR8_UTF8: pn_encoder_writev8(encoder, &atom->u.as_bytes); return 0;
-  case PNE_STR32_UTF8: pn_encoder_writev32(encoder, &atom->u.as_bytes); return 0;
-  case PNE_SYM8: pn_encoder_writev8(encoder, &atom->u.as_bytes); return 0;
-  case PNE_SYM32: pn_encoder_writev32(encoder, &atom->u.as_bytes); return 0;
-  case PNE_ARRAY32:
-    node->start = encoder->position;
-    node->small = false;
-    // we'll backfill the size on exit
-    encoder->position += 4;
-    pn_encoder_writef32(encoder, node->described ? node->children - 1 : node->children);
-    if (node->described)
-      pn_encoder_writef8(encoder, 0);
-    return 0;
-  case PNE_LIST32:
-  case PNE_MAP32:
-    node->start = encoder->position;
-    node->small = false;
-    // we'll backfill the size later
-    encoder->position += 4;
-    pn_encoder_writef32(encoder, node->children);
-    return 0;
-  default:
-    return pn_error_format(data->error, PN_ERR, "unrecognized encoding: %u", code);
-  }
-}
-
-#include <stdio.h>
-
-static int pni_encoder_exit(void *ctx, pn_data_t *data, pni_node_t *node)
-{
-  pn_encoder_t *encoder = (pn_encoder_t *) ctx;
-  char *pos;
-
-  switch (node->atom.type) {
-  case PN_ARRAY:
-    if ((node->described && node->children == 1) || (!node->described && node->children == 0)) {
-      pn_encoder_writef8(encoder, pn_type2code(encoder, node->type));
-    }
-  // Fallthrough
-  case PN_LIST:
-  case PN_MAP:
-    pos = encoder->position;
-    encoder->position = node->start;
-    if (node->small) {
-      // backfill size
-      size_t size = pos - node->start - 1;
-      pn_encoder_writef8(encoder, size);
-    } else {
-      // backfill size
-      size_t size = pos - node->start - 4;
-      pn_encoder_writef32(encoder, size);
-    }
-    encoder->position = pos;
-    return 0;
-  default:
-    return 0;
-  }
-}
-
-ssize_t pn_encoder_encode(pn_encoder_t *encoder, pn_data_t *src, char *dst, size_t size)
-{
-  encoder->output = dst;
-  encoder->position = dst;
-  encoder->size = size;
-
-  int err = pni_data_traverse(src, pni_encoder_enter, pni_encoder_exit, encoder);
-  if (err) return err;
-  size_t encoded = encoder->position - encoder->output;
-  if (encoded > size) {
-      pn_error_format(pn_data_error(src), PN_OVERFLOW, "not enough space to encode");
-      return PN_OVERFLOW;
-  }
-  return (ssize_t)encoded;
-}
-
-ssize_t pn_encoder_size(pn_encoder_t *encoder, pn_data_t *src)
-{
-  encoder->output = 0;
-  encoder->position = 0;
-  encoder->size = 0;
-
-  pn_handle_t save = pn_data_point(src);
-  int err = pni_data_traverse(src, pni_encoder_enter, pni_encoder_exit, encoder);
-  pn_data_restore(src, save);
-
-  if (err) return err;
-  return encoder->position - encoder->output;
-}
diff --git a/proton-c/src/core/encoder.h b/proton-c/src/core/encoder.h
deleted file mode 100644
index 20876cb..0000000
--- a/proton-c/src/core/encoder.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef _PROTON_ENCODER_H
-#define _PROTON_ENCODER_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-typedef struct pn_encoder_t pn_encoder_t;
-
-pn_encoder_t *pn_encoder(void);
-ssize_t pn_encoder_encode(pn_encoder_t *encoder, pn_data_t *src, char *dst, size_t size);
-ssize_t pn_encoder_size(pn_encoder_t *encoder, pn_data_t *src);
-
-#endif /* encoder.h */
diff --git a/proton-c/src/core/engine-internal.h b/proton-c/src/core/engine-internal.h
deleted file mode 100644
index 1dbe91c..0000000
--- a/proton-c/src/core/engine-internal.h
+++ /dev/null
@@ -1,377 +0,0 @@
-#ifndef _PROTON_ENGINE_INTERNAL_H
-#define _PROTON_ENGINE_INTERNAL_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/object.h>
-#include <proton/engine.h>
-#include <proton/types.h>
-
-#include "buffer.h"
-#include "dispatcher.h"
-#include "util.h"
-
-typedef enum pn_endpoint_type_t {CONNECTION, SESSION, SENDER, RECEIVER} pn_endpoint_type_t;
-
-typedef struct pn_endpoint_t pn_endpoint_t;
-
-struct pn_condition_t {
-  pn_string_t *name;
-  pn_string_t *description;
-  pn_data_t *info;
-};
-
-struct pn_endpoint_t {
-  pn_endpoint_type_t type;
-  pn_state_t state;
-  pn_error_t *error;
-  pn_condition_t condition;
-  pn_condition_t remote_condition;
-  pn_endpoint_t *endpoint_next;
-  pn_endpoint_t *endpoint_prev;
-  pn_endpoint_t *transport_next;
-  pn_endpoint_t *transport_prev;
-  int refcount; // when this hits zero we generate a final event
-  bool modified;
-  bool freed;
-  bool referenced;
-};
-
-typedef struct {
-  pn_sequence_t id;
-  bool sent;
-  bool init;
-} pn_delivery_state_t;
-
-typedef struct {
-  pn_sequence_t next;
-  pn_hash_t *deliveries;
-} pn_delivery_map_t;
-
-typedef struct {
-  // XXX: stop using negative numbers
-  uint32_t local_handle;
-  uint32_t remote_handle;
-  pn_sequence_t delivery_count;
-  pn_sequence_t link_credit;
-} pn_link_state_t;
-
-typedef struct {
-  // XXX: stop using negative numbers
-  uint16_t local_channel;
-  uint16_t remote_channel;
-  bool incoming_init;
-  pn_delivery_map_t incoming;
-  pn_delivery_map_t outgoing;
-  pn_sequence_t incoming_transfer_count;
-  pn_sequence_t incoming_window;
-  pn_sequence_t remote_incoming_window;
-  pn_sequence_t outgoing_transfer_count;
-  pn_sequence_t outgoing_window;
-  pn_hash_t *local_handles;
-  pn_hash_t *remote_handles;
-
-  uint64_t disp_code;
-  bool disp_settled;
-  bool disp_type;
-  pn_sequence_t disp_first;
-  pn_sequence_t disp_last;
-  bool disp;
-} pn_session_state_t;
-
-typedef struct pn_io_layer_t {
-  ssize_t (*process_input)(struct pn_transport_t *transport, unsigned int layer, const char *, size_t);
-  ssize_t (*process_output)(struct pn_transport_t *transport, unsigned int layer, char *, size_t);
-  void (*handle_error)(struct pn_transport_t* transport, unsigned int layer);
-  pn_timestamp_t (*process_tick)(struct pn_transport_t *transport, unsigned int layer, pn_timestamp_t);
-  size_t (*buffered_output)(struct pn_transport_t *transport);  // how much output is held
-} pn_io_layer_t;
-
-extern const pn_io_layer_t pni_passthru_layer;
-extern const pn_io_layer_t ssl_layer;
-extern const pn_io_layer_t sasl_header_layer;
-extern const pn_io_layer_t sasl_write_header_layer;
-
-// Bit flag defines for the protocol layers
-typedef uint8_t pn_io_layer_flags_t;
-#define LAYER_NONE     0
-#define LAYER_AMQP1    1
-#define LAYER_AMQPSASL 2
-#define LAYER_AMQPSSL  4
-#define LAYER_SSL      8
-
-typedef struct pni_sasl_t pni_sasl_t;
-typedef struct pni_ssl_t pni_ssl_t;
-
-struct pn_transport_t {
-  pn_tracer_t tracer;
-  pni_sasl_t *sasl;
-  pni_ssl_t *ssl;
-  pn_connection_t *connection;  // reference counted
-  char *remote_container;
-  char *remote_hostname;
-  pn_data_t *remote_offered_capabilities;
-  pn_data_t *remote_desired_capabilities;
-  pn_data_t *remote_properties;
-  pn_data_t *disp_data;
-  //#define PN_DEFAULT_MAX_FRAME_SIZE (16*1024)
-#define PN_DEFAULT_MAX_FRAME_SIZE (0)  /* for now, allow unlimited size */
-  uint32_t   local_max_frame;
-  uint32_t   remote_max_frame;
-  pn_condition_t remote_condition;
-  pn_condition_t condition;
-  pn_error_t *error;
-
-#define PN_IO_LAYER_CT 3
-  const pn_io_layer_t *io_layers[PN_IO_LAYER_CT];
-
-  /* dead remote detection */
-  pn_millis_t local_idle_timeout;
-  pn_millis_t remote_idle_timeout;
-  pn_timestamp_t dead_remote_deadline;
-  uint64_t last_bytes_input;
-
-  /* keepalive */
-  pn_timestamp_t keepalive_deadline;
-  uint64_t last_bytes_output;
-
-  pn_hash_t *local_channels;
-  pn_hash_t *remote_channels;
-
-
-  /* scratch area */
-  pn_string_t *scratch;
-  pn_data_t *args;
-  pn_data_t *output_args;
-  pn_buffer_t *frame;  // frame under construction
-  // Temporary
-  size_t capacity;
-  size_t available; /* number of raw bytes pending output */
-  char *output;
-
-  /* statistics */
-  uint64_t bytes_input;
-  uint64_t bytes_output;
-  uint64_t output_frames_ct;
-  uint64_t input_frames_ct;
-
-  /* output buffered for send */
-  size_t output_size;
-  size_t output_pending;
-  char *output_buf;
-
-  /* input from peer */
-  size_t input_size;
-  size_t input_pending;
-  char *input_buf;
-
-  pn_record_t *context;
-
-  pn_trace_t trace;
-
-  /*
-   * The maximum channel number can be constrained in several ways:
-   *   1. an unchangeable limit imposed by this library code
-   *   2. a limit imposed by the remote peer when the connection is opened,
-   *      which this app must honor
-   *   3. a limit imposed by this app, which may be raised and lowered
-   *      until the OPEN frame is sent.
-   * These constraints are all summed up in channel_max, below.
-   */
-  #define PN_IMPL_CHANNEL_MAX  32767
-  uint16_t local_channel_max;
-  uint16_t remote_channel_max;
-  uint16_t channel_max;
-
-  pn_io_layer_flags_t allowed_layers;
-  pn_io_layer_flags_t present_layers;
-
-  bool freed;
-  bool open_sent;
-  bool open_rcvd;
-  bool close_sent;
-  bool close_rcvd;
-  bool tail_closed;      // input stream closed by driver
-  bool head_closed;
-  bool done_processing; // if true, don't call pn_process again
-  bool posted_idle_timeout;
-  bool server;
-  bool halt;
-  bool auth_required;
-  bool authenticated;
-  bool encryption_required;
-
-  bool referenced;
-};
-
-struct pn_connection_t {
-  pn_endpoint_t endpoint;
-  pn_endpoint_t *endpoint_head;
-  pn_endpoint_t *endpoint_tail;
-  pn_endpoint_t *transport_head;  // reference counted
-  pn_endpoint_t *transport_tail;
-  pn_list_t *sessions;
-  pn_list_t *freed;
-  pn_transport_t *transport;
-  pn_delivery_t *work_head;
-  pn_delivery_t *work_tail;
-  pn_delivery_t *tpwork_head;  // reference counted
-  pn_delivery_t *tpwork_tail;
-  pn_string_t *container;
-  pn_string_t *hostname;
-  pn_string_t *auth_user;
-  pn_string_t *auth_password;
-  pn_data_t *offered_capabilities;
-  pn_data_t *desired_capabilities;
-  pn_data_t *properties;
-  pn_collector_t *collector;
-  pn_record_t *context;
-  pn_list_t *delivery_pool;
-};
-
-struct pn_session_t {
-  pn_endpoint_t endpoint;
-  pn_connection_t *connection;  // reference counted
-  pn_list_t *links;
-  pn_list_t *freed;
-  pn_record_t *context;
-  size_t incoming_capacity;
-  pn_sequence_t incoming_bytes;
-  pn_sequence_t outgoing_bytes;
-  pn_sequence_t incoming_deliveries;
-  pn_sequence_t outgoing_deliveries;
-  pn_sequence_t outgoing_window;
-  pn_session_state_t state;
-};
-
-struct pn_terminus_t {
-  pn_string_t *address;
-  pn_data_t *properties;
-  pn_data_t *capabilities;
-  pn_data_t *outcomes;
-  pn_data_t *filter;
-  pn_durability_t durability;
-  pn_expiry_policy_t expiry_policy;
-  pn_seconds_t timeout;
-  pn_terminus_type_t type;
-  pn_distribution_mode_t distribution_mode;
-  bool dynamic;
-};
-
-struct pn_link_t {
-  pn_endpoint_t endpoint;
-  pn_terminus_t source;
-  pn_terminus_t target;
-  pn_terminus_t remote_source;
-  pn_terminus_t remote_target;
-  pn_link_state_t state;
-  pn_string_t *name;
-  pn_session_t *session;  // reference counted
-  pn_delivery_t *unsettled_head;
-  pn_delivery_t *unsettled_tail;
-  pn_delivery_t *current;
-  pn_record_t *context;
-  size_t unsettled_count;
-  uint64_t max_message_size;
-  uint64_t remote_max_message_size;
-  pn_sequence_t available;
-  pn_sequence_t credit;
-  pn_sequence_t queued;
-  int drained; // number of drained credits
-  uint8_t snd_settle_mode;
-  uint8_t rcv_settle_mode;
-  uint8_t remote_snd_settle_mode;
-  uint8_t remote_rcv_settle_mode;
-  bool drain_flag_mode; // receiver only
-  bool drain;
-  bool detached;
-};
-
-struct pn_disposition_t {
-  pn_condition_t condition;
-  uint64_t type;
-  pn_data_t *data;
-  pn_data_t *annotations;
-  uint64_t section_offset;
-  uint32_t section_number;
-  bool failed;
-  bool undeliverable;
-  bool settled;
-};
-
-struct pn_delivery_t {
-  pn_disposition_t local;
-  pn_disposition_t remote;
-  pn_link_t *link;  // reference counted
-  pn_buffer_t *tag;
-  pn_delivery_t *unsettled_next;
-  pn_delivery_t *unsettled_prev;
-  pn_delivery_t *work_next;
-  pn_delivery_t *work_prev;
-  pn_delivery_t *tpwork_next;
-  pn_delivery_t *tpwork_prev;
-  pn_delivery_state_t state;
-  pn_buffer_t *bytes;
-  pn_record_t *context;
-  bool updated;
-  bool settled; // tracks whether we're in the unsettled list or not
-  bool work;
-  bool tpwork;
-  bool done;
-  bool referenced;
-};
-
-#define PN_SET_LOCAL(OLD, NEW)                                          \
-  (OLD) = ((OLD) & PN_REMOTE_MASK) | (NEW)
-
-#define PN_SET_REMOTE(OLD, NEW)                                         \
-  (OLD) = ((OLD) & PN_LOCAL_MASK) | (NEW)
-
-void pn_link_dump(pn_link_t *link);
-
-void pn_dump(pn_connection_t *conn);
-void pn_transport_sasl_init(pn_transport_t *transport);
-
-void pn_condition_init(pn_condition_t *condition);
-void pn_condition_tini(pn_condition_t *condition);
-void pn_modified(pn_connection_t *connection, pn_endpoint_t *endpoint, bool emit);
-void pn_real_settle(pn_delivery_t *delivery);  // will free delivery if link is freed
-void pn_clear_tpwork(pn_delivery_t *delivery);
-void pn_work_update(pn_connection_t *connection, pn_delivery_t *delivery);
-void pn_clear_modified(pn_connection_t *connection, pn_endpoint_t *endpoint);
-void pn_connection_bound(pn_connection_t *conn);
-void pn_connection_unbound(pn_connection_t *conn);
-int pn_do_error(pn_transport_t *transport, const char *condition, const char *fmt, ...);
-void pn_set_error_layer(pn_transport_t *transport);
-void pn_session_unbound(pn_session_t* ssn);
-void pn_link_unbound(pn_link_t* link);
-void pn_ep_incref(pn_endpoint_t *endpoint);
-void pn_ep_decref(pn_endpoint_t *endpoint);
-
-int pn_post_frame(pn_transport_t *transport, uint8_t type, uint16_t ch, const char *fmt, ...);
-
-typedef enum {IN, OUT} pn_dir_t;
-
-void pn_do_trace(pn_transport_t *transport, uint16_t ch, pn_dir_t dir,
-                 pn_data_t *args, const char *payload, size_t size);
-
-#endif /* engine-internal.h */
diff --git a/proton-c/src/core/engine.c b/proton-c/src/core/engine.c
deleted file mode 100644
index 8c2aeb0..0000000
--- a/proton-c/src/core/engine.c
+++ /dev/null
@@ -1,2277 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "engine-internal.h"
-#include <stdlib.h>
-#include <string.h>
-#include "protocol.h"
-
-#include <assert.h>
-#include <stdarg.h>
-#include <stdio.h>
-
-#include "platform/platform.h"
-#include "platform/platform_fmt.h"
-#include "transport.h"
-
-static void pni_session_bound(pn_session_t *ssn);
-static void pni_link_bound(pn_link_t *link);
-
-
-// endpoints
-
-static pn_connection_t *pni_ep_get_connection(pn_endpoint_t *endpoint)
-{
-  switch (endpoint->type) {
-  case CONNECTION:
-    return (pn_connection_t *) endpoint;
-  case SESSION:
-    return ((pn_session_t *) endpoint)->connection;
-  case SENDER:
-  case RECEIVER:
-    return ((pn_link_t *) endpoint)->session->connection;
-  }
-
-  return NULL;
-}
-
-static pn_event_type_t endpoint_event(pn_endpoint_type_t type, bool open) {
-  switch (type) {
-  case CONNECTION:
-    return open ? PN_CONNECTION_LOCAL_OPEN : PN_CONNECTION_LOCAL_CLOSE;
-  case SESSION:
-    return open ? PN_SESSION_LOCAL_OPEN : PN_SESSION_LOCAL_CLOSE;
-  case SENDER:
-  case RECEIVER:
-    return open ? PN_LINK_LOCAL_OPEN : PN_LINK_LOCAL_CLOSE;
-  default:
-    assert(false);
-    return PN_EVENT_NONE;
-  }
-}
-
-static void pn_endpoint_open(pn_endpoint_t *endpoint)
-{
-  if (!(endpoint->state & PN_LOCAL_ACTIVE)) {
-    PN_SET_LOCAL(endpoint->state, PN_LOCAL_ACTIVE);
-    pn_connection_t *conn = pni_ep_get_connection(endpoint);
-    pn_collector_put(conn->collector, PN_OBJECT, endpoint,
-                     endpoint_event(endpoint->type, true));
-    pn_modified(conn, endpoint, true);
-  }
-}
-
-static void pn_endpoint_close(pn_endpoint_t *endpoint)
-{
-  if (!(endpoint->state & PN_LOCAL_CLOSED)) {
-    PN_SET_LOCAL(endpoint->state, PN_LOCAL_CLOSED);
-    pn_connection_t *conn = pni_ep_get_connection(endpoint);
-    pn_collector_put(conn->collector, PN_OBJECT, endpoint,
-                     endpoint_event(endpoint->type, false));
-    pn_modified(conn, endpoint, true);
-  }
-}
-
-void pn_connection_reset(pn_connection_t *connection)
-{
-  assert(connection);
-  pn_endpoint_t *endpoint = &connection->endpoint;
-  endpoint->state = PN_LOCAL_UNINIT | PN_REMOTE_UNINIT;
-}
-
-void pn_connection_open(pn_connection_t *connection)
-{
-  assert(connection);
-  pn_endpoint_open(&connection->endpoint);
-}
-
-void pn_connection_close(pn_connection_t *connection)
-{
-  assert(connection);
-  pn_endpoint_close(&connection->endpoint);
-}
-
-static void pni_endpoint_tini(pn_endpoint_t *endpoint);
-
-void pn_connection_release(pn_connection_t *connection)
-{
-  assert(!connection->endpoint.freed);
-  // free those endpoints that haven't been freed by the application
-  LL_REMOVE(connection, endpoint, &connection->endpoint);
-  while (connection->endpoint_head) {
-    pn_endpoint_t *ep = connection->endpoint_head;
-    switch (ep->type) {
-    case SESSION:
-      // note: this will free all child links:
-      pn_session_free((pn_session_t *)ep);
-      break;
-    case SENDER:
-    case RECEIVER:
-      pn_link_free((pn_link_t *)ep);
-      break;
-    default:
-      assert(false);
-    }
-  }
-  connection->endpoint.freed = true;
-  if (!connection->transport) {
-    // no transport available to consume transport work items,
-    // so manually clear them:
-    pn_ep_incref(&connection->endpoint);
-    pn_connection_unbound(connection);
-  }
-  pn_ep_decref(&connection->endpoint);
-}
-
-void pn_connection_free(pn_connection_t *connection) {
-  pn_connection_release(connection);
-  pn_decref(connection);
-}
-
-void pn_connection_bound(pn_connection_t *connection)
-{
-  pn_collector_put(connection->collector, PN_OBJECT, connection, PN_CONNECTION_BOUND);
-  pn_ep_incref(&connection->endpoint);
-
-  size_t nsessions = pn_list_size(connection->sessions);
-  for (size_t i = 0; i < nsessions; i++) {
-    pni_session_bound((pn_session_t *) pn_list_get(connection->sessions, i));
-  }
-}
-
-// invoked when transport has been removed:
-void pn_connection_unbound(pn_connection_t *connection)
-{
-  connection->transport = NULL;
-  if (connection->endpoint.freed) {
-    // connection has been freed prior to unbinding, thus it
-    // cannot be re-assigned to a new transport.  Clear the
-    // transport work lists to allow the connection to be freed.
-    while (connection->transport_head) {
-        pn_clear_modified(connection, connection->transport_head);
-    }
-    while (connection->tpwork_head) {
-      pn_clear_tpwork(connection->tpwork_head);
-    }
-  }
-  pn_ep_decref(&connection->endpoint);
-}
-
-pn_record_t *pn_connection_attachments(pn_connection_t *connection)
-{
-  assert(connection);
-  return connection->context;
-}
-
-void *pn_connection_get_context(pn_connection_t *conn)
-{
-  // XXX: we should really assert on conn here, but this causes
-  // messenger tests to fail
-  return conn ? pn_record_get(conn->context, PN_LEGCTX) : NULL;
-}
-
-void pn_connection_set_context(pn_connection_t *conn, void *context)
-{
-  assert(conn);
-  pn_record_set(conn->context, PN_LEGCTX, context);
-}
-
-pn_transport_t *pn_connection_transport(pn_connection_t *connection)
-{
-  assert(connection);
-  return connection->transport;
-}
-
-void pn_condition_init(pn_condition_t *condition)
-{
-  condition->name = pn_string(NULL);
-  condition->description = pn_string(NULL);
-  condition->info = pn_data(0);
-}
-
-pn_condition_t *pn_condition() {
-  pn_condition_t *c = (pn_condition_t*)malloc(sizeof(pn_condition_t));
-  pn_condition_init(c);
-  return c;
-}
-
-void pn_condition_tini(pn_condition_t *condition)
-{
-  pn_data_free(condition->info);
-  pn_free(condition->description);
-  pn_free(condition->name);
-}
-
-void pn_condition_free(pn_condition_t *c) {
-  if (c) {
-    pn_condition_clear(c);
-    pn_condition_tini(c);
-    free(c);
-  }
-}
-
-static void pni_add_session(pn_connection_t *conn, pn_session_t *ssn)
-{
-  pn_list_add(conn->sessions, ssn);
-  ssn->connection = conn;
-  pn_incref(conn);  // keep around until finalized
-  pn_ep_incref(&conn->endpoint);
-}
-
-static void pni_remove_session(pn_connection_t *conn, pn_session_t *ssn)
-{
-  if (pn_list_remove(conn->sessions, ssn)) {
-    pn_ep_decref(&conn->endpoint);
-    LL_REMOVE(conn, endpoint, &ssn->endpoint);
-  }
-}
-
-pn_connection_t *pn_session_connection(pn_session_t *session)
-{
-  if (!session) return NULL;
-  return session->connection;
-}
-
-void pn_session_open(pn_session_t *session)
-{
-  assert(session);
-  pn_endpoint_open(&session->endpoint);
-}
-
-void pn_session_close(pn_session_t *session)
-{
-  assert(session);
-  pn_endpoint_close(&session->endpoint);
-}
-
-void pn_session_free(pn_session_t *session)
-{
-  assert(!session->endpoint.freed);
-  while(pn_list_size(session->links)) {
-    pn_link_t *link = (pn_link_t *)pn_list_get(session->links, 0);
-    pn_link_free(link);
-  }
-  pni_remove_session(session->connection, session);
-  pn_list_add(session->connection->freed, session);
-  session->endpoint.freed = true;
-  pn_ep_decref(&session->endpoint);
-
-  // the finalize logic depends on endpoint.freed, so we incref/decref
-  // to give it a chance to rerun
-  pn_incref(session);
-  pn_decref(session);
-}
-
-pn_record_t *pn_session_attachments(pn_session_t *session)
-{
-  assert(session);
-  return session->context;
-}
-
-void *pn_session_get_context(pn_session_t *session)
-{
-  return session ? pn_record_get(session->context, PN_LEGCTX) : 0;
-}
-
-void pn_session_set_context(pn_session_t *session, void *context)
-{
-  assert(context);
-  pn_record_set(session->context, PN_LEGCTX, context);
-}
-
-
-static void pni_add_link(pn_session_t *ssn, pn_link_t *link)
-{
-  pn_list_add(ssn->links, link);
-  link->session = ssn;
-  pn_ep_incref(&ssn->endpoint);
-}
-
-static void pni_remove_link(pn_session_t *ssn, pn_link_t *link)
-{
-  if (pn_list_remove(ssn->links, link)) {
-    pn_ep_decref(&ssn->endpoint);
-    LL_REMOVE(ssn->connection, endpoint, &link->endpoint);
-  }
-}
-
-void pn_link_open(pn_link_t *link)
-{
-  assert(link);
-  pn_endpoint_open(&link->endpoint);
-}
-
-void pn_link_close(pn_link_t *link)
-{
-  assert(link);
-  pn_endpoint_close(&link->endpoint);
-}
-
-void pn_link_detach(pn_link_t *link)
-{
-  assert(link);
-  if (link->detached) return;
-
-  link->detached = true;
-  pn_collector_put(link->session->connection->collector, PN_OBJECT, link, PN_LINK_LOCAL_DETACH);
-  pn_modified(link->session->connection, &link->endpoint, true);
-
-}
-
-static void pni_terminus_free(pn_terminus_t *terminus)
-{
-  pn_free(terminus->address);
-  pn_free(terminus->properties);
-  pn_free(terminus->capabilities);
-  pn_free(terminus->outcomes);
-  pn_free(terminus->filter);
-}
-
-void pn_link_free(pn_link_t *link)
-{
-  assert(!link->endpoint.freed);
-  pni_remove_link(link->session, link);
-  pn_list_add(link->session->freed, link);
-  pn_delivery_t *delivery = link->unsettled_head;
-  while (delivery) {
-    pn_delivery_t *next = delivery->unsettled_next;
-    pn_delivery_settle(delivery);
-    delivery = next;
-  }
-  link->endpoint.freed = true;
-  pn_ep_decref(&link->endpoint);
-
-  // the finalize logic depends on endpoint.freed (modified above), so
-  // we incref/decref to give it a chance to rerun
-  pn_incref(link);
-  pn_decref(link);
-}
-
-void *pn_link_get_context(pn_link_t *link)
-{
-  assert(link);
-  return pn_record_get(link->context, PN_LEGCTX);
-}
-
-void pn_link_set_context(pn_link_t *link, void *context)
-{
-  assert(link);
-  pn_record_set(link->context, PN_LEGCTX, context);
-}
-
-pn_record_t *pn_link_attachments(pn_link_t *link)
-{
-  assert(link);
-  return link->context;
-}
-
-void pn_endpoint_init(pn_endpoint_t *endpoint, int type, pn_connection_t *conn)
-{
-  endpoint->type = (pn_endpoint_type_t) type;
-  endpoint->referenced = true;
-  endpoint->state = PN_LOCAL_UNINIT | PN_REMOTE_UNINIT;
-  endpoint->error = pn_error();
-  pn_condition_init(&endpoint->condition);
-  pn_condition_init(&endpoint->remote_condition);
-  endpoint->endpoint_next = NULL;
-  endpoint->endpoint_prev = NULL;
-  endpoint->transport_next = NULL;
-  endpoint->transport_prev = NULL;
-  endpoint->modified = false;
-  endpoint->freed = false;
-  endpoint->refcount = 1;
-  //fprintf(stderr, "initting 0x%lx\n", (uintptr_t) endpoint);
-
-  LL_ADD(conn, endpoint, endpoint);
-}
-
-void pn_ep_incref(pn_endpoint_t *endpoint)
-{
-  endpoint->refcount++;
-}
-
-static pn_event_type_t pn_final_type(pn_endpoint_type_t type) {
-  switch (type) {
-  case CONNECTION:
-    return PN_CONNECTION_FINAL;
-  case SESSION:
-    return PN_SESSION_FINAL;
-  case SENDER:
-  case RECEIVER:
-    return PN_LINK_FINAL;
-  default:
-    assert(false);
-    return PN_EVENT_NONE;
-  }
-}
-
-static pn_endpoint_t *pn_ep_parent(pn_endpoint_t *endpoint) {
-  switch (endpoint->type) {
-  case CONNECTION:
-    return NULL;
-  case SESSION:
-    return &((pn_session_t *) endpoint)->connection->endpoint;
-  case SENDER:
-  case RECEIVER:
-    return &((pn_link_t *) endpoint)->session->endpoint;
-  default:
-    assert(false);
-    return NULL;
-  }
-}
-
-void pn_ep_decref(pn_endpoint_t *endpoint)
-{
-  assert(endpoint->refcount > 0);
-  endpoint->refcount--;
-  if (endpoint->refcount == 0) {
-    pn_connection_t *conn = pni_ep_get_connection(endpoint);
-    pn_collector_put(conn->collector, PN_OBJECT, endpoint, pn_final_type(endpoint->type));
-  }
-}
-
-static void pni_endpoint_tini(pn_endpoint_t *endpoint)
-{
-  pn_error_free(endpoint->error);
-  pn_condition_tini(&endpoint->remote_condition);
-  pn_condition_tini(&endpoint->condition);
-}
-
-static void pni_free_children(pn_list_t *children, pn_list_t *freed)
-{
-  while (pn_list_size(children) > 0) {
-    pn_endpoint_t *endpoint = (pn_endpoint_t *) pn_list_get(children, 0);
-    assert(!endpoint->referenced);
-    pn_free(endpoint);
-  }
-
-  while (pn_list_size(freed) > 0) {
-    pn_endpoint_t *endpoint = (pn_endpoint_t *) pn_list_get(freed, 0);
-    assert(!endpoint->referenced);
-    pn_free(endpoint);
-  }
-
-  pn_free(children);
-  pn_free(freed);
-}
-
-static void pn_connection_finalize(void *object)
-{
-  pn_connection_t *conn = (pn_connection_t *) object;
-  pn_endpoint_t *endpoint = &conn->endpoint;
-
-  if (conn->transport) {
-    assert(!conn->transport->referenced);
-    pn_free(conn->transport);
-  }
-
-  // freeing the transport could post events
-  if (pn_refcount(conn) > 0) {
-    return;
-  }
-
-  pni_free_children(conn->sessions, conn->freed);
-  pn_free(conn->context);
-  pn_decref(conn->collector);
-
-  pn_free(conn->container);
-  pn_free(conn->hostname);
-  pn_free(conn->auth_user);
-  pn_free(conn->auth_password);
-  pn_free(conn->offered_capabilities);
-  pn_free(conn->desired_capabilities);
-  pn_free(conn->properties);
-  pni_endpoint_tini(endpoint);
-  pn_free(conn->delivery_pool);
-}
-
-#define pn_connection_initialize NULL
-#define pn_connection_hashcode NULL
-#define pn_connection_compare NULL
-#define pn_connection_inspect NULL
-
-pn_connection_t *pn_connection()
-{
-  static const pn_class_t clazz = PN_CLASS(pn_connection);
-  pn_connection_t *conn = (pn_connection_t *) pn_class_new(&clazz, sizeof(pn_connection_t));
-  if (!conn) return NULL;
-
-  conn->endpoint_head = NULL;
-  conn->endpoint_tail = NULL;
-  pn_endpoint_init(&conn->endpoint, CONNECTION, conn);
-  conn->transport_head = NULL;
-  conn->transport_tail = NULL;
-  conn->sessions = pn_list(PN_WEAKREF, 0);
-  conn->freed = pn_list(PN_WEAKREF, 0);
-  conn->transport = NULL;
-  conn->work_head = NULL;
-  conn->work_tail = NULL;
-  conn->tpwork_head = NULL;
-  conn->tpwork_tail = NULL;
-  conn->container = pn_string(NULL);
-  conn->hostname = pn_string(NULL);
-  conn->auth_user = pn_string(NULL);
-  conn->auth_password = pn_string(NULL);
-  conn->offered_capabilities = pn_data(0);
-  conn->desired_capabilities = pn_data(0);
-  conn->properties = pn_data(0);
-  conn->collector = NULL;
-  conn->context = pn_record();
-  conn->delivery_pool = pn_list(PN_OBJECT, 0);
-
-  return conn;
-}
-
-static const pn_event_type_t endpoint_init_event_map[] = {
-  PN_CONNECTION_INIT,  /* CONNECTION */
-  PN_SESSION_INIT,     /* SESSION */
-  PN_LINK_INIT,        /* SENDER */
-  PN_LINK_INIT};       /* RECEIVER */
-
-void pn_connection_collect(pn_connection_t *connection, pn_collector_t *collector)
-{
-  pn_decref(connection->collector);
-  connection->collector = collector;
-  pn_incref(connection->collector);
-  pn_endpoint_t *endpoint = connection->endpoint_head;
-  while (endpoint) {
-    pn_collector_put(connection->collector, PN_OBJECT, endpoint, endpoint_init_event_map[endpoint->type]);
-    endpoint = endpoint->endpoint_next;
-  }
-}
-
-pn_collector_t* pn_connection_collector(pn_connection_t *connection) {
-  return connection->collector;
-}
-
-pn_state_t pn_connection_state(pn_connection_t *connection)
-{
-  return connection ? connection->endpoint.state : 0;
-}
-
-pn_error_t *pn_connection_error(pn_connection_t *connection)
-{
-  return connection ? connection->endpoint.error : NULL;
-}
-
-const char *pn_connection_get_container(pn_connection_t *connection)
-{
-  assert(connection);
-  return pn_string_get(connection->container);
-}
-
-void pn_connection_set_container(pn_connection_t *connection, const char *container)
-{
-  assert(connection);
-  pn_string_set(connection->container, container);
-}
-
-const char *pn_connection_get_hostname(pn_connection_t *connection)
-{
-  assert(connection);
-  return pn_string_get(connection->hostname);
-}
-
-void pn_connection_set_hostname(pn_connection_t *connection, const char *hostname)
-{
-  assert(connection);
-  pn_string_set(connection->hostname, hostname);
-}
-
-const char *pn_connection_get_user(pn_connection_t *connection)
-{
-    assert(connection);
-    return pn_string_get(connection->auth_user);
-}
-
-void pn_connection_set_user(pn_connection_t *connection, const char *user)
-{
-    assert(connection);
-    pn_string_set(connection->auth_user, user);
-}
-
-void pn_connection_set_password(pn_connection_t *connection, const char *password)
-{
-    assert(connection);
-    // Make sure the previous password is erased, if there was one.
-    size_t n = pn_string_size(connection->auth_password);
-    const char* s = pn_string_get(connection->auth_password);
-    if (n > 0 && s) memset((void*)s, 0, n);
-    pn_string_set(connection->auth_password, password);
-}
-
-pn_data_t *pn_connection_offered_capabilities(pn_connection_t *connection)
-{
-  assert(connection);
-  return connection->offered_capabilities;
-}
-
-pn_data_t *pn_connection_desired_capabilities(pn_connection_t *connection)
-{
-  assert(connection);
-  return connection->desired_capabilities;
-}
-
-pn_data_t *pn_connection_properties(pn_connection_t *connection)
-{
-  assert(connection);
-  return connection->properties;
-}
-
-pn_data_t *pn_connection_remote_offered_capabilities(pn_connection_t *connection)
-{
-  assert(connection);
-  return connection->transport ? connection->transport->remote_offered_capabilities : NULL;
-}
-
-pn_data_t *pn_connection_remote_desired_capabilities(pn_connection_t *connection)
-{
-  assert(connection);
-  return connection->transport ? connection->transport->remote_desired_capabilities : NULL;
-}
-
-pn_data_t *pn_connection_remote_properties(pn_connection_t *connection)
-{
-  assert(connection);
-  return connection->transport ? connection->transport->remote_properties : NULL;
-}
-
-const char *pn_connection_remote_container(pn_connection_t *connection)
-{
-  assert(connection);
-  return connection->transport ? connection->transport->remote_container : NULL;
-}
-
-const char *pn_connection_remote_hostname(pn_connection_t *connection)
-{
-  assert(connection);
-  return connection->transport ? connection->transport->remote_hostname : NULL;
-}
-
-pn_delivery_t *pn_work_head(pn_connection_t *connection)
-{
-  assert(connection);
-  return connection->work_head;
-}
-
-pn_delivery_t *pn_work_next(pn_delivery_t *delivery)
-{
-  assert(delivery);
-
-  if (delivery->work)
-    return delivery->work_next;
-  else
-    return pn_work_head(delivery->link->session->connection);
-}
-
-static void pni_add_work(pn_connection_t *connection, pn_delivery_t *delivery)
-{
-  if (!delivery->work)
-  {
-    assert(!delivery->local.settled);   // never allow settled deliveries
-    LL_ADD(connection, work, delivery);
-    delivery->work = true;
-  }
-}
-
-static void pni_clear_work(pn_connection_t *connection, pn_delivery_t *delivery)
-{
-  if (delivery->work)
-  {
-    LL_REMOVE(connection, work, delivery);
-    delivery->work = false;
-  }
-}
-
-void pn_work_update(pn_connection_t *connection, pn_delivery_t *delivery)
-{
-  pn_link_t *link = pn_delivery_link(delivery);
-  pn_delivery_t *current = pn_link_current(link);
-  if (delivery->updated && !delivery->local.settled) {
-    pni_add_work(connection, delivery);
-  } else if (delivery == current) {
-    if (link->endpoint.type == SENDER) {
-      if (pn_link_credit(link) > 0) {
-        pni_add_work(connection, delivery);
-      } else {
-        pni_clear_work(connection, delivery);
-      }
-    } else {
-      pni_add_work(connection, delivery);
-    }
-  } else {
-    pni_clear_work(connection, delivery);
-  }
-}
-
-static void pni_add_tpwork(pn_delivery_t *delivery)
-{
-  pn_connection_t *connection = delivery->link->session->connection;
-  if (!delivery->tpwork)
-  {
-    LL_ADD(connection, tpwork, delivery);
-    delivery->tpwork = true;
-  }
-  pn_modified(connection, &connection->endpoint, true);
-}
-
-void pn_clear_tpwork(pn_delivery_t *delivery)
-{
-  pn_connection_t *connection = delivery->link->session->connection;
-  if (delivery->tpwork)
-  {
-    LL_REMOVE(connection, tpwork, delivery);
-    delivery->tpwork = false;
-    if (pn_refcount(delivery) > 0) {
-      pn_incref(delivery);
-      pn_decref(delivery);
-    }
-  }
-}
-
-void pn_dump(pn_connection_t *conn)
-{
-  pn_endpoint_t *endpoint = conn->transport_head;
-  while (endpoint)
-  {
-    printf("%p", (void *) endpoint);
-    endpoint = endpoint->transport_next;
-    if (endpoint)
-      printf(" -> ");
-  }
-  printf("\n");
-}
-
-void pn_modified(pn_connection_t *connection, pn_endpoint_t *endpoint, bool emit)
-{
-  if (!endpoint->modified) {
-    LL_ADD(connection, transport, endpoint);
-    endpoint->modified = true;
-  }
-
-  if (emit && connection->transport) {
-    pn_collector_put(connection->collector, PN_OBJECT, connection->transport,
-                     PN_TRANSPORT);
-  }
-}
-
-void pn_clear_modified(pn_connection_t *connection, pn_endpoint_t *endpoint)
-{
-  if (endpoint->modified) {
-    LL_REMOVE(connection, transport, endpoint);
-    endpoint->transport_next = NULL;
-    endpoint->transport_prev = NULL;
-    endpoint->modified = false;
-  }
-}
-
-static bool pni_matches(pn_endpoint_t *endpoint, pn_endpoint_type_t type, pn_state_t state)
-{
-  if (endpoint->type != type) return false;
-
-  if (!state) return true;
-
-  int st = endpoint->state;
-  if ((state & PN_REMOTE_MASK) == 0 || (state & PN_LOCAL_MASK) == 0)
-    return st & state;
-  else
-    return st == state;
-}
-
-pn_endpoint_t *pn_find(pn_endpoint_t *endpoint, pn_endpoint_type_t type, pn_state_t state)
-{
-  while (endpoint)
-  {
-    if (pni_matches(endpoint, type, state))
-      return endpoint;
-    endpoint = endpoint->endpoint_next;
-  }
-  return NULL;
-}
-
-pn_session_t *pn_session_head(pn_connection_t *conn, pn_state_t state)
-{
-  if (conn)
-    return (pn_session_t *) pn_find(conn->endpoint_head, SESSION, state);
-  else
-    return NULL;
-}
-
-pn_session_t *pn_session_next(pn_session_t *ssn, pn_state_t state)
-{
-  if (ssn)
-    return (pn_session_t *) pn_find(ssn->endpoint.endpoint_next, SESSION, state);
-  else
-    return NULL;
-}
-
-pn_link_t *pn_link_head(pn_connection_t *conn, pn_state_t state)
-{
-  if (!conn) return NULL;
-
-  pn_endpoint_t *endpoint = conn->endpoint_head;
-
-  while (endpoint)
-  {
-    if (pni_matches(endpoint, SENDER, state) || pni_matches(endpoint, RECEIVER, state))
-      return (pn_link_t *) endpoint;
-    endpoint = endpoint->endpoint_next;
-  }
-
-  return NULL;
-}
-
-pn_link_t *pn_link_next(pn_link_t *link, pn_state_t state)
-{
-  if (!link) return NULL;
-
-  pn_endpoint_t *endpoint = link->endpoint.endpoint_next;
-
-  while (endpoint)
-  {
-    if (pni_matches(endpoint, SENDER, state) || pni_matches(endpoint, RECEIVER, state))
-      return (pn_link_t *) endpoint;
-    endpoint = endpoint->endpoint_next;
-  }
-
-  return NULL;
-}
-
-static void pn_session_incref(void *object)
-{
-  pn_session_t *session = (pn_session_t *) object;
-  if (!session->endpoint.referenced) {
-    session->endpoint.referenced = true;
-    pn_incref(session->connection);
-  } else {
-    pn_object_incref(object);
-  }
-}
-
-static bool pn_ep_bound(pn_endpoint_t *endpoint)
-{
-  pn_connection_t *conn = pni_ep_get_connection(endpoint);
-  pn_session_t *ssn;
-  pn_link_t *lnk;
-
-  if (!conn->transport) return false;
-  if (endpoint->modified) return true;
-
-  switch (endpoint->type) {
-  case CONNECTION:
-    return ((pn_connection_t *)endpoint)->transport;
-  case SESSION:
-    ssn = (pn_session_t *) endpoint;
-    return (((int16_t) ssn->state.local_channel) >= 0 || ((int16_t) ssn->state.remote_channel) >= 0);
-  case SENDER:
-  case RECEIVER:
-    lnk = (pn_link_t *) endpoint;
-    return ((int32_t) lnk->state.local_handle) >= 0 || ((int32_t) lnk->state.remote_handle) >= 0;
-  default:
-    assert(false);
-    return false;
-  }
-}
-
-static bool pni_connection_live(pn_connection_t *conn) {
-  return pn_refcount(conn) > 1;
-}
-
-static bool pni_session_live(pn_session_t *ssn) {
-  return pni_connection_live(ssn->connection) || pn_refcount(ssn) > 1;
-}
-
-static bool pni_link_live(pn_link_t *link) {
-  return pni_session_live(link->session) || pn_refcount(link) > 1;
-}
-
-static bool pni_endpoint_live(pn_endpoint_t *endpoint) {
-  switch (endpoint->type) {
-  case CONNECTION:
-    return pni_connection_live((pn_connection_t *)endpoint);
-  case SESSION:
-    return pni_session_live((pn_session_t *) endpoint);
-  case SENDER:
-  case RECEIVER:
-    return pni_link_live((pn_link_t *) endpoint);
-  default:
-    assert(false);
-    return false;
-  }
-}
-
-static bool pni_preserve_child(pn_endpoint_t *endpoint)
-{
-  pn_connection_t *conn = pni_ep_get_connection(endpoint);
-  pn_endpoint_t *parent = pn_ep_parent(endpoint);
-  if (pni_endpoint_live(parent) && (!endpoint->freed || (pn_ep_bound(endpoint)))
-      && endpoint->referenced) {
-    pn_object_incref(endpoint);
-    endpoint->referenced = false;
-    pn_decref(parent);
-    return true;
-  } else {
-    LL_REMOVE(conn, transport, endpoint);
-    return false;
-  }
-}
-
-static void pn_session_finalize(void *object)
-{
-  pn_session_t *session = (pn_session_t *) object;
-  pn_endpoint_t *endpoint = &session->endpoint;
-
-  if (pni_preserve_child(endpoint)) {
-    return;
-  }
-
-  pn_free(session->context);
-  pni_free_children(session->links, session->freed);
-  pni_endpoint_tini(endpoint);
-  pn_delivery_map_free(&session->state.incoming);
-  pn_delivery_map_free(&session->state.outgoing);
-  pn_free(session->state.local_handles);
-  pn_free(session->state.remote_handles);
-  pni_remove_session(session->connection, session);
-  pn_list_remove(session->connection->freed, session);
-
-  if (session->connection->transport) {
-    pn_transport_t *transport = session->connection->transport;
-    pn_hash_del(transport->local_channels, session->state.local_channel);
-    pn_hash_del(transport->remote_channels, session->state.remote_channel);
-  }
-
-  if (endpoint->referenced) {
-    pn_decref(session->connection);
-  }
-}
-
-#define pn_session_new pn_object_new
-#define pn_session_refcount pn_object_refcount
-#define pn_session_decref pn_object_decref
-#define pn_session_reify pn_object_reify
-#define pn_session_initialize NULL
-#define pn_session_hashcode NULL
-#define pn_session_compare NULL
-#define pn_session_inspect NULL
-
-pn_session_t *pn_session(pn_connection_t *conn)
-{
-  assert(conn);
-
-
-  pn_transport_t * transport = pn_connection_transport(conn);
-
-  if(transport) {
-    // channel_max is an index, not a count.  
-    if(pn_hash_size(transport->local_channels) > (size_t)transport->channel_max) {
-      pn_transport_logf(transport, 
-                        "pn_session: too many sessions: %d  channel_max is %d",
-                        pn_hash_size(transport->local_channels),
-                        transport->channel_max);
-      return (pn_session_t *) 0;
-    }
-  }
-
-#define pn_session_free pn_object_free
-  static const pn_class_t clazz = PN_METACLASS(pn_session);
-#undef pn_session_free
-  pn_session_t *ssn = (pn_session_t *) pn_class_new(&clazz, sizeof(pn_session_t));
-  if (!ssn) return NULL;
-  pn_endpoint_init(&ssn->endpoint, SESSION, conn);
-  pni_add_session(conn, ssn);
-  ssn->links = pn_list(PN_WEAKREF, 0);
-  ssn->freed = pn_list(PN_WEAKREF, 0);
-  ssn->context = pn_record();
-  ssn->incoming_capacity = 1024*1024;
-  ssn->incoming_bytes = 0;
-  ssn->outgoing_bytes = 0;
-  ssn->incoming_deliveries = 0;
-  ssn->outgoing_deliveries = 0;
-  ssn->outgoing_window = 2147483647;
-
-  // begin transport state
-  memset(&ssn->state, 0, sizeof(ssn->state));
-  ssn->state.local_channel = (uint16_t)-1;
-  ssn->state.remote_channel = (uint16_t)-1;
-  pn_delivery_map_init(&ssn->state.incoming, 0);
-  pn_delivery_map_init(&ssn->state.outgoing, 0);
-  ssn->state.local_handles = pn_hash(PN_WEAKREF, 0, 0.75);
-  ssn->state.remote_handles = pn_hash(PN_WEAKREF, 0, 0.75);
-  // end transport state
-
-  pn_collector_put(conn->collector, PN_OBJECT, ssn, PN_SESSION_INIT);
-  if (conn->transport) {
-    pni_session_bound(ssn);
-  }
-  pn_decref(ssn);
-  return ssn;
-}
-
-static void pni_session_bound(pn_session_t *ssn)
-{
-  assert(ssn);
-  size_t nlinks = pn_list_size(ssn->links);
-  for (size_t i = 0; i < nlinks; i++) {
-    pni_link_bound((pn_link_t *) pn_list_get(ssn->links, i));
-  }
-}
-
-void pn_session_unbound(pn_session_t* ssn)
-{
-  assert(ssn);
-  ssn->state.local_channel = (uint16_t)-1;
-  ssn->state.remote_channel = (uint16_t)-1;
-  ssn->incoming_bytes = 0;
-  ssn->outgoing_bytes = 0;
-  ssn->incoming_deliveries = 0;
-  ssn->outgoing_deliveries = 0;
-}
-
-size_t pn_session_get_incoming_capacity(pn_session_t *ssn)
-{
-  assert(ssn);
-  return ssn->incoming_capacity;
-}
-
-void pn_session_set_incoming_capacity(pn_session_t *ssn, size_t capacity)
-{
-  assert(ssn);
-  // XXX: should this trigger a flow?
-  ssn->incoming_capacity = capacity;
-}
-
-size_t pn_session_get_outgoing_window(pn_session_t *ssn)
-{
-  assert(ssn);
-  return ssn->outgoing_window;
-}
-
-void pn_session_set_outgoing_window(pn_session_t *ssn, size_t window)
-{
-  assert(ssn);
-  ssn->outgoing_window = window;
-}
-
-size_t pn_session_outgoing_bytes(pn_session_t *ssn)
-{
-  assert(ssn);
-  return ssn->outgoing_bytes;
-}
-
-size_t pn_session_incoming_bytes(pn_session_t *ssn)
-{
-  assert(ssn);
-  return ssn->incoming_bytes;
-}
-
-pn_state_t pn_session_state(pn_session_t *session)
-{
-  return session->endpoint.state;
-}
-
-pn_error_t *pn_session_error(pn_session_t *session)
-{
-  return session->endpoint.error;
-}
-
-static void pni_terminus_init(pn_terminus_t *terminus, pn_terminus_type_t type)
-{
-  terminus->type = type;
-  terminus->address = pn_string(NULL);
-  terminus->durability = PN_NONDURABLE;
-  terminus->expiry_policy = PN_EXPIRE_WITH_SESSION;
-  terminus->timeout = 0;
-  terminus->dynamic = false;
-  terminus->distribution_mode = PN_DIST_MODE_UNSPECIFIED;
-  terminus->properties = pn_data(0);
-  terminus->capabilities = pn_data(0);
-  terminus->outcomes = pn_data(0);
-  terminus->filter = pn_data(0);
-}
-
-static void pn_link_incref(void *object)
-{
-  pn_link_t *link = (pn_link_t *) object;
-  if (!link->endpoint.referenced) {
-    link->endpoint.referenced = true;
-    pn_incref(link->session);
-  } else {
-    pn_object_incref(object);
-  }
-}
-
-static void pn_link_finalize(void *object)
-{
-  pn_link_t *link = (pn_link_t *) object;
-  pn_endpoint_t *endpoint = &link->endpoint;
-
-  if (pni_preserve_child(endpoint)) {
-    return;
-  }
-
-  while (link->unsettled_head) {
-    assert(!link->unsettled_head->referenced);
-    pn_free(link->unsettled_head);
-  }
-
-  pn_free(link->context);
-  pni_terminus_free(&link->source);
-  pni_terminus_free(&link->target);
-  pni_terminus_free(&link->remote_source);
-  pni_terminus_free(&link->remote_target);
-  pn_free(link->name);
-  pni_endpoint_tini(endpoint);
-  pni_remove_link(link->session, link);
-  pn_hash_del(link->session->state.local_handles, link->state.local_handle);
-  pn_hash_del(link->session->state.remote_handles, link->state.remote_handle);
-  pn_list_remove(link->session->freed, link);
-  if (endpoint->referenced) {
-    pn_decref(link->session);
-  }
-}
-
-#define pn_link_refcount pn_object_refcount
-#define pn_link_decref pn_object_decref
-#define pn_link_reify pn_object_reify
-#define pn_link_initialize NULL
-#define pn_link_hashcode NULL
-#define pn_link_compare NULL
-#define pn_link_inspect NULL
-
-pn_link_t *pn_link_new(int type, pn_session_t *session, const char *name)
-{
-#define pn_link_new pn_object_new
-#define pn_link_free pn_object_free
-  static const pn_class_t clazz = PN_METACLASS(pn_link);
-#undef pn_link_new
-#undef pn_link_free
-  pn_link_t *link = (pn_link_t *) pn_class_new(&clazz, sizeof(pn_link_t));
-
-  pn_endpoint_init(&link->endpoint, type, session->connection);
-  pni_add_link(session, link);
-  pn_incref(session);  // keep session until link finalized
-  link->name = pn_string(name);
-  pni_terminus_init(&link->source, PN_SOURCE);
-  pni_terminus_init(&link->target, PN_TARGET);
-  pni_terminus_init(&link->remote_source, PN_UNSPECIFIED);
-  pni_terminus_init(&link->remote_target, PN_UNSPECIFIED);
-  link->unsettled_head = link->unsettled_tail = link->current = NULL;
-  link->unsettled_count = 0;
-  link->max_message_size = 0;
-  link->remote_max_message_size = 0;
-  link->available = 0;
-  link->credit = 0;
-  link->queued = 0;
-  link->drain = false;
-  link->drain_flag_mode = true;
-  link->drained = 0;
-  link->context = pn_record();
-  link->snd_settle_mode = PN_SND_MIXED;
-  link->rcv_settle_mode = PN_RCV_FIRST;
-  link->remote_snd_settle_mode = PN_SND_MIXED;
-  link->remote_rcv_settle_mode = PN_RCV_FIRST;
-  link->detached = false;
-
-  // begin transport state
-  link->state.local_handle = -1;
-  link->state.remote_handle = -1;
-  link->state.delivery_count = 0;
-  link->state.link_credit = 0;
-  // end transport state
-
-  pn_collector_put(session->connection->collector, PN_OBJECT, link, PN_LINK_INIT);
-  if (session->connection->transport) {
-    pni_link_bound(link);
-  }
-  pn_decref(link);
-  return link;
-}
-
-static void pni_link_bound(pn_link_t *link)
-{
-}
-
-void pn_link_unbound(pn_link_t* link)
-{
-  assert(link);
-  link->state.local_handle = -1;
-  link->state.remote_handle = -1;
-  link->state.delivery_count = 0;
-  link->state.link_credit = 0;
-}
-
-pn_terminus_t *pn_link_source(pn_link_t *link)
-{
-  return link ? &link->source : NULL;
-}
-
-pn_terminus_t *pn_link_target(pn_link_t *link)
-{
-  return link ? &link->target : NULL;
-}
-
-pn_terminus_t *pn_link_remote_source(pn_link_t *link)
-{
-  return link ? &link->remote_source : NULL;
-}
-
-pn_terminus_t *pn_link_remote_target(pn_link_t *link)
-{
-  return link ? &link->remote_target : NULL;
-}
-
-int pn_terminus_set_type(pn_terminus_t *terminus, pn_terminus_type_t type)
-{
-  if (!terminus) return PN_ARG_ERR;
-  terminus->type = type;
-  return 0;
-}
-
-pn_terminus_type_t pn_terminus_get_type(pn_terminus_t *terminus)
-{
-  return terminus ? terminus->type : (pn_terminus_type_t) 0;
-}
-
-const char *pn_terminus_get_address(pn_terminus_t *terminus)
-{
-  assert(terminus);
-  return pn_string_get(terminus->address);
-}
-
-int pn_terminus_set_address(pn_terminus_t *terminus, const char *address)
-{
-  assert(terminus);
-  return pn_string_set(terminus->address, address);
-}
-
-pn_durability_t pn_terminus_get_durability(pn_terminus_t *terminus)
-{
-  return terminus ? terminus->durability : (pn_durability_t) 0;
-}
-
-int pn_terminus_set_durability(pn_terminus_t *terminus, pn_durability_t durability)
-{
-  if (!terminus) return PN_ARG_ERR;
-  terminus->durability = durability;
-  return 0;
-}
-
-pn_expiry_policy_t pn_terminus_get_expiry_policy(pn_terminus_t *terminus)
-{
-  return terminus ? terminus->expiry_policy : (pn_expiry_policy_t) 0;
-}
-
-int pn_terminus_set_expiry_policy(pn_terminus_t *terminus, pn_expiry_policy_t expiry_policy)
-{
-  if (!terminus) return PN_ARG_ERR;
-  terminus->expiry_policy = expiry_policy;
-  return 0;
-}
-
-pn_seconds_t pn_terminus_get_timeout(pn_terminus_t *terminus)
-{
-  return terminus ? terminus->timeout : 0;
-}
-
-int pn_terminus_set_timeout(pn_terminus_t *terminus, pn_seconds_t timeout)
-{
-  if (!terminus) return PN_ARG_ERR;
-  terminus->timeout = timeout;
-  return 0;
-}
-
-bool pn_terminus_is_dynamic(pn_terminus_t *terminus)
-{
-  return terminus ? terminus->dynamic : false;
-}
-
-int pn_terminus_set_dynamic(pn_terminus_t *terminus, bool dynamic)
-{
-  if (!terminus) return PN_ARG_ERR;
-  terminus->dynamic = dynamic;
-  return 0;
-}
-
-pn_data_t *pn_terminus_properties(pn_terminus_t *terminus)
-{
-  return terminus ? terminus->properties : NULL;
-}
-
-pn_data_t *pn_terminus_capabilities(pn_terminus_t *terminus)
-{
-  return terminus ? terminus->capabilities : NULL;
-}
-
-pn_data_t *pn_terminus_outcomes(pn_terminus_t *terminus)
-{
-  return terminus ? terminus->outcomes : NULL;
-}
-
-pn_data_t *pn_terminus_filter(pn_terminus_t *terminus)
-{
-  return terminus ? terminus->filter : NULL;
-}
-
-pn_distribution_mode_t pn_terminus_get_distribution_mode(const pn_terminus_t *terminus)
-{
-  return terminus ? terminus->distribution_mode : PN_DIST_MODE_UNSPECIFIED;
-}
-
-int pn_terminus_set_distribution_mode(pn_terminus_t *terminus, pn_distribution_mode_t m)
-{
-  if (!terminus) return PN_ARG_ERR;
-  terminus->distribution_mode = m;
-  return 0;
-}
-
-int pn_terminus_copy(pn_terminus_t *terminus, pn_terminus_t *src)
-{
-  if (!terminus || !src) {
-    return PN_ARG_ERR;
-  }
-
-  terminus->type = src->type;
-  int err = pn_terminus_set_address(terminus, pn_terminus_get_address(src));
-  if (err) return err;
-  terminus->durability = src->durability;
-  terminus->expiry_policy = src->expiry_policy;
-  terminus->timeout = src->timeout;
-  terminus->dynamic = src->dynamic;
-  terminus->distribution_mode = src->distribution_mode;
-  err = pn_data_copy(terminus->properties, src->properties);
-  if (err) return err;
-  err = pn_data_copy(terminus->capabilities, src->capabilities);
-  if (err) return err;
-  err = pn_data_copy(terminus->outcomes, src->outcomes);
-  if (err) return err;
-  err = pn_data_copy(terminus->filter, src->filter);
-  if (err) return err;
-  return 0;
-}
-
-pn_link_t *pn_sender(pn_session_t *session, const char *name)
-{
-  return pn_link_new(SENDER, session, name);
-}
-
-pn_link_t *pn_receiver(pn_session_t *session, const char *name)
-{
-  return pn_link_new(RECEIVER, session, name);
-}
-
-pn_state_t pn_link_state(pn_link_t *link)
-{
-  return link->endpoint.state;
-}
-
-pn_error_t *pn_link_error(pn_link_t *link)
-{
-  return link->endpoint.error;
-}
-
-const char *pn_link_name(pn_link_t *link)
-{
-  assert(link);
-  return pn_string_get(link->name);
-}
-
-bool pn_link_is_sender(pn_link_t *link)
-{
-  return link->endpoint.type == SENDER;
-}
-
-bool pn_link_is_receiver(pn_link_t *link)
-{
-  return link->endpoint.type == RECEIVER;
-}
-
-pn_session_t *pn_link_session(pn_link_t *link)
-{
-  assert(link);
-  return link->session;
-}
-
-static void pn_disposition_finalize(pn_disposition_t *ds)
-{
-  pn_free(ds->data);
-  pn_free(ds->annotations);
-  pn_condition_tini(&ds->condition);
-}
-
-static void pn_delivery_incref(void *object)
-{
-  pn_delivery_t *delivery = (pn_delivery_t *) object;
-  if (delivery->link && !delivery->referenced) {
-    delivery->referenced = true;
-    pn_incref(delivery->link);
-  } else {
-    pn_object_incref(object);
-  }
-}
-
-static bool pni_preserve_delivery(pn_delivery_t *delivery)
-{
-  pn_connection_t *conn = delivery->link->session->connection;
-  return !delivery->local.settled || (conn->transport && (delivery->state.init || delivery->tpwork));
-}
-
-static void pn_delivery_finalize(void *object)
-{
-  pn_delivery_t *delivery = (pn_delivery_t *) object;
-  pn_link_t *link = delivery->link;
-  //  assert(!delivery->state.init);
-
-  bool pooled = false;
-  bool referenced = true;
-  if (link) {
-    if (pni_link_live(link) && pni_preserve_delivery(delivery) && delivery->referenced) {
-      delivery->referenced = false;
-      pn_object_incref(delivery);
-      pn_decref(link);
-      return;
-    }
-    referenced = delivery->referenced;
-
-    pn_clear_tpwork(delivery);
-    LL_REMOVE(link, unsettled, delivery);
-    pn_delivery_map_del(pn_link_is_sender(link)
-                        ? &link->session->state.outgoing
-                        : &link->session->state.incoming,
-                        delivery);
-    pn_buffer_clear(delivery->tag);
-    pn_buffer_clear(delivery->bytes);
-    pn_record_clear(delivery->context);
-    delivery->settled = true;
-    pn_connection_t *conn = link->session->connection;
-    assert(pn_refcount(delivery) == 0);
-    if (pni_connection_live(conn)) {
-      pn_list_t *pool = link->session->connection->delivery_pool;
-      delivery->link = NULL;
-      pn_list_add(pool, delivery);
-      pooled = true;
-      assert(pn_refcount(delivery) == 1);
-    }
-  }
-
-  if (!pooled) {
-    pn_free(delivery->context);
-    pn_buffer_free(delivery->tag);
-    pn_buffer_free(delivery->bytes);
-    pn_disposition_finalize(&delivery->local);
-    pn_disposition_finalize(&delivery->remote);
-  }
-
-  if (referenced) {
-    pn_decref(link);
-  }
-}
-
-static void pn_disposition_init(pn_disposition_t *ds)
-{
-  ds->data = pn_data(0);
-  ds->annotations = pn_data(0);
-  pn_condition_init(&ds->condition);
-}
-
-static void pn_disposition_clear(pn_disposition_t *ds)
-{
-  ds->type = 0;
-  ds->section_number = 0;
-  ds->section_offset = 0;
-  ds->failed = false;
-  ds->undeliverable = false;
-  ds->settled = false;
-  pn_data_clear(ds->data);
-  pn_data_clear(ds->annotations);
-  pn_condition_clear(&ds->condition);
-}
-
-#define pn_delivery_new pn_object_new
-#define pn_delivery_refcount pn_object_refcount
-#define pn_delivery_decref pn_object_decref
-#define pn_delivery_free pn_object_free
-#define pn_delivery_reify pn_object_reify
-#define pn_delivery_initialize NULL
-#define pn_delivery_hashcode NULL
-#define pn_delivery_compare NULL
-#define pn_delivery_inspect NULL
-
-pn_delivery_tag_t pn_dtag(const char *bytes, size_t size) {
-  pn_delivery_tag_t dtag = {size, bytes};
-  return dtag;
-}
-
-pn_delivery_t *pn_delivery(pn_link_t *link, pn_delivery_tag_t tag)
-{
-  assert(link);
-  pn_list_t *pool = link->session->connection->delivery_pool;
-  pn_delivery_t *delivery = (pn_delivery_t *) pn_list_pop(pool);
-  if (!delivery) {
-    static const pn_class_t clazz = PN_METACLASS(pn_delivery);
-    delivery = (pn_delivery_t *) pn_class_new(&clazz, sizeof(pn_delivery_t));
-    if (!delivery) return NULL;
-    delivery->tag = pn_buffer(16);
-    delivery->bytes = pn_buffer(64);
-    pn_disposition_init(&delivery->local);
-    pn_disposition_init(&delivery->remote);
-    delivery->context = pn_record();
-  } else {
-    assert(!delivery->state.init);
-  }
-  delivery->link = link;
-  pn_incref(delivery->link);  // keep link until finalized
-  pn_buffer_clear(delivery->tag);
-  pn_buffer_append(delivery->tag, tag.start, tag.size);
-  pn_disposition_clear(&delivery->local);
-  pn_disposition_clear(&delivery->remote);
-  delivery->updated = false;
-  delivery->settled = false;
-  LL_ADD(link, unsettled, delivery);
-  delivery->referenced = true;
-  delivery->work_next = NULL;
-  delivery->work_prev = NULL;
-  delivery->work = false;
-  delivery->tpwork_next = NULL;
-  delivery->tpwork_prev = NULL;
-  delivery->tpwork = false;
-  pn_buffer_clear(delivery->bytes);
-  delivery->done = false;
-  pn_record_clear(delivery->context);
-
-  // begin delivery state
-  delivery->state.init = false;
-  delivery->state.sent = false;
-  // end delivery state
-
-  if (!link->current)
-    link->current = delivery;
-
-  link->unsettled_count++;
-
-  pn_work_update(link->session->connection, delivery);
-
-  // XXX: could just remove incref above
-  pn_decref(delivery);
-
-  return delivery;
-}
-
-bool pn_delivery_buffered(pn_delivery_t *delivery)
-{
-  assert(delivery);
-  if (delivery->settled) return false;
-  if (pn_link_is_sender(delivery->link)) {
-    pn_delivery_state_t *state = &delivery->state;
-    if (state->sent) {
-      return false;
-    } else {
-      return delivery->done || (pn_buffer_size(delivery->bytes) > 0);
-    }
-  } else {
-    return false;
-  }
-}
-
-int pn_link_unsettled(pn_link_t *link)
-{
-  return link->unsettled_count;
-}
-
-pn_delivery_t *pn_unsettled_head(pn_link_t *link)
-{
-  pn_delivery_t *d = link->unsettled_head;
-  while (d && d->local.settled) {
-    d = d->unsettled_next;
-  }
-  return d;
-}
-
-pn_delivery_t *pn_unsettled_next(pn_delivery_t *delivery)
-{
-  pn_delivery_t *d = delivery->unsettled_next;
-  while (d && d->local.settled) {
-    d = d->unsettled_next;
-  }
-  return d;
-}
-
-bool pn_delivery_current(pn_delivery_t *delivery)
-{
-  pn_link_t *link = delivery->link;
-  return pn_link_current(link) == delivery;
-}
-
-void pn_delivery_dump(pn_delivery_t *d)
-{
-  char tag[1024];
-  pn_bytes_t bytes = pn_buffer_bytes(d->tag);
-  pn_quote_data(tag, 1024, bytes.start, bytes.size);
-  printf("{tag=%s, local.type=%" PRIu64 ", remote.type=%" PRIu64 ", local.settled=%u, "
-         "remote.settled=%u, updated=%u, current=%u, writable=%u, readable=%u, "
-         "work=%u}",
-         tag, d->local.type, d->remote.type, d->local.settled,
-         d->remote.settled, d->updated, pn_delivery_current(d),
-         pn_delivery_writable(d), pn_delivery_readable(d), d->work);
-}
-
-void *pn_delivery_get_context(pn_delivery_t *delivery)
-{
-  assert(delivery);
-  return pn_record_get(delivery->context, PN_LEGCTX);
-}
-
-void pn_delivery_set_context(pn_delivery_t *delivery, void *context)
-{
-  assert(delivery);
-  pn_record_set(delivery->context, PN_LEGCTX, context);
-}
-
-pn_record_t *pn_delivery_attachments(pn_delivery_t *delivery)
-{
-  assert(delivery);
-  return delivery->context;
-}
-
-uint64_t pn_disposition_type(pn_disposition_t *disposition)
-{
-  assert(disposition);
-  return disposition->type;
-}
-
-pn_data_t *pn_disposition_data(pn_disposition_t *disposition)
-{
-  assert(disposition);
-  return disposition->data;
-}
-
-uint32_t pn_disposition_get_section_number(pn_disposition_t *disposition)
-{
-  assert(disposition);
-  return disposition->section_number;
-}
-
-void pn_disposition_set_section_number(pn_disposition_t *disposition, uint32_t section_number)
-{
-  assert(disposition);
-  disposition->section_number = section_number;
-}
-
-uint64_t pn_disposition_get_section_offset(pn_disposition_t *disposition)
-{
-  assert(disposition);
-  return disposition->section_offset;
-}
-
-void pn_disposition_set_section_offset(pn_disposition_t *disposition, uint64_t section_offset)
-{
-  assert(disposition);
-  disposition->section_offset = section_offset;
-}
-
-bool pn_disposition_is_failed(pn_disposition_t *disposition)
-{
-  assert(disposition);
-  return disposition->failed;
-}
-
-void pn_disposition_set_failed(pn_disposition_t *disposition, bool failed)
-{
-  assert(disposition);
-  disposition->failed = failed;
-}
-
-bool pn_disposition_is_undeliverable(pn_disposition_t *disposition)
-{
-  assert(disposition);
-  return disposition->undeliverable;
-}
-
-void pn_disposition_set_undeliverable(pn_disposition_t *disposition, bool undeliverable)
-{
-  assert(disposition);
-  disposition->undeliverable = undeliverable;
-}
-
-pn_data_t *pn_disposition_annotations(pn_disposition_t *disposition)
-{
-  assert(disposition);
-  return disposition->annotations;
-}
-
-pn_condition_t *pn_disposition_condition(pn_disposition_t *disposition)
-{
-  assert(disposition);
-  return &disposition->condition;
-}
-
-pn_delivery_tag_t pn_delivery_tag(pn_delivery_t *delivery)
-{
-  if (delivery) {
-    pn_bytes_t tag = pn_buffer_bytes(delivery->tag);
-    return pn_dtag(tag.start, tag.size);
-  } else {
-    return pn_dtag(0, 0);
-  }
-}
-
-pn_delivery_t *pn_link_current(pn_link_t *link)
-{
-  if (!link) return NULL;
-  return link->current;
-}
-
-static void pni_advance_sender(pn_link_t *link)
-{
-  link->current->done = true;
-  link->queued++;
-  link->credit--;
-  link->session->outgoing_deliveries++;
-  pni_add_tpwork(link->current);
-  link->current = link->current->unsettled_next;
-}
-
-static void pni_advance_receiver(pn_link_t *link)
-{
-  link->credit--;
-  link->queued--;
-  link->session->incoming_deliveries--;
-
-  pn_delivery_t *current = link->current;
-  link->session->incoming_bytes -= pn_buffer_size(current->bytes);
-  pn_buffer_clear(current->bytes);
-
-  if (!link->session->state.incoming_window) {
-    pni_add_tpwork(current);
-  }
-
-  link->current = link->current->unsettled_next;
-}
-
-bool pn_link_advance(pn_link_t *link)
-{
-  if (link && link->current) {
-    pn_delivery_t *prev = link->current;
-    if (link->endpoint.type == SENDER) {
-      pni_advance_sender(link);
-    } else {
-      pni_advance_receiver(link);
-    }
-    pn_delivery_t *next = link->current;
-    pn_work_update(link->session->connection, prev);
-    if (next) pn_work_update(link->session->connection, next);
-    return prev != next;
-  } else {
-    return false;
-  }
-}
-
-int pn_link_credit(pn_link_t *link)
-{
-  return link ? link->credit : 0;
-}
-
-int pn_link_available(pn_link_t *link)
-{
-  return link ? link->available : 0;
-}
-
-int pn_link_queued(pn_link_t *link)
-{
-  return link ? link->queued : 0;
-}
-
-int pn_link_remote_credit(pn_link_t *link)
-{
-  assert(link);
-  return link->credit - link->queued;
-}
-
-bool pn_link_get_drain(pn_link_t *link)
-{
-  assert(link);
-  return link->drain;
-}
-
-pn_snd_settle_mode_t pn_link_snd_settle_mode(pn_link_t *link)
-{
-  return link ? (pn_snd_settle_mode_t)link->snd_settle_mode
-      : PN_SND_MIXED;
-}
-
-pn_rcv_settle_mode_t pn_link_rcv_settle_mode(pn_link_t *link)
-{
-  return link ? (pn_rcv_settle_mode_t)link->rcv_settle_mode
-      : PN_RCV_FIRST;
-}
-
-pn_snd_settle_mode_t pn_link_remote_snd_settle_mode(pn_link_t *link)
-{
-  return link ? (pn_snd_settle_mode_t)link->remote_snd_settle_mode
-      : PN_SND_MIXED;
-}
-
-pn_rcv_settle_mode_t pn_link_remote_rcv_settle_mode(pn_link_t *link)
-{
-  return link ? (pn_rcv_settle_mode_t)link->remote_rcv_settle_mode
-      : PN_RCV_FIRST;
-}
-void pn_link_set_snd_settle_mode(pn_link_t *link, pn_snd_settle_mode_t mode)
-{
-  if (link)
-    link->snd_settle_mode = (uint8_t)mode;
-}
-void pn_link_set_rcv_settle_mode(pn_link_t *link, pn_rcv_settle_mode_t mode)
-{
-  if (link)
-    link->rcv_settle_mode = (uint8_t)mode;
-}
-
-void pn_delivery_settle(pn_delivery_t *delivery)
-{
-  assert(delivery);
-  if (!delivery->local.settled) {
-    pn_link_t *link = delivery->link;
-    if (pn_delivery_current(delivery)) {
-      pn_link_advance(link);
-    }
-
-    link->unsettled_count--;
-    delivery->local.settled = true;
-    pni_add_tpwork(delivery);
-    pn_work_update(delivery->link->session->connection, delivery);
-    pn_incref(delivery);
-    pn_decref(delivery);
-  }
-}
-
-void pn_link_offered(pn_link_t *sender, int credit)
-{
-  sender->available = credit;
-}
-
-ssize_t pn_link_send(pn_link_t *sender, const char *bytes, size_t n)
-{
-  pn_delivery_t *current = pn_link_current(sender);
-  if (!current) return PN_EOS;
-  if (!bytes || !n) return 0;
-  pn_buffer_append(current->bytes, bytes, n);
-  sender->session->outgoing_bytes += n;
-  pni_add_tpwork(current);
-  return n;
-}
-
-int pn_link_drained(pn_link_t *link)
-{
-  assert(link);
-  int drained = 0;
-
-  if (pn_link_is_sender(link)) {
-    if (link->drain && link->credit > 0) {
-      link->drained = link->credit;
-      link->credit = 0;
-      pn_modified(link->session->connection, &link->endpoint, true);
-      drained = link->drained;
-    }
-  } else {
-    drained = link->drained;
-    link->drained = 0;
-  }
-
-  return drained;
-}
-
-ssize_t pn_link_recv(pn_link_t *receiver, char *bytes, size_t n)
-{
-  if (!receiver) return PN_ARG_ERR;
-
-  pn_delivery_t *delivery = receiver->current;
-  if (delivery) {
-    size_t size = pn_buffer_get(delivery->bytes, 0, n, bytes);
-    pn_buffer_trim(delivery->bytes, size, 0);
-    if (size) {
-      receiver->session->incoming_bytes -= size;
-      if (!receiver->session->state.incoming_window) {
-        pni_add_tpwork(delivery);
-      }
-      return size;
-    } else {
-      return delivery->done ? PN_EOS : 0;
-    }
-  } else {
-    return PN_STATE_ERR;
-  }
-}
-
-void pn_link_flow(pn_link_t *receiver, int credit)
-{
-  assert(receiver);
-  assert(pn_link_is_receiver(receiver));
-  receiver->credit += credit;
-  pn_modified(receiver->session->connection, &receiver->endpoint, true);
-  if (!receiver->drain_flag_mode) {
-    pn_link_set_drain(receiver, false);
-    receiver->drain_flag_mode = false;
-  }
-}
-
-void pn_link_drain(pn_link_t *receiver, int credit)
-{
-  assert(receiver);
-  assert(pn_link_is_receiver(receiver));
-  pn_link_set_drain(receiver, true);
-  pn_link_flow(receiver, credit);
-  receiver->drain_flag_mode = false;
-}
-
-void pn_link_set_drain(pn_link_t *receiver, bool drain)
-{
-  assert(receiver);
-  assert(pn_link_is_receiver(receiver));
-  receiver->drain = drain;
-  pn_modified(receiver->session->connection, &receiver->endpoint, true);
-  receiver->drain_flag_mode = true;
-}
-
-bool pn_link_draining(pn_link_t *receiver)
-{
-  assert(receiver);
-  assert(pn_link_is_receiver(receiver));
-  return receiver->drain && (pn_link_credit(receiver) > pn_link_queued(receiver));
-}
-
-uint64_t pn_link_max_message_size(pn_link_t *link)
-{
-  return link->max_message_size;
-}
-
-void pn_link_set_max_message_size(pn_link_t *link, uint64_t size)
-{
-  link->max_message_size = size;
-}
-
-uint64_t pn_link_remote_max_message_size(pn_link_t *link)
-{
-  return link->remote_max_message_size;
-}
-
-pn_link_t *pn_delivery_link(pn_delivery_t *delivery)
-{
-  assert(delivery);
-  return delivery->link;
-}
-
-pn_disposition_t *pn_delivery_local(pn_delivery_t *delivery)
-{
-  assert(delivery);
-  return &delivery->local;
-}
-
-uint64_t pn_delivery_local_state(pn_delivery_t *delivery)
-{
-  assert(delivery);
-  return delivery->local.type;
-}
-
-pn_disposition_t *pn_delivery_remote(pn_delivery_t *delivery)
-{
-  assert(delivery);
-  return &delivery->remote;
-}
-
-uint64_t pn_delivery_remote_state(pn_delivery_t *delivery)
-{
-  assert(delivery);
-  return delivery->remote.type;
-}
-
-bool pn_delivery_settled(pn_delivery_t *delivery)
-{
-  return delivery ? delivery->remote.settled : false;
-}
-
-bool pn_delivery_updated(pn_delivery_t *delivery)
-{
-  return delivery ? delivery->updated : false;
-}
-
-void pn_delivery_clear(pn_delivery_t *delivery)
-{
-  delivery->updated = false;
-  pn_work_update(delivery->link->session->connection, delivery);
-}
-
-void pn_delivery_update(pn_delivery_t *delivery, uint64_t state)
-{
-  if (!delivery) return;
-  delivery->local.type = state;
-  pni_add_tpwork(delivery);
-}
-
-bool pn_delivery_writable(pn_delivery_t *delivery)
-{
-  if (!delivery) return false;
-
-  pn_link_t *link = delivery->link;
-  return pn_link_is_sender(link) && pn_delivery_current(delivery) && pn_link_credit(link) > 0;
-}
-
-bool pn_delivery_readable(pn_delivery_t *delivery)
-{
-  if (delivery) {
-    pn_link_t *link = delivery->link;
-    return pn_link_is_receiver(link) && pn_delivery_current(delivery);
-  } else {
-    return false;
-  }
-}
-
-size_t pn_delivery_pending(pn_delivery_t *delivery)
-{
-  return pn_buffer_size(delivery->bytes);
-}
-
-bool pn_delivery_partial(pn_delivery_t *delivery)
-{
-  return !delivery->done;
-}
-
-pn_condition_t *pn_connection_condition(pn_connection_t *connection)
-{
-  assert(connection);
-  return &connection->endpoint.condition;
-}
-
-pn_condition_t *pn_connection_remote_condition(pn_connection_t *connection)
-{
-  assert(connection);
-  pn_transport_t *transport = connection->transport;
-  return transport ? &transport->remote_condition : NULL;
-}
-
-pn_condition_t *pn_session_condition(pn_session_t *session)
-{
-  assert(session);
-  return &session->endpoint.condition;
-}
-
-pn_condition_t *pn_session_remote_condition(pn_session_t *session)
-{
-  assert(session);
-  return &session->endpoint.remote_condition;
-}
-
-pn_condition_t *pn_link_condition(pn_link_t *link)
-{
-  assert(link);
-  return &link->endpoint.condition;
-}
-
-pn_condition_t *pn_link_remote_condition(pn_link_t *link)
-{
-  assert(link);
-  return &link->endpoint.remote_condition;
-}
-
-bool pn_condition_is_set(pn_condition_t *condition)
-{
-  return condition && pn_string_get(condition->name);
-}
-
-void pn_condition_clear(pn_condition_t *condition)
-{
-  assert(condition);
-  pn_string_clear(condition->name);
-  pn_string_clear(condition->description);
-  pn_data_clear(condition->info);
-}
-
-const char *pn_condition_get_name(pn_condition_t *condition)
-{
-  assert(condition);
-  return pn_string_get(condition->name);
-}
-
-int pn_condition_set_name(pn_condition_t *condition, const char *name)
-{
-  assert(condition);
-  return pn_string_set(condition->name, name);
-}
-
-const char *pn_condition_get_description(pn_condition_t *condition)
-{
-  assert(condition);
-  return pn_string_get(condition->description);
-}
-
-int pn_condition_set_description(pn_condition_t *condition, const char *description)
-{
-  assert(condition);
-  return pn_string_set(condition->description, description);
-}
-
-int pn_condition_vformat(pn_condition_t *condition, const char *name, const char *fmt, va_list ap)
-{
-  assert(condition);
-  int err = pn_condition_set_name(condition, name);
-  if (err)
-      return err;
-
-  char text[1024];
-  size_t n = pni_vsnprintf(text, 1024, fmt, ap);
-  if (n >= sizeof(text))
-      text[sizeof(text)-1] = '\0';
-  err = pn_condition_set_description(condition, text);
-  return err;
-}
-
-int pn_condition_format(pn_condition_t *condition, const char *name, const char *fmt, ...)
-{
-  assert(condition);
-  va_list ap;
-  va_start(ap, fmt);
-  int err = pn_condition_vformat(condition, name, fmt, ap);
-  va_end(ap);
-  return err;
-}
-
-pn_data_t *pn_condition_info(pn_condition_t *condition)
-{
-  assert(condition);
-  return condition->info;
-}
-
-bool pn_condition_is_redirect(pn_condition_t *condition)
-{
-  const char *name = pn_condition_get_name(condition);
-  return name && (!strcmp(name, "amqp:connection:redirect") ||
-                  !strcmp(name, "amqp:link:redirect"));
-}
-
-const char *pn_condition_redirect_host(pn_condition_t *condition)
-{
-  pn_data_t *data = pn_condition_info(condition);
-  pn_data_rewind(data);
-  pn_data_next(data);
-  pn_data_enter(data);
-  pn_data_lookup(data, "network-host");
-  pn_bytes_t host = pn_data_get_bytes(data);
-  pn_data_rewind(data);
-  return host.start;
-}
-
-int pn_condition_redirect_port(pn_condition_t *condition)
-{
-  pn_data_t *data = pn_condition_info(condition);
-  pn_data_rewind(data);
-  pn_data_next(data);
-  pn_data_enter(data);
-  pn_data_lookup(data, "port");
-  int port = pn_data_get_int(data);
-  pn_data_rewind(data);
-  return port;
-}
-
-pn_connection_t *pn_event_connection(pn_event_t *event)
-{
-  pn_session_t *ssn;
-  pn_transport_t *transport;
-
-  switch (pn_class_id(pn_event_class(event))) {
-  case CID_pn_connection:
-    return (pn_connection_t *) pn_event_context(event);
-  case CID_pn_transport:
-    transport = pn_event_transport(event);
-    if (transport)
-      return transport->connection;
-    return NULL;
-  default:
-    ssn = pn_event_session(event);
-    if (ssn)
-     return pn_session_connection(ssn);
-  }
-  return NULL;
-}
-
-pn_session_t *pn_event_session(pn_event_t *event)
-{
-  pn_link_t *link;
-  switch (pn_class_id(pn_event_class(event))) {
-  case CID_pn_session:
-    return (pn_session_t *) pn_event_context(event);
-  default:
-    link = pn_event_link(event);
-    if (link)
-      return pn_link_session(link);
-  }
-  return NULL;
-}
-
-pn_link_t *pn_event_link(pn_event_t *event)
-{
-  pn_delivery_t *dlv;
-  switch (pn_class_id(pn_event_class(event))) {
-  case CID_pn_link:
-    return (pn_link_t *) pn_event_context(event);
-  default:
-    dlv = pn_event_delivery(event);
-    if (dlv)
-      return pn_delivery_link(dlv);
-  }
-  return NULL;
-}
-
-pn_delivery_t *pn_event_delivery(pn_event_t *event)
-{
-  switch (pn_class_id(pn_event_class(event))) {
-  case CID_pn_delivery:
-    return (pn_delivery_t *) pn_event_context(event);
-  default:
-    return NULL;
-  }
-}
-
-pn_transport_t *pn_event_transport(pn_event_t *event)
-{
-  switch (pn_class_id(pn_event_class(event))) {
-  case CID_pn_transport:
-    return (pn_transport_t *) pn_event_context(event);
-  default:
-    {
-      pn_connection_t *conn = pn_event_connection(event);
-      if (conn)
-        return pn_connection_transport(conn);
-      return NULL;
-    }
-  }
-}
-
-int pn_condition_copy(pn_condition_t *dest, pn_condition_t *src) {
-  assert(dest);
-  assert(src);
-  int err = 0;
-  if (src != dest) {
-    int err = pn_string_copy(dest->name, src->name);
-    if (!err) err = pn_string_copy(dest->description, src->description);
-    if (!err) err = pn_data_copy(dest->info, src->info);
-  }
-  return err;
-}
diff --git a/proton-c/src/core/error.c b/proton-c/src/core/error.c
deleted file mode 100644
index 70d36fa..0000000
--- a/proton-c/src/core/error.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "platform/platform.h"
-#include "util.h"
-
-#include <proton/error.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-struct pn_error_t {
-  char *text;
-  pn_error_t *root;
-  int code;
-};
-
-pn_error_t *pn_error()
-{
-  pn_error_t *error = (pn_error_t *) malloc(sizeof(pn_error_t));
-  if (error != NULL) {
-    error->code = 0;
-    error->text = NULL;
-    error->root = NULL;
-  }
-  return error;
-}
-
-void pn_error_free(pn_error_t *error)
-{
-  if (error) {
-    free(error->text);
-    free(error);
-  }
-}
-
-void pn_error_clear(pn_error_t *error)
-{
-  if (error) {
-    error->code = 0;
-    free(error->text);
-    error->text = NULL;
-    error->root = NULL;
-  }
-}
-
-int pn_error_set(pn_error_t *error, int code, const char *text)
-{
-  assert(error);
-  pn_error_clear(error);
-  if (code) {
-    error->code = code;
-    error->text = pn_strdup(text);
-  }
-  return code;
-}
-
-int pn_error_vformat(pn_error_t *error, int code, const char *fmt, va_list ap)
-{
-  assert(error);
-  char text[1024];
-  int n = pni_vsnprintf(text, 1024, fmt, ap);
-  if (n >= 1024) {
-    text[1023] = '\0';
-  }
-  return pn_error_set(error, code, text);
-}
-
-int pn_error_format(pn_error_t *error, int code, const char *fmt, ...)
-{
-  assert(error);
-  va_list ap;
-  va_start(ap, fmt);
-  int rcode = pn_error_vformat(error, code, fmt, ap);
-  va_end(ap);
-  return rcode;
-}
-
-int pn_error_code(pn_error_t *error)
-{
-  assert(error);
-  return error->code;
-}
-
-const char *pn_error_text(pn_error_t *error)
-{
-  assert(error);
-  return error->text;
-}
-
-int pn_error_copy(pn_error_t *error, pn_error_t *src)
-{
-  assert(error);
-  if (src) {
-    return pn_error_set(error, pn_error_code(src), pn_error_text(src));
-  } else {
-    pn_error_clear(error);
-    return 0;
-  }
-}
-
-const char *pn_code(int code)
-{
-  switch (code)
-  {
-  case 0: return "<ok>";
-  case PN_EOS: return "PN_EOS";
-  case PN_ERR: return "PN_ERR";
-  case PN_OVERFLOW: return "PN_OVERFLOW";
-  case PN_UNDERFLOW: return "PN_UNDERFLOW";
-  case PN_STATE_ERR: return "PN_STATE_ERR";
-  case PN_ARG_ERR: return "PN_ARG_ERR";
-  case PN_TIMEOUT: return "PN_TIMEOUT";
-  case PN_INTR: return "PN_INTR";
-  case PN_OUT_OF_MEMORY: return "PN_OUT_OF_MEMORY";
-  default: return "<unknown>";
-  }
-}
diff --git a/proton-c/src/core/event.c b/proton-c/src/core/event.c
deleted file mode 100644
index 2a0a5cf..0000000
--- a/proton-c/src/core/event.c
+++ /dev/null
@@ -1,404 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include <stdio.h>
-#include <proton/object.h>
-#include <proton/event.h>
-#include <proton/reactor.h>
-#include <assert.h>
-
-struct pn_collector_t {
-  pn_list_t *pool;
-  pn_event_t *head;
-  pn_event_t *tail;
-  bool freed:1;
-  bool head_returned:1;         /* Head has been returned by pn_collector_next() */
-};
-
-struct pn_event_t {
-  pn_list_t *pool;
-  const pn_class_t *clazz;
-  void *context;    // depends on clazz
-  pn_record_t *attachments;
-  pn_event_t *next;
-  pn_event_type_t type;
-};
-
-static void pn_collector_initialize(pn_collector_t *collector)
-{
-  collector->pool = pn_list(PN_OBJECT, 0);
-  collector->head = NULL;
-  collector->tail = NULL;
-  collector->freed = false;
-}
-
-static void pn_collector_drain(pn_collector_t *collector)
-{
-  assert(collector);
-  while (pn_collector_next(collector))
-    ;
-  assert(!collector->head);
-  assert(!collector->tail);
-}
-
-static void pn_collector_shrink(pn_collector_t *collector)
-{
-  assert(collector);
-  pn_list_clear(collector->pool);
-}
-
-static void pn_collector_finalize(pn_collector_t *collector)
-{
-  pn_collector_drain(collector);
-  pn_decref(collector->pool);
-}
-
-static int pn_collector_inspect(pn_collector_t *collector, pn_string_t *dst)
-{
-  assert(collector);
-  int err = pn_string_addf(dst, "EVENTS[");
-  if (err) return err;
-  pn_event_t *event = collector->head;
-  bool first = true;
-  while (event) {
-    if (first) {
-      first = false;
-    } else {
-      err = pn_string_addf(dst, ", ");
-      if (err) return err;
-    }
-    err = pn_inspect(event, dst);
-    if (err) return err;
-    event = event->next;
-  }
-  return pn_string_addf(dst, "]");
-}
-
-#define pn_collector_hashcode NULL
-#define pn_collector_compare NULL
-
-PN_CLASSDEF(pn_collector)
-
-pn_collector_t *pn_collector(void)
-{
-  return pn_collector_new();
-}
-
-void pn_collector_free(pn_collector_t *collector)
-{
-  assert(collector);
-  pn_collector_release(collector);
-  pn_decref(collector);
-}
-
-void pn_collector_release(pn_collector_t *collector)
-{
-  assert(collector);
-  if (!collector->freed) {
-    collector->freed = true;
-    pn_collector_drain(collector);
-    pn_collector_shrink(collector);
-  }
-}
-
-pn_event_t *pn_event(void);
-
-pn_event_t *pn_collector_put(pn_collector_t *collector,
-                             const pn_class_t *clazz, void *context,
-                             pn_event_type_t type)
-{
-  if (!collector) {
-    return NULL;
-  }
-
-  assert(context);
-
-  if (collector->freed) {
-    return NULL;
-  }
-
-  pn_event_t *tail = collector->tail;
-  if (tail && tail->type == type && tail->context == context) {
-    return NULL;
-  }
-
-  clazz = clazz->reify(context);
-
-  pn_event_t *event = (pn_event_t *) pn_list_pop(collector->pool);
-
-  if (!event) {
-    event = pn_event();
-  }
-
-  event->pool = collector->pool;
-  pn_incref(event->pool);
-
-  if (tail) {
-    tail->next = event;
-    collector->tail = event;
-  } else {
-    collector->tail = event;
-    collector->head = event;
-  }
-
-  event->clazz = clazz;
-  event->context = context;
-  event->type = type;
-  pn_class_incref(clazz, event->context);
-
-  return event;
-}
-
-pn_event_t *pn_collector_peek(pn_collector_t *collector)
-{
-  return collector->head;
-}
-
-bool pn_collector_pop(pn_collector_t *collector)
-{
-  collector->head_returned = false;
-  pn_event_t *event = collector->head;
-  if (event) {
-    collector->head = event->next;
-  } else {
-    return false;
-  }
-
-  if (!collector->head) {
-    collector->tail = NULL;
-  }
-
-  pn_decref(event);
-  return true;
-}
-
-pn_event_t *pn_collector_next(pn_collector_t *collector)
-{
-  if (collector->head_returned) {
-    pn_collector_pop(collector);
-  }
-  collector->head_returned = collector->head;
-  return collector->head;
-}
-
-pn_event_t *pn_collector_prev(pn_collector_t *collector) {
-  return collector->head_returned ? collector->head : NULL;
-}
-
-bool pn_collector_more(pn_collector_t *collector)
-{
-  assert(collector);
-  return collector->head && collector->head->next;
-}
-
-static void pn_event_initialize(pn_event_t *event)
-{
-  event->pool = NULL;
-  event->type = PN_EVENT_NONE;
-  event->clazz = NULL;
-  event->context = NULL;
-  event->next = NULL;
-  event->attachments = pn_record();
-}
-
-static void pn_event_finalize(pn_event_t *event) {
-  // decref before adding to the free list
-  if (event->clazz && event->context) {
-    pn_class_decref(event->clazz, event->context);
-  }
-
-  pn_list_t *pool = event->pool;
-
-  if (pool && pn_refcount(pool) > 1) {
-    event->pool = NULL;
-    event->type = PN_EVENT_NONE;
-    event->clazz = NULL;
-    event->context = NULL;
-    event->next = NULL;
-    pn_record_clear(event->attachments);
-    pn_list_add(pool, event);
-  } else {
-    pn_decref(event->attachments);
-  }
-
-  pn_decref(pool);
-}
-
-static int pn_event_inspect(pn_event_t *event, pn_string_t *dst)
-{
-  assert(event);
-  assert(dst);
-  const char *name = pn_event_type_name(event->type);
-  int err;
-  if (name) {
-    err = pn_string_addf(dst, "(%s", pn_event_type_name(event->type));
-  } else {
-    err = pn_string_addf(dst, "(<%u>", (unsigned int) event->type);
-  }
-  if (err) return err;
-  if (event->context) {
-    err = pn_string_addf(dst, ", ");
-    if (err) return err;
-    err = pn_class_inspect(event->clazz, event->context, dst);
-    if (err) return err;
-  }
-
-  return pn_string_addf(dst, ")");
-}
-
-#define pn_event_hashcode NULL
-#define pn_event_compare NULL
-
-PN_CLASSDEF(pn_event)
-
-pn_event_t *pn_event(void)
-{
-  return pn_event_new();
-}
-
-pn_event_type_t pn_event_type(pn_event_t *event)
-{
-  return event->type;
-}
-
-const pn_class_t *pn_event_class(pn_event_t *event)
-{
-  assert(event);
-  return event->clazz;
-}
-
-void *pn_event_context(pn_event_t *event)
-{
-  assert(event);
-  return event->context;
-}
-
-pn_record_t *pn_event_attachments(pn_event_t *event)
-{
-  assert(event);
-  return event->attachments;
-}
-
-const char *pn_event_type_name(pn_event_type_t type)
-{
-  switch (type) {
-  case PN_EVENT_NONE:
-    return "PN_EVENT_NONE";
-  case PN_REACTOR_INIT:
-    return "PN_REACTOR_INIT";
-  case PN_REACTOR_QUIESCED:
-    return "PN_REACTOR_QUIESCED";
-  case PN_REACTOR_FINAL:
-    return "PN_REACTOR_FINAL";
-  case PN_TIMER_TASK:
-    return "PN_TIMER_TASK";
-  case PN_CONNECTION_INIT:
-    return "PN_CONNECTION_INIT";
-  case PN_CONNECTION_BOUND:
-    return "PN_CONNECTION_BOUND";
-  case PN_CONNECTION_UNBOUND:
-    return "PN_CONNECTION_UNBOUND";
-  case PN_CONNECTION_REMOTE_OPEN:
-    return "PN_CONNECTION_REMOTE_OPEN";
-  case PN_CONNECTION_LOCAL_OPEN:
-    return "PN_CONNECTION_LOCAL_OPEN";
-  case PN_CONNECTION_REMOTE_CLOSE:
-    return "PN_CONNECTION_REMOTE_CLOSE";
-  case PN_CONNECTION_LOCAL_CLOSE:
-    return "PN_CONNECTION_LOCAL_CLOSE";
-  case PN_CONNECTION_FINAL:
-    return "PN_CONNECTION_FINAL";
-  case PN_SESSION_INIT:
-    return "PN_SESSION_INIT";
-  case PN_SESSION_REMOTE_OPEN:
-    return "PN_SESSION_REMOTE_OPEN";
-  case PN_SESSION_LOCAL_OPEN:
-    return "PN_SESSION_LOCAL_OPEN";
-  case PN_SESSION_REMOTE_CLOSE:
-    return "PN_SESSION_REMOTE_CLOSE";
-  case PN_SESSION_LOCAL_CLOSE:
-    return "PN_SESSION_LOCAL_CLOSE";
-  case PN_SESSION_FINAL:
-    return "PN_SESSION_FINAL";
-  case PN_LINK_INIT:
-    return "PN_LINK_INIT";
-  case PN_LINK_REMOTE_OPEN:
-    return "PN_LINK_REMOTE_OPEN";
-  case PN_LINK_LOCAL_OPEN:
-    return "PN_LINK_LOCAL_OPEN";
-  case PN_LINK_REMOTE_CLOSE:
-    return "PN_LINK_REMOTE_CLOSE";
-  case PN_LINK_LOCAL_DETACH:
-    return "PN_LINK_LOCAL_DETACH";
-  case PN_LINK_REMOTE_DETACH:
-    return "PN_LINK_REMOTE_DETACH";
-  case PN_LINK_LOCAL_CLOSE:
-    return "PN_LINK_LOCAL_CLOSE";
-  case PN_LINK_FLOW:
-    return "PN_LINK_FLOW";
-  case PN_LINK_FINAL:
-    return "PN_LINK_FINAL";
-  case PN_DELIVERY:
-    return "PN_DELIVERY";
-  case PN_TRANSPORT:
-    return "PN_TRANSPORT";
-  case PN_TRANSPORT_AUTHENTICATED:
-    return "PN_TRANSPORT_AUTHENTICATED";
-  case PN_TRANSPORT_ERROR:
-    return "PN_TRANSPORT_ERROR";
-  case PN_TRANSPORT_HEAD_CLOSED:
-    return "PN_TRANSPORT_HEAD_CLOSED";
-  case PN_TRANSPORT_TAIL_CLOSED:
-    return "PN_TRANSPORT_TAIL_CLOSED";
-  case PN_TRANSPORT_CLOSED:
-    return "PN_TRANSPORT_CLOSED";
-  case PN_SELECTABLE_INIT:
-    return "PN_SELECTABLE_INIT";
-  case PN_SELECTABLE_UPDATED:
-    return "PN_SELECTABLE_UPDATED";
-  case PN_SELECTABLE_READABLE:
-    return "PN_SELECTABLE_READABLE";
-  case PN_SELECTABLE_WRITABLE:
-    return "PN_SELECTABLE_WRITABLE";
-  case PN_SELECTABLE_ERROR:
-    return "PN_SELECTABLE_ERROR";
-  case PN_SELECTABLE_EXPIRED:
-    return "PN_SELECTABLE_EXPIRED";
-  case PN_SELECTABLE_FINAL:
-    return "PN_SELECTABLE_FINAL";
-   case PN_CONNECTION_WAKE:
-    return "PN_CONNECTION_WAKE";
-   case PN_LISTENER_CLOSE:
-    return "PN_LISTENER_CLOSE";
-   case PN_PROACTOR_INTERRUPT:
-    return "PN_PROACTOR_INTERRUPT";
-   case PN_PROACTOR_TIMEOUT:
-    return "PN_PROACTOR_TIMEOUT";
-   case PN_PROACTOR_INACTIVE:
-    return "PN_PROACTOR_INACTIVE";
-   default:
-    return "PN_UNKNOWN";
-  }
-  return NULL;
-}
-
-pn_event_t *pn_event_batch_next(pn_event_batch_t *batch) {
-  return batch->next_event(batch);
-}
diff --git a/proton-c/src/core/framing.c b/proton-c/src/core/framing.c
deleted file mode 100644
index 09bf4bb..0000000
--- a/proton-c/src/core/framing.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include "framing.h"
-
-// TODO: These are near duplicates of code in codec.c - they should be
-// deduplicated.
-static inline void pn_i_write16(char *bytes, uint16_t value)
-{
-    bytes[0] = 0xFF & (value >> 8);
-    bytes[1] = 0xFF & (value     );
-}
-
-
-static inline void pn_i_write32(char *bytes, uint32_t value)
-{
-    bytes[0] = 0xFF & (value >> 24);
-    bytes[1] = 0xFF & (value >> 16);
-    bytes[2] = 0xFF & (value >>  8);
-    bytes[3] = 0xFF & (value      );
-}
-
-static inline uint16_t pn_i_read16(const char *bytes)
-{
-    uint16_t a = (uint8_t) bytes[0];
-    uint16_t b = (uint8_t) bytes[1];
-    uint16_t r = a << 8
-    | b;
-    return r;
-}
-
-static inline uint32_t pn_i_read32(const char *bytes)
-{
-    uint32_t a = (uint8_t) bytes[0];
-    uint32_t b = (uint8_t) bytes[1];
-    uint32_t c = (uint8_t) bytes[2];
-    uint32_t d = (uint8_t) bytes[3];
-    uint32_t r = a << 24
-    | b << 16
-    | c <<  8
-    | d;
-    return r;
-}
-
-
-ssize_t pn_read_frame(pn_frame_t *frame, const char *bytes, size_t available, uint32_t max)
-{
-  if (available < AMQP_HEADER_SIZE) return 0;
-  uint32_t size = pn_i_read32(&bytes[0]);
-  if (max && size > max) return PN_ERR;
-  if (available < size) return 0;
-  unsigned int doff = 4 * (uint8_t)bytes[4];
-  if (doff < AMQP_HEADER_SIZE || doff > size) return PN_ERR;
-
-  frame->size = size - doff;
-  frame->ex_size = doff - AMQP_HEADER_SIZE;
-  frame->type = bytes[5];
-  frame->channel = pn_i_read16(&bytes[6]);
-  frame->extended = bytes + AMQP_HEADER_SIZE;
-  frame->payload = bytes + doff;
-
-  return size;
-}
-
-size_t pn_write_frame(char *bytes, size_t available, pn_frame_t frame)
-{
-  size_t size = AMQP_HEADER_SIZE + frame.ex_size + frame.size;
-  if (size <= available)
-  {
-    pn_i_write32(&bytes[0], size);
-    int doff = (frame.ex_size + AMQP_HEADER_SIZE - 1)/4 + 1;
-    bytes[4] = doff;
-    bytes[5] = frame.type;
-    pn_i_write16(&bytes[6], frame.channel);
-
-    memmove(bytes + AMQP_HEADER_SIZE, frame.extended, frame.ex_size);
-    memmove(bytes + 4*doff, frame.payload, frame.size);
-    return size;
-  } else {
-    return 0;
-  }
-}
diff --git a/proton-c/src/core/framing.h b/proton-c/src/core/framing.h
deleted file mode 100644
index ecb88a4..0000000
--- a/proton-c/src/core/framing.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef PROTON_FRAMING_H
-#define PROTON_FRAMING_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/type_compat.h>
-#include <proton/error.h>
-
-#define AMQP_HEADER_SIZE (8)
-#define AMQP_MIN_MAX_FRAME_SIZE ((uint32_t)512) // minimum allowable max-frame
-
-typedef struct {
-  uint8_t type;
-  uint16_t channel;
-  size_t ex_size;
-  const char *extended;
-  size_t size;
-  const char *payload;
-} pn_frame_t;
-
-ssize_t pn_read_frame(pn_frame_t *frame, const char *bytes, size_t available, uint32_t max);
-size_t pn_write_frame(char *bytes, size_t size, pn_frame_t frame);
-
-#endif /* framing.h */
diff --git a/proton-c/src/core/log.c b/proton-c/src/core/log.c
deleted file mode 100644
index ff96ff0..0000000
--- a/proton-c/src/core/log.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <proton/log.h>
-#include <proton/object.h>
-#include <stdio.h>
-#include "log_private.h"
-#include "util.h"
-
-
-static void stderr_logger(const char *message) {
-    fprintf(stderr, "%s\n", message);
-}
-
-static pn_logger_t logger = stderr_logger;
-static int enabled_env  = -1;   /* Set from environment variable. */
-static int enabled_call = -1;   /* set by pn_log_enable */
-
-void pn_log_enable(bool value) {
-    enabled_call = value;
-}
-
-bool pn_log_enabled(void) {
-    if (enabled_call != -1) return enabled_call; /* Takes precedence */
-    if (enabled_env == -1) 
-        enabled_env = pn_env_bool("PN_TRACE_LOG");
-    return enabled_env;
-}
-
-void pn_log_logger(pn_logger_t new_logger) {
-    logger = new_logger;
-    if (!logger) pn_log_enable(false);
-}
-
-void pn_vlogf_impl(const char *fmt, va_list ap) {
-    pn_string_t *msg = pn_string("");
-    pn_string_vformat(msg, fmt, ap);
-    fprintf(stderr, "%s\n", pn_string_get(msg));
-}
-
-/**@internal
- *
- * Note: We check pn_log_enabled() in the pn_logf macro *before* calling
- * pn_logf_impl because evaluating the arguments to that call could have
- * side-effects with performance impact (e.g. calling functions to construct
- * complicated messages.) It is important that a disabled log statement results
- * in nothing more than a call to pn_log_enabled().
- */
-void pn_logf_impl(const char *fmt, ...) {
-  va_list ap;
-  va_start(ap, fmt);
-  pn_vlogf_impl(fmt, ap);
-  va_end(ap);
-}
-
diff --git a/proton-c/src/core/log_private.h b/proton-c/src/core/log_private.h
deleted file mode 100644
index 4725045..0000000
--- a/proton-c/src/core/log_private.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef LOG_PRIVATE_H
-#define LOG_PRIVATE_H
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**@file
- *
- * Log messages that are not associated with a transport.
- */
-
-#include <proton/log.h>
-#include <stdarg.h>
-
-/** Log a printf style message */
-#define pn_logf(...)                            \
-    do {                                        \
-        if (pn_log_enabled())                   \
-            pn_logf_impl(__VA_ARGS__);          \
-    } while(0)
-
-/** va_list version of pn_logf */
-#define pn_vlogf(fmt, ap)                       \
-    do {                                        \
-        if (pn_log_enabled())                   \
-            pn_vlogf_impl(fmt, ap);             \
-    } while(0)
-
-/** Return true if logging is enabled. */
-bool pn_log_enabled(void);
-
-/**@internal*/
-void pn_logf_impl(const char* fmt, ...);
-/**@internal*/
-void pn_vlogf_impl(const char *fmt, va_list ap);
-
-
-
-#endif
diff --git a/proton-c/src/core/message.c b/proton-c/src/core/message.c
deleted file mode 100644
index f2fb20e..0000000
--- a/proton-c/src/core/message.c
+++ /dev/null
@@ -1,862 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "platform/platform_fmt.h"
-#include "protocol.h"
-#include "util.h"
-
-#include <proton/message.h>
-#include <proton/object.h>
-#include <proton/codec.h>
-#include <proton/error.h>
-#include <proton/parser.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <assert.h>
-
-// message
-
-struct pn_message_t {
-  pn_timestamp_t expiry_time;
-  pn_timestamp_t creation_time;
-  pn_data_t *id;
-  pn_string_t *user_id;
-  pn_string_t *address;
-  pn_string_t *subject;
-  pn_string_t *reply_to;
-  pn_data_t *correlation_id;
-  pn_string_t *content_type;
-  pn_string_t *content_encoding;
-  pn_string_t *group_id;
-  pn_string_t *reply_to_group_id;
-
-  pn_data_t *data;
-  pn_data_t *instructions;
-  pn_data_t *annotations;
-  pn_data_t *properties;
-  pn_data_t *body;
-
-  pn_error_t *error;
-
-  pn_sequence_t group_sequence;
-  pn_millis_t ttl;
-  uint32_t delivery_count;
-
-  uint8_t priority;
-
-  bool durable;
-  bool first_acquirer;
-  bool inferred;
-};
-
-void pn_message_finalize(void *obj)
-{
-  pn_message_t *msg = (pn_message_t *) obj;
-  pn_free(msg->user_id);
-  pn_free(msg->address);
-  pn_free(msg->subject);
-  pn_free(msg->reply_to);
-  pn_free(msg->content_type);
-  pn_free(msg->content_encoding);
-  pn_free(msg->group_id);
-  pn_free(msg->reply_to_group_id);
-  pn_data_free(msg->id);
-  pn_data_free(msg->correlation_id);
-  pn_data_free(msg->data);
-  pn_data_free(msg->instructions);
-  pn_data_free(msg->annotations);
-  pn_data_free(msg->properties);
-  pn_data_free(msg->body);
-  pn_error_free(msg->error);
-}
-
-int pn_message_inspect(void *obj, pn_string_t *dst)
-{
-  pn_message_t *msg = (pn_message_t *) obj;
-  int err = pn_string_addf(dst, "Message{");
-  if (err) return err;
-
-  bool comma = false;
-
-  if (pn_string_get(msg->address)) {
-    err = pn_string_addf(dst, "address=");
-    if (err) return err;
-    err = pn_inspect(msg->address, dst);
-    if (err) return err;
-    err = pn_string_addf(dst, ", ");
-    if (err) return err;
-    comma = true;
-  }
-
-  if (msg->durable) {
-    err = pn_string_addf(dst, "durable=%i, ", msg->durable);
-    if (err) return err;
-    comma = true;
-  }
-
-  if (msg->priority != PN_DEFAULT_PRIORITY) {
-    err = pn_string_addf(dst, "priority=%i, ", msg->priority);
-    if (err) return err;
-    comma = true;
-  }
-
-  if (msg->ttl) {
-    err = pn_string_addf(dst, "ttl=%" PRIu32 ", ", msg->ttl);
-    if (err) return err;
-    comma = true;
-  }
-
-  if (msg->first_acquirer) {
-    err = pn_string_addf(dst, "first_acquirer=%i, ", msg->first_acquirer);
-    if (err) return err;
-    comma = true;
-  }
-
-  if (msg->delivery_count) {
-    err = pn_string_addf(dst, "delivery_count=%" PRIu32 ", ", msg->delivery_count);
-    if (err) return err;
-    comma = true;
-  }
-
-  if (pn_data_size(msg->id)) {
-    err = pn_string_addf(dst, "id=");
-    if (err) return err;
-    err = pn_inspect(msg->id, dst);
-    if (err) return err;
-    err = pn_string_addf(dst, ", ");
-    if (err) return err;
-    comma = true;
-  }
-
-  if (pn_string_get(msg->user_id)) {
-    err = pn_string_addf(dst, "user_id=");
-    if (err) return err;
-    err = pn_inspect(msg->user_id, dst);
-    if (err) return err;
-    err = pn_string_addf(dst, ", ");
-    if (err) return err;
-    comma = true;
-  }
-
-  if (pn_string_get(msg->subject)) {
-    err = pn_string_addf(dst, "subject=");
-    if (err) return err;
-    err = pn_inspect(msg->subject, dst);
-    if (err) return err;
-    err = pn_string_addf(dst, ", ");
-    if (err) return err;
-    comma = true;
-  }
-
-  if (pn_string_get(msg->reply_to)) {
-    err = pn_string_addf(dst, "reply_to=");
-    if (err) return err;
-    err = pn_inspect(msg->reply_to, dst);
-    if (err) return err;
-    err = pn_string_addf(dst, ", ");
-    if (err) return err;
-    comma = true;
-  }
-
-  if (pn_data_size(msg->correlation_id)) {
-    err = pn_string_addf(dst, "correlation_id=");
-    if (err) return err;
-    err = pn_inspect(msg->correlation_id, dst);
-    if (err) return err;
-    err = pn_string_addf(dst, ", ");
-    if (err) return err;
-    comma = true;
-  }
-
-  if (pn_string_get(msg->content_type)) {
-    err = pn_string_addf(dst, "content_type=");
-    if (err) return err;
-    err = pn_inspect(msg->content_type, dst);
-    if (err) return err;
-    err = pn_string_addf(dst, ", ");
-    if (err) return err;
-    comma = true;
-  }
-
-  if (pn_string_get(msg->content_encoding)) {
-    err = pn_string_addf(dst, "content_encoding=");
-    if (err) return err;
-    err = pn_inspect(msg->content_encoding, dst);
-    if (err) return err;
-    err = pn_string_addf(dst, ", ");
-    if (err) return err;
-    comma = true;
-  }
-
-  if (msg->expiry_time) {
-    err = pn_string_addf(dst, "expiry_time=%" PRIi64 ", ", msg->expiry_time);
-    if (err) return err;
-    comma = true;
-  }
-
-  if (msg->creation_time) {
-    err = pn_string_addf(dst, "creation_time=%" PRIi64 ", ", msg->creation_time);
-    if (err) return err;
-    comma = true;
-  }
-
-  if (pn_string_get(msg->group_id)) {
-    err = pn_string_addf(dst, "group_id=");
-    if (err) return err;
-    err = pn_inspect(msg->group_id, dst);
-    if (err) return err;
-    err = pn_string_addf(dst, ", ");
-    if (err) return err;
-    comma = true;
-  }
-
-  if (msg->group_sequence) {
-    err = pn_string_addf(dst, "group_sequence=%" PRIi32 ", ", msg->group_sequence);
-    if (err) return err;
-    comma = true;
-  }
-
-  if (pn_string_get(msg->reply_to_group_id)) {
-    err = pn_string_addf(dst, "reply_to_group_id=");
-    if (err) return err;
-    err = pn_inspect(msg->reply_to_group_id, dst);
-    if (err) return err;
-    err = pn_string_addf(dst, ", ");
-    if (err) return err;
-    comma = true;
-  }
-
-  if (msg->inferred) {
-    err = pn_string_addf(dst, "inferred=%i, ", msg->inferred);
-    if (err) return err;
-    comma = true;
-  }
-
-  if (pn_data_size(msg->instructions)) {
-    err = pn_string_addf(dst, "instructions=");
-    if (err) return err;
-    err = pn_inspect(msg->instructions, dst);
-    if (err) return err;
-    err = pn_string_addf(dst, ", ");
-    if (err) return err;
-    comma = true;
-  }
-
-  if (pn_data_size(msg->annotations)) {
-    err = pn_string_addf(dst, "annotations=");
-    if (err) return err;
-    err = pn_inspect(msg->annotations, dst);
-    if (err) return err;
-    err = pn_string_addf(dst, ", ");
-    if (err) return err;
-    comma = true;
-  }
-
-  if (pn_data_size(msg->properties)) {
-    err = pn_string_addf(dst, "properties=");
-    if (err) return err;
-    err = pn_inspect(msg->properties, dst);
-    if (err) return err;
-    err = pn_string_addf(dst, ", ");
-    if (err) return err;
-    comma = true;
-  }
-
-  if (pn_data_size(msg->body)) {
-    err = pn_string_addf(dst, "body=");
-    if (err) return err;
-    err = pn_inspect(msg->body, dst);
-    if (err) return err;
-    err = pn_string_addf(dst, ", ");
-    if (err) return err;
-    comma = true;
-  }
-
-  if (comma) {
-    int err = pn_string_resize(dst, pn_string_size(dst) - 2);
-    if (err) return err;
-  }
-
-  return pn_string_addf(dst, "}");
-}
-
-#define pn_message_initialize NULL
-#define pn_message_hashcode NULL
-#define pn_message_compare NULL
-
-pn_message_t *pn_message()
-{
-  static const pn_class_t clazz = PN_CLASS(pn_message);
-  pn_message_t *msg = (pn_message_t *) pn_class_new(&clazz, sizeof(pn_message_t));
-  msg->durable = false;
-  msg->priority = PN_DEFAULT_PRIORITY;
-  msg->ttl = 0;
-  msg->first_acquirer = false;
-  msg->delivery_count = 0;
-  msg->id = pn_data(1);
-  msg->user_id = pn_string(NULL);
-  msg->address = pn_string(NULL);
-  msg->subject = pn_string(NULL);
-  msg->reply_to = pn_string(NULL);
-  msg->correlation_id = pn_data(1);
-  msg->content_type = pn_string(NULL);
-  msg->content_encoding = pn_string(NULL);
-  msg->expiry_time = 0;
-  msg->creation_time = 0;
-  msg->group_id = pn_string(NULL);
-  msg->group_sequence = 0;
-  msg->reply_to_group_id = pn_string(NULL);
-
-  msg->inferred = false;
-  msg->data = pn_data(16);
-  msg->instructions = pn_data(16);
-  msg->annotations = pn_data(16);
-  msg->properties = pn_data(16);
-  msg->body = pn_data(16);
-
-  msg->error = pn_error();
-  return msg;
-}
-
-void pn_message_free(pn_message_t *msg)
-{
-  pn_free(msg);
-}
-
-void pn_message_clear(pn_message_t *msg)
-{
-  msg->durable = false;
-  msg->priority = PN_DEFAULT_PRIORITY;
-  msg->ttl = 0;
-  msg->first_acquirer = false;
-  msg->delivery_count = 0;
-  pn_data_clear(msg->id);
-  pn_string_clear(msg->user_id);
-  pn_string_clear(msg->address);
-  pn_string_clear(msg->subject);
-  pn_string_clear(msg->reply_to);
-  pn_data_clear(msg->correlation_id);
-  pn_string_clear(msg->content_type);
-  pn_string_clear(msg->content_encoding);
-  msg->expiry_time = 0;
-  msg->creation_time = 0;
-  pn_string_clear(msg->group_id);
-  msg->group_sequence = 0;
-  pn_string_clear(msg->reply_to_group_id);
-  msg->inferred = false;
-  pn_data_clear(msg->data);
-  pn_data_clear(msg->instructions);
-  pn_data_clear(msg->annotations);
-  pn_data_clear(msg->properties);
-  pn_data_clear(msg->body);
-}
-
-int pn_message_errno(pn_message_t *msg)
-{
-  assert(msg);
-  return pn_error_code(msg->error);
-}
-
-pn_error_t *pn_message_error(pn_message_t *msg)
-{
-  assert(msg);
-  return msg->error;
-}
-
-bool pn_message_is_inferred(pn_message_t *msg)
-{
-  assert(msg);
-  return msg->inferred;
-}
-
-int pn_message_set_inferred(pn_message_t *msg, bool inferred)
-{
-  assert(msg);
-  msg->inferred = inferred;
-  return 0;
-}
-
-bool pn_message_is_durable(pn_message_t *msg)
-{
-  assert(msg);
-  return msg->durable;
-}
-int pn_message_set_durable(pn_message_t *msg, bool durable)
-{
-  assert(msg);
-  msg->durable = durable;
-  return 0;
-}
-
-
-uint8_t pn_message_get_priority(pn_message_t *msg)
-{
-  assert(msg);
-  return msg->priority;
-}
-int pn_message_set_priority(pn_message_t *msg, uint8_t priority)
-{
-  assert(msg);
-  msg->priority = priority;
-  return 0;
-}
-
-pn_millis_t pn_message_get_ttl(pn_message_t *msg)
-{
-  assert(msg);
-  return msg->ttl;
-}
-int pn_message_set_ttl(pn_message_t *msg, pn_millis_t ttl)
-{
-  assert(msg);
-  msg->ttl = ttl;
-  return 0;
-}
-
-bool pn_message_is_first_acquirer(pn_message_t *msg)
-{
-  assert(msg);
-  return msg->first_acquirer;
-}
-int pn_message_set_first_acquirer(pn_message_t *msg, bool first)
-{
-  assert(msg);
-  msg->first_acquirer = first;
-  return 0;
-}
-
-uint32_t pn_message_get_delivery_count(pn_message_t *msg)
-{
-  assert(msg);
-  return msg->delivery_count;
-}
-int pn_message_set_delivery_count(pn_message_t *msg, uint32_t count)
-{
-  assert(msg);
-  msg->delivery_count = count;
-  return 0;
-}
-
-pn_data_t *pn_message_id(pn_message_t *msg)
-{
-  assert(msg);
-  return msg->id;
-}
-pn_atom_t pn_message_get_id(pn_message_t *msg)
-{
-  assert(msg);
-  return pn_data_get_atom(msg->id);
-}
-int pn_message_set_id(pn_message_t *msg, pn_atom_t id)
-{
-  assert(msg);
-  pn_data_rewind(msg->id);
-  return pn_data_put_atom(msg->id, id);
-}
-
-static pn_bytes_t pn_string_get_bytes(pn_string_t *string)
-{
-  return pn_bytes(pn_string_size(string), (char *) pn_string_get(string));
-}
-
-static int pn_string_set_bytes(pn_string_t *string, pn_bytes_t bytes)
-{
-  return pn_string_setn(string, bytes.start, bytes.size);
-}
-
-pn_bytes_t pn_message_get_user_id(pn_message_t *msg)
-{
-  assert(msg);
-  return pn_string_get_bytes(msg->user_id);
-}
-int pn_message_set_user_id(pn_message_t *msg, pn_bytes_t user_id)
-{
-  assert(msg);
-  return pn_string_set_bytes(msg->user_id, user_id);
-}
-
-const char *pn_message_get_address(pn_message_t *msg)
-{
-  assert(msg);
-  return pn_string_get(msg->address);
-}
-int pn_message_set_address(pn_message_t *msg, const char *address)
-{
-  assert(msg);
-  return pn_string_set(msg->address, address);
-}
-
-const char *pn_message_get_subject(pn_message_t *msg)
-{
-  assert(msg);
-  return pn_string_get(msg->subject);
-}
-int pn_message_set_subject(pn_message_t *msg, const char *subject)
-{
-  assert(msg);
-  return pn_string_set(msg->subject, subject);
-}
-
-const char *pn_message_get_reply_to(pn_message_t *msg)
-{
-  assert(msg);
-  return pn_string_get(msg->reply_to);
-}
-int pn_message_set_reply_to(pn_message_t *msg, const char *reply_to)
-{
-  assert(msg);
-  return pn_string_set(msg->reply_to, reply_to);
-}
-
-pn_data_t *pn_message_correlation_id(pn_message_t *msg)
-{
-  assert(msg);
-  return msg->correlation_id;
-}
-pn_atom_t pn_message_get_correlation_id(pn_message_t *msg)
-{
-  assert(msg);
-  return pn_data_get_atom(msg->correlation_id);
-}
-int pn_message_set_correlation_id(pn_message_t *msg, pn_atom_t atom)
-{
-  assert(msg);
-  pn_data_rewind(msg->correlation_id);
-  return pn_data_put_atom(msg->correlation_id, atom);
-}
-
-const char *pn_message_get_content_type(pn_message_t *msg)
-{
-  assert(msg);
-  return pn_string_get(msg->content_type);
-}
-int pn_message_set_content_type(pn_message_t *msg, const char *type)
-{
-  assert(msg);
-  return pn_string_set(msg->content_type, type);
-}
-
-const char *pn_message_get_content_encoding(pn_message_t *msg)
-{
-  assert(msg);
-  return pn_string_get(msg->content_encoding);
-}
-int pn_message_set_content_encoding(pn_message_t *msg, const char *encoding)
-{
-  assert(msg);
-  return pn_string_set(msg->content_encoding, encoding);
-}
-
-pn_timestamp_t pn_message_get_expiry_time(pn_message_t *msg)
-{
-  assert(msg);
-  return msg->expiry_time;
-}
-int pn_message_set_expiry_time(pn_message_t *msg, pn_timestamp_t time)
-{
-  assert(msg);
-  msg->expiry_time = time;
-  return 0;
-}
-
-pn_timestamp_t pn_message_get_creation_time(pn_message_t *msg)
-{
-  assert(msg);
-  return msg->creation_time;
-}
-int pn_message_set_creation_time(pn_message_t *msg, pn_timestamp_t time)
-{
-  assert(msg);
-  msg->creation_time = time;
-  return 0;
-}
-
-const char *pn_message_get_group_id(pn_message_t *msg)
-{
-  assert(msg);
-  return pn_string_get(msg->group_id);
-}
-int pn_message_set_group_id(pn_message_t *msg, const char *group_id)
-{
-  assert(msg);
-  return pn_string_set(msg->group_id, group_id);
-}
-
-pn_sequence_t pn_message_get_group_sequence(pn_message_t *msg)
-{
-  assert(msg);
-  return msg->group_sequence;
-}
-int pn_message_set_group_sequence(pn_message_t *msg, pn_sequence_t n)
-{
-  assert(msg);
-  msg->group_sequence = n;
-  return 0;
-}
-
-const char *pn_message_get_reply_to_group_id(pn_message_t *msg)
-{
-  assert(msg);
-  return pn_string_get(msg->reply_to_group_id);
-}
-int pn_message_set_reply_to_group_id(pn_message_t *msg, const char *reply_to_group_id)
-{
-  assert(msg);
-  return pn_string_set(msg->reply_to_group_id, reply_to_group_id);
-}
-
-int pn_message_decode(pn_message_t *msg, const char *bytes, size_t size)
-{
-  assert(msg && bytes && size);
-
-  pn_message_clear(msg);
-
-  while (size) {
-    pn_data_clear(msg->data);
-    ssize_t used = pn_data_decode(msg->data, bytes, size);
-    if (used < 0)
-        return pn_error_format(msg->error, used, "data error: %s",
-                               pn_error_text(pn_data_error(msg->data)));
-    size -= used;
-    bytes += used;
-    bool scanned;
-    uint64_t desc;
-    int err = pn_data_scan(msg->data, "D?L.", &scanned, &desc);
-    if (err) return pn_error_format(msg->error, err, "data error: %s",
-                                    pn_error_text(pn_data_error(msg->data)));
-    if (!scanned) {
-      desc = 0;
-    }
-
-    pn_data_rewind(msg->data);
-    pn_data_next(msg->data);
-    pn_data_enter(msg->data);
-    pn_data_next(msg->data);
-
-    switch (desc) {
-    case HEADER:
-      err = pn_data_scan(msg->data, "D.[oBIoI]", &msg->durable, &msg->priority,
-                   &msg->ttl, &msg->first_acquirer, &msg->delivery_count);
-      if (err) return pn_error_format(msg->error, err, "data error: %s",
-                                      pn_error_text(pn_data_error(msg->data)));
-      break;
-    case PROPERTIES:
-      {
-        pn_bytes_t user_id, address, subject, reply_to, ctype, cencoding,
-          group_id, reply_to_group_id;
-        pn_data_clear(msg->id);
-        pn_data_clear(msg->correlation_id);
-        err = pn_data_scan(msg->data, "D.[CzSSSCssttSIS]", msg->id,
-                           &user_id, &address, &subject, &reply_to,
-                           msg->correlation_id, &ctype, &cencoding,
-                           &msg->expiry_time, &msg->creation_time, &group_id,
-                           &msg->group_sequence, &reply_to_group_id);
-        if (err) return pn_error_format(msg->error, err, "data error: %s",
-                                        pn_error_text(pn_data_error(msg->data)));
-        err = pn_string_set_bytes(msg->user_id, user_id);
-        if (err) return pn_error_format(msg->error, err, "error setting user_id");
-        err = pn_string_setn(msg->address, address.start, address.size);
-        if (err) return pn_error_format(msg->error, err, "error setting address");
-        err = pn_string_setn(msg->subject, subject.start, subject.size);
-        if (err) return pn_error_format(msg->error, err, "error setting subject");
-        err = pn_string_setn(msg->reply_to, reply_to.start, reply_to.size);
-        if (err) return pn_error_format(msg->error, err, "error setting reply_to");
-        err = pn_string_setn(msg->content_type, ctype.start, ctype.size);
-        if (err) return pn_error_format(msg->error, err, "error setting content_type");
-        err = pn_string_setn(msg->content_encoding, cencoding.start,
-                             cencoding.size);
-        if (err) return pn_error_format(msg->error, err, "error setting content_encoding");
-        err = pn_string_setn(msg->group_id, group_id.start, group_id.size);
-        if (err) return pn_error_format(msg->error, err, "error setting group_id");
-        err = pn_string_setn(msg->reply_to_group_id, reply_to_group_id.start,
-                             reply_to_group_id.size);
-        if (err) return pn_error_format(msg->error, err, "error setting reply_to_group_id");
-      }
-      break;
-    case DELIVERY_ANNOTATIONS:
-      pn_data_narrow(msg->data);
-      err = pn_data_copy(msg->instructions, msg->data);
-      if (err) return err;
-      break;
-    case MESSAGE_ANNOTATIONS:
-      pn_data_narrow(msg->data);
-      err = pn_data_copy(msg->annotations, msg->data);
-      if (err) return err;
-      break;
-    case APPLICATION_PROPERTIES:
-      pn_data_narrow(msg->data);
-      err = pn_data_copy(msg->properties, msg->data);
-      if (err) return err;
-      break;
-    case DATA:
-    case AMQP_SEQUENCE:
-    case AMQP_VALUE:
-      pn_data_narrow(msg->data);
-      err = pn_data_copy(msg->body, msg->data);
-      if (err) return err;
-      break;
-    case FOOTER:
-      break;
-    default:
-      err = pn_data_copy(msg->body, msg->data);
-      if (err) return err;
-      break;
-    }
-  }
-
-  pn_data_clear(msg->data);
-  return 0;
-}
-
-int pn_message_encode(pn_message_t *msg, char *bytes, size_t *size)
-{
-  if (!msg || !bytes || !size || !*size) return PN_ARG_ERR;
-  pn_data_clear(msg->data);
-  pn_message_data(msg, msg->data);
-  size_t remaining = *size;
-  ssize_t encoded = pn_data_encode(msg->data, bytes, remaining);
-  if (encoded < 0) {
-    if (encoded == PN_OVERFLOW) {
-      return encoded;
-    } else {
-      return pn_error_format(msg->error, encoded, "data error: %s",
-                             pn_error_text(pn_data_error(msg->data)));
-    }
-  }
-  bytes += encoded;
-  remaining -= encoded;
-  *size -= remaining;
-  pn_data_clear(msg->data);
-  return 0;
-}
-
-int pn_message_data(pn_message_t *msg, pn_data_t *data)
-{
-  pn_data_clear(data);
-  int err = pn_data_fill(data, "DL[oB?IoI]", HEADER, msg->durable,
-                         msg->priority, msg->ttl, msg->ttl, msg->first_acquirer,
-                         msg->delivery_count);
-  if (err)
-    return pn_error_format(msg->error, err, "data error: %s",
-                           pn_error_text(pn_data_error(data)));
-
-  if (pn_data_size(msg->instructions)) {
-    pn_data_put_described(data);
-    pn_data_enter(data);
-    pn_data_put_ulong(data, DELIVERY_ANNOTATIONS);
-    pn_data_rewind(msg->instructions);
-    err = pn_data_append(data, msg->instructions);
-    if (err)
-      return pn_error_format(msg->error, err, "data error: %s",
-                             pn_error_text(pn_data_error(data)));
-    pn_data_exit(data);
-  }
-
-  if (pn_data_size(msg->annotations)) {
-    pn_data_put_described(data);
-    pn_data_enter(data);
-    pn_data_put_ulong(data, MESSAGE_ANNOTATIONS);
-    pn_data_rewind(msg->annotations);
-    err = pn_data_append(data, msg->annotations);
-    if (err)
-      return pn_error_format(msg->error, err, "data error: %s",
-                             pn_error_text(pn_data_error(data)));
-    pn_data_exit(data);
-  }
-
-  err = pn_data_fill(data, "DL[CzSSSCssttSIS]", PROPERTIES,
-                     msg->id,
-                     pn_string_size(msg->user_id), pn_string_get(msg->user_id),
-                     pn_string_get(msg->address),
-                     pn_string_get(msg->subject),
-                     pn_string_get(msg->reply_to),
-                     msg->correlation_id,
-                     pn_string_get(msg->content_type),
-                     pn_string_get(msg->content_encoding),
-                     msg->expiry_time,
-                     msg->creation_time,
-                     pn_string_get(msg->group_id),
-                     msg->group_sequence,
-                     pn_string_get(msg->reply_to_group_id));
-  if (err)
-    return pn_error_format(msg->error, err, "data error: %s",
-                           pn_error_text(pn_data_error(data)));
-
-  if (pn_data_size(msg->properties)) {
-    pn_data_put_described(data);
-    pn_data_enter(data);
-    pn_data_put_ulong(data, APPLICATION_PROPERTIES);
-    pn_data_rewind(msg->properties);
-    err = pn_data_append(data, msg->properties);
-    if (err)
-      return pn_error_format(msg->error, err, "data error: %s",
-                             pn_data_error(data));
-    pn_data_exit(data);
-  }
-
-  if (pn_data_size(msg->body)) {
-    pn_data_rewind(msg->body);
-    pn_data_next(msg->body);
-    pn_type_t body_type = pn_data_type(msg->body);
-    pn_data_rewind(msg->body);
-
-    pn_data_put_described(data);
-    pn_data_enter(data);
-    if (msg->inferred) {
-      switch (body_type) {
-      case PN_BINARY:
-        pn_data_put_ulong(data, DATA);
-        break;
-      case PN_LIST:
-        pn_data_put_ulong(data, AMQP_SEQUENCE);
-        break;
-      default:
-        pn_data_put_ulong(data, AMQP_VALUE);
-        break;
-      }
-    } else {
-      pn_data_put_ulong(data, AMQP_VALUE);
-    }
-    pn_data_append(data, msg->body);
-  }
-  return 0;
-}
-
-pn_data_t *pn_message_instructions(pn_message_t *msg)
-{
-  return msg ? msg->instructions : NULL;
-}
-
-pn_data_t *pn_message_annotations(pn_message_t *msg)
-{
-  return msg ? msg->annotations : NULL;
-}
-
-pn_data_t *pn_message_properties(pn_message_t *msg)
-{
-  return msg ? msg->properties : NULL;
-}
-
-pn_data_t *pn_message_body(pn_message_t *msg)
-{
-  return msg ? msg->body : NULL;
-}
diff --git a/proton-c/src/core/object/iterator.c b/proton-c/src/core/object/iterator.c
deleted file mode 100644
index 61b3b8e..0000000
--- a/proton-c/src/core/object/iterator.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/object.h>
-#include <stdlib.h>
-#include <assert.h>
-
-struct pn_iterator_t {
-  pn_iterator_next_t next;
-  size_t size;
-  void *state;
-};
-
-static void pn_iterator_initialize(void *object)
-{
-  pn_iterator_t *it = (pn_iterator_t *) object;
-  it->next = NULL;
-  it->size = 0;
-  it->state = NULL;
-}
-
-static void pn_iterator_finalize(void *object)
-{
-  pn_iterator_t *it = (pn_iterator_t *) object;
-  free(it->state);
-}
-
-#define CID_pn_iterator CID_pn_object
-#define pn_iterator_hashcode NULL
-#define pn_iterator_compare NULL
-#define pn_iterator_inspect NULL
-
-pn_iterator_t *pn_iterator()
-{
-  static const pn_class_t clazz = PN_CLASS(pn_iterator);
-  pn_iterator_t *it = (pn_iterator_t *) pn_class_new(&clazz, sizeof(pn_iterator_t));
-  return it;
-}
-
-void  *pn_iterator_start(pn_iterator_t *iterator, pn_iterator_next_t next,
-                         size_t size) {
-  assert(iterator);
-  assert(next);
-  iterator->next = next;
-  if (iterator->size < size) {
-    iterator->state = realloc(iterator->state, size);
-  }
-  return iterator->state;
-}
-
-void *pn_iterator_next(pn_iterator_t *iterator) {
-  assert(iterator);
-  if (iterator->next) {
-    void *result = iterator->next(iterator->state);
-    if (!result) iterator->next = NULL;
-    return result;
-  } else {
-    return NULL;
-  }
-}
diff --git a/proton-c/src/core/object/list.c b/proton-c/src/core/object/list.c
deleted file mode 100644
index 76c70d2..0000000
--- a/proton-c/src/core/object/list.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/object.h>
-#include <stdlib.h>
-#include <assert.h>
-
-struct pn_list_t {
-  const pn_class_t *clazz;
-  size_t capacity;
-  size_t size;
-  void **elements;
-};
-
-size_t pn_list_size(pn_list_t *list)
-{
-  assert(list);
-  return list->size;
-}
-
-void *pn_list_get(pn_list_t *list, int index)
-{
-  assert(list); assert(list->size);
-  return list->elements[index % list->size];
-}
-
-void pn_list_set(pn_list_t *list, int index, void *value)
-{
-  assert(list); assert(list->size);
-  void *old = list->elements[index % list->size];
-  pn_class_decref(list->clazz, old);
-  list->elements[index % list->size] = value;
-  pn_class_incref(list->clazz, value);
-}
-
-static void pni_list_ensure(pn_list_t *list, size_t capacity)
-{
-  assert(list);
-  if (list->capacity < capacity) {
-    size_t newcap = list->capacity;
-    while (newcap < capacity) { newcap *= 2; }
-    list->elements = (void **) realloc(list->elements, newcap * sizeof(void *));
-    assert(list->elements);
-    list->capacity = newcap;
-  }
-}
-
-int pn_list_add(pn_list_t *list, void *value)
-{
-  assert(list);
-  pni_list_ensure(list, list->size + 1);
-  list->elements[list->size++] = value;
-  pn_class_incref(list->clazz, value);
-  return 0;
-}
-
-void *pn_list_pop(pn_list_t *list)
-{
-  assert(list);
-  if (list->size) {
-    return list->elements[--list->size];
-  } else {
-    return NULL;
-  }
-}
-
-ssize_t pn_list_index(pn_list_t *list, void *value)
-{
-  for (size_t i = 0; i < list->size; i++) {
-    if (pn_class_equals(list->clazz, list->elements[i], value)) {
-      return i;
-    }
-  }
-
-  return -1;
-}
-
-bool pn_list_remove(pn_list_t *list, void *value)
-{
-  assert(list);
-  ssize_t idx = pn_list_index(list, value);
-  if (idx < 0) {
-    return false;
-  } else {
-    pn_list_del(list, idx, 1);
-  }
-
-  return true;
-}
-
-void pn_list_del(pn_list_t *list, int index, int n)
-{
-  assert(list);
-  if (!list->size) { return; }
-  index %= list->size;
-
-  for (int i = 0; i < n; i++) {
-    pn_class_decref(list->clazz, list->elements[index + i]);
-  }
-
-  size_t slide = list->size - (index + n);
-  for (size_t i = 0; i < slide; i++) {
-    list->elements[index + i] = list->elements[index + n + i];
-  }
-
-  list->size -= n;
-}
-
-void pn_list_clear(pn_list_t *list)
-{
-  assert(list);
-  pn_list_del(list, 0, list->size);
-}
-
-void pn_list_minpush(pn_list_t *list, void *value)
-{
-  assert(list);
-  pn_list_add(list, value);
-  // we use one based indexing for the heap
-  void **heap = list->elements - 1;
-  int now = list->size;
-  while (now > 1 && pn_class_compare(list->clazz, heap[now/2], value) > 0) {
-    heap[now] = heap[now/2];
-    now /= 2;
-  }
-  heap[now] = value;
-}
-
-void *pn_list_minpop(pn_list_t *list)
-{
-  assert(list);
-  // we use one based indexing for the heap
-  void **heap = list->elements - 1;
-  void *min = heap[1];
-  void *last = pn_list_pop(list);
-  int size = pn_list_size(list);
-  int now, child;
-  for (now = 1; now*2 <= size; now = child) {
-    child = now*2;
-    if (child != size && pn_class_compare(list->clazz, heap[child], heap[child + 1]) > 0) {
-      child++;
-    }
-    if (pn_class_compare(list->clazz, last, heap[child]) > 0) {
-      heap[now] = heap[child];
-    } else {
-      break;
-    }
-  }
-  heap[now] = last;
-  return min;
-}
-
-typedef struct {
-  pn_list_t *list;
-  size_t index;
-} pni_list_iter_t;
-
-static void *pni_list_next(void *ctx)
-{
-  pni_list_iter_t *iter = (pni_list_iter_t *) ctx;
-  if (iter->index < pn_list_size(iter->list)) {
-    return pn_list_get(iter->list, iter->index++);
-  } else {
-    return NULL;
-  }
-}
-
-void pn_list_iterator(pn_list_t *list, pn_iterator_t *iter)
-{
-  pni_list_iter_t *liter = (pni_list_iter_t *) pn_iterator_start(iter, pni_list_next, sizeof(pni_list_iter_t));
-  liter->list = list;
-  liter->index = 0;
-}
-
-static void pn_list_finalize(void *object)
-{
-  assert(object);
-  pn_list_t *list = (pn_list_t *) object;
-  for (size_t i = 0; i < list->size; i++) {
-    pn_class_decref(list->clazz, pn_list_get(list, i));
-  }
-  free(list->elements);
-}
-
-static uintptr_t pn_list_hashcode(void *object)
-{
-  assert(object);
-  pn_list_t *list = (pn_list_t *) object;
-  uintptr_t hash = 1;
-
-  for (size_t i = 0; i < list->size; i++) {
-    hash = hash * 31 + pn_hashcode(pn_list_get(list, i));
-  }
-
-  return hash;
-}
-
-static intptr_t pn_list_compare(void *oa, void *ob)
-{
-  assert(oa); assert(ob);
-  pn_list_t *a = (pn_list_t *) oa;
-  pn_list_t *b = (pn_list_t *) ob;
-
-  size_t na = pn_list_size(a);
-  size_t nb = pn_list_size(b);
-  if (na != nb) {
-    return nb - na;
-  } else {
-    for (size_t i = 0; i < na; i++) {
-      intptr_t delta = pn_compare(pn_list_get(a, i), pn_list_get(b, i));
-      if (delta) return delta;
-    }
-  }
-
-  return 0;
-}
-
-static int pn_list_inspect(void *obj, pn_string_t *dst)
-{
-  assert(obj);
-  pn_list_t *list = (pn_list_t *) obj;
-  int err = pn_string_addf(dst, "[");
-  if (err) return err;
-  size_t n = pn_list_size(list);
-  for (size_t i = 0; i < n; i++) {
-    if (i > 0) {
-      err = pn_string_addf(dst, ", ");
-      if (err) return err;
-    }
-    err = pn_class_inspect(list->clazz, pn_list_get(list, i), dst);
-    if (err) return err;
-  }
-  return pn_string_addf(dst, "]");
-}
-
-#define pn_list_initialize NULL
-
-pn_list_t *pn_list(const pn_class_t *clazz, size_t capacity)
-{
-  static const pn_class_t list_clazz = PN_CLASS(pn_list);
-
-  pn_list_t *list = (pn_list_t *) pn_class_new(&list_clazz, sizeof(pn_list_t));
-  list->clazz = clazz;
-  list->capacity = capacity ? capacity : 16;
-  list->elements = (void **) malloc(list->capacity * sizeof(void *));
-  list->size = 0;
-  return list;
-}
-
diff --git a/proton-c/src/core/object/map.c b/proton-c/src/core/object/map.c
deleted file mode 100644
index cd38f19..0000000
--- a/proton-c/src/core/object/map.c
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/object.h>
-#include <stdlib.h>
-#include <assert.h>
-
-#define PNI_ENTRY_FREE (0)
-#define PNI_ENTRY_LINK (1)
-#define PNI_ENTRY_TAIL (2)
-
-typedef struct {
-  void *key;
-  void *value;
-  size_t next;
-  uint8_t state;
-} pni_entry_t;
-
-struct pn_map_t {
-  const pn_class_t *key;
-  const pn_class_t *value;
-  pni_entry_t *entries;
-  size_t capacity;
-  size_t addressable;
-  size_t size;
-  uintptr_t (*hashcode)(void *key);
-  bool (*equals)(void *a, void *b);
-  float load_factor;
-};
-
-static void pn_map_finalize(void *object)
-{
-  pn_map_t *map = (pn_map_t *) object;
-
-  for (size_t i = 0; i < map->capacity; i++) {
-    if (map->entries[i].state != PNI_ENTRY_FREE) {
-      pn_class_decref(map->key, map->entries[i].key);
-      pn_class_decref(map->value, map->entries[i].value);
-    }
-  }
-
-  free(map->entries);
-}
-
-static uintptr_t pn_map_hashcode(void *object)
-{
-  pn_map_t *map = (pn_map_t *) object;
-
-  uintptr_t hashcode = 0;
-
-  for (size_t i = 0; i < map->capacity; i++) {
-    if (map->entries[i].state != PNI_ENTRY_FREE) {
-      void *key = map->entries[i].key;
-      void *value = map->entries[i].value;
-      hashcode += pn_hashcode(key) ^ pn_hashcode(value);
-    }
-  }
-
-  return hashcode;
-}
-
-static void pni_map_allocate(pn_map_t *map)
-{
-  map->entries = (pni_entry_t *) malloc(map->capacity * sizeof (pni_entry_t));
-  if (map->entries != NULL) {
-    for (size_t i = 0; i < map->capacity; i++) {
-      map->entries[i].key = NULL;
-      map->entries[i].value = NULL;
-      map->entries[i].next = 0;
-      map->entries[i].state = PNI_ENTRY_FREE;
-    }
-  }
-  map->size = 0;
-}
-
-static int pn_map_inspect(void *obj, pn_string_t *dst)
-{
-  assert(obj);
-  pn_map_t *map = (pn_map_t *) obj;
-  int err = pn_string_addf(dst, "{");
-  if (err) return err;
-  pn_handle_t entry = pn_map_head(map);
-  bool first = true;
-  while (entry) {
-    if (first) {
-      first = false;
-    } else {
-      err = pn_string_addf(dst, ", ");
-      if (err) return err;
-    }
-    err = pn_class_inspect(map->key, pn_map_key(map, entry), dst);
-    if (err) return err;
-    err = pn_string_addf(dst, ": ");
-    if (err) return err;
-    err = pn_class_inspect(map->value, pn_map_value(map, entry), dst);
-    if (err) return err;
-    entry = pn_map_next(map, entry);
-  }
-  return pn_string_addf(dst, "}");
-}
-
-#define pn_map_initialize NULL
-#define pn_map_compare NULL
-
-pn_map_t *pn_map(const pn_class_t *key, const pn_class_t *value,
-                 size_t capacity, float load_factor)
-{
-  static const pn_class_t clazz = PN_CLASS(pn_map);
-
-  pn_map_t *map = (pn_map_t *) pn_class_new(&clazz, sizeof(pn_map_t));
-  map->key = key;
-  map->value = value;
-  map->capacity = capacity ? capacity : 16;
-  map->addressable = (size_t) (map->capacity * 0.86);
-  if (!map->addressable) map->addressable = map->capacity;
-  map->load_factor = load_factor;
-  map->hashcode = pn_hashcode;
-  map->equals = pn_equals;
-  pni_map_allocate(map);
-  return map;
-}
-
-size_t pn_map_size(pn_map_t *map)
-{
-  assert(map);
-  return map->size;
-}
-
-static float pni_map_load(pn_map_t *map)
-{
-  return ((float) map->size) / ((float) map->addressable);
-}
-
-static bool pni_map_ensure(pn_map_t *map, size_t capacity)
-{
-  float load = pni_map_load(map);
-  if (capacity <= map->capacity && load <= map->load_factor) {
-    return false;
-  }
-
-  size_t oldcap = map->capacity;
-
-  while (map->capacity < capacity || pni_map_load(map) > map->load_factor) {
-    map->capacity *= 2;
-    map->addressable = (size_t) (0.86 * map->capacity);
-  }
-
-  pni_entry_t *entries = map->entries;
-  pni_map_allocate(map);
-
-  for (size_t i = 0; i < oldcap; i++) {
-    if (entries[i].state != PNI_ENTRY_FREE) {
-      void *key = entries[i].key;
-      void *value = entries[i].value;
-      pn_map_put(map, key, value);
-    }
-  }
-
-  for (size_t i = 0; i < oldcap; i++) {
-    if (entries[i].state != PNI_ENTRY_FREE) {
-      void *key = entries[i].key;
-      void *value = entries[i].value;
-      pn_class_decref(map->key, key);
-      pn_class_decref(map->value, value);
-    }
-  }
-
-  free(entries);
-  return true;
-}
-
-static pni_entry_t *pni_map_entry(pn_map_t *map, void *key, pni_entry_t **pprev, bool create)
-{
-  uintptr_t hashcode = map->hashcode(key);
-
-  pni_entry_t *entry = &map->entries[hashcode % map->addressable];
-  pni_entry_t *prev = NULL;
-
-  if (entry->state == PNI_ENTRY_FREE) {
-    if (create) {
-      entry->state = PNI_ENTRY_TAIL;
-      entry->key = key;
-      pn_class_incref(map->key, key);
-      map->size++;
-      return entry;
-    } else {
-      return NULL;
-    }
-  }
-
-  while (true) {
-    if (map->equals(entry->key, key)) {
-      if (pprev) *pprev = prev;
-      return entry;
-    }
-
-    if (entry->state == PNI_ENTRY_TAIL) {
-      break;
-    } else {
-      prev = entry;
-      entry = &map->entries[entry->next];
-    }
-  }
-
-  if (create) {
-    if (pni_map_ensure(map, map->size + 1)) {
-      // if we had to grow the table we need to start over
-      return pni_map_entry(map, key, pprev, create);
-    }
-
-    size_t empty = 0;
-    for (size_t i = 0; i < map->capacity; i++) {
-      size_t idx = map->capacity - i - 1;
-      if (map->entries[idx].state == PNI_ENTRY_FREE) {
-        empty = idx;
-        break;
-      }
-    }
-    entry->next = empty;
-    entry->state = PNI_ENTRY_LINK;
-    map->entries[empty].state = PNI_ENTRY_TAIL;
-    map->entries[empty].key = key;
-    pn_class_incref(map->key, key);
-    if (pprev) *pprev = entry;
-    map->size++;
-    return &map->entries[empty];
-  } else {
-    return NULL;
-  }
-}
-
-int pn_map_put(pn_map_t *map, void *key, void *value)
-{
-  assert(map);
-  pni_entry_t *entry = pni_map_entry(map, key, NULL, true);
-  void *dref_val = entry->value;
-  entry->value = value;
-  pn_class_incref(map->value, value);
-  pn_class_decref(map->value, dref_val);
-  return 0;
-}
-
-void *pn_map_get(pn_map_t *map, void *key)
-{
-  assert(map);
-  pni_entry_t *entry = pni_map_entry(map, key, NULL, false);
-  return entry ? entry->value : NULL;
-}
-
-static void pni_map_rehash(pn_map_t *map, size_t index)
-{
-  //reinsert entries in chain starting at index
-  assert(map);
-  size_t i = index;
-  bool complete = false;
-  while (!complete) {
-    pni_entry_t *entry = &map->entries[i];
-    assert(entry);
-    assert(entry->state != PNI_ENTRY_FREE);
-    size_t current = i;
-    if (entry->state == PNI_ENTRY_TAIL) {
-      complete = true;
-    } else {
-      assert(entry->state == PNI_ENTRY_LINK);
-      i = entry->next;
-    }
-    uintptr_t hashcode = map->hashcode(entry->key);
-    pni_entry_t *reloc = &map->entries[hashcode % map->addressable];
-    if (reloc->state == PNI_ENTRY_FREE) {
-      //correct addressable slot is available, copy into that...
-      reloc->state = PNI_ENTRY_TAIL;
-      reloc->key = entry->key;
-      reloc->value = entry->value;
-      //...then free the current entry
-      entry->key = NULL;
-      entry->value = NULL;
-      entry->state = PNI_ENTRY_FREE;
-      entry->next = 0;
-    } else {
-      //iterate to end of chain...
-      while (reloc->state == PNI_ENTRY_LINK) {
-        reloc = &map->entries[reloc->next];
-      }
-      assert(reloc->state == PNI_ENTRY_TAIL);
-      //... and append current entry
-      reloc->state = PNI_ENTRY_LINK;
-      reloc->next = current;
-      entry->state = PNI_ENTRY_TAIL;
-      entry->next = 0;
-    }
-  }
-}
-
-void pn_map_del(pn_map_t *map, void *key)
-{
-  assert(map);
-  pni_entry_t *prev = NULL;
-  pni_entry_t *entry = pni_map_entry(map, key, &prev, false);
-  if (entry) {
-    uint8_t orig_state = entry->state;
-    size_t orig_next = entry->next;
-
-    void *dref_key = entry->key;
-    void *dref_value = entry->value;
-    if (prev) {
-      prev->next = 0;
-      prev->state = PNI_ENTRY_TAIL;
-    }
-    entry->state = PNI_ENTRY_FREE;
-    entry->next = 0;
-    entry->key = NULL;
-    entry->value = NULL;
-    map->size--;
-
-    if (orig_state == PNI_ENTRY_LINK) {
-      pni_map_rehash(map, orig_next);
-    }
-
-    // do this last as it may trigger further deletions
-    pn_class_decref(map->key, dref_key);
-    pn_class_decref(map->value, dref_value);
-  }
-}
-
-pn_handle_t pn_map_head(pn_map_t *map)
-{
-  assert(map);
-  for (size_t i = 0; i < map->capacity; i++)
-  {
-    if (map->entries[i].state != PNI_ENTRY_FREE) {
-      return (pn_handle_t)(i + 1);
-    }
-  }
-
-  return 0;
-}
-
-pn_handle_t pn_map_next(pn_map_t *map, pn_handle_t entry)
-{
-  for (size_t i = (size_t)entry; i < map->capacity; i++) {
-    if (map->entries[i].state != PNI_ENTRY_FREE) {
-      return (pn_handle_t)(i + 1);
-    }
-  }
-
-  return 0;
-}
-
-void *pn_map_key(pn_map_t *map, pn_handle_t entry)
-{
-  assert(map);
-  assert(entry);
-  return map->entries[(size_t)entry - 1].key;
-}
-
-void *pn_map_value(pn_map_t *map, pn_handle_t entry)
-{
-  assert(map);
-  assert(entry);
-  return map->entries[(size_t)entry - 1].value;
-}
-
-struct pn_hash_t {
-  pn_map_t map;
-};
-
-static uintptr_t pni_identity_hashcode(void *obj)
-{
-  return (uintptr_t ) obj;
-}
-
-static bool pni_identity_equals(void *a, void *b)
-{
-  return a == b;
-}
-
-#define CID_pni_uintptr CID_pn_void
-static const pn_class_t *pni_uintptr_reify(void *object);
-#define pni_uintptr_new NULL
-#define pni_uintptr_free NULL
-#define pni_uintptr_initialize NULL
-static void pni_uintptr_incref(void *object) {}
-static void pni_uintptr_decref(void *object) {}
-static int pni_uintptr_refcount(void *object) { return -1; }
-#define pni_uintptr_finalize NULL
-#define pni_uintptr_hashcode NULL
-#define pni_uintptr_compare NULL
-#define pni_uintptr_inspect NULL
-
-static const pn_class_t PN_UINTPTR[] = {PN_METACLASS(pni_uintptr)};
-
-static const pn_class_t *pni_uintptr_reify(void *object)
-{
-  return PN_UINTPTR;
-}
-
-pn_hash_t *pn_hash(const pn_class_t *clazz, size_t capacity, float load_factor)
-{
-  pn_hash_t *hash = (pn_hash_t *) pn_map(PN_UINTPTR, clazz, capacity, load_factor);
-  hash->map.hashcode = pni_identity_hashcode;
-  hash->map.equals = pni_identity_equals;
-  return hash;
-}
-
-size_t pn_hash_size(pn_hash_t *hash)
-{
-  return pn_map_size(&hash->map);
-}
-
-int pn_hash_put(pn_hash_t *hash, uintptr_t key, void *value)
-{
-  return pn_map_put(&hash->map, (void *) key, value);
-}
-
-void *pn_hash_get(pn_hash_t *hash, uintptr_t key)
-{
-  return pn_map_get(&hash->map, (void *) key);
-}
-
-void pn_hash_del(pn_hash_t *hash, uintptr_t key)
-{
-  pn_map_del(&hash->map, (void *) key);
-}
-
-pn_handle_t pn_hash_head(pn_hash_t *hash)
-{
-  return pn_map_head(&hash->map);
-}
-
-pn_handle_t pn_hash_next(pn_hash_t *hash, pn_handle_t entry)
-{
-  return pn_map_next(&hash->map, entry);
-}
-
-uintptr_t pn_hash_key(pn_hash_t *hash, pn_handle_t entry)
-{
-  return (uintptr_t) pn_map_key(&hash->map, entry);
-}
-
-void *pn_hash_value(pn_hash_t *hash, pn_handle_t entry)
-{
-  return pn_map_value(&hash->map, entry);
-}
diff --git a/proton-c/src/core/object/object.c b/proton-c/src/core/object/object.c
deleted file mode 100644
index a6952b6..0000000
--- a/proton-c/src/core/object/object.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/object.h>
-#include <stdlib.h>
-#include <assert.h>
-
-#define pn_object_initialize NULL
-#define pn_object_finalize NULL
-#define pn_object_inspect NULL
-uintptr_t pn_object_hashcode(void *object) { return (uintptr_t) object; }
-intptr_t pn_object_compare(void *a, void *b) { return (intptr_t) a - (intptr_t) b; }
-
-const pn_class_t PN_OBJECT[] = {PN_CLASS(pn_object)};
-
-#define pn_void_initialize NULL
-void *pn_void_new(const pn_class_t *clazz, size_t size) { return malloc(size); }
-void pn_void_incref(void* p) {}
-void pn_void_decref(void* p) {}
-int pn_void_refcount(void *object) { return -1; }
-#define pn_void_finalize NULL
-static void pn_void_free(void *object) { free(object); }
-static const pn_class_t *pn_void_reify(void *object) { return PN_VOID; }
-uintptr_t pn_void_hashcode(void *object) { return (uintptr_t) object; }
-intptr_t pn_void_compare(void *a, void *b) { return (intptr_t) a - (intptr_t) b; }
-int pn_void_inspect(void *object, pn_string_t *dst) { return pn_string_addf(dst, "%p", object); }
-
-const pn_class_t PN_VOID[] = {PN_METACLASS(pn_void)};
-
-const char *pn_class_name(const pn_class_t *clazz)
-{
-  return clazz->name;
-}
-
-pn_cid_t pn_class_id(const pn_class_t *clazz)
-{
-  return clazz->cid;
-}
-
-void *pn_class_new(const pn_class_t *clazz, size_t size)
-{
-  assert(clazz);
-  void *object = clazz->newinst(clazz, size);
-  if (clazz->initialize) {
-    clazz->initialize(object);
-  }
-  return object;
-}
-
-void *pn_class_incref(const pn_class_t *clazz, void *object)
-{
-  assert(clazz);
-  if (object) {
-    clazz = clazz->reify(object);
-    clazz->incref(object);
-  }
-  return object;
-}
-
-int pn_class_refcount(const pn_class_t *clazz, void *object)
-{
-  assert(clazz);
-  clazz = clazz->reify(object);
-  return clazz->refcount(object);
-}
-
-int pn_class_decref(const pn_class_t *clazz, void *object)
-{
-  assert(clazz);
-
-  if (object) {
-    clazz = clazz->reify(object);
-    clazz->decref(object);
-    int rc = clazz->refcount(object);
-    if (rc == 0) {
-      if (clazz->finalize) {
-        clazz->finalize(object);
-        // check the refcount again in case the finalizer created a
-        // new reference
-        rc = clazz->refcount(object);
-      }
-      if (rc == 0) {
-        clazz->free(object);
-        return 0;
-      }
-    } else {
-      return rc;
-    }
-  }
-
-  return 0;
-}
-
-void pn_class_free(const pn_class_t *clazz, void *object)
-{
-  assert(clazz);
-  if (object) {
-    clazz = clazz->reify(object);
-    int rc = clazz->refcount(object);
-    assert(rc == 1 || rc == -1);
-    if (rc == 1) {
-      rc = pn_class_decref(clazz, object);
-      assert(rc == 0);
-    } else {
-      if (clazz->finalize) {
-        clazz->finalize(object);
-      }
-      clazz->free(object);
-    }
-  }
-}
-
-const pn_class_t *pn_class_reify(const pn_class_t *clazz, void *object)
-{
-  assert(clazz);
-  return clazz->reify(object);
-}
-
-uintptr_t pn_class_hashcode(const pn_class_t *clazz, void *object)
-{
-  assert(clazz);
-
-  if (!object) return 0;
-
-  clazz = clazz->reify(object);
-
-  if (clazz->hashcode) {
-    return clazz->hashcode(object);
-  } else {
-    return (uintptr_t) object;
-  }
-}
-
-intptr_t pn_class_compare(const pn_class_t *clazz, void *a, void *b)
-{
-  assert(clazz);
-
-  if (a == b) return 0;
-
-  clazz = clazz->reify(a);
-
-  if (a && b && clazz->compare) {
-    return clazz->compare(a, b);
-  } else {
-    return (intptr_t) a - (intptr_t) b;
-  }
-}
-
-bool pn_class_equals(const pn_class_t *clazz, void *a, void *b)
-{
-  return pn_class_compare(clazz, a, b) == 0;
-}
-
-int pn_class_inspect(const pn_class_t *clazz, void *object, pn_string_t *dst)
-{
-  assert(clazz);
-
-  clazz = clazz->reify(object);
-
-  if (!pn_string_get(dst)) {
-    pn_string_set(dst, "");
-  }
-
-  if (object && clazz->inspect) {
-    return clazz->inspect(object, dst);
-  }
-
-  const char *name = clazz->name ? clazz->name : "<anon>";
-
-  return pn_string_addf(dst, "%s<%p>", name, object);
-}
-
-typedef struct {
-  const pn_class_t *clazz;
-  int refcount;
-} pni_head_t;
-
-#define pni_head(PTR) \
-  (((pni_head_t *) (PTR)) - 1)
-
-void *pn_object_new(const pn_class_t *clazz, size_t size)
-{
-  void *object = NULL;
-  pni_head_t *head = (pni_head_t *) calloc(1, sizeof(pni_head_t) + size);
-  if (head != NULL) {
-    object = head + 1;
-    head->clazz = clazz;
-    head->refcount = 1;
-  }
-  return object;
-}
-
-const pn_class_t *pn_object_reify(void *object)
-{
-  if (object) {
-    return pni_head(object)->clazz;
-  } else {
-    return PN_OBJECT;
-  }
-}
-
-void pn_object_incref(void *object)
-{
-  if (object) {
-    pni_head(object)->refcount++;
-  }
-}
-
-int pn_object_refcount(void *object)
-{
-  assert(object);
-  return pni_head(object)->refcount;
-}
-
-void pn_object_decref(void *object)
-{
-  pni_head_t *head = pni_head(object);
-  assert(head->refcount > 0);
-  head->refcount--;
-}
-
-void pn_object_free(void *object)
-{
-  pni_head_t *head = pni_head(object);
-  free(head);
-}
-
-void *pn_incref(void *object)
-{
-  return pn_class_incref(PN_OBJECT, object);
-}
-
-int pn_decref(void *object)
-{
-  return pn_class_decref(PN_OBJECT, object);
-}
-
-int pn_refcount(void *object)
-{
-  return pn_class_refcount(PN_OBJECT, object);
-}
-
-void pn_free(void *object)
-{
-  pn_class_free(PN_OBJECT, object);
-}
-
-const pn_class_t *pn_class(void *object)
-{
-  return pn_class_reify(PN_OBJECT, object);
-}
-
-uintptr_t pn_hashcode(void *object)
-{
-  return pn_class_hashcode(PN_OBJECT, object);
-}
-
-intptr_t pn_compare(void *a, void *b)
-{
-  return pn_class_compare(PN_OBJECT, a, b);
-}
-
-bool pn_equals(void *a, void *b)
-{
-  return !pn_compare(a, b);
-}
-
-int pn_inspect(void *object, pn_string_t *dst)
-{
-  return pn_class_inspect(PN_OBJECT, object, dst);
-}
-
-#define pn_weakref_new NULL
-#define pn_weakref_initialize NULL
-#define pn_weakref_finalize NULL
-#define pn_weakref_free NULL
-
-static void pn_weakref_incref(void *object) {}
-static void pn_weakref_decref(void *object) {}
-static int pn_weakref_refcount(void *object) { return -1; }
-static const pn_class_t *pn_weakref_reify(void *object) {
-  return PN_WEAKREF;
-}
-static uintptr_t pn_weakref_hashcode(void *object) {
-  return pn_hashcode(object);
-}
-static intptr_t pn_weakref_compare(void *a, void *b) {
-  return pn_compare(a, b);
-}
-static int pn_weakref_inspect(void *object, pn_string_t *dst) {
-  return pn_inspect(object, dst);
-}
-
-const pn_class_t PN_WEAKREF[] = {PN_METACLASS(pn_weakref)};
diff --git a/proton-c/src/core/object/record.c b/proton-c/src/core/object/record.c
deleted file mode 100644
index 6f4fe0a..0000000
--- a/proton-c/src/core/object/record.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/object.h>
-#include <stdlib.h>
-#include <assert.h>
-
-typedef struct {
-  pn_handle_t key;
-  const pn_class_t *clazz;
-  void *value;
-} pni_field_t;
-
-struct pn_record_t {
-  size_t size;
-  size_t capacity;
-  pni_field_t *fields;
-};
-
-static void pn_record_initialize(void *object)
-{
-  pn_record_t *record = (pn_record_t *) object;
-  record->size = 0;
-  record->capacity = 0;
-  record->fields = NULL;
-}
-
-static void pn_record_finalize(void *object)
-{
-  pn_record_t *record = (pn_record_t *) object;
-  for (size_t i = 0; i < record->size; i++) {
-    pni_field_t *v = &record->fields[i];
-    pn_class_decref(v->clazz, v->value);
-  }
-  free(record->fields);
-}
-
-#define pn_record_hashcode NULL
-#define pn_record_compare NULL
-#define pn_record_inspect NULL
-
-pn_record_t *pn_record(void)
-{
-  static const pn_class_t clazz = PN_CLASS(pn_record);
-  pn_record_t *record = (pn_record_t *) pn_class_new(&clazz, sizeof(pn_record_t));
-  pn_record_def(record, PN_LEGCTX, PN_VOID);
-  return record;
-}
-
-static pni_field_t *pni_record_find(pn_record_t *record, pn_handle_t key) {
-  for (size_t i = 0; i < record->size; i++) {
-    pni_field_t *field = &record->fields[i];
-    if (field->key == key) {
-      return field;
-    }
-  }
-  return NULL;
-}
-
-static pni_field_t *pni_record_create(pn_record_t *record) {
-  record->size++;
-  if (record->size > record->capacity) {
-    record->fields = (pni_field_t *) realloc(record->fields, record->size * sizeof(pni_field_t));
-    record->capacity = record->size;
-  }
-  pni_field_t *field = &record->fields[record->size - 1];
-  field->key = 0;
-  field->clazz = NULL;
-  field->value = NULL;
-  return field;
-}
-
-void pn_record_def(pn_record_t *record, pn_handle_t key, const pn_class_t *clazz)
-{
-  assert(record);
-  assert(clazz);
-
-  pni_field_t *field = pni_record_find(record, key);
-  if (field) {
-    assert(field->clazz == clazz);
-  } else {
-    field = pni_record_create(record);
-    field->key = key;
-    field->clazz = clazz;
-  }
-}
-
-bool pn_record_has(pn_record_t *record, pn_handle_t key)
-{
-  assert(record);
-  pni_field_t *field = pni_record_find(record, key);
-  if (field) {
-    return true;
-  } else {
-    return false;
-  }
-}
-
-void *pn_record_get(pn_record_t *record, pn_handle_t key)
-{
-  assert(record);
-  pni_field_t *field = pni_record_find(record, key);
-  if (field) {
-    return field->value;
-  } else {
-    return NULL;
-  }
-}
-
-void pn_record_set(pn_record_t *record, pn_handle_t key, void *value)
-{
-  assert(record);
-
-  pni_field_t *field = pni_record_find(record, key);
-  if (field) {
-    void *old = field->value;
-    field->value = value;
-    pn_class_incref(field->clazz, value);
-    pn_class_decref(field->clazz, old);
-  }
-}
-
-void pn_record_clear(pn_record_t *record)
-{
-  assert(record);
-  for (size_t i = 0; i < record->size; i++) {
-    pni_field_t *field = &record->fields[i];
-    pn_class_decref(field->clazz, field->value);
-    field->key = 0;
-    field->clazz = NULL;
-    field->value = NULL;
-  }
-  record->size = 0;
-  pn_record_def(record, PN_LEGCTX, PN_VOID);
-}
diff --git a/proton-c/src/core/object/string.c b/proton-c/src/core/object/string.c
deleted file mode 100644
index 71db6c4..0000000
--- a/proton-c/src/core/object/string.c
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include "platform/platform.h"
-
-#include <proton/error.h>
-#include <proton/object.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <ctype.h>
-
-#define PNI_NULL_SIZE (-1)
-
-struct pn_string_t {
-  char *bytes;
-  ssize_t size;       // PNI_NULL_SIZE (-1) means null
-  size_t capacity;
-};
-
-static void pn_string_finalize(void *object)
-{
-  pn_string_t *string = (pn_string_t *) object;
-  free(string->bytes);
-}
-
-static uintptr_t pn_string_hashcode(void *object)
-{
-  pn_string_t *string = (pn_string_t *) object;
-  if (string->size == PNI_NULL_SIZE) {
-    return 0;
-  }
-
-  uintptr_t hashcode = 1;
-  for (ssize_t i = 0; i < string->size; i++) {
-    hashcode = hashcode * 31 + string->bytes[i];
-  }
-  return hashcode;
-}
-
-static intptr_t pn_string_compare(void *oa, void *ob)
-{
-  pn_string_t *a = (pn_string_t *) oa;
-  pn_string_t *b = (pn_string_t *) ob;
-  if (a->size != b->size) {
-    return b->size - a->size;
-  }
-
-  if (a->size == PNI_NULL_SIZE) {
-    return 0;
-  } else {
-    return memcmp(a->bytes, b->bytes, a->size);
-  }
-}
-
-static int pn_string_inspect(void *obj, pn_string_t *dst)
-{
-  pn_string_t *str = (pn_string_t *) obj;
-  if (str->size == PNI_NULL_SIZE) {
-    return pn_string_addf(dst, "null");
-  }
-
-  int err = pn_string_addf(dst, "\"");
-  if (err) return err;
-
-  for (int i = 0; i < str->size; i++) {
-    uint8_t c = str->bytes[i];
-    if (isprint(c)) {
-      err = pn_string_addf(dst, "%c", c);
-      if (err) return err;
-    } else {
-      err = pn_string_addf(dst, "\\x%.2x", c);
-      if (err) return err;
-    }
-  }
-
-  return pn_string_addf(dst, "\"");
-}
-
-pn_string_t *pn_string(const char *bytes)
-{
-  return pn_stringn(bytes, bytes ? strlen(bytes) : 0);
-}
-
-#define pn_string_initialize NULL
-
-
-pn_string_t *pn_stringn(const char *bytes, size_t n)
-{
-  static const pn_class_t clazz = PN_CLASS(pn_string);
-  pn_string_t *string = (pn_string_t *) pn_class_new(&clazz, sizeof(pn_string_t));
-  string->capacity = n ? n * sizeof(char) : 16;
-  string->bytes = (char *) malloc(string->capacity);
-  pn_string_setn(string, bytes, n);
-  return string;
-}
-
-const char *pn_string_get(pn_string_t *string)
-{
-  assert(string);
-  if (string->size == PNI_NULL_SIZE) {
-    return NULL;
-  } else {
-    return string->bytes;
-  }
-}
-
-size_t pn_string_size(pn_string_t *string)
-{
-  assert(string);
-  if (string->size == PNI_NULL_SIZE) {
-    return 0;
-  } else {
-    return string->size;
-  }
-}
-
-int pn_string_set(pn_string_t *string, const char *bytes)
-{
-  return pn_string_setn(string, bytes, bytes ? strlen(bytes) : 0);
-}
-
-int pn_string_grow(pn_string_t *string, size_t capacity)
-{
-  bool grow = false;
-  while (string->capacity < (capacity*sizeof(char) + 1)) {
-    string->capacity *= 2;
-    grow = true;
-  }
-
-  if (grow) {
-    char *growed = (char *) realloc(string->bytes, string->capacity);
-    if (growed) {
-      string->bytes = growed;
-    } else {
-      return PN_ERR;
-    }
-  }
-
-  return 0;
-}
-
-int pn_string_setn(pn_string_t *string, const char *bytes, size_t n)
-{
-  int err = pn_string_grow(string, n);
-  if (err) return err;
-
-  if (bytes) {
-    memcpy(string->bytes, bytes, n*sizeof(char));
-    string->bytes[n] = '\0';
-    string->size = n;
-  } else {
-    string->size = PNI_NULL_SIZE;
-  }
-
-  return 0;
-}
-
-ssize_t pn_string_put(pn_string_t *string, char *dst)
-{
-  assert(string);
-  assert(dst);
-
-  if (string->size != PNI_NULL_SIZE) {
-    memcpy(dst, string->bytes, string->size + 1);
-  }
-
-  return string->size;
-}
-
-void pn_string_clear(pn_string_t *string)
-{
-  pn_string_set(string, NULL);
-}
-
-int pn_string_format(pn_string_t *string, const char *format, ...)
-{
-  va_list ap;
-
-  va_start(ap, format);
-  int err = pn_string_vformat(string, format, ap);
-  va_end(ap);
-  return err;
-}
-
-int pn_string_vformat(pn_string_t *string, const char *format, va_list ap)
-{
-  pn_string_set(string, "");
-  return pn_string_vaddf(string, format, ap);
-}
-
-int pn_string_addf(pn_string_t *string, const char *format, ...)
-{
-  va_list ap;
-
-  va_start(ap, format);
-  int err = pn_string_vaddf(string, format, ap);
-  va_end(ap);
-  return err;
-}
-
-int pn_string_vaddf(pn_string_t *string, const char *format, va_list ap)
-{
-  va_list copy;
-
-  if (string->size == PNI_NULL_SIZE) {
-    return PN_ERR;
-  }
-
-  while (true) {
-    va_copy(copy, ap);
-    int err = pni_vsnprintf(string->bytes + string->size, string->capacity - string->size, format, copy);
-    va_end(copy);
-    if (err < 0) {
-      return err;
-    } else if ((size_t) err >= string->capacity - string->size) {
-      pn_string_grow(string, string->size + err);
-    } else {
-      string->size += err;
-      return 0;
-    }
-  }
-}
-
-char *pn_string_buffer(pn_string_t *string)
-{
-  assert(string);
-  return string->bytes;
-}
-
-size_t pn_string_capacity(pn_string_t *string)
-{
-  assert(string);
-  return string->capacity - 1;
-}
-
-int pn_string_resize(pn_string_t *string, size_t size)
-{
-  assert(string);
-  int err = pn_string_grow(string, size);
-  if (err) return err;
-  string->size = size;
-  string->bytes[size] = '\0';
-  return 0;
-}
-
-int pn_string_copy(pn_string_t *string, pn_string_t *src)
-{
-  assert(string);
-  return pn_string_setn(string, pn_string_get(src), pn_string_size(src));
-}
diff --git a/proton-c/src/core/transport.c b/proton-c/src/core/transport.c
deleted file mode 100644
index 444145a..0000000
--- a/proton-c/src/core/transport.c
+++ /dev/null
@@ -1,3024 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "engine-internal.h"
-#include "framing.h"
-#include "platform/platform.h"
-#include "platform/platform_fmt.h"
-#include "sasl/sasl-internal.h"
-#include "ssl/ssl-internal.h"
-
-#include "autodetect.h"
-#include "protocol.h"
-#include "dispatch_actions.h"
-#include "config.h"
-#include "log_private.h"
-
-#include "proton/event.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <stdarg.h>
-#include <stdio.h>
-
-static ssize_t transport_consume(pn_transport_t *transport);
-
-// delivery buffers
-
-/*
- * Call this any time anything happens that may affect channel_max:
- * i.e. when the app indicates a preference, or when we receive the
- * OPEN frame from the remote peer.  And call it to do the final
- * calculation just before we communicate our limit to the remote
- * peer by sending our OPEN frame.
- */
-static void pni_calculate_channel_max(pn_transport_t *transport) {
-  /*
-   * The application cannot make the limit larger than
-   * what this library will allow.
-   */
-  transport->channel_max = (PN_IMPL_CHANNEL_MAX < transport->local_channel_max)
-                           ? PN_IMPL_CHANNEL_MAX
-                           : transport->local_channel_max;
-
-  /*
-   * The remote peer's constraint is not valid until the
-   * peer's open frame has been received.
-   */
-  if(transport->open_rcvd) {
-    transport->channel_max = (transport->channel_max < transport->remote_channel_max)
-                             ? transport->channel_max
-                             : transport->remote_channel_max;
-  }
-}
-
-void pn_delivery_map_init(pn_delivery_map_t *db, pn_sequence_t next)
-{
-  db->deliveries = pn_hash(PN_WEAKREF, 0, 0.75);
-  db->next = next;
-}
-
-void pn_delivery_map_free(pn_delivery_map_t *db)
-{
-  pn_free(db->deliveries);
-}
-
-static pn_delivery_t *pni_delivery_map_get(pn_delivery_map_t *db, pn_sequence_t id)
-{
-  return (pn_delivery_t *) pn_hash_get(db->deliveries, id);
-}
-
-static void pn_delivery_state_init(pn_delivery_state_t *ds, pn_delivery_t *delivery, pn_sequence_t id)
-{
-  ds->id = id;
-  ds->sent = false;
-  ds->init = true;
-}
-
-static pn_delivery_state_t *pni_delivery_map_push(pn_delivery_map_t *db, pn_delivery_t *delivery)
-{
-  pn_delivery_state_t *ds = &delivery->state;
-  pn_delivery_state_init(ds, delivery, db->next++);
-  pn_hash_put(db->deliveries, ds->id, delivery);
-  return ds;
-}
-
-void pn_delivery_map_del(pn_delivery_map_t *db, pn_delivery_t *delivery)
-{
-  if (delivery->state.init) {
-    delivery->state.init = false;
-    delivery->state.sent = false;
-    pn_hash_del(db->deliveries, delivery->state.id);
-  }
-}
-
-static void pni_delivery_map_clear(pn_delivery_map_t *dm)
-{
-  pn_hash_t *hash = dm->deliveries;
-  for (pn_handle_t entry = pn_hash_head(hash);
-       entry;
-       entry = pn_hash_next(hash, entry))
-  {
-    pn_delivery_t *dlv = (pn_delivery_t *) pn_hash_value(hash, entry);
-    pn_delivery_map_del(dm, dlv);
-  }
-  dm->next = 0;
-}
-
-static void pni_default_tracer(pn_transport_t *transport, const char *message)
-{
-  fprintf(stderr, "[%p]:%s\n", (void *) transport, message);
-}
-
-static ssize_t pn_io_layer_input_passthru(pn_transport_t *, unsigned int, const char *, size_t );
-static ssize_t pn_io_layer_output_passthru(pn_transport_t *, unsigned int, char *, size_t );
-
-static ssize_t pn_io_layer_input_error(pn_transport_t *, unsigned int, const char *, size_t );
-static ssize_t pn_io_layer_output_error(pn_transport_t *, unsigned int, char *, size_t );
-
-static ssize_t pn_io_layer_input_setup(pn_transport_t *transport, unsigned int layer, const char *bytes, size_t available);
-static ssize_t pn_io_layer_output_setup(pn_transport_t *transport, unsigned int layer, char *bytes, size_t available);
-
-static ssize_t pn_input_read_amqp_header(pn_transport_t *transport, unsigned int layer, const char *bytes, size_t available);
-static ssize_t pn_input_read_amqp(pn_transport_t *transport, unsigned int layer, const char *bytes, size_t available);
-static ssize_t pn_output_write_amqp_header(pn_transport_t *transport, unsigned int layer, char *bytes, size_t available);
-static ssize_t pn_output_write_amqp(pn_transport_t *transport, unsigned int layer, char *bytes, size_t available);
-static void pn_error_amqp(pn_transport_t *transport, unsigned int layer);
-static pn_timestamp_t pn_tick_amqp(pn_transport_t *transport, unsigned int layer, pn_timestamp_t now);
-
-static ssize_t pn_io_layer_input_autodetect(pn_transport_t *transport, unsigned int layer, const char *bytes, size_t available);
-static ssize_t pn_io_layer_output_null(pn_transport_t *transport, unsigned int layer, char *bytes, size_t available);
-
-const pn_io_layer_t amqp_header_layer = {
-    pn_input_read_amqp_header,
-    pn_output_write_amqp_header,
-    NULL,
-    pn_tick_amqp,
-    NULL
-};
-
-const pn_io_layer_t amqp_write_header_layer = {
-    pn_input_read_amqp,
-    pn_output_write_amqp_header,
-    NULL,
-    pn_tick_amqp,
-    NULL
-};
-
-const pn_io_layer_t amqp_read_header_layer = {
-    pn_input_read_amqp_header,
-    pn_output_write_amqp,
-    pn_error_amqp,
-    pn_tick_amqp,
-    NULL
-};
-
-const pn_io_layer_t amqp_layer = {
-    pn_input_read_amqp,
-    pn_output_write_amqp,
-    pn_error_amqp,
-    pn_tick_amqp,
-    NULL
-};
-
-const pn_io_layer_t pni_setup_layer = {
-    pn_io_layer_input_setup,
-    pn_io_layer_output_setup,
-    NULL,
-    NULL,
-    NULL
-};
-
-const pn_io_layer_t pni_autodetect_layer = {
-    pn_io_layer_input_autodetect,
-    pn_io_layer_output_null,
-    NULL,
-    NULL,
-    NULL
-};
-
-const pn_io_layer_t pni_passthru_layer = {
-    pn_io_layer_input_passthru,
-    pn_io_layer_output_passthru,
-    NULL,
-    NULL,
-    NULL
-};
-
-const pn_io_layer_t pni_header_error_layer = {
-    pn_io_layer_input_error,
-    pn_output_write_amqp_header,
-    NULL,
-    NULL,
-    NULL
-};
-
-const pn_io_layer_t pni_error_layer = {
-    pn_io_layer_input_error,
-    pn_io_layer_output_error,
-    pn_error_amqp,
-    NULL,
-    NULL
-};
-
-/* Set up the transport protocol layers depending on what is configured */
-static void pn_io_layer_setup(pn_transport_t *transport, unsigned int layer)
-{
-  assert(layer == 0);
-  // Figure out if we are server or not
-  if (transport->server) {
-      transport->io_layers[layer++] = &pni_autodetect_layer;
-      return;
-  }
-  if (transport->ssl) {
-    transport->io_layers[layer++] = &ssl_layer;
-  }
-  if (transport->sasl) {
-    transport->io_layers[layer++] = &sasl_header_layer;
-  }
-  transport->io_layers[layer++] = &amqp_header_layer;
-}
-
-ssize_t pn_io_layer_input_setup(pn_transport_t *transport, unsigned int layer, const char *bytes, size_t available)
-{
-  pn_io_layer_setup(transport, layer);
-  return transport->io_layers[layer]->process_input(transport, layer, bytes, available);
-}
-
-ssize_t pn_io_layer_output_setup(pn_transport_t *transport, unsigned int layer, char *bytes, size_t available)
-{
-  pn_io_layer_setup(transport, layer);
-  return transport->io_layers[layer]->process_output(transport, layer, bytes, available);
-}
-
-void pn_set_error_layer(pn_transport_t *transport)
-{
-  // Set every layer to the error layer in case we manually
-  // pass through (happens from SASL to AMQP)
-  for (int layer=0; layer<PN_IO_LAYER_CT; ++layer) {
-    transport->io_layers[layer] = &pni_error_layer;
-  }
-}
-
-// Autodetect the layer by reading the protocol header
-ssize_t pn_io_layer_input_autodetect(pn_transport_t *transport, unsigned int layer, const char *bytes, size_t available)
-{
-  const char* error;
-  bool eos = pn_transport_capacity(transport)==PN_EOS;
-  if (eos && available==0) {
-    pn_do_error(transport, "amqp:connection:framing-error", "No valid protocol header found");
-    pn_set_error_layer(transport);
-    return PN_EOS;
-  }
-  pni_protocol_type_t protocol = pni_sniff_header(bytes, available);
-  if (transport->trace & PN_TRACE_DRV)
-      pn_transport_logf(transport, "%s detected", pni_protocol_name(protocol));
-  switch (protocol) {
-  case PNI_PROTOCOL_SSL:
-    if (!(transport->allowed_layers & LAYER_SSL)) {
-      error = "SSL protocol header not allowed (maybe detected twice)";
-      break;
-    }
-    transport->present_layers |= LAYER_SSL;
-    transport->allowed_layers &= LAYER_AMQP1 | LAYER_AMQPSASL;
-    if (!transport->ssl) {
-      pn_ssl(transport);
-    }
-    transport->io_layers[layer] = &ssl_layer;
-    transport->io_layers[layer+1] = &pni_autodetect_layer;
-    return ssl_layer.process_input(transport, layer, bytes, available);
-  case PNI_PROTOCOL_AMQP_SSL:
-    if (!(transport->allowed_layers & LAYER_AMQPSSL)) {
-      error = "AMQP SSL protocol header not allowed (maybe detected twice)";
-      break;
-    }
-    transport->present_layers |= LAYER_AMQPSSL;
-    transport->allowed_layers &= LAYER_AMQP1 | LAYER_AMQPSASL;
-    if (!transport->ssl) {
-      pn_ssl(transport);
-    }
-    transport->io_layers[layer] = &ssl_layer;
-    transport->io_layers[layer+1] = &pni_autodetect_layer;
-    return 8;
-  case PNI_PROTOCOL_AMQP_SASL:
-    if (!(transport->allowed_layers & LAYER_AMQPSASL)) {
-      error = "AMQP SASL protocol header not allowed (maybe detected twice)";
-      break;
-    }
-    transport->present_layers |= LAYER_AMQPSASL;
-    transport->allowed_layers &= LAYER_AMQP1 | LAYER_AMQPSSL;
-    if (!transport->sasl) {
-      pn_sasl(transport);
-    }
-    transport->io_layers[layer] = &sasl_write_header_layer;
-    transport->io_layers[layer+1] = &pni_autodetect_layer;
-    if (transport->trace & PN_TRACE_FRM)
-        pn_transport_logf(transport, "  <- %s", "SASL");
-    pni_sasl_set_external_security(transport, pn_ssl_get_ssf((pn_ssl_t*)transport), pn_ssl_get_remote_subject((pn_ssl_t*)transport));
-    return 8;
-  case PNI_PROTOCOL_AMQP1:
-    if (!(transport->allowed_layers & LAYER_AMQP1)) {
-      error = "AMQP1.0 protocol header not allowed (maybe detected twice)";
-      break;
-    }
-    transport->present_layers |= LAYER_AMQP1;
-    transport->allowed_layers = LAYER_NONE;
-    if (transport->auth_required && !pn_transport_is_authenticated(transport)) {
-      pn_do_error(transport, "amqp:connection:policy-error",
-                  "Client skipped authentication - forbidden");
-      pn_set_error_layer(transport);
-      return 8;
-    }
-    if (transport->encryption_required && !pn_transport_is_encrypted(transport)) {
-      pn_do_error(transport, "amqp:connection:policy-error",
-                  "Client connection unencryted - forbidden");
-      pn_set_error_layer(transport);
-      return 8;
-    }
-    transport->io_layers[layer] = &amqp_write_header_layer;
-    if (transport->trace & PN_TRACE_FRM)
-        pn_transport_logf(transport, "  <- %s", "AMQP");
-    return 8;
-  case PNI_PROTOCOL_INSUFFICIENT:
-    if (!eos) return 0;
-    error = "End of input stream before protocol detection";
-    break;
-  case PNI_PROTOCOL_AMQP_OTHER:
-    error = "Incompatible AMQP connection detected";
-    break;
-  case PNI_PROTOCOL_UNKNOWN:
-  default:
-    error = "Unknown protocol detected";
-    break;
-  }
-  transport->io_layers[layer] = &pni_header_error_layer;
-  char quoted[1024];
-  pn_quote_data(quoted, 1024, bytes, available);
-  pn_do_error(transport, "amqp:connection:framing-error",
-              "%s: '%s'%s", error, quoted,
-              !eos ? "" : " (connection aborted)");
-  return 0;
-}
-
-// We don't know what the output should be - do nothing
-ssize_t pn_io_layer_output_null(pn_transport_t *transport, unsigned int layer, char *bytes, size_t available)
-{
-  return 0;
-}
-
-/** Pass through input handler */
-ssize_t pn_io_layer_input_passthru(pn_transport_t *transport, unsigned int layer, const char *data, size_t available)
-{
-    if (layer+1<PN_IO_LAYER_CT)
-        return transport->io_layers[layer+1]->process_input(transport, layer+1, data, available);
-    return PN_EOS;
-}
-
-/** Pass through output handler */
-ssize_t pn_io_layer_output_passthru(pn_transport_t *transport, unsigned int layer, char *data, size_t available)
-{
-    if (layer+1<PN_IO_LAYER_CT)
-        return transport->io_layers[layer+1]->process_output(transport, layer+1, data, available);
-    return PN_EOS;
-}
-
-/** Input handler after detected error */
-ssize_t pn_io_layer_input_error(pn_transport_t *transport, unsigned int layer, const char *data, size_t available)
-{
-    return PN_EOS;
-}
-
-/** Output handler after detected error */
-ssize_t pn_io_layer_output_error(pn_transport_t *transport, unsigned int layer, char *data, size_t available)
-{
-    return PN_EOS;
-}
-
-static void pn_transport_initialize(void *object)
-{
-  pn_transport_t *transport = (pn_transport_t *)object;
-  transport->freed = false;
-  transport->output_buf = NULL;
-  transport->output_size = PN_DEFAULT_MAX_FRAME_SIZE ? PN_DEFAULT_MAX_FRAME_SIZE : 16 * 1024;
-  transport->input_buf = NULL;
-  transport->input_size =  PN_DEFAULT_MAX_FRAME_SIZE ? PN_DEFAULT_MAX_FRAME_SIZE : 16 * 1024;
-  transport->tracer = pni_default_tracer;
-  transport->sasl = NULL;
-  transport->ssl = NULL;
-
-  transport->scratch = pn_string(NULL);
-  transport->args = pn_data(16);
-  transport->output_args = pn_data(16);
-  transport->frame = pn_buffer(PN_TRANSPORT_INITIAL_FRAME_SIZE);
-  transport->input_frames_ct = 0;
-  transport->output_frames_ct = 0;
-
-  transport->connection = NULL;
-  transport->context = pn_record();
-
-  for (int layer=0; layer<PN_IO_LAYER_CT; ++layer) {
-    transport->io_layers[layer] = NULL;
-  }
-
-  transport->allowed_layers = LAYER_AMQP1 | LAYER_AMQPSASL | LAYER_AMQPSSL | LAYER_SSL;
-  transport->present_layers = LAYER_NONE;
-
-  // Defer setting up the layers until the first data arrives or is sent
-  transport->io_layers[0] = &pni_setup_layer;
-
-  transport->open_sent = false;
-  transport->open_rcvd = false;
-  transport->close_sent = false;
-  transport->close_rcvd = false;
-  transport->tail_closed = false;
-  transport->head_closed = false;
-  transport->remote_container = NULL;
-  transport->remote_hostname = NULL;
-  transport->local_max_frame = PN_DEFAULT_MAX_FRAME_SIZE;
-  transport->remote_max_frame = (uint32_t) 0xffffffff;
-
-  /*
-   * We set the local limit on channels to 2^15, because
-   * parts of the code use the topmost bit (of a short)
-   * as a flag.
-   * The peer that this transport connects to may also
-   * place its own limit on max channel number, and the
-   * application may also set a limit.
-   * The maximum that we use will be the minimum of all
-   * these constraints.
-   */
-  // There is no constraint yet from remote peer,
-  // so set to max possible.
-  transport->remote_channel_max = 65535;
-  transport->local_channel_max  = PN_IMPL_CHANNEL_MAX;
-  transport->channel_max        = transport->local_channel_max;
-
-  transport->local_idle_timeout = 0;
-  transport->dead_remote_deadline = 0;
-  transport->last_bytes_input = 0;
-  transport->remote_idle_timeout = 0;
-  transport->keepalive_deadline = 0;
-  transport->last_bytes_output = 0;
-  transport->remote_offered_capabilities = pn_data(0);
-  transport->remote_desired_capabilities = pn_data(0);
-  transport->remote_properties = pn_data(0);
-  transport->disp_data = pn_data(0);
-  pn_condition_init(&transport->remote_condition);
-  pn_condition_init(&transport->condition);
-  transport->error = pn_error();
-
-  transport->local_channels = pn_hash(PN_WEAKREF, 0, 0.75);
-  transport->remote_channels = pn_hash(PN_WEAKREF, 0, 0.75);
-
-  transport->bytes_input = 0;
-  transport->bytes_output = 0;
-
-  transport->input_pending = 0;
-  transport->output_pending = 0;
-
-  transport->done_processing = false;
-
-  transport->posted_idle_timeout = false;
-
-  transport->server = false;
-  transport->halt = false;
-  transport->auth_required = false;
-  transport->authenticated = false;
-  transport->encryption_required = false;
-
-  transport->referenced = true;
-
-  transport->trace =
-    (pn_env_bool("PN_TRACE_RAW") ? PN_TRACE_RAW : PN_TRACE_OFF) |
-    (pn_env_bool("PN_TRACE_FRM") ? PN_TRACE_FRM : PN_TRACE_OFF) |
-    (pn_env_bool("PN_TRACE_DRV") ? PN_TRACE_DRV : PN_TRACE_OFF) |
-    (pn_env_bool("PN_TRACE_EVT") ? PN_TRACE_EVT : PN_TRACE_OFF) ;
-}
-
-
-static pn_session_t *pni_channel_state(pn_transport_t *transport, uint16_t channel)
-{
-  return (pn_session_t *) pn_hash_get(transport->remote_channels, channel);
-}
-
-static void pni_map_remote_channel(pn_session_t *session, uint16_t channel)
-{
-  pn_transport_t *transport = session->connection->transport;
-  pn_hash_put(transport->remote_channels, channel, session);
-  session->state.remote_channel = channel;
-  pn_ep_incref(&session->endpoint);
-}
-
-void pni_transport_unbind_handles(pn_hash_t *handles, bool reset_state);
-
-static void pni_unmap_remote_channel(pn_session_t *ssn)
-{
-  // XXX: should really update link state also
-  pni_delivery_map_clear(&ssn->state.incoming);
-  pni_transport_unbind_handles(ssn->state.remote_handles, false);
-  pn_transport_t *transport = ssn->connection->transport;
-  uint16_t channel = ssn->state.remote_channel;
-  ssn->state.remote_channel = -2;
-  if (pn_hash_get(transport->remote_channels, channel)) {
-    pn_ep_decref(&ssn->endpoint);
-  }
-  // note: may free the session:
-  pn_hash_del(transport->remote_channels, channel);
-}
-
-static void pn_transport_incref(void *object)
-{
-  pn_transport_t *transport = (pn_transport_t *) object;
-  if (!transport->referenced) {
-    transport->referenced = true;
-    if (transport->connection) {
-      pn_incref(transport->connection);
-    } else {
-      pn_object_incref(object);
-    }
-  } else {
-    pn_object_incref(object);
-  }
-}
-
-static void pn_transport_finalize(void *object);
-#define pn_transport_new pn_object_new
-#define pn_transport_refcount pn_object_refcount
-#define pn_transport_decref pn_object_decref
-#define pn_transport_reify pn_object_reify
-#define pn_transport_hashcode NULL
-#define pn_transport_compare NULL
-#define pn_transport_inspect NULL
-
-pn_transport_t *pn_transport(void)
-{
-#define pn_transport_free pn_object_free
-  static const pn_class_t clazz = PN_METACLASS(pn_transport);
-#undef pn_transport_free
-  pn_transport_t *transport =
-    (pn_transport_t *) pn_class_new(&clazz, sizeof(pn_transport_t));
-  if (!transport) return NULL;
-
-  transport->output_buf = (char *) malloc(transport->output_size);
-  if (!transport->output_buf) {
-    pn_transport_free(transport);
-    return NULL;
-  }
-
-  transport->input_buf = (char *) malloc(transport->input_size);
-  if (!transport->input_buf) {
-    pn_transport_free(transport);
-    return NULL;
-  }
-
-  transport->capacity = 4*1024;
-  transport->available = 0;
-  transport->output = (char *) malloc(transport->capacity);
-  if (!transport->output) {
-    pn_transport_free(transport);
-    return NULL;
-  }
-
-  return transport;
-}
-
-void pn_transport_set_server(pn_transport_t *transport)
-{
-  assert(transport);
-  transport->server = true;
-}
-
-const char *pn_transport_get_user(pn_transport_t *transport)
-{
-  assert(transport);
-  // Client - just return whatever we gave to sasl
-  if (!transport->server) {
-    if (transport->sasl) return pn_sasl_get_user((pn_sasl_t *)transport);
-    return "anonymous";
-  }
-
-  // Server
-  // Not finished authentication yet
-  if (!(transport->present_layers & LAYER_AMQP1)) return 0;
-  // We have SASL so it takes precedence
-  if (transport->present_layers & LAYER_AMQPSASL) return pn_sasl_get_user((pn_sasl_t *)transport);
-  // No SASL but we may have a SSL remote_subject
-  if (transport->present_layers & (LAYER_AMQPSSL | LAYER_SSL)) return pn_ssl_get_remote_subject((pn_ssl_t *)transport);
-  // otherwise it's just an unauthenticated anonymous connection
-  return "anonymous";
-}
-
-void pn_transport_require_auth(pn_transport_t *transport, bool required)
-{
-  assert(transport);
-  transport->auth_required = required;
-}
-
-bool pn_transport_is_authenticated(pn_transport_t *transport)
-{
-  return transport && transport->authenticated;
-}
-
-void pn_transport_require_encryption(pn_transport_t *transport, bool required)
-{
-  assert(transport);
-  transport->encryption_required = required;
-}
-
-bool pn_transport_is_encrypted(pn_transport_t *transport)
-{
-    return transport && transport->ssl && pn_ssl_get_ssf((pn_ssl_t*)transport)>0;
-}
-
-void pn_transport_free(pn_transport_t *transport)
-{
-  if (!transport) return;
-  assert(!transport->freed);
-  transport->freed = true;
-  pn_decref(transport);
-}
-
-static void pn_transport_finalize(void *object)
-{
-  pn_transport_t *transport = (pn_transport_t *) object;
-
-  if (transport->referenced && transport->connection && pn_refcount(transport->connection) > 1) {
-    pn_object_incref(transport);
-    transport->referenced = false;
-    pn_decref(transport->connection);
-    return;
-  }
-
-  // once the application frees the transport, no further I/O
-  // processing can be done to the connection:
-  pn_transport_unbind(transport);
-  // we may have posted events, so stay alive until they are processed
-  if (pn_refcount(transport) > 0) return;
-
-  pn_ssl_free(transport);
-  pn_sasl_free(transport);
-  free(transport->remote_container);
-  free(transport->remote_hostname);
-  pn_free(transport->remote_offered_capabilities);
-  pn_free(transport->remote_desired_capabilities);
-  pn_free(transport->remote_properties);
-  pn_free(transport->disp_data);
-  pn_condition_tini(&transport->remote_condition);
-  pn_condition_tini(&transport->condition);
-  pn_error_free(transport->error);
-  pn_free(transport->local_channels);
-  pn_free(transport->remote_channels);
-  if (transport->input_buf) free(transport->input_buf);
-  if (transport->output_buf) free(transport->output_buf);
-  pn_free(transport->scratch);
-  pn_data_free(transport->args);
-  pn_data_free(transport->output_args);
-  pn_buffer_free(transport->frame);
-  pn_free(transport->context);
-  free(transport->output);
-}
-
-static void pni_post_remote_open_events(pn_transport_t *transport, pn_connection_t *connection) {
-    pn_collector_put(connection->collector, PN_OBJECT, connection, PN_CONNECTION_REMOTE_OPEN);
-    if (transport->remote_idle_timeout) {
-      pn_collector_put(connection->collector, PN_OBJECT, transport, PN_TRANSPORT);
-    }
-}
-
-int pn_transport_bind(pn_transport_t *transport, pn_connection_t *connection)
-{
-  assert(transport);
-  assert(connection);
-
-  if (transport->connection) return PN_STATE_ERR;
-  if (connection->transport) return PN_STATE_ERR;
-
-  transport->connection = connection;
-  connection->transport = transport;
-
-  pn_incref(connection);
-
-  pn_connection_bound(connection);
-
-  // set the hostname/user/password
-  if (pn_string_size(connection->auth_user)) {
-    pn_sasl(transport);
-    pni_sasl_set_user_password(transport, pn_string_get(connection->auth_user), pn_string_get(connection->auth_password));
-  }
-
-  if (pn_string_size(connection->hostname)) {
-      if (transport->sasl) {
-          pni_sasl_set_remote_hostname(transport, pn_string_get(connection->hostname));
-      }
-
-      // be sure not to overwrite a hostname already set by the user via
-      // pn_ssl_set_peer_hostname() called before the bind
-      if (transport->ssl) {
-          size_t name_len = 0;
-          pn_ssl_get_peer_hostname((pn_ssl_t*) transport, NULL, &name_len);
-          if (name_len == 0) {
-              pn_ssl_set_peer_hostname((pn_ssl_t*) transport, pn_string_get(connection->hostname));
-          }
-      }
-  }
-
-  if (transport->open_rcvd) {
-    PN_SET_REMOTE(connection->endpoint.state, PN_REMOTE_ACTIVE);
-    pni_post_remote_open_events(transport, connection);
-    transport->halt = false;
-    transport_consume(transport);        // blech - testBindAfterOpen
-  }
-
-  return 0;
-}
-
-void pni_transport_unbind_handles(pn_hash_t *handles, bool reset_state)
-{
-  for (pn_handle_t h = pn_hash_head(handles); h; h = pn_hash_next(handles, h)) {
-    uintptr_t key = pn_hash_key(handles, h);
-    pn_link_t *link = (pn_link_t *) pn_hash_value(handles, h);
-    if (reset_state) {
-      pn_link_unbound(link);
-    }
-    pn_ep_decref(&link->endpoint);
-    pn_hash_del(handles, key);
-  }
-}
-
-void pni_transport_unbind_channels(pn_hash_t *channels)
-{
-  for (pn_handle_t h = pn_hash_head(channels); h; h = pn_hash_next(channels, h)) {
-    uintptr_t key = pn_hash_key(channels, h);
-    pn_session_t *ssn = (pn_session_t *) pn_hash_value(channels, h);
-    pni_delivery_map_clear(&ssn->state.incoming);
-    pni_delivery_map_clear(&ssn->state.outgoing);
-    pni_transport_unbind_handles(ssn->state.local_handles, true);
-    pni_transport_unbind_handles(ssn->state.remote_handles, true);
-    pn_session_unbound(ssn);
-    pn_ep_decref(&ssn->endpoint);
-    pn_hash_del(channels, key);
-  }
-}
-
-int pn_transport_unbind(pn_transport_t *transport)
-{
-  assert(transport);
-  if (!transport->connection) return 0;
-
-
-  pn_connection_t *conn = transport->connection;
-  transport->connection = NULL;
-  bool was_referenced = transport->referenced;
-
-  pn_collector_put(conn->collector, PN_OBJECT, conn, PN_CONNECTION_UNBOUND);
-
-  // XXX: what happens if the endpoints are freed before we get here?
-  pn_session_t *ssn = pn_session_head(conn, 0);
-  while (ssn) {
-    pni_delivery_map_clear(&ssn->state.incoming);
-    pni_delivery_map_clear(&ssn->state.outgoing);
-    ssn = pn_session_next(ssn, 0);
-  }
-
-  pn_endpoint_t *endpoint = conn->endpoint_head;
-  while (endpoint) {
-    pn_condition_clear(&endpoint->remote_condition);
-    pn_modified(conn, endpoint, true);
-    endpoint = endpoint->endpoint_next;
-  }
-
-  pni_transport_unbind_channels(transport->local_channels);
-  pni_transport_unbind_channels(transport->remote_channels);
-
-  pn_connection_unbound(conn);
-  if (was_referenced) {
-    pn_decref(conn);
-  }
-  return 0;
-}
-
-pn_error_t *pn_transport_error(pn_transport_t *transport)
-{
-  assert(transport);
-  if (pn_condition_is_set(&transport->condition)) {
-    pn_error_format(transport->error, PN_ERR, "%s: %s",
-                    pn_condition_get_name(&transport->condition),
-                    pn_condition_get_description(&transport->condition));
-  } else {
-    pn_error_clear(transport->error);
-  }
-  return transport->error;
-}
-
-pn_condition_t *pn_transport_condition(pn_transport_t *transport)
-{
-  assert(transport);
-  return &transport->condition;
-}
-
-static void pni_map_remote_handle(pn_link_t *link, uint32_t handle)
-{
-  link->state.remote_handle = handle;
-  pn_hash_put(link->session->state.remote_handles, handle, link);
-  pn_ep_incref(&link->endpoint);
-}
-
-static void pni_unmap_remote_handle(pn_link_t *link)
-{
-  uintptr_t handle = link->state.remote_handle;
-  link->state.remote_handle = -2;
-  if (pn_hash_get(link->session->state.remote_handles, handle)) {
-    pn_ep_decref(&link->endpoint);
-  }
-  // may delete link:
-  pn_hash_del(link->session->state.remote_handles, handle);
-}
-
-static pn_link_t *pni_handle_state(pn_session_t *ssn, uint32_t handle)
-{
-  return (pn_link_t *) pn_hash_get(ssn->state.remote_handles, handle);
-}
-
-bool pni_disposition_batchable(pn_disposition_t *disposition)
-{
-  switch (disposition->type) {
-  case PN_ACCEPTED:
-    return true;
-  case PN_RELEASED:
-    return true;
-  default:
-    return false;
-  }
-}
-
-static int pni_disposition_encode(pn_disposition_t *disposition, pn_data_t *data)
-{
-  pn_condition_t *cond = &disposition->condition;
-  switch (disposition->type) {
-  case PN_RECEIVED:
-    PN_RETURN_IF_ERROR(pn_data_put_list(data));
-    pn_data_enter(data);
-    PN_RETURN_IF_ERROR(pn_data_put_uint(data, disposition->section_number));
-    PN_RETURN_IF_ERROR(pn_data_put_ulong(data, disposition->section_offset));
-    pn_data_exit(data);
-    return 0;
-  case PN_ACCEPTED:
-  case PN_RELEASED:
-    return 0;
-  case PN_REJECTED:
-    return pn_data_fill(data, "[?DL[sSC]]", pn_condition_is_set(cond), ERROR,
-                 pn_condition_get_name(cond),
-                 pn_condition_get_description(cond),
-                 pn_condition_info(cond));
-  case PN_MODIFIED:
-    return pn_data_fill(data, "[ooC]",
-                 disposition->failed,
-                 disposition->undeliverable,
-                 disposition->annotations);
-  default:
-    return pn_data_copy(data, disposition->data);
-  }
-}
-
-
-void pn_do_trace(pn_transport_t *transport, uint16_t ch, pn_dir_t dir,
-                 pn_data_t *args, const char *payload, size_t size)
-{
-  if (transport->trace & PN_TRACE_FRM) {
-    pn_string_format(transport->scratch, "%u %s ", ch, dir == OUT ? "->" : "<-");
-    pn_inspect(args, transport->scratch);
-
-    if (pn_data_size(args)==0) {
-        pn_string_addf(transport->scratch, "(EMPTY FRAME)");
-    }
-
-    if (size) {
-      char buf[1024];
-      int e = pn_quote_data(buf, 1024, payload, size);
-      pn_string_addf(transport->scratch, " (%" PN_ZU ") \"%s\"%s", size, buf,
-                     e == PN_OVERFLOW ? "... (truncated)" : "");
-    }
-
-    pn_transport_log(transport, pn_string_get(transport->scratch));
-  }
-}
-
-int pn_post_frame(pn_transport_t *transport, uint8_t type, uint16_t ch, const char *fmt, ...)
-{
-  pn_buffer_t *frame_buf = transport->frame;
-  va_list ap;
-  va_start(ap, fmt);
-  pn_data_clear(transport->output_args);
-  int err = pn_data_vfill(transport->output_args, fmt, ap);
-  va_end(ap);
-  if (err) {
-    pn_transport_logf(transport,
-                      "error posting frame: %s, %s: %s", fmt, pn_code(err),
-                      pn_error_text(pn_data_error(transport->output_args)));
-    return PN_ERR;
-  }
-
-  pn_do_trace(transport, ch, OUT, transport->output_args, NULL, 0);
-
- encode_performatives:
-  pn_buffer_clear( frame_buf );
-  pn_rwbytes_t buf = pn_buffer_memory( frame_buf );
-  buf.size = pn_buffer_available( frame_buf );
-
-  ssize_t wr = pn_data_encode( transport->output_args, buf.start, buf.size );
-  if (wr < 0) {
-    if (wr == PN_OVERFLOW) {
-      pn_buffer_ensure( frame_buf, pn_buffer_available( frame_buf ) * 2 );
-      goto encode_performatives;
-    }
-    pn_transport_logf(transport,
-                      "error posting frame: %s", pn_code(wr));
-    return PN_ERR;
-  }
-
-  pn_frame_t frame = {0,};
-  frame.type = type;
-  frame.channel = ch;
-  frame.payload = buf.start;
-  frame.size = wr;
-  size_t n;
-  while (!(n = pn_write_frame(transport->output + transport->available,
-                              transport->capacity - transport->available, frame))) {
-    transport->capacity *= 2;
-    transport->output = (char *) realloc(transport->output, transport->capacity);
-  }
-  transport->output_frames_ct += 1;
-  if (transport->trace & PN_TRACE_RAW) {
-    pn_string_set(transport->scratch, "RAW: \"");
-    pn_quote(transport->scratch, transport->output + transport->available, n);
-    pn_string_addf(transport->scratch, "\"");
-    pn_transport_log(transport, pn_string_get(transport->scratch));
-  }
-  transport->available += n;
-
-  return 0;
-}
-
-static int pni_post_amqp_transfer_frame(pn_transport_t *transport, uint16_t ch,
-                                        uint32_t handle,
-                                        pn_sequence_t id,
-                                        pn_bytes_t *payload,
-                                        const pn_bytes_t *tag,
-                                        uint32_t message_format,
-                                        bool settled,
-                                        bool more,
-                                        pn_sequence_t frame_limit,
-                                        uint64_t code,
-                                        pn_data_t* state)
-{
-  bool more_flag = more;
-  int framecount = 0;
-  pn_buffer_t *frame = transport->frame;
-
-  // create preformatives, assuming 'more' flag need not change
-
- compute_performatives:
-  pn_data_clear(transport->output_args);
-  int err = pn_data_fill(transport->output_args, "DL[IIzIoon?DLC]", TRANSFER,
-                         handle, id, tag->size, tag->start,
-                         message_format,
-                         settled, more_flag, (bool)code, code, state);
-  if (err) {
-    pn_transport_logf(transport,
-                      "error posting transfer frame: %s: %s", pn_code(err),
-                      pn_error_text(pn_data_error(transport->output_args)));
-    return PN_ERR;
-  }
-
-  do { // send as many frames as possible without changing the 'more' flag...
-
-  encode_performatives:
-    pn_buffer_clear( frame );
-    pn_rwbytes_t buf = pn_buffer_memory( frame );
-    buf.size = pn_buffer_available( frame );
-
-    ssize_t wr = pn_data_encode(transport->output_args, buf.start, buf.size);
-    if (wr < 0) {
-      if (wr == PN_OVERFLOW) {
-        pn_buffer_ensure( frame, pn_buffer_available( frame ) * 2 );
-        goto encode_performatives;
-      }
-      pn_transport_logf(transport, "error posting frame: %s", pn_code(wr));
-      return PN_ERR;
-    }
-    buf.size = wr;
-
-    // check if we need to break up the outbound frame
-    size_t available = payload->size;
-    if (transport->remote_max_frame) {
-      if ((available + buf.size) > transport->remote_max_frame - 8) {
-        available = transport->remote_max_frame - 8 - buf.size;
-        if (more_flag == false) {
-          more_flag = true;
-          goto compute_performatives;  // deal with flag change
-        }
-      } else if (more_flag == true && more == false) {
-        // caller has no more, and this is the last frame
-        more_flag = false;
-        goto compute_performatives;
-      }
-    }
-
-    if (pn_buffer_available( frame ) < (available + buf.size)) {
-      // not enough room for payload - try again...
-      pn_buffer_ensure( frame, available + buf.size );
-      goto encode_performatives;
-    }
-
-    pn_do_trace(transport, ch, OUT, transport->output_args, payload->start, available);
-
-    memmove( buf.start + buf.size, payload->start, available);
-    payload->start += available;
-    payload->size -= available;
-    buf.size += available;
-
-    pn_frame_t frame = {AMQP_FRAME_TYPE};
-    frame.channel = ch;
-    frame.payload = buf.start;
-    frame.size = buf.size;
-
-    size_t n;
-    while (!(n = pn_write_frame(transport->output + transport->available,
-                                transport->capacity - transport->available, frame))) {
-      transport->capacity *= 2;
-      transport->output = (char *) realloc(transport->output, transport->capacity);
-    }
-    transport->output_frames_ct += 1;
-    framecount++;
-    if (transport->trace & PN_TRACE_RAW) {
-      pn_string_set(transport->scratch, "RAW: \"");
-      pn_quote(transport->scratch, transport->output + transport->available, n);
-      pn_string_addf(transport->scratch, "\"");
-      pn_transport_log(transport, pn_string_get(transport->scratch));
-    }
-    transport->available += n;
-  } while (payload->size > 0 && framecount < frame_limit);
-
-  return framecount;
-}
-
-static int pni_post_close(pn_transport_t *transport, pn_condition_t *cond)
-{
-  if (!cond && transport->connection) {
-    cond = pn_connection_condition(transport->connection);
-  }
-  const char *condition = NULL;
-  const char *description = NULL;
-  pn_data_t *info = NULL;
-  if (pn_condition_is_set(cond)) {
-    condition = pn_condition_get_name(cond);
-    description = pn_condition_get_description(cond);
-    info = pn_condition_info(cond);
-  }
-
-  return pn_post_frame(transport, AMQP_FRAME_TYPE, 0, "DL[?DL[sSC]]", CLOSE,
-                       (bool) condition, ERROR, condition, description, info);
-}
-
-static pn_collector_t *pni_transport_collector(pn_transport_t *transport)
-{
-  if (transport->connection && transport->connection->collector) {
-    return transport->connection->collector;
-  } else {
-    return NULL;
-  }
-}
-
-static void pni_maybe_post_closed(pn_transport_t *transport)
-{
-  pn_collector_t *collector = pni_transport_collector(transport);
-  if (transport->head_closed && transport->tail_closed) {
-    pn_collector_put(collector, PN_OBJECT, transport, PN_TRANSPORT_CLOSED);
-  }
-}
-
-static void pni_close_tail(pn_transport_t *transport)
-{
-  if (!transport->tail_closed) {
-    transport->tail_closed = true;
-    pn_collector_t *collector = pni_transport_collector(transport);
-    pn_collector_put(collector, PN_OBJECT, transport, PN_TRANSPORT_TAIL_CLOSED);
-    pni_maybe_post_closed(transport);
-  }
-}
-
-int pn_do_error(pn_transport_t *transport, const char *condition, const char *fmt, ...)
-{
-  va_list ap;
-  va_start(ap, fmt);
-  char buf[1024];
-  if (fmt) {
-    // XXX: result
-    pni_vsnprintf(buf, 1024, fmt, ap);
-  } else {
-    buf[0] = '\0';
-  }
-  va_end(ap);
-  pn_condition_t *cond = &transport->condition;
-  if (!pn_condition_is_set(cond)) {
-    pn_condition_set_name(cond, condition);
-    if (fmt) {
-      pn_condition_set_description(cond, buf);
-    }
-  } else {
-    const char *first = pn_condition_get_description(cond);
-    if (first && fmt) {
-      char extended[2048];
-      pni_snprintf(extended, 2048, "%s (%s)", first, buf);
-      pn_condition_set_description(cond, extended);
-    } else if (fmt) {
-      pn_condition_set_description(cond, buf);
-    }
-  }
-  pn_collector_t *collector = pni_transport_collector(transport);
-  pn_collector_put(collector, PN_OBJECT, transport, PN_TRANSPORT_ERROR);
-  if (transport->trace & PN_TRACE_DRV) {
-    pn_transport_logf(transport, "ERROR %s %s", condition, buf);
-  }
-
-  for (int i = 0; i<PN_IO_LAYER_CT; ++i) {
-    if (transport->io_layers[i] && transport->io_layers[i]->handle_error)
-        transport->io_layers[i]->handle_error(transport, i);
-  }
-
-  pni_close_tail(transport);
-  return PN_ERR;
-}
-
-static char *pn_bytes_strdup(pn_bytes_t str)
-{
-  return pn_strndup(str.start, str.size);
-}
-
-int pn_do_open(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload)
-{
-  pn_connection_t *conn = transport->connection;
-  bool container_q, hostname_q, remote_channel_max_q, remote_max_frame_q;
-  uint16_t remote_channel_max;
-  uint32_t remote_max_frame;
-  pn_bytes_t remote_container, remote_hostname;
-  pn_data_clear(transport->remote_offered_capabilities);
-  pn_data_clear(transport->remote_desired_capabilities);
-  pn_data_clear(transport->remote_properties);
-  int err = pn_data_scan(args, "D.[?S?S?I?HI..CCC]",
-                         &container_q, &remote_container,
-                         &hostname_q, &remote_hostname,
-                         &remote_max_frame_q, &remote_max_frame,
-                         &remote_channel_max_q, &remote_channel_max,
-                         &transport->remote_idle_timeout,
-                         transport->remote_offered_capabilities,
-                         transport->remote_desired_capabilities,
-                         transport->remote_properties);
-  if (err) return err;
-  /*
-   * The default value is already stored in the variable.
-   * But the scanner zeroes out values if it does not
-   * find them in the args, so don't give the variable
-   * directly to the scanner.
-   */
-  if (remote_channel_max_q) {
-    transport->remote_channel_max = remote_channel_max;
-  }
-
-  if (remote_max_frame_q) {
-    transport->remote_max_frame = remote_max_frame;
-  }
-
-  if (transport->remote_max_frame > 0) {
-    if (transport->remote_max_frame < AMQP_MIN_MAX_FRAME_SIZE) {
-      pn_transport_logf(transport, "Peer advertised bad max-frame (%u), forcing to %u",
-                        transport->remote_max_frame, AMQP_MIN_MAX_FRAME_SIZE);
-      transport->remote_max_frame = AMQP_MIN_MAX_FRAME_SIZE;
-    }
-  }
-  if (container_q) {
-    transport->remote_container = pn_bytes_strdup(remote_container);
-  } else {
-    transport->remote_container = NULL;
-  }
-  if (hostname_q) {
-    transport->remote_hostname = pn_bytes_strdup(remote_hostname);
-  } else {
-    transport->remote_hostname = NULL;
-  }
-
-  if (conn) {
-    PN_SET_REMOTE(conn->endpoint.state, PN_REMOTE_ACTIVE);
-    pni_post_remote_open_events(transport, conn);
-  } else {
-    transport->halt = true;
-  }
-  transport->open_rcvd = true;
-  pni_calculate_channel_max(transport);
-  return 0;
-}
-
-int pn_do_begin(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload)
-{
-  bool reply;
-  uint16_t remote_channel;
-  pn_sequence_t next;
-  int err = pn_data_scan(args, "D.[?HI]", &reply, &remote_channel, &next);
-  if (err) return err;
-
-  // AMQP 1.0 section 2.7.1 - if the peer doesn't honor our channel_max --
-  // express our displeasure by closing the connection with a framing error.
-  if (remote_channel > transport->channel_max) {
-    pn_do_error(transport,
-                "amqp:connection:framing-error",
-                "remote channel %d is above negotiated channel_max %d.",
-                remote_channel,
-                transport->channel_max
-               );
-    return PN_TRANSPORT_ERROR;
-  }
-
-  pn_session_t *ssn;
-  if (reply) {
-    ssn = (pn_session_t *) pn_hash_get(transport->local_channels, remote_channel);
-  } else {
-    ssn = pn_session(transport->connection);
-  }
-  if (ssn == 0) {
-    pn_do_error(transport,
-                "amqp:connection:framing-error",
-                "remote channel is above negotiated channel_max %d.",
-                transport->channel_max
-               );
-    return PN_TRANSPORT_ERROR;
-  }
-  ssn->state.incoming_transfer_count = next;
-  pni_map_remote_channel(ssn, channel);
-  PN_SET_REMOTE(ssn->endpoint.state, PN_REMOTE_ACTIVE);
-  pn_collector_put(transport->connection->collector, PN_OBJECT, ssn, PN_SESSION_REMOTE_OPEN);
-  return 0;
-}
-
-pn_link_t *pn_find_link(pn_session_t *ssn, pn_bytes_t name, bool is_sender)
-{
-  pn_endpoint_type_t type = is_sender ? SENDER : RECEIVER;
-
-  for (size_t i = 0; i < pn_list_size(ssn->links); i++)
-  {
-    pn_link_t *link = (pn_link_t *) pn_list_get(ssn->links, i);
-    if (link->endpoint.type == type &&
-        // This function is used to locate the link object for an
-        // incoming attach. If a link object of the same name is found
-        // which is closed both locally and remotely, assume that is
-        // no longer in use.
-        !((link->endpoint.state & PN_LOCAL_CLOSED) && (link->endpoint.state & PN_REMOTE_CLOSED)) &&
-        !strncmp(name.start, pn_string_get(link->name), name.size))
-    {
-      return link;
-    }
-  }
-  return NULL;
-}
-
-static pn_expiry_policy_t symbol2policy(pn_bytes_t symbol)
-{
-  if (!symbol.start)
-    return PN_EXPIRE_WITH_SESSION;
-
-  if (!strncmp(symbol.start, "link-detach", symbol.size))
-    return PN_EXPIRE_WITH_LINK;
-  if (!strncmp(symbol.start, "session-end", symbol.size))
-    return PN_EXPIRE_WITH_SESSION;
-  if (!strncmp(symbol.start, "connection-close", symbol.size))
-    return PN_EXPIRE_WITH_CONNECTION;
-  if (!strncmp(symbol.start, "never", symbol.size))
-    return PN_EXPIRE_NEVER;
-
-  return PN_EXPIRE_WITH_SESSION;
-}
-
-static pn_distribution_mode_t symbol2dist_mode(const pn_bytes_t symbol)
-{
-  if (!symbol.start)
-    return PN_DIST_MODE_UNSPECIFIED;
-
-  if (!strncmp(symbol.start, "move", symbol.size))
-    return PN_DIST_MODE_MOVE;
-  if (!strncmp(symbol.start, "copy", symbol.size))
-    return PN_DIST_MODE_COPY;
-
-  return PN_DIST_MODE_UNSPECIFIED;
-}
-
-static const char *dist_mode2symbol(const pn_distribution_mode_t mode)
-{
-  switch (mode)
-  {
-  case PN_DIST_MODE_COPY:
-    return "copy";
-  case PN_DIST_MODE_MOVE:
-    return "move";
-  default:
-    return NULL;
-  }
-}
-
-int pn_terminus_set_address_bytes(pn_terminus_t *terminus, pn_bytes_t address)
-{
-  assert(terminus);
-  return pn_string_setn(terminus->address, address.start, address.size);
-}
-
-int pn_do_attach(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload)
-{
-  pn_bytes_t name;
-  uint32_t handle;
-  bool is_sender;
-  pn_bytes_t source, target;
-  pn_durability_t src_dr, tgt_dr;
-  pn_bytes_t src_exp, tgt_exp;
-  pn_seconds_t src_timeout, tgt_timeout;
-  bool src_dynamic, tgt_dynamic;
-  pn_sequence_t idc;
-  pn_bytes_t dist_mode;
-  bool snd_settle, rcv_settle;
-  uint8_t snd_settle_mode, rcv_settle_mode;
-  uint64_t max_msgsz;
-  int err = pn_data_scan(args, "D.[SIo?B?BD.[SIsIo.s]D.[SIsIo]..IL]", &name, &handle,
-                         &is_sender,
-                         &snd_settle, &snd_settle_mode,
-                         &rcv_settle, &rcv_settle_mode,
-                         &source, &src_dr, &src_exp, &src_timeout, &src_dynamic, &dist_mode,
-                         &target, &tgt_dr, &tgt_exp, &tgt_timeout, &tgt_dynamic,
-                         &idc, &max_msgsz);
-  if (err) return err;
-  char strbuf[128];      // avoid malloc for most link names
-  char *strheap = (name.size >= sizeof(strbuf)) ? (char *) malloc(name.size + 1) : NULL;
-  char *strname = strheap ? strheap : strbuf;
-  strncpy(strname, name.start, name.size);
-  strname[name.size] = '\0';
-
-  pn_session_t *ssn = pni_channel_state(transport, channel);
-  if (!ssn) {
-      pn_do_error(transport, "amqp:not-allowed", "no such channel: %u", channel);
-      if (strheap) free(strheap);
-      return PN_EOS;
-  }
-  pn_link_t *link = pn_find_link(ssn, name, is_sender);
-  if (!link) {
-    if (is_sender) {
-      link = (pn_link_t *) pn_sender(ssn, strname);
-    } else {
-      link = (pn_link_t *) pn_receiver(ssn, strname);
-    }
-  }
-
-  if (strheap) {
-    free(strheap);
-  }
-
-  pni_map_remote_handle(link, handle);
-  PN_SET_REMOTE(link->endpoint.state, PN_REMOTE_ACTIVE);
-  pn_terminus_t *rsrc = &link->remote_source;
-  if (source.start || src_dynamic) {
-    pn_terminus_set_type(rsrc, PN_SOURCE);
-    pn_terminus_set_address_bytes(rsrc, source);
-    pn_terminus_set_durability(rsrc, src_dr);
-    pn_terminus_set_expiry_policy(rsrc, symbol2policy(src_exp));
-    pn_terminus_set_timeout(rsrc, src_timeout);
-    pn_terminus_set_dynamic(rsrc, src_dynamic);
-    pn_terminus_set_distribution_mode(rsrc, symbol2dist_mode(dist_mode));
-  } else {
-    pn_terminus_set_type(rsrc, PN_UNSPECIFIED);
-  }
-  pn_terminus_t *rtgt = &link->remote_target;
-  if (target.start || tgt_dynamic) {
-    pn_terminus_set_type(rtgt, PN_TARGET);
-    pn_terminus_set_address_bytes(rtgt, target);
-    pn_terminus_set_durability(rtgt, tgt_dr);
-    pn_terminus_set_expiry_policy(rtgt, symbol2policy(tgt_exp));
-    pn_terminus_set_timeout(rtgt, tgt_timeout);
-    pn_terminus_set_dynamic(rtgt, tgt_dynamic);
-  } else {
-    uint64_t code = 0;
-    pn_data_clear(link->remote_target.capabilities);
-    err = pn_data_scan(args, "D.[.....D..DL[C]...]", &code,
-                       link->remote_target.capabilities);
-    if (err) return err;
-    if (code == COORDINATOR) {
-      pn_terminus_set_type(rtgt, PN_COORDINATOR);
-    } else if (code == TARGET) {
-      pn_terminus_set_type(rtgt, PN_TARGET);
-    } else {
-      pn_terminus_set_type(rtgt, PN_UNSPECIFIED);
-    }
-  }
-
-  if (snd_settle)
-    link->remote_snd_settle_mode = snd_settle_mode;
-  if (rcv_settle)
-    link->remote_rcv_settle_mode = rcv_settle_mode;
-
-  pn_data_clear(link->remote_source.properties);
-  pn_data_clear(link->remote_source.filter);
-  pn_data_clear(link->remote_source.outcomes);
-  pn_data_clear(link->remote_source.capabilities);
-  pn_data_clear(link->remote_target.properties);
-  pn_data_clear(link->remote_target.capabilities);
-
-  err = pn_data_scan(args, "D.[.....D.[.....C.C.CC]D.[.....CC]",
-                     link->remote_source.properties,
-                     link->remote_source.filter,
-                     link->remote_source.outcomes,
-                     link->remote_source.capabilities,
-                     link->remote_target.properties,
-                     link->remote_target.capabilities);
-  if (err) return err;
-
-  pn_data_rewind(link->remote_source.properties);
-  pn_data_rewind(link->remote_source.filter);
-  pn_data_rewind(link->remote_source.outcomes);
-  pn_data_rewind(link->remote_source.capabilities);
-  pn_data_rewind(link->remote_target.properties);
-  pn_data_rewind(link->remote_target.capabilities);
-
-  if (!is_sender) {
-    link->state.delivery_count = idc;
-  }
-
-  if (max_msgsz) {
-    link->remote_max_message_size = max_msgsz;
-  }
-
-  pn_collector_put(transport->connection->collector, PN_OBJECT, link, PN_LINK_REMOTE_OPEN);
-  return 0;
-}
-
-static int pni_post_flow(pn_transport_t *transport, pn_session_t *ssn, pn_link_t *link);
-
-// free the delivery
-static void pn_full_settle(pn_delivery_map_t *db, pn_delivery_t *delivery)
-{
-  assert(!delivery->work);
-  pn_clear_tpwork(delivery);
-  pn_delivery_map_del(db, delivery);
-  pn_incref(delivery);
-  pn_decref(delivery);
-}
-
-int pn_do_transfer(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload)
-{
-  // XXX: multi transfer
-  uint32_t handle;
-  pn_bytes_t tag;
-  bool id_present;
-  pn_sequence_t id;
-  bool settled;
-  bool more;
-  bool has_type;
-  uint64_t type;
-  pn_data_clear(transport->disp_data);
-  int err = pn_data_scan(args, "D.[I?Iz.oo.D?LC]", &handle, &id_present, &id, &tag,
-                         &settled, &more, &has_type, &type, transport->disp_data);
-  if (err) return err;
-  pn_session_t *ssn = pni_channel_state(transport, channel);
-  if (!ssn) {
-    return pn_do_error(transport, "amqp:not-allowed", "no such channel: %u", channel);
-  }
-
-  if (!ssn->state.incoming_window) {
-    return pn_do_error(transport, "amqp:session:window-violation", "incoming session window exceeded");
-  }
-
-  pn_link_t *link = pni_handle_state(ssn, handle);
-  if (!link) {
-    return pn_do_error(transport, "amqp:invalid-field", "no such handle: %u", handle);
-  }
-  pn_delivery_t *delivery;
-  if (link->unsettled_tail && !link->unsettled_tail->done) {
-    delivery = link->unsettled_tail;
-  } else {
-    pn_delivery_map_t *incoming = &ssn->state.incoming;
-
-    if (!ssn->state.incoming_init) {
-      incoming->next = id;
-      ssn->state.incoming_init = true;
-      ssn->incoming_deliveries++;
-    }
-
-    delivery = pn_delivery(link, pn_dtag(tag.start, tag.size));
-    pn_delivery_state_t *state = pni_delivery_map_push(incoming, delivery);
-    if (id_present && id != state->id) {
-      return pn_do_error(transport, "amqp:session:invalid-field",
-                         "sequencing error, expected delivery-id %u, got %u",
-                         state->id, id);
-    }
-    if (has_type) {
-      delivery->remote.type = type;
-      pn_data_copy(delivery->remote.data, transport->disp_data);
-    }
-
-    link->state.delivery_count++;
-    link->state.link_credit--;
-    link->queued++;
-
-    // XXX: need to fill in remote state: delivery->remote.state = ...;
-    delivery->remote.settled = settled;
-    if (settled) {
-      delivery->updated = true;
-      pn_work_update(transport->connection, delivery);
-    }
-  }
-
-  pn_buffer_append(delivery->bytes, payload->start, payload->size);
-  ssn->incoming_bytes += payload->size;
-  delivery->done = !more;
-
-  ssn->state.incoming_transfer_count++;
-  ssn->state.incoming_window--;
-
-  // XXX: need better policy for when to refresh window
-  if (!ssn->state.incoming_window && (int32_t) link->state.local_handle >= 0) {
-    pni_post_flow(transport, ssn, link);
-  }
-
-  pn_collector_put(transport->connection->collector, PN_OBJECT, delivery, PN_DELIVERY);
-  return 0;
-}
-
-int pn_do_flow(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload)
-{
-  pn_sequence_t onext, inext, delivery_count;
-  uint32_t iwin, owin, link_credit;
-  uint32_t handle;
-  bool inext_init, handle_init, dcount_init, drain;
-  int err = pn_data_scan(args, "D.[?IIII?I?II.o]", &inext_init, &inext, &iwin,
-                         &onext, &owin, &handle_init, &handle, &dcount_init,
-                         &delivery_count, &link_credit, &drain);
-  if (err) return err;
-
-  pn_session_t *ssn = pni_channel_state(transport, channel);
-  if (!ssn) {
-    return pn_do_error(transport, "amqp:not-allowed", "no such channel: %u", channel);
-  }
-
-  if (inext_init) {
-    ssn->state.remote_incoming_window = inext + iwin - ssn->state.outgoing_transfer_count;
-  } else {
-    ssn->state.remote_incoming_window = iwin;
-  }
-
-  if (handle_init) {
-    pn_link_t *link = pni_handle_state(ssn, handle);
-    if (!link) {
-      return pn_do_error(transport, "amqp:invalid-field", "no such handle: %u", handle);
-    }
-    if (link->endpoint.type == SENDER) {
-      pn_sequence_t receiver_count;
-      if (dcount_init) {
-        receiver_count = delivery_count;
-      } else {
-        // our initial delivery count
-        receiver_count = 0;
-      }
-      pn_sequence_t old = link->state.link_credit;
-      link->state.link_credit = receiver_count + link_credit - link->state.delivery_count;
-      link->credit += link->state.link_credit - old;
-      link->drain = drain;
-      pn_delivery_t *delivery = pn_link_current(link);
-      if (delivery) pn_work_update(transport->connection, delivery);
-    } else {
-      pn_sequence_t delta = delivery_count - link->state.delivery_count;
-      if (delta > 0) {
-        link->state.delivery_count += delta;
-        link->state.link_credit -= delta;
-        link->credit -= delta;
-        link->drained += delta;
-      }
-    }
-
-    pn_collector_put(transport->connection->collector, PN_OBJECT, link, PN_LINK_FLOW);
-  }
-
-  return 0;
-}
-
-#define SCAN_ERROR_DEFAULT ("D.[D.[sSC]")
-#define SCAN_ERROR_DETACH ("D.[..D.[sSC]")
-#define SCAN_ERROR_DISP ("[D.[sSC]")
-
-static int pn_scan_error(pn_data_t *data, pn_condition_t *condition, const char *fmt)
-{
-  pn_bytes_t cond;
-  pn_bytes_t desc;
-  pn_condition_clear(condition);
-  int err = pn_data_scan(data, fmt, &cond, &desc, condition->info);
-  if (err) return err;
-  pn_string_setn(condition->name, cond.start, cond.size);
-  pn_string_setn(condition->description, desc.start, desc.size);
-  pn_data_rewind(condition->info);
-  return 0;
-}
-
-int pn_do_disposition(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload)
-{
-  bool role;
-  pn_sequence_t first, last;
-  uint64_t type = 0;
-  bool last_init, settled, type_init;
-  pn_data_clear(transport->disp_data);
-  int err = pn_data_scan(args, "D.[oI?IoD?LC]", &role, &first, &last_init,
-                         &last, &settled, &type_init, &type,
-                         transport->disp_data);
-  if (err) return err;
-  if (!last_init) last = first;
-
-  pn_session_t *ssn = pni_channel_state(transport, channel);
-  if (!ssn) {
-    return pn_do_error(transport, "amqp:not-allowed", "no such channel: %u", channel);
-  }
-
-  pn_delivery_map_t *deliveries;
-  if (role) {
-    deliveries = &ssn->state.outgoing;
-  } else {
-    deliveries = &ssn->state.incoming;
-  }
-
-  pn_data_rewind(transport->disp_data);
-  bool remote_data = (pn_data_next(transport->disp_data) &&
-                      pn_data_get_list(transport->disp_data) > 0);
-
-  for (pn_sequence_t id = first; id <= last; id++) {
-    pn_delivery_t *delivery = pni_delivery_map_get(deliveries, id);
-    pn_disposition_t *remote = &delivery->remote;
-    if (delivery) {
-      if (type_init) remote->type = type;
-      if (remote_data) {
-        switch (type) {
-        case PN_RECEIVED:
-          pn_data_rewind(transport->disp_data);
-          pn_data_next(transport->disp_data);
-          pn_data_enter(transport->disp_data);
-          if (pn_data_next(transport->disp_data))
-            remote->section_number = pn_data_get_uint(transport->disp_data);
-          if (pn_data_next(transport->disp_data))
-            remote->section_offset = pn_data_get_ulong(transport->disp_data);
-          break;
-        case PN_ACCEPTED:
-          break;
-        case PN_REJECTED:
-          err = pn_scan_error(transport->disp_data, &remote->condition, SCAN_ERROR_DISP);
-          if (err) return err;
-          break;
-        case PN_RELEASED:
-          break;
-        case PN_MODIFIED:
-          pn_data_rewind(transport->disp_data);
-          pn_data_next(transport->disp_data);
-          pn_data_enter(transport->disp_data);
-          if (pn_data_next(transport->disp_data))
-            remote->failed = pn_data_get_bool(transport->disp_data);
-          if (pn_data_next(transport->disp_data))
-            remote->undeliverable = pn_data_get_bool(transport->disp_data);
-          pn_data_narrow(transport->disp_data);
-          pn_data_clear(remote->data);
-          pn_data_appendn(remote->annotations, transport->disp_data, 1);
-          pn_data_widen(transport->disp_data);
-          break;
-        default:
-          pn_data_copy(remote->data, transport->disp_data);
-          break;
-        }
-      }
-      remote->settled = settled;
-      delivery->updated = true;
-      pn_work_update(transport->connection, delivery);
-
-      pn_collector_put(transport->connection->collector, PN_OBJECT, delivery, PN_DELIVERY);
-    }
-  }
-
-  return 0;
-}
-
-int pn_do_detach(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload)
-{
-  uint32_t handle;
-  bool closed;
-  int err = pn_data_scan(args, "D.[Io]", &handle, &closed);
-  if (err) return err;
-
-  pn_session_t *ssn = pni_channel_state(transport, channel);
-  if (!ssn) {
-    return pn_do_error(transport, "amqp:not-allowed", "no such channel: %u", channel);
-  }
-  pn_link_t *link = pni_handle_state(ssn, handle);
-  if (!link) {
-    return pn_do_error(transport, "amqp:invalid-field", "no such handle: %u", handle);
-  }
-
-  err = pn_scan_error(args, &link->endpoint.remote_condition, SCAN_ERROR_DETACH);
-  if (err) return err;
-
-  if (closed)
-  {
-    PN_SET_REMOTE(link->endpoint.state, PN_REMOTE_CLOSED);
-    pn_collector_put(transport->connection->collector, PN_OBJECT, link, PN_LINK_REMOTE_CLOSE);
-  } else {
-    pn_collector_put(transport->connection->collector, PN_OBJECT, link, PN_LINK_REMOTE_DETACH);
-  }
-
-  pni_unmap_remote_handle(link);
-  return 0;
-}
-
-int pn_do_end(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload)
-{
-  pn_session_t *ssn = pni_channel_state(transport, channel);
-  if (!ssn) {
-    return pn_do_error(transport, "amqp:not-allowed", "no such channel: %u", channel);
-  }
-  int err = pn_scan_error(args, &ssn->endpoint.remote_condition, SCAN_ERROR_DEFAULT);
-  if (err) return err;
-  PN_SET_REMOTE(ssn->endpoint.state, PN_REMOTE_CLOSED);
-  pn_collector_put(transport->connection->collector, PN_OBJECT, ssn, PN_SESSION_REMOTE_CLOSE);
-  pni_unmap_remote_channel(ssn);
-  return 0;
-}
-
-int pn_do_close(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload)
-{
-  pn_connection_t *conn = transport->connection;
-  int err = pn_scan_error(args, &transport->remote_condition, SCAN_ERROR_DEFAULT);
-  if (err) return err;
-  transport->close_rcvd = true;
-  PN_SET_REMOTE(conn->endpoint.state, PN_REMOTE_CLOSED);
-  pn_collector_put(transport->connection->collector, PN_OBJECT, conn, PN_CONNECTION_REMOTE_CLOSE);
-  return 0;
-}
-
-// deprecated
-ssize_t pn_transport_input(pn_transport_t *transport, const char *bytes, size_t available)
-{
-  if (!transport) return PN_ARG_ERR;
-  if (available == 0) {
-    return pn_transport_close_tail(transport);
-  }
-  const size_t original = available;
-  ssize_t capacity = pn_transport_capacity(transport);
-  if (capacity < 0) return capacity;
-  while (available && capacity) {
-    char *dest = pn_transport_tail(transport);
-    assert(dest);
-    size_t count = pn_min( (size_t)capacity, available );
-    memmove( dest, bytes, count );
-    available -= count;
-    bytes += count;
-    int rc = pn_transport_process( transport, count );
-    if (rc < 0) return rc;
-    capacity = pn_transport_capacity(transport);
-    if (capacity < 0) return capacity;
-  }
-
-  return original - available;
-}
-
-// process pending input until none remaining or EOS
-static ssize_t transport_consume(pn_transport_t *transport)
-{
-  // This allows whatever is driving the I/O to set the error
-  // condition on the transport before doing pn_transport_close_head()
-  // or pn_transport_close_tail(). This allows all transport errors to
-  // flow to the app the same way, but provides cleaner error messages
-  // since we don't try to look for a protocol header when, e.g. the
-  // connection was refused.
-  if (!transport->bytes_input && transport->tail_closed &&
-      pn_condition_is_set(&transport->condition)) {
-    pn_do_error(transport, NULL, NULL);
-    return PN_EOS;
-  }
-
-  size_t consumed = 0;
-
-  while (transport->input_pending || transport->tail_closed) {
-    ssize_t n;
-    n = transport->io_layers[0]->
-      process_input( transport, 0,
-                     transport->input_buf + consumed,
-                     transport->input_pending );
-    if (n > 0) {
-      consumed += n;
-      transport->input_pending -= n;
-    } else if (n == 0) {
-      break;
-    } else {
-      assert(n == PN_EOS);
-      if (transport->trace & (PN_TRACE_RAW | PN_TRACE_FRM))
-        pn_transport_log(transport, "  <- EOS");
-      transport->input_pending = 0;  // XXX ???
-      return n;
-    }
-  }
-
-  if (transport->input_pending && consumed) {
-    memmove( transport->input_buf,  &transport->input_buf[consumed], transport->input_pending );
-  }
-
-  return consumed;
-}
-
-static int pni_process_conn_setup(pn_transport_t *transport, pn_endpoint_t *endpoint)
-{
-  if (endpoint->type == CONNECTION)
-  {
-    if (!(endpoint->state & PN_LOCAL_UNINIT) && !transport->open_sent)
-    {
-      // as per the recommendation in the spec, advertise half our
-      // actual timeout to the remote
-      const pn_millis_t idle_timeout = transport->local_idle_timeout
-          ? (transport->local_idle_timeout/2)
-          : 0;
-      pn_connection_t *connection = (pn_connection_t *) endpoint;
-      const char *cid = pn_string_get(connection->container);
-      pni_calculate_channel_max(transport);
-      int err = pn_post_frame(transport, AMQP_FRAME_TYPE, 0, "DL[SS?I?H?InnCCC]", OPEN,
-                              cid ? cid : "",
-                              pn_string_get(connection->hostname),
-                              // if not zero, advertise our max frame size and idle timeout
-                              (bool)transport->local_max_frame, transport->local_max_frame,
-                              (bool)transport->channel_max, transport->channel_max,
-                              (bool)idle_timeout, idle_timeout,
-                              connection->offered_capabilities,
-                              connection->desired_capabilities,
-                              connection->properties);
-      if (err) return err;
-      transport->open_sent = true;
-    }
-  }
-
-  return 0;
-}
-
-static uint16_t allocate_alias(pn_hash_t *aliases, uint32_t max_index, int * valid)
-{
-  for (uint32_t i = 0; i <= max_index; i++) {
-    if (!pn_hash_get(aliases, i)) {
-      * valid = 1;
-      return i;
-    }
-  }
-
-  * valid = 0;
-  return 0;
-}
-
-static size_t pni_session_outgoing_window(pn_session_t *ssn)
-{
-  return ssn->outgoing_window;
-}
-
-static size_t pni_session_incoming_window(pn_session_t *ssn)
-{
-  uint32_t size = ssn->connection->transport->local_max_frame;
-  if (!size) {
-    return 2147483647; // biggest legal value
-  } else {
-    return (ssn->incoming_capacity - ssn->incoming_bytes)/size;
-  }
-}
-
-static int pni_map_local_channel(pn_session_t *ssn)
-{
-  pn_transport_t *transport = ssn->connection->transport;
-  pn_session_state_t *state = &ssn->state;
-  int valid;
-  uint16_t channel = allocate_alias(transport->local_channels, transport->channel_max, & valid);
-  if (!valid) {
-    return 0;
-  }
-  state->local_channel = channel;
-  pn_hash_put(transport->local_channels, channel, ssn);
-  pn_ep_incref(&ssn->endpoint);
-  return 1;
-}
-
-static int pni_process_ssn_setup(pn_transport_t *transport, pn_endpoint_t *endpoint)
-{
-  if (endpoint->type == SESSION && transport->open_sent)
-  {
-    pn_session_t *ssn = (pn_session_t *) endpoint;
-    pn_session_state_t *state = &ssn->state;
-    if (!(endpoint->state & PN_LOCAL_UNINIT) && state->local_channel == (uint16_t) -1)
-    {
-      if (! pni_map_local_channel(ssn)) {
-        pn_transport_logf(transport, "unable to find an open available channel within limit of %d", transport->channel_max );
-        return PN_ERR;
-      }
-      state->incoming_window = pni_session_incoming_window(ssn);
-      state->outgoing_window = pni_session_outgoing_window(ssn);
-      pn_post_frame(transport, AMQP_FRAME_TYPE, state->local_channel, "DL[?HIII]", BEGIN,
-                    ((int16_t) state->remote_channel >= 0), state->remote_channel,
-                    state->outgoing_transfer_count,
-                    state->incoming_window,
-                    state->outgoing_window);
-    }
-  }
-
-  return 0;
-}
-
-static const char *expiry_symbol(pn_expiry_policy_t policy)
-{
-  switch (policy)
-  {
-  case PN_EXPIRE_WITH_LINK:
-    return "link-detach";
-  case PN_EXPIRE_WITH_SESSION:
-    return NULL;
-  case PN_EXPIRE_WITH_CONNECTION:
-    return "connection-close";
-  case PN_EXPIRE_NEVER:
-    return "never";
-  }
-  return NULL;
-}
-
-static int pni_map_local_handle(pn_link_t *link) {
-  pn_link_state_t *state = &link->state;
-  pn_session_state_t *ssn_state = &link->session->state;
-  int valid;
-  // XXX TODO MICK: once changes are made to handle_max, change this hardcoded value to something reasonable.
-  state->local_handle = allocate_alias(ssn_state->local_handles, 65536, & valid);
-  if ( ! valid )
-    return 0;
-  pn_hash_put(ssn_state->local_handles, state->local_handle, link);
-  pn_ep_incref(&link->endpoint);
-  return 1;
-}
-
-static int pni_process_link_setup(pn_transport_t *transport, pn_endpoint_t *endpoint)
-{
-  if (transport->open_sent && (endpoint->type == SENDER ||
-                               endpoint->type == RECEIVER))
-  {
-    pn_link_t *link = (pn_link_t *) endpoint;
-    pn_session_state_t *ssn_state = &link->session->state;
-    pn_link_state_t *state = &link->state;
-    if (((int16_t) ssn_state->local_channel >= 0) &&
-        !(endpoint->state & PN_LOCAL_UNINIT) && state->local_handle == (uint32_t) -1)
-    {
-      pni_map_local_handle(link);
-      const pn_distribution_mode_t dist_mode = link->source.distribution_mode;
-      if (link->target.type == PN_COORDINATOR) {
-        int err = pn_post_frame(transport, AMQP_FRAME_TYPE, ssn_state->local_channel,
-                                "DL[SIoBB?DL[SIsIoC?sCnCC]DL[C]nnI]", ATTACH,
-                                pn_string_get(link->name),
-                                state->local_handle,
-                                endpoint->type == RECEIVER,
-                                link->snd_settle_mode,
-                                link->rcv_settle_mode,
-                                (bool) link->source.type, SOURCE,
-                                pn_string_get(link->source.address),
-                                link->source.durability,
-                                expiry_symbol(link->source.expiry_policy),
-                                link->source.timeout,
-                                link->source.dynamic,
-                                link->source.properties,
-                                (dist_mode != PN_DIST_MODE_UNSPECIFIED), dist_mode2symbol(dist_mode),
-                                link->source.filter,
-                                link->source.outcomes,
-                                link->source.capabilities,
-                                COORDINATOR, link->target.capabilities,
-                                0);
-        if (err) return err;
-      } else {
-        int err = pn_post_frame(transport, AMQP_FRAME_TYPE, ssn_state->local_channel,
-                                "DL[SIoBB?DL[SIsIoC?sCnCC]?DL[SIsIoCC]nnIL]", ATTACH,
-                                pn_string_get(link->name),
-                                state->local_handle,
-                                endpoint->type == RECEIVER,
-                                link->snd_settle_mode,
-                                link->rcv_settle_mode,
-                                (bool) link->source.type, SOURCE,
-                                pn_string_get(link->source.address),
-                                link->source.durability,
-                                expiry_symbol(link->source.expiry_policy),
-                                link->source.timeout,
-                                link->source.dynamic,
-                                link->source.properties,
-                                (dist_mode != PN_DIST_MODE_UNSPECIFIED), dist_mode2symbol(dist_mode),
-                                link->source.filter,
-                                link->source.outcomes,
-                                link->source.capabilities,
-                                (bool) link->target.type, TARGET,
-                                pn_string_get(link->target.address),
-                                link->target.durability,
-                                expiry_symbol(link->target.expiry_policy),
-                                link->target.timeout,
-                                link->target.dynamic,
-                                link->target.properties,
-                                link->target.capabilities,
-                                0, link->max_message_size);
-        if (err) return err;
-      }
-    }
-  }
-
-  return 0;
-}
-
-static int pni_post_flow(pn_transport_t *transport, pn_session_t *ssn, pn_link_t *link)
-{
-  ssn->state.incoming_window = pni_session_incoming_window(ssn);
-  ssn->state.outgoing_window = pni_session_outgoing_window(ssn);
-  bool linkq = (bool) link;
-  pn_link_state_t *state = &link->state;
-  return pn_post_frame(transport, AMQP_FRAME_TYPE, ssn->state.local_channel, "DL[?IIII?I?I?In?o]", FLOW,
-                       (int16_t) ssn->state.remote_channel >= 0, ssn->state.incoming_transfer_count,
-                       ssn->state.incoming_window,
-                       ssn->state.outgoing_transfer_count,
-                       ssn->state.outgoing_window,
-                       linkq, linkq ? state->local_handle : 0,
-                       linkq, linkq ? state->delivery_count : 0,
-                       linkq, linkq ? state->link_credit : 0,
-                       linkq, linkq ? link->drain : false);
-}
-
-static int pni_process_flow_receiver(pn_transport_t *transport, pn_endpoint_t *endpoint)
-{
-  if (endpoint->type == RECEIVER && endpoint->state & PN_LOCAL_ACTIVE)
-  {
-    pn_link_t *rcv = (pn_link_t *) endpoint;
-    pn_session_t *ssn = rcv->session;
-    pn_link_state_t *state = &rcv->state;
-    if ((int16_t) ssn->state.local_channel >= 0 &&
-        (int32_t) state->local_handle >= 0 &&
-        ((rcv->drain || state->link_credit != rcv->credit - rcv->queued) || !ssn->state.incoming_window)) {
-      state->link_credit = rcv->credit - rcv->queued;
-      return pni_post_flow(transport, ssn, rcv);
-    }
-  }
-
-  return 0;
-}
-
-static int pni_flush_disp(pn_transport_t *transport, pn_session_t *ssn)
-{
-  uint64_t code = ssn->state.disp_code;
-  bool settled = ssn->state.disp_settled;
-  if (ssn->state.disp) {
-    int err = pn_post_frame(transport, AMQP_FRAME_TYPE, ssn->state.local_channel, "DL[oIIo?DL[]]", DISPOSITION,
-                            ssn->state.disp_type, ssn->state.disp_first, ssn->state.disp_last,
-                            settled, (bool)code, code);
-    if (err) return err;
-    ssn->state.disp_type = 0;
-    ssn->state.disp_code = 0;
-    ssn->state.disp_settled = 0;
-    ssn->state.disp_first = 0;
-    ssn->state.disp_last = 0;
-    ssn->state.disp = false;
-  }
-  return 0;
-}
-
-static int pni_post_disp(pn_transport_t *transport, pn_delivery_t *delivery)
-{
-  pn_link_t *link = delivery->link;
-  pn_session_t *ssn = link->session;
-  pn_session_state_t *ssn_state = &ssn->state;
-  pn_modified(transport->connection, &link->session->endpoint, false);
-  pn_delivery_state_t *state = &delivery->state;
-  assert(state->init);
-  bool role = (link->endpoint.type == RECEIVER);
-  uint64_t code = delivery->local.type;
-
-  if (!code && !delivery->local.settled) {
-    return 0;
-  }
-
-  if (!pni_disposition_batchable(&delivery->local)) {
-    pn_data_clear(transport->disp_data);
-    PN_RETURN_IF_ERROR(pni_disposition_encode(&delivery->local, transport->disp_data));
-    return pn_post_frame(transport, AMQP_FRAME_TYPE, ssn->state.local_channel,
-      "DL[oIIo?DLC]", DISPOSITION,
-      role, state->id, state->id, delivery->local.settled,
-      (bool)code, code, transport->disp_data);
-  }
-
-  if (ssn_state->disp && code == ssn_state->disp_code &&
-      delivery->local.settled == ssn_state->disp_settled &&
-      ssn_state->disp_type == role) {
-    if (state->id == ssn_state->disp_first - 1) {
-      ssn_state->disp_first = state->id;
-      return 0;
-    } else if (state->id == ssn_state->disp_last + 1) {
-      ssn_state->disp_last = state->id;
-      return 0;
-    }
-  }
-
-  if (ssn_state->disp) {
-    int err = pni_flush_disp(transport, ssn);
-    if (err) return err;
-  }
-
-  ssn_state->disp_type = role;
-  ssn_state->disp_code = code;
-  ssn_state->disp_settled = delivery->local.settled;
-  ssn_state->disp_first = state->id;
-  ssn_state->disp_last = state->id;
-  ssn_state->disp = true;
-
-  return 0;
-}
-
-static int pni_process_tpwork_sender(pn_transport_t *transport, pn_delivery_t *delivery, bool *settle)
-{
-  *settle = false;
-  pn_link_t *link = delivery->link;
-  pn_session_state_t *ssn_state = &link->session->state;
-  pn_link_state_t *link_state = &link->state;
-  bool xfr_posted = false;
-  if ((int16_t) ssn_state->local_channel >= 0 && (int32_t) link_state->local_handle >= 0) {
-    pn_delivery_state_t *state = &delivery->state;
-    if (!state->sent && (delivery->done || pn_buffer_size(delivery->bytes) > 0) &&
-        ssn_state->remote_incoming_window > 0 && link_state->link_credit > 0) {
-      if (!state->init) {
-        state = pni_delivery_map_push(&ssn_state->outgoing, delivery);
-      }
-
-      pn_bytes_t bytes = pn_buffer_bytes(delivery->bytes);
-      size_t full_size = bytes.size;
-      pn_bytes_t tag = pn_buffer_bytes(delivery->tag);
-      pn_data_clear(transport->disp_data);
-      PN_RETURN_IF_ERROR(pni_disposition_encode(&delivery->local, transport->disp_data));
-      int count = pni_post_amqp_transfer_frame(transport,
-                                              ssn_state->local_channel,
-                                              link_state->local_handle,
-                                              state->id, &bytes, &tag,
-                                              0, // message-format
-                                              delivery->local.settled,
-                                              !delivery->done,
-                                              ssn_state->remote_incoming_window,
-                                              delivery->local.type, transport->disp_data);
-      if (count < 0) return count;
-      xfr_posted = true;
-      ssn_state->outgoing_transfer_count += count;
-      ssn_state->remote_incoming_window -= count;
-
-      int sent = full_size - bytes.size;
-      pn_buffer_trim(delivery->bytes, sent, 0);
-      link->session->outgoing_bytes -= sent;
-      if (!pn_buffer_size(delivery->bytes) && delivery->done) {
-        state->sent = true;
-        link_state->delivery_count++;
-        link_state->link_credit--;
-        link->queued--;
-        link->session->outgoing_deliveries--;
-      }
-
-      pn_collector_put(transport->connection->collector, PN_OBJECT, link, PN_LINK_FLOW);
-    }
-  }
-
-  pn_delivery_state_t *state = delivery->state.init ? &delivery->state : NULL;
-  if ((int16_t) ssn_state->local_channel >= 0 && !delivery->remote.settled
-      && state && state->sent && !xfr_posted) {
-    int err = pni_post_disp(transport, delivery);
-    if (err) return err;
-  }
-
-  *settle = delivery->local.settled && state && state->sent;
-  return 0;
-}
-
-static int pni_process_tpwork_receiver(pn_transport_t *transport, pn_delivery_t *delivery, bool *settle)
-{
-  *settle = false;
-  pn_link_t *link = delivery->link;
-  // XXX: need to prevent duplicate disposition sending
-  pn_session_t *ssn = link->session;
-  if ((int16_t) ssn->state.local_channel >= 0 && !delivery->remote.settled && delivery->state.init) {
-    int err = pni_post_disp(transport, delivery);
-    if (err) return err;
-  }
-
-  // XXX: need to centralize this policy and improve it
-  if (!ssn->state.incoming_window) {
-    int err = pni_post_flow(transport, ssn, link);
-    if (err) return err;
-  }
-
-  *settle = delivery->local.settled;
-  return 0;
-}
-
-static int pni_process_tpwork(pn_transport_t *transport, pn_endpoint_t *endpoint)
-{
-  if (endpoint->type == CONNECTION && !transport->close_sent)
-  {
-    pn_connection_t *conn = (pn_connection_t *) endpoint;
-    pn_delivery_t *delivery = conn->tpwork_head;
-    while (delivery)
-    {
-      pn_delivery_t *tp_next = delivery->tpwork_next;
-      bool settle = false;
-
-      pn_link_t *link = delivery->link;
-      pn_delivery_map_t *dm = NULL;
-      if (pn_link_is_sender(link)) {
-        dm = &link->session->state.outgoing;
-        int err = pni_process_tpwork_sender(transport, delivery, &settle);
-        if (err) return err;
-      } else {
-        dm = &link->session->state.incoming;
-        int err = pni_process_tpwork_receiver(transport, delivery, &settle);
-        if (err) return err;
-      }
-
-      if (settle) {
-        pn_full_settle(dm, delivery);
-      } else if (!pn_delivery_buffered(delivery)) {
-        pn_clear_tpwork(delivery);
-      }
-
-      delivery = tp_next;
-    }
-  }
-
-  return 0;
-}
-
-static int pni_process_flush_disp(pn_transport_t *transport, pn_endpoint_t *endpoint)
-{
-  if (endpoint->type == SESSION) {
-    pn_session_t *session = (pn_session_t *) endpoint;
-    pn_session_state_t *state = &session->state;
-    if ((int16_t) state->local_channel >= 0 && !transport->close_sent)
-    {
-      int err = pni_flush_disp(transport, session);
-      if (err) return err;
-    }
-  }
-
-  return 0;
-}
-
-static int pni_process_flow_sender(pn_transport_t *transport, pn_endpoint_t *endpoint)
-{
-  if (endpoint->type == SENDER && endpoint->state & PN_LOCAL_ACTIVE)
-  {
-    pn_link_t *snd = (pn_link_t *) endpoint;
-    pn_session_t *ssn = snd->session;
-    pn_link_state_t *state = &snd->state;
-    if ((int16_t) ssn->state.local_channel >= 0 &&
-        (int32_t) state->local_handle >= 0 &&
-        snd->drain && snd->drained) {
-      pn_delivery_t *tail = snd->unsettled_tail;
-      if (!tail || !pn_delivery_buffered(tail)) {
-        state->delivery_count += state->link_credit;
-        state->link_credit = 0;
-        snd->drained = 0;
-        return pni_post_flow(transport, ssn, snd);
-      }
-    }
-  }
-
-  return 0;
-}
-
-static void pni_unmap_local_handle(pn_link_t *link) {
-  pn_link_state_t *state = &link->state;
-  uintptr_t handle = state->local_handle;
-  state->local_handle = -2;
-  if (pn_hash_get(link->session->state.local_handles, handle)) {
-    pn_ep_decref(&link->endpoint);
-  }
-  // may delete link
-  pn_hash_del(link->session->state.local_handles, handle);
-}
-
-static int pni_process_link_teardown(pn_transport_t *transport, pn_endpoint_t *endpoint)
-{
-  if (endpoint->type == SENDER || endpoint->type == RECEIVER)
-  {
-    pn_link_t *link = (pn_link_t *) endpoint;
-    pn_session_t *session = link->session;
-    pn_session_state_t *ssn_state = &session->state;
-    pn_link_state_t *state = &link->state;
-    if (((endpoint->state & PN_LOCAL_CLOSED) || link->detached) && (int32_t) state->local_handle >= 0 &&
-        (int16_t) ssn_state->local_channel >= 0 && !transport->close_sent) {
-      if (pn_link_is_sender(link) && pn_link_queued(link) &&
-          (int32_t) state->remote_handle != -2 &&
-          (int16_t) ssn_state->remote_channel != -2 &&
-          !transport->close_rcvd) return 0;
-
-      const char *name = NULL;
-      const char *description = NULL;
-      pn_data_t *info = NULL;
-
-      if (pn_condition_is_set(&endpoint->condition)) {
-        name = pn_condition_get_name(&endpoint->condition);
-        description = pn_condition_get_description(&endpoint->condition);
-        info = pn_condition_info(&endpoint->condition);
-      }
-
-      int err =
-          pn_post_frame(transport, AMQP_FRAME_TYPE, ssn_state->local_channel,
-                        "DL[Io?DL[sSC]]", DETACH, state->local_handle, !link->detached,
-                        (bool)name, ERROR, name, description, info);
-      if (err) return err;
-      pni_unmap_local_handle(link);
-    }
-
-    pn_clear_modified(transport->connection, endpoint);
-  }
-
-  return 0;
-}
-
-static bool pni_pointful_buffering(pn_transport_t *transport, pn_session_t *session)
-{
-  if (transport->close_rcvd) return false;
-  if (!transport->open_rcvd) return true;
-
-  pn_connection_t *conn = transport->connection;
-  pn_link_t *link = pn_link_head(conn, 0);
-  while (link) {
-    if (pn_link_is_sender(link) && pn_link_queued(link) > 0) {
-      pn_session_t *ssn = link->session;
-      if (session && session == ssn) {
-        if ((int32_t) link->state.remote_handle != -2 &&
-            (int16_t) session->state.remote_channel != -2) {
-          return true;
-        }
-      }
-    }
-    link = pn_link_next(link, 0);
-  }
-
-  return false;
-}
-
-static void pni_unmap_local_channel(pn_session_t *ssn) {
-  // XXX: should really update link state also
-  pni_delivery_map_clear(&ssn->state.outgoing);
-  pni_transport_unbind_handles(ssn->state.local_handles, false);
-  pn_transport_t *transport = ssn->connection->transport;
-  pn_session_state_t *state = &ssn->state;
-  uintptr_t channel = state->local_channel;
-  state->local_channel = -2;
-  if (pn_hash_get(transport->local_channels, channel)) {
-    pn_ep_decref(&ssn->endpoint);
-  }
-  // may delete session
-  pn_hash_del(transport->local_channels, channel);
-}
-
-static int pni_process_ssn_teardown(pn_transport_t *transport, pn_endpoint_t *endpoint)
-{
-  if (endpoint->type == SESSION)
-  {
-    pn_session_t *session = (pn_session_t *) endpoint;
-    pn_session_state_t *state = &session->state;
-    if (endpoint->state & PN_LOCAL_CLOSED && (int16_t) state->local_channel >= 0
-        && !transport->close_sent)
-    {
-      if (pni_pointful_buffering(transport, session)) {
-        return 0;
-      }
-
-      const char *name = NULL;
-      const char *description = NULL;
-      pn_data_t *info = NULL;
-
-      if (pn_condition_is_set(&endpoint->condition)) {
-        name = pn_condition_get_name(&endpoint->condition);
-        description = pn_condition_get_description(&endpoint->condition);
-        info = pn_condition_info(&endpoint->condition);
-      }
-
-      int err = pn_post_frame(transport, AMQP_FRAME_TYPE, state->local_channel, "DL[?DL[sSC]]", END,
-                              (bool) name, ERROR, name, description, info);
-      if (err) return err;
-      pni_unmap_local_channel(session);
-    }
-
-    pn_clear_modified(transport->connection, endpoint);
-  }
-  return 0;
-}
-
-static int pni_process_conn_teardown(pn_transport_t *transport, pn_endpoint_t *endpoint)
-{
-  if (endpoint->type == CONNECTION)
-  {
-    if (endpoint->state & PN_LOCAL_CLOSED && !transport->close_sent) {
-      if (pni_pointful_buffering(transport, NULL)) return 0;
-      int err = pni_post_close(transport, NULL);
-      if (err) return err;
-      transport->close_sent = true;
-    }
-
-    pn_clear_modified(transport->connection, endpoint);
-  }
-  return 0;
-}
-
-static int pni_phase(pn_transport_t *transport, int (*phase)(pn_transport_t *, pn_endpoint_t *))
-{
-  pn_connection_t *conn = transport->connection;
-  pn_endpoint_t *endpoint = conn->transport_head;
-  while (endpoint)
-  {
-    pn_endpoint_t *next = endpoint->transport_next;
-    int err = phase(transport, endpoint);
-    if (err) return err;
-    endpoint = next;
-  }
-  return 0;
-}
-
-static int pni_process(pn_transport_t *transport)
-{
-  int err;
-  if ((err = pni_phase(transport, pni_process_conn_setup))) return err;
-  if ((err = pni_phase(transport, pni_process_ssn_setup))) return err;
-  if ((err = pni_phase(transport, pni_process_link_setup))) return err;
-  if ((err = pni_phase(transport, pni_process_flow_receiver))) return err;
-
-  // XXX: this has to happen two times because we might settle stuff
-  // on the first pass and create space for more work to be done on the
-  // second pass
-  if ((err = pni_phase(transport, pni_process_tpwork))) return err;
-  if ((err = pni_phase(transport, pni_process_tpwork))) return err;
-
-  if ((err = pni_phase(transport, pni_process_flush_disp))) return err;
-
-  if ((err = pni_phase(transport, pni_process_flow_sender))) return err;
-  if ((err = pni_phase(transport, pni_process_link_teardown))) return err;
-  if ((err = pni_phase(transport, pni_process_ssn_teardown))) return err;
-  if ((err = pni_phase(transport, pni_process_conn_teardown))) return err;
-
-  if (transport->connection->tpwork_head) {
-    pn_modified(transport->connection, &transport->connection->endpoint, false);
-  }
-
-  return 0;
-}
-
-#define AMQP_HEADER ("AMQP\x00\x01\x00\x00")
-
-static void pn_error_amqp(pn_transport_t* transport, unsigned int layer)
-{
-  if (!transport->close_sent) {
-    if (!transport->open_sent) {
-      pn_post_frame(transport, AMQP_FRAME_TYPE, 0, "DL[S]", OPEN, "");
-    }
-
-    pni_post_close(transport, &transport->condition);
-    transport->close_sent = true;
-  }
-  transport->halt = true;
-  transport->done_processing = true;
-}
-
-static ssize_t pn_input_read_amqp_header(pn_transport_t* transport, unsigned int layer, const char* bytes, size_t available)
-{
-  bool eos = pn_transport_capacity(transport)==PN_EOS;
-  pni_protocol_type_t protocol = pni_sniff_header(bytes, available);
-  switch (protocol) {
-  case PNI_PROTOCOL_AMQP1:
-    if (transport->io_layers[layer] == &amqp_read_header_layer) {
-      transport->io_layers[layer] = &amqp_layer;
-    } else {
-      transport->io_layers[layer] = &amqp_write_header_layer;
-    }
-    if (transport->trace & PN_TRACE_FRM)
-      pn_transport_logf(transport, "  <- %s", "AMQP");
-    return 8;
-  case PNI_PROTOCOL_INSUFFICIENT:
-    if (!eos) return 0;
-    /* Fallthru */
-  default:
-    break;
-  }
-  char quoted[1024];
-  pn_quote_data(quoted, 1024, bytes, available);
-  pn_do_error(transport, "amqp:connection:framing-error",
-              "%s header mismatch: %s ['%s']%s", "AMQP", pni_protocol_name(protocol), quoted,
-              !eos ? "" : " (connection aborted)");
-  return PN_EOS;
-}
-
-static ssize_t pn_input_read_amqp(pn_transport_t* transport, unsigned int layer, const char* bytes, size_t available)
-{
-  if (transport->close_rcvd) {
-    if (available > 0) {
-      pn_do_error(transport, "amqp:connection:framing-error", "data after close");
-      return PN_EOS;
-    }
-  }
-
-  if (!transport->close_rcvd && !available) {
-    pn_do_error(transport, "amqp:connection:framing-error", "connection aborted");
-    return PN_EOS;
-  }
-
-
-  ssize_t n = pn_dispatcher_input(transport, bytes, available, true, &transport->halt);
-  if (n < 0) {
-    //return pn_error_set(transport->error, n, "dispatch error");
-    return PN_EOS;
-  } else if (transport->close_rcvd) {
-    return PN_EOS;
-  } else {
-    return n;
-  }
-}
-
-/* process AMQP related timer events */
-static pn_timestamp_t pn_tick_amqp(pn_transport_t* transport, unsigned int layer, pn_timestamp_t now)
-{
-  pn_timestamp_t timeout = 0;
-
-  if (transport->local_idle_timeout) {
-    if (transport->dead_remote_deadline == 0 ||
-        transport->last_bytes_input != transport->bytes_input) {
-      transport->dead_remote_deadline = now + transport->local_idle_timeout;
-      transport->last_bytes_input = transport->bytes_input;
-    } else if (transport->dead_remote_deadline <= now) {
-      transport->dead_remote_deadline = now + transport->local_idle_timeout;
-      if (!transport->posted_idle_timeout) {
-        transport->posted_idle_timeout = true;
-        // Note: AMQP-1.0 really should define a generic "timeout" error, but does not.
-        pn_do_error(transport, "amqp:resource-limit-exceeded", "local-idle-timeout expired");
-      }
-    }
-    timeout = transport->dead_remote_deadline;
-  }
-
-  // Prevent remote idle timeout as describe by AMQP 1.0:
-  if (transport->remote_idle_timeout && !transport->close_sent) {
-    if (transport->keepalive_deadline == 0 ||
-        transport->last_bytes_output != transport->bytes_output) {
-      transport->keepalive_deadline = now + (pn_timestamp_t)(transport->remote_idle_timeout/2.0);
-      transport->last_bytes_output = transport->bytes_output;
-    } else if (transport->keepalive_deadline <= now) {
-      transport->keepalive_deadline = now + (pn_timestamp_t)(transport->remote_idle_timeout/2.0);
-      if (transport->available == 0) {    // no outbound data pending
-        // so send empty frame (and account for it!)
-        pn_post_frame(transport, AMQP_FRAME_TYPE, 0, "");
-        transport->last_bytes_output += transport->available;
-      }
-    }
-    timeout = pn_timestamp_min( timeout, transport->keepalive_deadline );
-  }
-
-  return timeout;
-}
-
-static ssize_t pn_output_write_amqp_header(pn_transport_t* transport, unsigned int layer, char* bytes, size_t available)
-{
-  if (transport->trace & PN_TRACE_FRM)
-    pn_transport_logf(transport, "  -> %s", "AMQP");
-  assert(available >= 8);
-  memmove(bytes, AMQP_HEADER, 8);
-  if (pn_condition_is_set(&transport->condition)) {
-      pn_error_amqp(transport, layer);
-    transport->io_layers[layer] = &pni_error_layer;
-    return pn_dispatcher_output(transport, bytes+8, available-8) + 8;
-  }
-
-  if (transport->io_layers[layer] == &amqp_write_header_layer) {
-    transport->io_layers[layer] = &amqp_layer;
-  } else {
-    transport->io_layers[layer] = &amqp_read_header_layer;
-  }
-  return 8;
-}
-
-static ssize_t pn_output_write_amqp(pn_transport_t* transport, unsigned int layer, char* bytes, size_t available)
-{
-  if (transport->connection && !transport->done_processing) {
-    int err = pni_process(transport);
-    if (err) {
-      pn_transport_logf(transport, "process error %i", err);
-      transport->done_processing = true;
-    }
-  }
-
-  // write out any buffered data _before_ returning PN_EOS, else we
-  // could truncate an outgoing Close frame containing a useful error
-  // status
-  if (!transport->available && transport->close_sent) {
-    return PN_EOS;
-  }
-
-  return pn_dispatcher_output(transport, bytes, available);
-}
-
-// Mark transport output as closed and send event
-static void pni_close_head(pn_transport_t *transport)
-{
-  if (!transport->head_closed) {
-    transport->head_closed = true;
-    pn_collector_t *collector = pni_transport_collector(transport);
-    pn_collector_put(collector, PN_OBJECT, transport, PN_TRANSPORT_HEAD_CLOSED);
-    pni_maybe_post_closed(transport);
-  }
-}
-
-// generate outbound data, return amount of pending output else error
-static ssize_t transport_produce(pn_transport_t *transport)
-{
-  if (transport->head_closed) return PN_EOS;
-
-  ssize_t space = transport->output_size - transport->output_pending;
-
-  if (space <= 0) {     // can we expand the buffer?
-    int more = 0;
-    if (!transport->remote_max_frame)   // no limit, so double it
-      more = transport->output_size;
-    else if (transport->remote_max_frame > transport->output_size)
-      more = pn_min(transport->output_size, transport->remote_max_frame - transport->output_size);
-    if (more) {
-      char *newbuf = (char *)realloc( transport->output_buf, transport->output_size + more );
-      if (newbuf) {
-        transport->output_buf = newbuf;
-        transport->output_size += more;
-        space += more;
-      }
-    }
-  }
-
-  while (space > 0) {
-    ssize_t n;
-    n = transport->io_layers[0]->
-      process_output( transport, 0,
-                      &transport->output_buf[transport->output_pending],
-                      space );
-    if (n > 0) {
-      space -= n;
-      transport->output_pending += n;
-    } else if (n == 0) {
-      break;
-    } else {
-      if (transport->output_pending)
-        break;   // return what is available
-      if (transport->trace & (PN_TRACE_RAW | PN_TRACE_FRM)) {
-        pn_transport_log(transport, "  -> EOS");
-      }
-      pni_close_head(transport);
-      return n;
-    }
-  }
-
-  return transport->output_pending;
-}
-
-// deprecated
-ssize_t pn_transport_output(pn_transport_t *transport, char *bytes, size_t size)
-{
-  if (!transport) return PN_ARG_ERR;
-  ssize_t available = pn_transport_pending(transport);
-  if (available > 0) {
-    available = (ssize_t) pn_min( (size_t)available, size );
-    memmove( bytes, pn_transport_head(transport), available );
-    pn_transport_pop( transport, (size_t) available );
-  }
-  return available;
-}
-
-
-void pn_transport_trace(pn_transport_t *transport, pn_trace_t trace)
-{
-  transport->trace = trace;
-}
-
-void pn_transport_set_tracer(pn_transport_t *transport, pn_tracer_t tracer)
-{
-  assert(transport);
-  assert(tracer);
-
-  transport->tracer = tracer;
-}
-
-pn_tracer_t pn_transport_get_tracer(pn_transport_t *transport)
-{
-  assert(transport);
-  return transport->tracer;
-}
-
-void pn_transport_set_context(pn_transport_t *transport, void *context)
-{
-  assert(transport);
-  pn_record_set(transport->context, PN_LEGCTX, context);
-}
-
-void *pn_transport_get_context(pn_transport_t *transport)
-{
-  assert(transport);
-  return pn_record_get(transport->context, PN_LEGCTX);
-}
-
-pn_record_t *pn_transport_attachments(pn_transport_t *transport)
-{
-  assert(transport);
-  return transport->context;
-}
-
-void pn_transport_log(pn_transport_t *transport, const char *message)
-{
-  assert(transport);
-  transport->tracer(transport, message);
-}
-
-void pn_transport_vlogf(pn_transport_t *transport, const char *fmt, va_list ap)
-{
-  if (transport) {
-    pn_string_vformat(transport->scratch, fmt, ap);
-    pn_transport_log(transport, pn_string_get(transport->scratch));
-  } else {
-    pn_vlogf(fmt, ap);
-  }
-}
-
-void pn_transport_logf(pn_transport_t *transport, const char *fmt, ...)
-{
-  va_list ap;
-
-  va_start(ap, fmt);
-  pn_transport_vlogf(transport, fmt, ap);
-  va_end(ap);
-}
-
-uint16_t pn_transport_get_channel_max(pn_transport_t *transport)
-{
-  return transport->channel_max;
-}
-
-int pn_transport_set_channel_max(pn_transport_t *transport, uint16_t requested_channel_max)
-{
-  /*
-   * Once the OPEN frame has been sent, we have communicated our
-   * wishes to the remote client and there is no way to renegotiate.
-   * After that point, we do not allow the application to make changes.
-   * Before that point, however, the app is free to either raise or
-   * lower our local limit.  (But the app cannot raise it above the
-   * limit imposed by this library.)
-   * The channel-max value will be finalized just before the OPEN frame
-   * is sent.
-   */
-  if(transport->open_sent) {
-    pn_transport_logf(transport, "Cannot change local channel-max after OPEN frame sent.");
-    return PN_STATE_ERR;
-  }
-
-  transport->local_channel_max = (requested_channel_max < PN_IMPL_CHANNEL_MAX)
-                                 ? requested_channel_max
-                                 : PN_IMPL_CHANNEL_MAX;
-  pni_calculate_channel_max(transport);
-
-  return PN_OK;
-}
-
-uint16_t pn_transport_remote_channel_max(pn_transport_t *transport)
-{
-  return transport->remote_channel_max;
-}
-
-uint32_t pn_transport_get_max_frame(pn_transport_t *transport)
-{
-  return transport->local_max_frame;
-}
-
-void pn_transport_set_max_frame(pn_transport_t *transport, uint32_t size)
-{
-  // if size == 0, no advertised limit to input frame size.
-  if (size && size < AMQP_MIN_MAX_FRAME_SIZE)
-    size = AMQP_MIN_MAX_FRAME_SIZE;
-  transport->local_max_frame = size;
-}
-
-uint32_t pn_transport_get_remote_max_frame(pn_transport_t *transport)
-{
-  return transport->remote_max_frame;
-}
-
-pn_millis_t pn_transport_get_idle_timeout(pn_transport_t *transport)
-{
-  return transport->local_idle_timeout;
-}
-
-void pn_transport_set_idle_timeout(pn_transport_t *transport, pn_millis_t timeout)
-{
-  transport->local_idle_timeout = timeout;
-}
-
-pn_millis_t pn_transport_get_remote_idle_timeout(pn_transport_t *transport)
-{
-  return transport->remote_idle_timeout;
-}
-
-pn_timestamp_t pn_transport_tick(pn_transport_t *transport, pn_timestamp_t now)
-{
-  pn_timestamp_t r = 0;
-  for (int i = 0; i<PN_IO_LAYER_CT; ++i) {
-    if (transport->io_layers[i] && transport->io_layers[i]->process_tick)
-      r = pn_timestamp_min(r, transport->io_layers[i]->process_tick(transport, i, now));
-  }
-  return r;
-}
-
-uint64_t pn_transport_get_frames_output(const pn_transport_t *transport)
-{
-  if (transport)
-    return transport->output_frames_ct;
-  return 0;
-}
-
-uint64_t pn_transport_get_frames_input(const pn_transport_t *transport)
-{
-  if (transport)
-    return transport->input_frames_ct;
-  return 0;
-}
-
-// input
-ssize_t pn_transport_capacity(pn_transport_t *transport)  /* <0 == done */
-{
-  if (transport->tail_closed) return PN_EOS;
-  //if (pn_error_code(transport->error)) return pn_error_code(transport->error);
-
-  ssize_t capacity = transport->input_size - transport->input_pending;
-  if ( capacity<=0 ) {
-    // can we expand the size of the input buffer?
-    int more = 0;
-    if (!transport->local_max_frame) {  // no limit (ha!)
-      more = transport->input_size;
-    } else if (transport->local_max_frame > transport->input_size) {
-      more = pn_min(transport->input_size, transport->local_max_frame - transport->input_size);
-    }
-    if (more) {
-      char *newbuf = (char *) realloc( transport->input_buf, transport->input_size + more );
-      if (newbuf) {
-        transport->input_buf = newbuf;
-        transport->input_size += more;
-        capacity += more;
-      }
-    }
-  }
-  return capacity;
-}
-
-
-char *pn_transport_tail(pn_transport_t *transport)
-{
-  if (transport && transport->input_pending < transport->input_size) {
-    return &transport->input_buf[transport->input_pending];
-  }
-  return NULL;
-}
-
-ssize_t pn_transport_push(pn_transport_t *transport, const char *src, size_t size)
-{
-  assert(transport);
-
-  ssize_t capacity = pn_transport_capacity(transport);
-  if (capacity < 0) {
-    return capacity;
-  } else if (size > (size_t) capacity) {
-    size = capacity;
-  }
-
-  char *dst = pn_transport_tail(transport);
-  assert(dst);
-  memmove(dst, src, size);
-
-  int n = pn_transport_process(transport, size);
-  if (n < 0) {
-    return n;
-  } else {
-    return size;
-  }
-}
-
-int pn_transport_process(pn_transport_t *transport, size_t size)
-{
-  assert(transport);
-  size = pn_min( size, (transport->input_size - transport->input_pending) );
-  transport->input_pending += size;
-  transport->bytes_input += size;
-
-  ssize_t n = transport_consume( transport );
-  if (n == PN_EOS) {
-    pni_close_tail(transport);
-  }
-
-  if (n < 0 && n != PN_EOS) return n;
-  return 0;
-}
-
-// input stream has closed
-int pn_transport_close_tail(pn_transport_t *transport)
-{
-  pni_close_tail(transport);
-  transport_consume( transport );
-  return 0;
-  // XXX: what if not all input processed at this point?  do we care???
-}
-
-// output
-ssize_t pn_transport_pending(pn_transport_t *transport)      /* <0 == done */
-{
-  assert(transport);
-  return transport_produce( transport );
-}
-
-const char *pn_transport_head(pn_transport_t *transport)
-{
-  if (transport && transport->output_pending) {
-    return transport->output_buf;
-  }
-  return NULL;
-}
-
-ssize_t pn_transport_peek(pn_transport_t *transport, char *dst, size_t size)
-{
-  assert(transport);
-
-  ssize_t pending = pn_transport_pending(transport);
-  if (pending < 0) {
-    return pending;
-  } else if (size > (size_t) pending) {
-    size = pending;
-  }
-
-  if (pending > 0) {
-    const char *src = pn_transport_head(transport);
-    assert(src);
-    memmove(dst, src, size);
-  }
-
-  return size;
-}
-
-void pn_transport_pop(pn_transport_t *transport, size_t size)
-{
-  if (transport) {
-    assert( transport->output_pending >= size );
-    transport->output_pending -= size;
-    transport->bytes_output += size;
-    if (transport->output_pending) {
-      memmove( transport->output_buf,  &transport->output_buf[size],
-               transport->output_pending );
-    }
-
-    if (transport->output_pending==0 && pn_transport_pending(transport) < 0) {
-      // TODO: It looks to me that this is a NOP as iff we ever get here
-      // TODO: pni_close_head() will always have been already called before leaving pn_transport_pending()
-      pni_close_head(transport);
-    }
-  }
-}
-
-int pn_transport_close_head(pn_transport_t *transport)
-{
-  ssize_t pending = pn_transport_pending(transport);
-  pni_close_head(transport);
-  if (pending > 0)
-    pn_transport_pop(transport, pending);
-  return 0;
-}
-
-// true if the transport will not generate further output
-bool pn_transport_quiesced(pn_transport_t *transport)
-{
-  if (!transport) return true;
-  ssize_t pending = pn_transport_pending(transport);
-  if (pending < 0) return true; // output done
-  else if (pending > 0) return false;
-  // no pending at transport, but check if data is buffered in I/O layers
-  for (int layer = 0; layer<PN_IO_LAYER_CT; ++layer) {
-    if (transport->io_layers[layer] &&
-        transport->io_layers[layer]->buffered_output &&
-        transport->io_layers[layer]->buffered_output( transport ))
-      return false;
-  }
-  return true;
-}
-
-bool pn_transport_closed(pn_transport_t *transport)
-{
-  assert(transport);
-  ssize_t capacity = pn_transport_capacity(transport);
-  ssize_t pending = pn_transport_pending(transport);
-  return capacity < 0 && pending < 0;
-}
-
-pn_connection_t *pn_transport_connection(pn_transport_t *transport)
-{
-  assert(transport);
-  return transport->connection;
-}
diff --git a/proton-c/src/core/transport.h b/proton-c/src/core/transport.h
deleted file mode 100644
index 66ebc51..0000000
--- a/proton-c/src/core/transport.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef _PROTON_TRANSPORT_INTERNAL_H
-#define _PROTON_TRANSPORT_INTERNAL_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-void pn_delivery_map_init(pn_delivery_map_t *db, pn_sequence_t next);
-void pn_delivery_map_del(pn_delivery_map_t *db, pn_delivery_t *delivery);
-void pn_delivery_map_free(pn_delivery_map_t *db);
-void pn_unmap_handle(pn_session_t *ssn, pn_link_t *link);
-void pn_unmap_channel(pn_transport_t *transport, pn_session_t *ssn);
-
-#endif /* transport.h */
diff --git a/proton-c/src/core/types.c b/proton-c/src/core/types.c
deleted file mode 100644
index dbd18d0..0000000
--- a/proton-c/src/core/types.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/types.h>
-
-pn_bytes_t pn_bytes(size_t size, const char *start)
-{
-  pn_bytes_t bytes = {size, start};
-  return bytes;
-}
-
-pn_rwbytes_t pn_rwbytes(size_t size, char *start)
-{
-  pn_rwbytes_t bytes = {size, start};
-  return bytes;
-}
diff --git a/proton-c/src/core/util.c b/proton-c/src/core/util.c
deleted file mode 100644
index 62eec9a..0000000
--- a/proton-c/src/core/util.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <proton/type_compat.h>
-#include <ctype.h>
-#include <string.h>
-#include <proton/error.h>
-#include <proton/types.h>
-#include "util.h"
-
-ssize_t pn_quote_data(char *dst, size_t capacity, const char *src, size_t size)
-{
-  int idx = 0;
-  for (unsigned i = 0; i < size; i++)
-  {
-    uint8_t c = src[i];
-    if (isprint(c)) {
-      if (idx < (int) (capacity - 1)) {
-        dst[idx++] = c;
-      } else {
-        if (idx > 0) {
-          dst[idx - 1] = '\0';
-        }
-        return PN_OVERFLOW;
-      }
-    } else {
-      if (idx < (int) (capacity - 4)) {
-        idx += sprintf(dst + idx, "\\x%.2x", c);
-      } else {
-        if (idx > 0) {
-          dst[idx - 1] = '\0';
-        }
-        return PN_OVERFLOW;
-      }
-    }
-  }
-
-  dst[idx] = '\0';
-  return idx;
-}
-
-int pn_quote(pn_string_t *dst, const char *src, size_t size)
-{
-  while (true) {
-    size_t str_size = pn_string_size(dst);
-    char *str = pn_string_buffer(dst) + str_size;
-    size_t capacity = pn_string_capacity(dst) - str_size;
-    ssize_t ssize = pn_quote_data(str, capacity, src, size);
-    if (ssize == PN_OVERFLOW) {
-      int err = pn_string_grow(dst, (str_size + capacity) ? 2*(str_size + capacity) : 16);
-      if (err) return err;
-    } else if (ssize >= 0) {
-      return pn_string_resize(dst, str_size + ssize);
-    } else {
-      return ssize;
-    }
-  }
-}
-
-void pn_fprint_data(FILE *stream, const char *bytes, size_t size)
-{
-  char buf[256];
-  ssize_t n = pn_quote_data(buf, 256, bytes, size);
-  if (n >= 0) {
-    fputs(buf, stream);
-  } else {
-    if (n == PN_OVERFLOW) {
-      fputs(buf, stream);
-      fputs("... (truncated)", stream);
-    }
-    else
-      fprintf(stderr, "pn_quote_data: %s\n", pn_code(n));
-  }
-}
-
-void pn_print_data(const char *bytes, size_t size)
-{
-  pn_fprint_data(stdout, bytes, size);
-}
-
-int pn_strcasecmp(const char *a, const char *b)
-{
-  int diff;
-  while (*b) {
-    char aa = *a++, bb = *b++;
-    diff = tolower(aa)-tolower(bb);
-    if ( diff!=0 ) return diff;
-  }
-  return *a;
-}
-
-int pn_strncasecmp(const char* a, const char* b, size_t len)
-{
-  int diff = 0;
-  while (*b && len > 0) {
-    char aa = *a++, bb = *b++;
-    diff = tolower(aa)-tolower(bb);
-    if ( diff!=0 ) return diff;
-    --len;
-  };
-  return len==0 ? diff : *a;
-}
-
-bool pn_env_bool(const char *name)
-{
-  char *v = getenv(name);
-  return v && (!pn_strcasecmp(v, "true") || !pn_strcasecmp(v, "1") ||
-               !pn_strcasecmp(v, "yes")  || !pn_strcasecmp(v, "on"));
-}
-
-char *pn_strdup(const char *src)
-{
-  if (!src) return NULL;
-  char *dest = (char *) malloc(strlen(src)+1);
-  if (!dest) return NULL;
-  return strcpy(dest, src);
-}
-
-char *pn_strndup(const char *src, size_t n)
-{
-  if (src) {
-    unsigned size = 0;
-    for (const char *c = src; size < n && *c; c++) {
-      size++;
-    }
-
-    char *dest = (char *) malloc(size + 1);
-    if (!dest) return NULL;
-    strncpy(dest, src, n);
-    dest[size] = '\0';
-    return dest;
-  } else {
-    return NULL;
-  }
-}
-
-// which timestamp will expire next, or zero if none set
-pn_timestamp_t pn_timestamp_min( pn_timestamp_t a, pn_timestamp_t b )
-{
-  if (a && b) return pn_min(a, b);
-  if (a) return a;
-  return b;
-}
-
diff --git a/proton-c/src/core/util.h b/proton-c/src/core/util.h
deleted file mode 100644
index b54f689..0000000
--- a/proton-c/src/core/util.h
+++ /dev/null
@@ -1,123 +0,0 @@
-#ifndef _PROTON_SRC_UTIL_H
-#define _PROTON_SRC_UTIL_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <errno.h>
-#ifndef __cplusplus
-#include <stdbool.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <proton/types.h>
-#include <proton/object.h>
-
-ssize_t pn_quote_data(char *dst, size_t capacity, const char *src, size_t size);
-int pn_quote(pn_string_t *dst, const char *src, size_t size);
-void pn_fprint_data(FILE *stream, const char *bytes, size_t size);
-void pn_print_data(const char *bytes, size_t size);
-bool pn_env_bool(const char *name);
-pn_timestamp_t pn_timestamp_min(pn_timestamp_t a, pn_timestamp_t b);
-
-char *pn_strdup(const char *src);
-char *pn_strndup(const char *src, size_t n);
-int pn_strcasecmp(const char* a, const char* b);
-int pn_strncasecmp(const char* a, const char* b, size_t len);
-
-#define DIE_IFR(EXPR, STRERR)                                           \
-  do {                                                                  \
-    int __code__ = (EXPR);                                              \
-    if (__code__) {                                                     \
-      fprintf(stderr, "%s:%d: %s: %s (%d)\n", __FILE__, __LINE__,       \
-              #EXPR, STRERR(__code__), __code__);                       \
-      exit(-1);                                                         \
-    }                                                                   \
-  } while (0)
-
-#define DIE_IFE(EXPR)                                                   \
-  do {                                                                  \
-    if ((EXPR) == -1) {                                                 \
-      int __code__ = errno;                                             \
-      fprintf(stderr, "%s:%d: %s: %s (%d)\n", __FILE__, __LINE__,       \
-              #EXPR, strerror(__code__), __code__);                     \
-      exit(-1);                                                         \
-    }                                                                   \
-  } while (0)
-
-
-#define LL_HEAD(ROOT, LIST) ((ROOT)-> LIST ## _head)
-#define LL_TAIL(ROOT, LIST) ((ROOT)-> LIST ## _tail)
-#define LL_ADD(ROOT, LIST, NODE)                              \
-  {                                                           \
-    (NODE)-> LIST ## _next = NULL;                            \
-    (NODE)-> LIST ## _prev = (ROOT)-> LIST ## _tail;          \
-    if (LL_TAIL(ROOT, LIST))                                  \
-      LL_TAIL(ROOT, LIST)-> LIST ## _next = (NODE);           \
-    LL_TAIL(ROOT, LIST) = (NODE);                             \
-    if (!LL_HEAD(ROOT, LIST)) LL_HEAD(ROOT, LIST) = (NODE);   \
-  }
-
-#define LL_POP(ROOT, LIST, TYPE)                              \
-  {                                                           \
-    if (LL_HEAD(ROOT, LIST)) {                                \
-      TYPE *_old = LL_HEAD(ROOT, LIST);                       \
-      LL_HEAD(ROOT, LIST) = LL_HEAD(ROOT, LIST)-> LIST ## _next; \
-      _old-> LIST ## _next = NULL;                            \
-      if (_old == LL_TAIL(ROOT, LIST)) {                      \
-        LL_TAIL(ROOT, LIST) = NULL;                           \
-      } else {                                                \
-        LL_HEAD(ROOT, LIST)-> LIST ## _prev = NULL;           \
-      }                                                       \
-    }                                                         \
-  }
-
-#define LL_REMOVE(ROOT, LIST, NODE)                                    \
-  {                                                                    \
-    if ((NODE)-> LIST ## _prev)                                        \
-      (NODE)-> LIST ## _prev-> LIST ## _next = (NODE)-> LIST ## _next; \
-    if ((NODE)-> LIST ## _next)                                        \
-      (NODE)-> LIST ## _next-> LIST ## _prev = (NODE)-> LIST ## _prev; \
-    if ((NODE) == LL_HEAD(ROOT, LIST))                                 \
-      LL_HEAD(ROOT, LIST) = (NODE)-> LIST ## _next;                    \
-    if ((NODE) == LL_TAIL(ROOT, LIST))                                 \
-      LL_TAIL(ROOT, LIST) = (NODE)-> LIST ## _prev;                    \
-  }
-
-#define pn_min(X,Y) ((X) > (Y) ? (Y) : (X))
-#define pn_max(X,Y) ((X) < (Y) ? (Y) : (X))
-
-#define PN_ENSURE(ARRAY, CAPACITY, COUNT, TYPE)                 \
-  while ((CAPACITY) < (COUNT)) {                                \
-    (CAPACITY) = (CAPACITY) ? 2 * (CAPACITY) : 16;              \
-    (ARRAY) = (TYPE *) realloc((ARRAY), (CAPACITY) * sizeof (TYPE));    \
-  }                                                             \
-
-#define PN_ENSUREZ(ARRAY, CAPACITY, COUNT, TYPE)           \
-  {                                                        \
-    size_t _old_capacity = (CAPACITY);                     \
-    PN_ENSURE(ARRAY, CAPACITY, COUNT, TYPE);               \
-    memset((ARRAY) + _old_capacity, 0,                     \
-           sizeof(TYPE)*((CAPACITY) - _old_capacity));     \
-  }
-
-#endif /* util.h */
diff --git a/proton-c/src/encodings.h.py b/proton-c/src/encodings.h.py
deleted file mode 100644
index 9f08c6c..0000000
--- a/proton-c/src/encodings.h.py
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import mllib, optparse, os, sys
-
-xml = os.path.join(os.path.dirname(__file__), "types.xml")
-doc = mllib.xml_parse(xml)
-
-print("/* generated from %s */" % xml)
-print("#ifndef _PROTON_ENCODINGS_H")
-print("#define _PROTON_ENCODINGS_H 1")
-print()
-print("#define PNE_DESCRIPTOR          (0x00)")
-
-for enc in doc.query["amqp/section/type/encoding"]:
-  name = enc["@name"] or enc.parent["@name"]
-  # XXX: a bit hacky
-  if name == "ieee-754":
-    name = enc.parent["@name"]
-  cname = "PNE_" + name.replace("-", "_").upper()
-  print("#define %s%s(%s)" % (cname, " "*(20-len(cname)), enc["@code"]))
-
-print()
-print("#endif /* encodings.h */")
diff --git a/proton-c/src/extra/parser.c b/proton-c/src/extra/parser.c
deleted file mode 100644
index 36fb4fb..0000000
--- a/proton-c/src/extra/parser.c
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/parser.h>
-
-#include "platform/platform.h"
-#include "scanner.h"
-
-#include <proton/error.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-struct pn_parser_t {
-  pn_scanner_t *scanner;
-  char *atoms;
-  size_t size;
-  size_t capacity;
-  int error_code;
-};
-
-pn_parser_t *pn_parser()
-{
-  pn_parser_t *parser = (pn_parser_t *) malloc(sizeof(pn_parser_t));
-  if (parser != NULL) {
-    parser->scanner = pn_scanner();
-    parser->atoms = NULL;
-    parser->size = 0;
-    parser->capacity = 0;
-  }
-  return parser;
-}
-
-static void pni_parser_ensure(pn_parser_t *parser, size_t size)
-{
-  while (parser->capacity - parser->size < size) {
-    parser->capacity = parser->capacity ? 2 * parser->capacity : 1024;
-    parser->atoms = (char *) realloc(parser->atoms, parser->capacity);
-  }
-}
-
-int pn_parser_err(pn_parser_t *parser, int code, const char *fmt, ...)
-{
-  va_list ap;
-  va_start(ap, fmt);
-  int err = pn_scanner_verr(parser->scanner, code, fmt, ap);
-  va_end(ap);
-  return err;
-}
-
-int pn_parser_errno(pn_parser_t *parser)
-{
-  return pn_scanner_errno(parser->scanner);
-}
-
-const char *pn_parser_error(pn_parser_t *parser)
-{
-  return pn_scanner_error(parser->scanner);
-}
-
-void pn_parser_free(pn_parser_t *parser)
-{
-  if (parser) {
-    pn_scanner_free(parser->scanner);
-    free(parser->atoms);
-    free(parser);
-  }
-}
-
-static int pni_parser_shift(pn_parser_t *parser)
-{
-  return pn_scanner_shift(parser->scanner);
-}
-
-static pn_token_t pni_parser_token(pn_parser_t *parser)
-{
-  return pn_scanner_token(parser->scanner);
-}
-
-static int pni_parser_value(pn_parser_t *parser, pn_data_t *data);
-
-static int pni_parser_descriptor(pn_parser_t *parser, pn_data_t *data)
-{
-  if (pni_parser_token(parser).type == PN_TOK_AT) {
-    int err = pni_parser_shift(parser);
-    if (err) return err;
-
-    err = pn_data_put_described(data);
-    if (err) return pn_parser_err(parser, err, "error writing described");
-    pn_data_enter(data);
-    for (int i = 0; i < 2; i++) {
-      err = pni_parser_value(parser, data);
-      if (err) return err;
-    }
-    pn_data_exit(data);
-    return 0;
-  } else {
-    return pn_parser_err(parser, PN_ERR, "expecting '@'");
-  }
-}
-
-static int pni_parser_map(pn_parser_t *parser, pn_data_t *data)
-{
-  if (pni_parser_token(parser).type == PN_TOK_LBRACE) {
-    int err = pni_parser_shift(parser);
-    if (err) return err;
-
-    err = pn_data_put_map(data);
-    if (err) return pn_parser_err(parser, err, "error writing map");
-
-    pn_data_enter(data);
-
-    if (pni_parser_token(parser).type != PN_TOK_RBRACE) {
-      while (true) {
-        err = pni_parser_value(parser, data);
-        if (err) return err;
-
-        if (pni_parser_token(parser).type == PN_TOK_EQUAL) {
-          err = pni_parser_shift(parser);
-          if (err) return err;
-        } else {
-          return pn_parser_err(parser, PN_ERR, "expecting '='");
-        }
-
-        err = pni_parser_value(parser, data);
-        if (err) return err;
-
-        if (pni_parser_token(parser).type == PN_TOK_COMMA) {
-          err = pni_parser_shift(parser);
-          if (err) return err;
-        } else {
-          break;
-        }
-      }
-    }
-
-    pn_data_exit(data);
-
-    if (pni_parser_token(parser).type == PN_TOK_RBRACE) {
-      return pni_parser_shift(parser);
-    } else {
-      return pn_parser_err(parser, PN_ERR, "expecting '}'");
-    }
-  } else {
-    return pn_parser_err(parser, PN_ERR, "expecting '{'");
-  }
-}
-
-static int pni_parser_list(pn_parser_t *parser, pn_data_t *data)
-{
-  int err;
-
-  if (pni_parser_token(parser).type == PN_TOK_LBRACKET) {
-    err = pni_parser_shift(parser);
-    if (err) return err;
-
-    err = pn_data_put_list(data);
-    if (err) return pn_parser_err(parser, err, "error writing list");
-
-    pn_data_enter(data);
-
-    if (pni_parser_token(parser).type != PN_TOK_RBRACKET) {
-      while (true) {
-        err = pni_parser_value(parser, data);
-        if (err) return err;
-
-        if (pni_parser_token(parser).type == PN_TOK_COMMA) {
-          err = pni_parser_shift(parser);
-          if (err) return err;
-        } else {
-          break;
-        }
-      }
-    }
-
-    pn_data_exit(data);
-
-    if (pni_parser_token(parser).type == PN_TOK_RBRACKET) {
-      return pni_parser_shift(parser);
-    } else {
-      return pn_parser_err(parser, PN_ERR, "expecting ']'");
-    }
-  } else {
-    return pn_parser_err(parser, PN_ERR, "expecting '['");
-  }
-}
-
-static void pni_parser_append_tok(pn_parser_t *parser, char *dst, int *idx)
-{
-  memcpy(dst + *idx, pni_parser_token(parser).start, pni_parser_token(parser).size);
-  *idx += pni_parser_token(parser).size;
-}
-
-static int pni_parser_number(pn_parser_t *parser, pn_data_t *data)
-{
-  bool dbl = false;
-  char number[1024];
-  int idx = 0;
-  int err;
-
-  bool negate = false;
-
-  if (pni_parser_token(parser).type == PN_TOK_NEG || pni_parser_token(parser).type == PN_TOK_POS) {
-    if (pni_parser_token(parser).type == PN_TOK_NEG)
-      negate = !negate;
-    err = pni_parser_shift(parser);
-    if (err) return err;
-  }
-
-  if (pni_parser_token(parser).type == PN_TOK_FLOAT || pni_parser_token(parser).type == PN_TOK_INT) {
-    dbl = pni_parser_token(parser).type == PN_TOK_FLOAT;
-    pni_parser_append_tok(parser, number, &idx);
-    err = pni_parser_shift(parser);
-    if (err) return err;
-  } else {
-    return pn_parser_err(parser, PN_ERR, "expecting FLOAT or INT");
-  }
-
-  number[idx] = '\0';
-
-  if (dbl) {
-    double value = atof(number);
-    if (negate) {
-      value = -value;
-    }
-    err = pn_data_put_double(data, value);
-    if (err) return pn_parser_err(parser, err, "error writing double");
-  } else {
-    int64_t value = pn_i_atoll(number);
-    if (negate) {
-      value = -value;
-    }
-    err = pn_data_put_long(data, value);
-    if (err) return pn_parser_err(parser, err, "error writing long");
-  }
-
-  return 0;
-}
-
-static int pni_parser_unquote(pn_parser_t *parser, char *dst, const char *src, size_t *n)
-{
-  size_t idx = 0;
-  bool escape = false;
-  int start, end;
-  if (src[0] != '"') {
-    if (src[1] == '"') {
-      start = 2;
-      end = *n - 1;
-    } else {
-      start = 1;
-      end = *n;
-    }
-  } else {
-    start = 1;
-    end = *n - 1;
-  }
-  for (int i = start; i < end; i++)
-  {
-    char c = src[i];
-    if (escape) {
-      switch (c) {
-      case '"':
-      case '\\':
-      case '/':
-        dst[idx++] = c;
-        escape = false;
-        break;
-      case 'b':
-        dst[idx++] = '\b';
-        break;
-      case 'f':
-        dst[idx++] = '\f';
-        break;
-      case 'n':
-        dst[idx++] = '\n';
-        break;
-      case 'r':
-        dst[idx++] = '\r';
-        break;
-      case 't':
-        dst[idx++] = '\t';
-        break;
-      case 'x':
-        {
-          char n1 = toupper(src[i+1]);
-          char n2 = n1 ? toupper(src[i+2]) : 0;
-          if (!n2) {
-            return pn_parser_err(parser, PN_ERR, "truncated escape code");
-          }
-          int d1 = isdigit(n1) ? n1 - '0' : n1 - 'A' + 10;
-          int d2 = isdigit(n2) ? n2 - '0' : n2 - 'A' + 10;
-          dst[idx++] = d1*16 + d2;
-          i += 2;
-        }
-        break;
-      // XXX: need to handle unicode escapes: 'u'
-      default:
-        return pn_parser_err(parser, PN_ERR, "unrecognized escape code");
-      }
-      escape = false;
-    } else {
-      switch (c)
-      {
-      case '\\':
-        escape = true;
-        break;
-      default:
-        dst[idx++] = c;
-        break;
-      }
-    }
-  }
-  dst[idx++] = '\0';
-  *n = idx;
-  return 0;
-}
-
-static int pni_parser_value(pn_parser_t *parser, pn_data_t *data)
-{
-  int err;
-  size_t n;
-  char *dst;
-
-  pn_token_t tok = pni_parser_token(parser);
-
-  switch (tok.type)
-  {
-  case PN_TOK_AT:
-    return pni_parser_descriptor(parser, data);
-  case PN_TOK_LBRACE:
-    return pni_parser_map(parser, data);
-  case PN_TOK_LBRACKET:
-    return pni_parser_list(parser, data);
-  case PN_TOK_BINARY:
-  case PN_TOK_SYMBOL:
-  case PN_TOK_STRING:
-    n = tok.size;
-    pni_parser_ensure(parser, n);
-    dst = parser->atoms + parser->size;
-    err = pni_parser_unquote(parser, dst, tok.start, &n);
-    if (err) return err;
-    parser->size += n;
-    switch (tok.type) {
-    case PN_TOK_BINARY:
-      err = pn_data_put_binary(data, pn_bytes(n - 1, dst));
-      break;
-    case PN_TOK_STRING:
-      err = pn_data_put_string(data, pn_bytes(n - 1, dst));
-      break;
-    case PN_TOK_SYMBOL:
-      err = pn_data_put_symbol(data, pn_bytes(n - 1, dst));
-      break;
-    default:
-      return pn_parser_err(parser, PN_ERR, "internal error");
-    }
-    if (err) return pn_parser_err(parser, err, "error writing string/binary/symbol");
-    return pni_parser_shift(parser);
-  case PN_TOK_POS:
-  case PN_TOK_NEG:
-  case PN_TOK_FLOAT:
-  case PN_TOK_INT:
-    return pni_parser_number(parser, data);
-  case PN_TOK_TRUE:
-    err = pn_data_put_bool(data, true);
-    if (err) return pn_parser_err(parser, err, "error writing boolean");
-    return pni_parser_shift(parser);
-  case PN_TOK_FALSE:
-    err = pn_data_put_bool(data, false);
-    if (err) return pn_parser_err(parser, err, "error writing boolean");
-    return pni_parser_shift(parser);
-  case PN_TOK_NULL:
-    err = pn_data_put_null(data);
-    if (err) return pn_parser_err(parser, err, "error writing null");
-    return pni_parser_shift(parser);
-  default:
-    return pn_parser_err(parser, PN_ERR, "expecting one of '[', '{', STRING, "
-                         "SYMBOL, BINARY, true, false, null, NUMBER");
-  }
-}
-
-static int pni_parser_parse_r(pn_parser_t *parser, pn_data_t *data)
-{
-  while (true) {
-    int err;
-    switch (pni_parser_token(parser).type)
-    {
-    case PN_TOK_EOS:
-      return 0;
-    case PN_TOK_ERR:
-      return PN_ERR;
-    default:
-      err = pni_parser_value(parser, data);
-      if (err) return err;
-    }
-  }
-}
-
-int pn_parser_parse(pn_parser_t *parser, const char *str, pn_data_t *data)
-{
-  int err = pn_scanner_start(parser->scanner, str);
-  if (err) return err;
-  parser->size = 0;
-  return pni_parser_parse_r(parser, data);
-}
diff --git a/proton-c/src/extra/scanner.c b/proton-c/src/extra/scanner.c
deleted file mode 100644
index beb7322..0000000
--- a/proton-c/src/extra/scanner.c
+++ /dev/null
@@ -1,399 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "scanner.h"
-
-#include "platform/platform.h"
-
-#include <proton/error.h>
-#ifndef __cplusplus
-#include <stdbool.h>
-#endif
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#define ERROR_SIZE (1024)
-
-struct pn_scanner_t {
-  const char *input;
-  const char *position;
-  pn_token_t token;
-  char *atoms;
-  size_t size;
-  size_t capacity;
-  pn_error_t *error;
-};
-
-static const char *pni_token_type(pn_token_type_t type)
-{
-  switch (type)
-  {
-  case PN_TOK_LBRACE: return "LBRACE";
-  case PN_TOK_RBRACE: return "RBRACE";
-  case PN_TOK_LBRACKET: return "LBRACKET";
-  case PN_TOK_RBRACKET: return "RBRACKET";
-  case PN_TOK_EQUAL: return "EQUAL";
-  case PN_TOK_COMMA: return "COMMA";
-  case PN_TOK_POS: return "POS";
-  case PN_TOK_NEG: return "NEG";
-  case PN_TOK_DOT: return "DOT";
-  case PN_TOK_AT: return "AT";
-  case PN_TOK_DOLLAR: return "DOLLAR";
-  case PN_TOK_BINARY: return "BINARY";
-  case PN_TOK_STRING: return "STRING";
-  case PN_TOK_SYMBOL: return "SYMBOL";
-  case PN_TOK_ID: return "ID";
-  case PN_TOK_FLOAT: return "FLOAT";
-  case PN_TOK_INT: return "INT";
-  case PN_TOK_TRUE: return "TRUE";
-  case PN_TOK_FALSE: return "FALSE";
-  case PN_TOK_NULL: return "NULL";
-  case PN_TOK_EOS: return "EOS";
-  case PN_TOK_ERR: return "ERR";
-  default: return "<UNKNOWN>";
-  }
-}
-
-pn_scanner_t *pn_scanner()
-{
-  pn_scanner_t *scanner = (pn_scanner_t *) malloc(sizeof(pn_scanner_t));
-  if (scanner) {
-    scanner->input = NULL;
-    scanner->error = pn_error();
-  }
-  return scanner;
-}
-
-void pn_scanner_free(pn_scanner_t *scanner)
-{
-  if (scanner) {
-    pn_error_free(scanner->error);
-    free(scanner);
-  }
-}
-
-pn_token_t pn_scanner_token(pn_scanner_t *scanner)
-{
-  if (scanner) {
-    return scanner->token;
-  } else {
-    pn_token_t tok = {PN_TOK_ERR, 0, (size_t)0};
-    return tok;
-  }
-}
-
-void pn_scanner_line_info(pn_scanner_t *scanner, int *line, int *col)
-{
-  *line = 1;
-  *col = 0;
-
-  for (const char *c = scanner->input; *c && c <= scanner->token.start; c++) {
-    if (*c == '\n') {
-      *line += 1;
-      *col = -1;
-    } else {
-      *col += 1;
-    }
-  }
-}
-
-int pn_scanner_err(pn_scanner_t *scanner, int code, const char *fmt, ...)
-{
-  va_list ap;
-  va_start(ap, fmt);
-  int err = pn_scanner_verr(scanner, code, fmt, ap);
-  va_end(ap);
-  return err;
-}
-
-int pn_scanner_verr(pn_scanner_t *scanner, int code, const char *fmt, va_list ap)
-{
-  char error[ERROR_SIZE];
-
-  int line, col;
-  pn_scanner_line_info(scanner, &line, &col);
-  int size = scanner->token.size;
-  int ln = pni_snprintf(error, ERROR_SIZE,
-                    "input line %i column %i %s:'%.*s': ", line, col,
-                    pni_token_type(scanner->token.type),
-                    size, scanner->token.start);
-  if (ln >= ERROR_SIZE) {
-    return pn_scanner_err(scanner, code, "error info truncated");
-  } else if (ln < 0) {
-    error[0] = '\0';
-  }
-
-  int n = pni_snprintf(error + ln, ERROR_SIZE - ln, fmt, ap);
-
-  if (n >= ERROR_SIZE - ln) {
-    return pn_scanner_err(scanner, code, "error info truncated");
-  } else if (n < 0) {
-    error[0] = '\0';
-  }
-
-  return pn_error_set(scanner->error, code, error);
-}
-
-int pn_scanner_errno(pn_scanner_t *scanner)
-{
-  return pn_error_code(scanner->error);
-}
-
-const char *pn_scanner_error(pn_scanner_t *scanner)
-{
-  return pn_error_text(scanner->error);
-}
-
-static void pni_scanner_emit(pn_scanner_t *scanner, pn_token_type_t type, const char *start, size_t size)
-{
-  scanner->token.type = type;
-  scanner->token.start = start;
-  scanner->token.size = size;
-}
-
-static int pni_scanner_quoted(pn_scanner_t *scanner, const char *str, int start,
-                      pn_token_type_t type)
-{
-  bool escape = false;
-
-  for (int i = start; true; i++) {
-    char c = str[i];
-    if (escape) {
-      escape = false;
-    } else {
-      switch (c) {
-      case '\0':
-      case '"':
-        pni_scanner_emit(scanner, c ? type : PN_TOK_ERR,
-                        str, c ? i + 1 : i);
-        return c ? 0 : pn_scanner_err(scanner, PN_ERR, "missmatched quote");
-      case '\\':
-        escape = true;
-        break;
-      }
-    }
-  }
-}
-
-static int pni_scanner_binary(pn_scanner_t *scanner, const char *str)
-{
-  return pni_scanner_quoted(scanner, str, 2, PN_TOK_BINARY);
-}
-
-static int pni_scanner_string(pn_scanner_t *scanner, const char *str)
-{
-  return pni_scanner_quoted(scanner, str, 1, PN_TOK_STRING);
-}
-
-static int pni_scanner_alpha_end(pn_scanner_t *scanner, const char *str, int start)
-{
-  for (int i = start; true; i++) {
-    char c = str[i];
-    if (!((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))) {
-      return i;
-    }
-  }
-}
-
-static int pni_scanner_alpha(pn_scanner_t *scanner, const char *str)
-{
-  int n = pni_scanner_alpha_end(scanner, str, 0);
-  pn_token_type_t type;
-  if (!strncmp(str, "true", n)) {
-    type = PN_TOK_TRUE;
-  } else if (!strncmp(str, "false", n)) {
-    type = PN_TOK_FALSE;
-  } else if (!strncmp(str, "null", n)) {
-    type = PN_TOK_NULL;
-  } else {
-    type = PN_TOK_ID;
-  }
-
-  pni_scanner_emit(scanner, type, str, n);
-  return 0;
-}
-
-static int pni_scanner_symbol(pn_scanner_t *scanner, const char *str)
-{
-  char c = str[1];
-
-  if (c == '"') {
-    return pni_scanner_quoted(scanner, str, 2, PN_TOK_SYMBOL);
-  } else {
-    int n = pni_scanner_alpha_end(scanner, str, 1);
-    pni_scanner_emit(scanner, PN_TOK_SYMBOL, str, n);
-    return 0;
-  }
-}
-
-static int pni_scanner_number(pn_scanner_t *scanner, const char *str)
-{
-  bool dot = false;
-  bool exp = false;
-
-  int i = 0;
-
-  if (str[i] == '+' || str[i] == '-') {
-    i++;
-  }
-
-  for ( ; true; i++) {
-    char c = str[i];
-    switch (c) {
-    case '0': case '1': case '2': case '3': case '4': case '5': case '6':
-    case '7': case '8': case '9':
-      continue;
-    case '.':
-      if (dot) {
-        pni_scanner_emit(scanner, PN_TOK_FLOAT, str, i);
-        return 0;
-      } else {
-        dot = true;
-      }
-      continue;
-    case 'e':
-    case 'E':
-      if (exp) {
-        pni_scanner_emit(scanner, PN_TOK_FLOAT, str, i);
-        return 0;
-      } else {
-        dot = true;
-        exp = true;
-        if (str[i+1] == '+' || str[i+1] == '-') {
-          i++;
-        }
-        continue;
-      }
-    default:
-      if (dot || exp) {
-        pni_scanner_emit(scanner, PN_TOK_FLOAT, str, i);
-        return 0;
-      } else {
-        pni_scanner_emit(scanner, PN_TOK_INT, str, i);
-        return 0;
-      }
-    }
-  }
-}
-
-static int pni_scanner_single(pn_scanner_t *scanner, const char *str, pn_token_type_t type)
-{
-  pni_scanner_emit(scanner, type, str, 1);
-  return 0;
-}
-
-int pn_scanner_start(pn_scanner_t *scanner, const char *input)
-{
-  if (!scanner || !input) return PN_ARG_ERR;
-  scanner->input = input;
-  scanner->position = input;
-  return pn_scanner_scan(scanner);
-}
-
-int pn_scanner_scan(pn_scanner_t *scanner)
-{
-  const char *str = scanner->position;
-  char n;
-
-  for (char c; true; str++) {
-    c = *str;
-    switch (c)
-    {
-    case '{':
-      return pni_scanner_single(scanner, str, PN_TOK_LBRACE);
-    case '}':
-      return pni_scanner_single(scanner, str, PN_TOK_RBRACE);
-    case'[':
-      return pni_scanner_single(scanner, str, PN_TOK_LBRACKET);
-    case ']':
-      return pni_scanner_single(scanner, str, PN_TOK_RBRACKET);
-    case '=':
-      return pni_scanner_single(scanner, str, PN_TOK_EQUAL);
-    case ',':
-      return pni_scanner_single(scanner, str, PN_TOK_COMMA);
-    case '.':
-      n = *(str+1);
-      if ((n >= '0' && n <= '9')) {
-        return pni_scanner_number(scanner, str);
-      } else {
-        return pni_scanner_single(scanner, str, PN_TOK_DOT);
-      }
-    case '@':
-      return pni_scanner_single(scanner, str, PN_TOK_AT);
-    case '$':
-      return pni_scanner_single(scanner, str, PN_TOK_DOLLAR);
-    case '-':
-      n = *(str+1);
-      if ((n >= '0' && n <= '9') || n == '.') {
-        return pni_scanner_number(scanner, str);
-      } else {
-        return pni_scanner_single(scanner, str, PN_TOK_NEG);
-      }
-    case '+':
-      n = *(str+1);
-      if ((n >= '0' && n <= '9') || n == '.') {
-        return pni_scanner_number(scanner, str);
-      } else {
-        return pni_scanner_single(scanner, str, PN_TOK_POS);
-      }
-    case ' ': case '\t': case '\r': case '\v': case '\f': case '\n':
-      break;
-    case '0': case '1': case '2': case '3': case '4': case '5': case '6':
-    case '7': case '8': case '9':
-      return pni_scanner_number(scanner, str);
-    case ':':
-      return pni_scanner_symbol(scanner, str);
-    case '"':
-      return pni_scanner_string(scanner, str);
-    case 'b':
-      if (str[1] == '"') {
-        return pni_scanner_binary(scanner, str);
-      }
-    case 'a': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h':
-    case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': case 'o':
-    case 'p': case 'q': case 'r': case 's': case 't': case 'u': case 'v':
-    case 'w': case 'x': case 'y': case 'z': case 'A': case 'B': case 'C':
-    case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J':
-    case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q':
-    case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
-    case 'Y': case 'Z':
-      return pni_scanner_alpha(scanner, str);
-    case '\0':
-      pni_scanner_emit(scanner, PN_TOK_EOS, str, 0);
-      return PN_EOS;
-    default:
-      pni_scanner_emit(scanner, PN_TOK_ERR, str, 1);
-      return pn_scanner_err(scanner, PN_ERR, "illegal character");
-    }
-  }
-}
-
-int pn_scanner_shift(pn_scanner_t *scanner)
-{
-  scanner->position = scanner->token.start + scanner->token.size;
-  int err = pn_scanner_scan(scanner);
-  if (err == PN_EOS) {
-    return 0;
-  } else {
-    return err;
-  }
-}
diff --git a/proton-c/src/extra/scanner.h b/proton-c/src/extra/scanner.h
deleted file mode 100644
index 218babe..0000000
--- a/proton-c/src/extra/scanner.h
+++ /dev/null
@@ -1,74 +0,0 @@
-#ifndef PROTON_SCANNER_H
-#define PROTON_SCANNER_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <stddef.h>
-#include <stdarg.h>
-
-typedef enum {
-  PN_TOK_LBRACE,
-  PN_TOK_RBRACE,
-  PN_TOK_LBRACKET,
-  PN_TOK_RBRACKET,
-  PN_TOK_EQUAL,
-  PN_TOK_COMMA,
-  PN_TOK_POS,
-  PN_TOK_NEG,
-  PN_TOK_DOT,
-  PN_TOK_AT,
-  PN_TOK_DOLLAR,
-  PN_TOK_BINARY,
-  PN_TOK_STRING,
-  PN_TOK_SYMBOL,
-  PN_TOK_ID,
-  PN_TOK_FLOAT,
-  PN_TOK_INT,
-  PN_TOK_TRUE,
-  PN_TOK_FALSE,
-  PN_TOK_NULL,
-  PN_TOK_EOS,
-  PN_TOK_ERR
-} pn_token_type_t;
-
-typedef struct pn_scanner_t pn_scanner_t;
-
-typedef struct {
-  pn_token_type_t type;
-  const char *start;
-  size_t size;
-} pn_token_t;
-
-PN_EXTERN pn_scanner_t *pn_scanner(void);
-PN_EXTERN void pn_scanner_free(pn_scanner_t *scanner);
-PN_EXTERN pn_token_t pn_scanner_token(pn_scanner_t *scanner);
-PN_EXTERN int pn_scanner_err(pn_scanner_t *scanner, int code, const char *fmt, ...);
-PN_EXTERN int pn_scanner_verr(pn_scanner_t *scanner, int code, const char *fmt, va_list ap);
-PN_EXTERN void pn_scanner_line_info(pn_scanner_t *scanner, int *line, int *col);
-PN_EXTERN int pn_scanner_errno(pn_scanner_t *scanner);
-PN_EXTERN const char *pn_scanner_error(pn_scanner_t *scanner);
-PN_EXTERN int pn_scanner_start(pn_scanner_t *scanner, const char *input);
-PN_EXTERN int pn_scanner_scan(pn_scanner_t *scanner);
-PN_EXTERN int pn_scanner_shift(pn_scanner_t *scanner);
-
-#endif /* scanner.h */
diff --git a/proton-c/src/extra/url.c b/proton-c/src/extra/url.c
deleted file mode 100644
index c1ce628..0000000
--- a/proton-c/src/extra/url.c
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/url.h"
-#include "proton/object.h"
-
-#include "core/util.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-
-/** URL-encode src and append to dst. */
-static void pni_urlencode(pn_string_t *dst, const char* src) {
-    static const char *bad = "@:/";
-
-    if (!src) return;
-    const char *i = src;
-    const char *j = strpbrk(i, bad);
-    while (j) {
-        pn_string_addf(dst, "%.*s", (int)(j-i), i);
-        pn_string_addf(dst, "%%%02X", (int)*j);
-        i = j + 1;
-        j = strpbrk(i, bad);
-    }
-    pn_string_addf(dst, "%s", i);
-}
-
-// Low level url parser
-static void pni_urldecode(const char *src, char *dst)
-{
-  const char *in = src;
-  char *out = dst;
-  while (*in != '\0')
-  {
-    if ('%' == *in)
-    {
-      if ((in[1] != '\0') && (in[2] != '\0'))
-      {
-        char esc[3];
-        esc[0] = in[1];
-        esc[1] = in[2];
-        esc[2] = '\0';
-        unsigned long d = strtoul(esc, NULL, 16);
-        *out = (char)d;
-        in += 3;
-        out++;
-      }
-      else
-      {
-        *out = *in;
-        in++;
-        out++;
-      }
-    }
-    else
-    {
-      *out = *in;
-      in++;
-      out++;
-    }
-  }
-  *out = '\0';
-}
-
-void pni_parse_url(char *url, char **scheme, char **user, char **pass, char **host, char **port, char **path)
-{
-  if (!url) return;
-
-  char *slash = strchr(url, '/');
-
-  if (slash && slash>url) {
-    char *scheme_end = strstr(slash-1, "://");
-
-    if (scheme_end && scheme_end<slash) {
-      *scheme_end = '\0';
-      *scheme = url;
-      url = scheme_end + 3;
-      slash = strchr(url, '/');
-    }
-  }
-
-  if (slash) {
-    *slash = '\0';
-    *path = slash + 1;
-  }
-
-  char *at = strchr(url, '@');
-  if (at) {
-    *at = '\0';
-    char *up = url;
-    *user = up;
-    url = at + 1;
-    char *colon = strchr(up, ':');
-    if (colon) {
-      *colon = '\0';
-      *pass = colon + 1;
-    }
-  }
-
-  *host = url;
-  char *open = (*url == '[') ? url : 0;
-  if (open) {
-    char *close = strchr(open, ']');
-    if (close) {
-        *host = open + 1;
-        *close = '\0';
-        url = close + 1;
-    }
-  }
-
-  char *colon = strchr(url, ':');
-  if (colon) {
-    *colon = '\0';
-    *port = colon + 1;
-  }
-
-  if (*user) pni_urldecode(*user, *user);
-  if (*pass) pni_urldecode(*pass, *pass);
-}
-
-struct pn_url_t {
-    char *scheme;
-    char *username;
-    char *password;
-    char *host;
-    char *port;
-    char *path;
-    pn_string_t *str;
-};
-
-/** Internal use only, returns the pn_string_t. Public function is pn_url_str() */
-static pn_string_t *pn_url_string(pn_url_t* url)
-{
-    pn_url_str(url);               /* Make sure str is up to date */
-    return url->str;
-}
-
-static void pn_url_finalize(void *object)
-{
-    pn_url_t *url = (pn_url_t *) object;
-    pn_url_clear(url);
-    pn_free(url->str);
-}
-
-static uintptr_t pn_url_hashcode(void *object)
-{
-    pn_url_t *url = (pn_url_t *) object;
-    return pn_hashcode(pn_url_string(url));
-}
-
-static intptr_t pn_url_compare(void *oa, void *ob)
-{
-    pn_url_t *a = (pn_url_t *) oa;
-    pn_url_t *b = (pn_url_t *) ob;
-    return pn_compare(pn_url_string(a), pn_url_string(b));
-}
-
-
-static int pn_url_inspect(void *obj, pn_string_t *dst)
-{
-    pn_url_t *url = (pn_url_t *) obj;
-    int err = 0;
-    err = pn_string_addf(dst, "Url("); if (err) return err;
-    err = pn_inspect(pn_url_string(url), dst); if (err) return err;
-    return pn_string_addf(dst, ")");
-}
-
-#define pn_url_initialize NULL
-
-
-pn_url_t *pn_url() {
-    static const pn_class_t clazz = PN_CLASS(pn_url);
-    pn_url_t *url = (pn_url_t*) pn_class_new(&clazz, sizeof(pn_url_t));
-    if (!url) return NULL;
-    memset(url, 0, sizeof(*url));
-    url->str = pn_string(NULL);
-    return url;
-}
-
-/** Parse a string URL as a pn_url_t.
- *@param[in] url A URL string.
- *@return The parsed pn_url_t or NULL if url is not a valid URL string.
- */
-pn_url_t *pn_url_parse(const char *str) {
-    if (!str || !*str)          /* Empty string or NULL is illegal. */
-        return NULL;
-
-    pn_url_t *url = pn_url();
-    char *str2 = pn_strdup(str);
-    pni_parse_url(str2, &url->scheme, &url->username, &url->password, &url->host, &url->port, &url->path);
-    url->scheme = pn_strdup(url->scheme);
-    url->username = pn_strdup(url->username);
-    url->password = pn_strdup(url->password);
-    url->host = (url->host && !*url->host) ? NULL : pn_strdup(url->host);
-    url->port = pn_strdup(url->port);
-    url->path = pn_strdup(url->path);
-
-    free(str2);
-    return url;
-}
-
-/** Free a URL */
-void pn_url_free(pn_url_t *url) { pn_free(url); }
-
-/** Clear the contents of the URL. */
-void pn_url_clear(pn_url_t *url) {
-    pn_url_set_scheme(url, NULL);
-    pn_url_set_username(url, NULL);
-    pn_url_set_password(url, NULL);
-    pn_url_set_host(url, NULL);
-    pn_url_set_port(url, NULL);
-    pn_url_set_path(url, NULL);
-    pn_string_clear(url->str);
-}
-
-/** Return the string form of a URL. */
-const char *pn_url_str(pn_url_t *url) {
-    if (pn_string_get(url->str) == NULL) {
-        pn_string_set(url->str, "");
-        if (url->scheme) pn_string_addf(url->str, "%s://", url->scheme);
-        if (url->username) pni_urlencode(url->str, url->username);
-        if (url->password) {
-            pn_string_addf(url->str, ":");
-            pni_urlencode(url->str, url->password);
-        }
-        if (url->username || url->password) pn_string_addf(url->str, "@");
-        if (url->host) {
-            if (strchr(url->host, ':')) pn_string_addf(url->str, "[%s]", url->host);
-            else pn_string_addf(url->str, "%s", url->host);
-        }
-        if (url->port) pn_string_addf(url->str, ":%s", url->port);
-        if (url->path) pn_string_addf(url->str, "/%s", url->path);
-    }
-    return pn_string_get(url->str);
-}
-
-const char *pn_url_get_scheme(pn_url_t *url) { return url->scheme; }
-const char *pn_url_get_username(pn_url_t *url) { return url->username; }
-const char *pn_url_get_password(pn_url_t *url) { return url->password; }
-const char *pn_url_get_host(pn_url_t *url) { return url->host; }
-const char *pn_url_get_port(pn_url_t *url) { return url->port; }
-const char *pn_url_get_path(pn_url_t *url) { return url->path; }
-
-#define SET(part) free(url->part); url->part = pn_strdup(part); pn_string_clear(url->str)
-void pn_url_set_scheme(pn_url_t *url, const char *scheme) { SET(scheme); }
-void pn_url_set_username(pn_url_t *url, const char *username) { SET(username); }
-void pn_url_set_password(pn_url_t *url, const char *password) { SET(password); }
-void pn_url_set_host(pn_url_t *url, const char *host) { SET(host); }
-void pn_url_set_port(pn_url_t *url, const char *port) { SET(port); }
-void pn_url_set_path(pn_url_t *url, const char *path) { SET(path); }
-
-
diff --git a/proton-c/src/handlers/flowcontroller.c b/proton-c/src/handlers/flowcontroller.c
deleted file mode 100644
index d7cc3b9..0000000
--- a/proton-c/src/handlers/flowcontroller.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/link.h>
-#include <proton/handlers.h>
-#include <assert.h>
-
-typedef struct {
-  int window;
-  int drained;
-} pni_flowcontroller_t;
-
-pni_flowcontroller_t *pni_flowcontroller(pn_handler_t *handler) {
-  return (pni_flowcontroller_t *) pn_handler_mem(handler);
-}
-
-static void pni_topup(pn_link_t *link, int window) {
-  int delta = window - pn_link_credit(link);
-  pn_link_flow(link, delta);
-}
-
-static void pn_flowcontroller_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) {
-  pni_flowcontroller_t *fc = pni_flowcontroller(handler);
-  int window = fc->window;
-  pn_link_t *link = pn_event_link(event);
-
-  switch (pn_event_type(event)) {
-  case PN_LINK_LOCAL_OPEN:
-  case PN_LINK_REMOTE_OPEN:
-  case PN_LINK_FLOW:
-  case PN_DELIVERY:
-    if (pn_link_is_receiver(link)) {
-      fc->drained += pn_link_drained(link);
-      if (!fc->drained) {
-        pni_topup(link, window);
-      }
-    }
-    break;
-  default:
-    break;
-  }
-}
-
-pn_flowcontroller_t *pn_flowcontroller(int window) {
-  // XXX: a window of 1 doesn't work because we won't necessarily get
-  // notified when the one allowed delivery is settled
-  assert(window > 1);
-  pn_flowcontroller_t *handler = pn_handler_new(pn_flowcontroller_dispatch, sizeof(pni_flowcontroller_t), NULL);
-  pni_flowcontroller_t *fc = pni_flowcontroller(handler);
-  fc->window = window;
-  fc->drained = 0;
-  return handler;
-}
diff --git a/proton-c/src/handlers/handshaker.c b/proton-c/src/handlers/handshaker.c
deleted file mode 100644
index ea406c1..0000000
--- a/proton-c/src/handlers/handshaker.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/connection.h>
-#include <proton/session.h>
-#include <proton/link.h>
-#include <proton/handlers.h>
-#include <assert.h>
-
-typedef struct {
-  pn_map_t *handlers;
-} pni_handshaker_t;
-
-pni_handshaker_t *pni_handshaker(pn_handler_t *handler) {
-  return (pni_handshaker_t *) pn_handler_mem(handler);
-}
-
-static void pn_handshaker_finalize(pn_handler_t *handler) {
-  pni_handshaker_t *handshaker = pni_handshaker(handler);
-  pn_free(handshaker->handlers);
-}
-
-static void pn_handshaker_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) {
-  switch (type) {
-  case PN_CONNECTION_REMOTE_OPEN:
-    {
-      pn_connection_t *conn = pn_event_connection(event);
-      if (pn_connection_state(conn) & PN_LOCAL_UNINIT) {
-        pn_connection_open(conn);
-      }
-    }
-    break;
-  case PN_SESSION_REMOTE_OPEN:
-    {
-      pn_session_t *ssn = pn_event_session(event);
-      if (pn_session_state(ssn) & PN_LOCAL_UNINIT) {
-        pn_session_open(ssn);
-      }
-    }
-    break;
-  case PN_LINK_REMOTE_OPEN:
-    {
-      pn_link_t *link = pn_event_link(event);
-      if (pn_link_state(link) & PN_LOCAL_UNINIT) {
-        pn_terminus_copy(pn_link_source(link), pn_link_remote_source(link));
-        pn_terminus_copy(pn_link_target(link), pn_link_remote_target(link));
-        pn_link_open(link);
-      }
-    }
-    break;
-  case PN_CONNECTION_REMOTE_CLOSE:
-    {
-      pn_connection_t *conn = pn_event_connection(event);
-      if (!(pn_connection_state(conn) & PN_LOCAL_CLOSED)) {
-        pn_connection_close(conn);
-      }
-    }
-    break;
-  case PN_SESSION_REMOTE_CLOSE:
-    {
-      pn_session_t *ssn = pn_event_session(event);
-      if (!(pn_session_state(ssn) & PN_LOCAL_CLOSED)) {
-        pn_session_close(ssn);
-      }
-    }
-    break;
-  case PN_LINK_REMOTE_CLOSE:
-    {
-      pn_link_t *link = pn_event_link(event);
-      if (!(pn_link_state(link) & PN_LOCAL_CLOSED)) {
-        pn_link_close(link);
-      }
-    }
-    break;
-  default:
-    break;
-  }
-}
-
-pn_handshaker_t *pn_handshaker(void) {
-  pn_handler_t *handler = pn_handler_new(pn_handshaker_dispatch, sizeof(pni_handshaker_t), pn_handshaker_finalize);
-  pni_handshaker_t *handshaker = pni_handshaker(handler);
-  handshaker->handlers = NULL;
-  return handler;
-}
diff --git a/proton-c/src/handlers/iohandler.c b/proton-c/src/handlers/iohandler.c
deleted file mode 100644
index db18c0c..0000000
--- a/proton-c/src/handlers/iohandler.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "reactor/io.h"
-#include "reactor/reactor.h"
-#include "reactor/selector.h"
-
-#include <proton/handlers.h>
-#include <proton/transport.h>
-#include <assert.h>
-
-static const char pni_selector_handle = 0;
-
-#define PN_SELECTOR ((pn_handle_t) &pni_selector_handle)
-
-void pni_handle_quiesced(pn_reactor_t *reactor, pn_selector_t *selector) {
-  // check if we are still quiesced, other handlers of
-  // PN_REACTOR_QUIESCED could have produced more events to process
-  if (!pn_reactor_quiesced(reactor)) { return; }
-  pn_selector_select(selector, pn_reactor_get_timeout(reactor));
-  pn_selectable_t *sel;
-  int events;
-  pn_reactor_mark(reactor);
-  while ((sel = pn_selector_next(selector, &events))) {
-    if (events & PN_READABLE) {
-      pn_selectable_readable(sel);
-    }
-    if (events & PN_WRITABLE) {
-      pn_selectable_writable(sel);
-    }
-    if (events & PN_EXPIRED) {
-      pn_selectable_expired(sel);
-    }
-    if (events & PN_ERROR) {
-      pn_selectable_error(sel);
-    }
-  }
-  pn_reactor_yield(reactor);
-}
-
-void pni_handle_transport(pn_reactor_t *reactor, pn_event_t *event);
-void pni_handle_open(pn_reactor_t *reactor, pn_event_t *event);
-void pni_handle_bound(pn_reactor_t *reactor, pn_event_t *event);
-
-static void pn_iodispatch(pn_iohandler_t *handler, pn_event_t *event, pn_event_type_t type) {
-  pn_reactor_t *reactor = pn_event_reactor(event);
-  pn_record_t *record = pn_reactor_attachments(reactor);
-  pn_selector_t *selector = (pn_selector_t *) pn_record_get(record, PN_SELECTOR);
-  if (!selector) {
-    selector = pn_io_selector(pni_reactor_io(reactor));
-    pn_record_def(record, PN_SELECTOR, PN_OBJECT);
-    pn_record_set(record, PN_SELECTOR, selector);
-    pn_decref(selector);
-  }
-  switch (type) {
-  case PN_SELECTABLE_INIT:
-    {
-      pn_selectable_t *sel = (pn_selectable_t *) pn_event_context(event);
-      pn_selector_add(selector, sel);
-    }
-    break;
-  case PN_SELECTABLE_UPDATED:
-    {
-      pn_selectable_t *sel = (pn_selectable_t *) pn_event_context(event);
-      pn_selector_update(selector, sel);
-    }
-    break;
-  case PN_SELECTABLE_FINAL:
-    {
-      pn_selectable_t *sel = (pn_selectable_t *) pn_event_context(event);
-      pn_selector_remove(selector, sel);
-      pn_selectable_release(sel);
-    }
-    break;
-  case PN_CONNECTION_LOCAL_OPEN:
-    pni_handle_open(reactor, event);
-    break;
-  case PN_CONNECTION_BOUND:
-    pni_handle_bound(reactor, event);
-    break;
-  case PN_TRANSPORT:
-    pni_handle_transport(reactor, event);
-    break;
-  case PN_TRANSPORT_CLOSED:
-    pn_transport_unbind(pn_event_transport(event));
-    break;
-  case PN_REACTOR_QUIESCED:
-    pni_handle_quiesced(reactor, selector);
-    break;
-  default:
-    break;
-  }
-}
-
-pn_iohandler_t *pn_iohandler(void) {
-  return pn_handler(pn_iodispatch);
-}
diff --git a/proton-c/src/libqpid-proton-core.pc.in b/proton-c/src/libqpid-proton-core.pc.in
deleted file mode 100644
index ff99108..0000000
--- a/proton-c/src/libqpid-proton-core.pc.in
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-prefix=@PREFIX@
-exec_prefix=@EXEC_PREFIX@
-libdir=@LIBDIR@
-includedir=@INCLUDEDIR@
-
-Name: Proton Core
-Description: Qpid Proton C core protocol library
-Version: @PN_VERSION@
-URL: http://qpid.apache.org/proton/
-Libs: -L${libdir} -lqpid-proton-core
-Cflags: -I${includedir}
diff --git a/proton-c/src/libqpid-proton.pc.in b/proton-c/src/libqpid-proton.pc.in
deleted file mode 100644
index a045c3f..0000000
--- a/proton-c/src/libqpid-proton.pc.in
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-prefix=@PREFIX@
-exec_prefix=@EXEC_PREFIX@
-libdir=@LIBDIR@
-includedir=@INCLUDEDIR@
-
-Name: Proton
-Description: Qpid Proton C library
-Version: @PN_VERSION@
-URL: http://qpid.apache.org/proton/
-Libs: -L${libdir} -lqpid-proton
-Cflags: -I${includedir}
diff --git a/proton-c/src/messaging.xml b/proton-c/src/messaging.xml
deleted file mode 100644
index 01c34e7..0000000
--- a/proton-c/src/messaging.xml
+++ /dev/null
@@ -1,168 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-Copyright Bank of America, N.A., Barclays Bank PLC, Cisco Systems, Credit
-Suisse, Deutsche Boerse, Envoy Technologies Inc., Goldman Sachs, HCL
-Technologies Ltd, IIT Software GmbH, iMatix Corporation, INETCO Systems Limited,
-Informatica Corporation, JPMorgan Chase & Co., Kaazing Corporation, N.A,
-Microsoft Corporation, my-Channels, Novell, Progress Software, Red Hat Inc.,
-Software AG, Solace Systems Inc., StormMQ Ltd., Tervela Inc., TWIST Process
-Innovations Ltd, VMware, Inc., and WS02 Inc. 2006-2011. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-3. The name of the author may not be used to endorse or promote products
-derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--->
-
-<amqp name="messaging" xmlns="http://www.amqp.org/schema/amqp.xsd">
-  <section name="message-format">
-    <type name="header" class="composite" source="list" provides="section">
-      <descriptor name="amqp:header:list" code="0x00000000:0x00000070"/>
-      <field name="durable" type="boolean"/>
-      <field name="priority" type="ubyte"/>
-      <field name="ttl" type="milliseconds"/>
-      <field name="first-acquirer" type="boolean"/>
-      <field name="delivery-count" type="uint"/>
-    </type>
-    <type name="delivery-annotations" class="restricted" source="annotations" provides="section">
-      <descriptor name="amqp:delivery-annotations:map" code="0x00000000:0x00000071"/>
-    </type>
-    <type name="message-annotations" class="restricted" source="annotations" provides="section">
-      <descriptor name="amqp:message-annotations:map" code="0x00000000:0x00000072"/>
-    </type>
-    <type name="properties" class="composite" source="list" provides="section">
-      <descriptor name="amqp:properties:list" code="0x00000000:0x00000073"/>
-      <field name="message-id" type="*" requires="message-id"/>
-      <field name="user-id" type="binary"/>
-      <field name="to" type="*" requires="address"/>
-      <field name="subject" type="string"/>
-      <field name="reply-to" type="*" requires="address"/>
-      <field name="correlation-id" type="*" requires="message-id"/>
-      <field name="content-type" type="symbol"/>
-      <field name="content-encoding" type="symbol"/>
-      <field name="absolute-expiry-time" type="timestamp"/>
-      <field name="creation-time" type="timestamp"/>
-      <field name="group-id" type="string"/>
-      <field name="group-sequence" type="sequence-no"/>
-      <field name="reply-to-group-id" type="string"/>
-    </type>
-    <type name="application-properties" class="restricted" source="map" provides="section">
-      <descriptor name="amqp:application-properties:map" code="0x00000000:0x00000074"/>
-    </type>
-    <type name="data" class="restricted" source="binary" provides="section">
-      <descriptor name="amqp:data:binary" code="0x00000000:0x00000075"/>
-    </type>
-    <type name="amqp-sequence" class="restricted" source="list" provides="section">
-      <descriptor name="amqp:amqp-sequence:list" code="0x00000000:0x00000076"/>
-    </type>
-    <type name="amqp-value" class="restricted" source="*" provides="section">
-      <descriptor name="amqp:amqp-value:*" code="0x00000000:0x00000077"/>
-    </type>
-    <type name="footer" class="restricted" source="annotations" provides="section">
-      <descriptor name="amqp:footer:map" code="0x00000000:0x00000078"/>
-    </type>
-    <type name="annotations" class="restricted" source="map"/>
-    <type name="message-id-ulong" class="restricted" source="ulong" provides="message-id"/>
-    <type name="message-id-uuid" class="restricted" source="uuid" provides="message-id"/>
-    <type name="message-id-binary" class="restricted" source="binary" provides="message-id"/>
-    <type name="message-id-string" class="restricted" source="string" provides="message-id"/>
-    <type name="address-string" class="restricted" source="string" provides="address"/>
-    <definition name="MESSAGE-FORMAT" value="0"/>
-  </section>
-  <section name="delivery-state">
-    <type name="received" class="composite" source="list" provides="delivery-state">
-      <descriptor name="amqp:received:list" code="0x00000000:0x00000023"/>
-      <field name="section-number" type="uint" mandatory="true"/>
-      <field name="section-offset" type="ulong" mandatory="true"/>
-    </type>
-    <type name="accepted" class="composite" source="list" provides="delivery-state, outcome">
-      <descriptor name="amqp:accepted:list" code="0x00000000:0x00000024"/>
-    </type>
-    <type name="rejected" class="composite" source="list" provides="delivery-state, outcome">
-      <descriptor name="amqp:rejected:list" code="0x00000000:0x00000025"/>
-      <field name="error" type="error"/>
-    </type>
-    <type name="released" class="composite" source="list" provides="delivery-state, outcome">
-      <descriptor name="amqp:released:list" code="0x00000000:0x00000026"/>
-    </type>
-    <type name="modified" class="composite" source="list" provides="delivery-state, outcome">
-      <descriptor name="amqp:modified:list" code="0x00000000:0x00000027"/>
-      <field name="delivery-failed" type="boolean"/>
-      <field name="undeliverable-here" type="boolean"/>
-      <field name="message-annotations" type="fields"/>
-    </type>
-  </section>
-  <section name="addressing">
-    <type name="source" class="composite" source="list" provides="source">
-      <descriptor name="amqp:source:list" code="0x00000000:0x00000028"/>
-      <field name="address" type="*" requires="address"/>
-      <field name="durable" type="terminus-durability" default="none"/>
-      <field name="expiry-policy" type="terminus-expiry-policy" default="session-end"/>
-      <field name="timeout" type="seconds" default="0"/>
-      <field name="dynamic" type="boolean" default="false"/>
-      <field name="dynamic-node-properties" type="node-properties"/>
-      <field name="distribution-mode" type="symbol" requires="distribution-mode"/>
-      <field name="filter" type="filter-set"/>
-      <field name="default-outcome" type="*" requires="outcome"/>
-      <field name="outcomes" type="symbol" multiple="true"/>
-      <field name="capabilities" type="symbol" multiple="true"/>
-    </type>
-    <type name="target" class="composite" source="list" provides="target">
-      <descriptor name="amqp:target:list" code="0x00000000:0x00000029"/>
-      <field name="address" type="*" requires="address"/>
-      <field name="durable" type="terminus-durability" default="none"/>
-      <field name="expiry-policy" type="terminus-expiry-policy" default="session-end"/>
-      <field name="timeout" type="seconds" default="0"/>
-      <field name="dynamic" type="boolean" default="false"/>
-      <field name="dynamic-node-properties" type="node-properties"/>
-      <field name="capabilities" type="symbol" multiple="true"/>
-    </type>
-    <type name="terminus-durability" class="restricted" source="uint">
-      <choice name="none" value="0"/>
-      <choice name="configuration" value="1"/>
-      <choice name="unsettled-state" value="2"/>
-    </type>
-    <type name="terminus-expiry-policy" class="restricted" source="symbol">
-      <choice name="link-detach" value="link-detach"/>
-      <choice name="session-end" value="session-end"/>
-      <choice name="connection-close" value="connection-close"/>
-      <choice name="never" value="never"/>
-    </type>
-    <type name="std-dist-mode" class="restricted" source="symbol" provides="distribution-mode">
-      <choice name="move" value="move"/>
-      <choice name="copy" value="copy"/>
-    </type>
-    <type name="filter-set" class="restricted" source="map"/>
-    <type name="node-properties" class="restricted" source="fields"/>
-    <type name="delete-on-close" class="composite" source="list" provides="lifetime-policy">
-      <descriptor name="amqp:delete-on-close:list" code="0x00000000:0x0000002b"/>
-    </type>
-    <type name="delete-on-no-links" class="composite" source="list" provides="lifetime-policy">
-      <descriptor name="amqp:delete-on-no-links:list" code="0x00000000:0x0000002c"/>
-    </type>
-    <type name="delete-on-no-messages" class="composite" source="list" provides="lifetime-policy">
-      <descriptor name="amqp:delete-on-no-messages:list" code="0x00000000:0x0000002d"/>
-    </type>
-    <type name="delete-on-no-links-or-messages" class="composite" source="list" provides="lifetime-policy">
-      <descriptor name="amqp:delete-on-no-links-or-messages:list" code="0x00000000:0x0000002e"/>
-    </type>
-  </section>
-</amqp>
diff --git a/proton-c/src/messenger/messenger.c b/proton-c/src/messenger/messenger.c
deleted file mode 100644
index 264a733..0000000
--- a/proton-c/src/messenger/messenger.c
+++ /dev/null
@@ -1,2438 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/messenger.h>
-
-#include <proton/connection.h>
-#include <proton/delivery.h>
-#include <proton/event.h>
-#include <proton/object.h>
-#include <proton/sasl.h>
-#include <proton/session.h>
-
-#include <assert.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-#include "core/log_private.h"
-#include "core/util.h"
-#include "platform/platform.h" // pn_i_getpid, pn_i_now, pni_snprintf
-#include "platform/platform_fmt.h"
-#include "store.h"
-#include "subscription.h"
-#include "transform.h"
-
-#include "reactor/io.h"
-#include "reactor/selectable.h"
-#include "reactor/selector.h"
-
-typedef struct pn_link_ctx_t pn_link_ctx_t;
-
-typedef struct {
-  pn_string_t *text;
-  bool passive;
-  char *scheme;
-  char *user;
-  char *pass;
-  char *host;
-  char *port;
-  char *name;
-} pn_address_t;
-
-// algorithm for granting credit to receivers
-typedef enum {
-  // pn_messenger_recv( X ), where:
-  LINK_CREDIT_EXPLICIT, // X > 0
-  LINK_CREDIT_AUTO,     // X == -1
-  LINK_CREDIT_MANUAL    // X == -2
-} pn_link_credit_mode_t;
-
-struct pn_messenger_t {
-  pn_address_t address;
-  char *name;
-  char *certificate;
-  char *private_key;
-  char *password;
-  char *trusted_certificates;
-  pn_io_t *io;
-  pn_list_t *pending; // pending selectables
-  pn_selectable_t *interruptor;
-  pn_socket_t ctrl[2];
-  pn_list_t *listeners;
-  pn_list_t *connections;
-  pn_selector_t *selector;
-  pn_collector_t *collector;
-  pn_list_t *credited;
-  pn_list_t *blocked;
-  pn_timestamp_t next_drain;
-  uint64_t next_tag;
-  pni_store_t *outgoing;
-  pni_store_t *incoming;
-  pn_list_t *subscriptions;
-  pn_subscription_t *incoming_subscription;
-  pn_error_t *error;
-  pn_transform_t *routes;
-  pn_transform_t *rewrites;
-  pn_tracker_t outgoing_tracker;
-  pn_tracker_t incoming_tracker;
-  pn_string_t *original;
-  pn_string_t *rewritten;
-  pn_string_t *domain;
-  int timeout;
-  int send_threshold;
-  pn_link_credit_mode_t credit_mode;
-  int credit_batch;  // when LINK_CREDIT_AUTO
-  int credit;        // available
-  int distributed;   // credit
-  int receivers;     // # receiver links
-  int draining;      // # links in drain state
-  int connection_error;
-  int flags;
-  int snd_settle_mode;          /* pn_snd_settle_mode_t or -1 for unset */
-  pn_rcv_settle_mode_t rcv_settle_mode;
-  pn_tracer_t tracer;
-  pn_ssl_verify_mode_t ssl_peer_authentication_mode;
-  bool blocking;
-  bool passive;
-  bool interrupted;
-  bool worked;
-};
-
-#define CTX_HEAD                                \
-  pn_messenger_t *messenger;                    \
-  pn_selectable_t *selectable;                  \
-  bool pending;
-
-typedef struct pn_ctx_t {
-  CTX_HEAD
-} pn_ctx_t;
-
-typedef struct {
-  CTX_HEAD
-  char *host;
-  char *port;
-  pn_subscription_t *subscription;
-  pn_ssl_domain_t *domain;
-} pn_listener_ctx_t;
-
-typedef struct {
-  CTX_HEAD
-  pn_connection_t *connection;
-  char *address;
-  char *scheme;
-  char *user;
-  char *pass;
-  char *host;
-  char *port;
-  pn_listener_ctx_t *listener;
-} pn_connection_ctx_t;
-
-static pn_connection_ctx_t *pni_context(pn_selectable_t *sel)
-{
-  assert(sel);
-  pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pni_selectable_get_context(sel);
-  assert(ctx);
-  return ctx;
-}
-
-static pn_transport_t *pni_transport(pn_selectable_t *sel)
-{
-  return pn_connection_transport(pni_context(sel)->connection);
-}
-
-static ssize_t pni_connection_capacity(pn_selectable_t *sel)
-{
-  pn_transport_t *transport = pni_transport(sel);
-  ssize_t capacity = pn_transport_capacity(transport);
-  if (capacity < 0) {
-    if (pn_transport_closed(transport)) {
-      pn_selectable_terminate(sel);
-    }
-  }
-  return capacity;
-}
-
-bool pn_messenger_flow(pn_messenger_t *messenger);
-
-static ssize_t pni_connection_pending(pn_selectable_t *sel)
-{
-  pn_connection_ctx_t *ctx = pni_context(sel);
-  pn_messenger_flow(ctx->messenger);
-  pn_transport_t *transport = pni_transport(sel);
-  ssize_t pending = pn_transport_pending(transport);
-  if (pending < 0) {
-    if (pn_transport_closed(transport)) {
-      pn_selectable_terminate(sel);
-    }
-  }
-  return pending;
-}
-
-static pn_timestamp_t pni_connection_deadline(pn_selectable_t *sel)
-{
-  pn_connection_ctx_t *ctx = pni_context(sel);
-  return ctx->messenger->next_drain;
-}
-
-static void pni_connection_update(pn_selectable_t *sel) {
-  ssize_t c = pni_connection_capacity(sel);
-  pn_selectable_set_reading(sel, c > 0);
-  ssize_t p = pni_connection_pending(sel);
-  pn_selectable_set_writing(sel, p > 0);
-  pn_selectable_set_deadline(sel, pni_connection_deadline(sel));
-  if (c < 0 && p < 0) {
-    pn_selectable_terminate(sel);
-  }
-}
-
-#include <errno.h>
-
-static void pn_error_report(const char *pfx, const char *error)
-{
-  pn_logf("%s ERROR %s", pfx, error);
-}
-
-void pni_modified(pn_ctx_t *ctx)
-{
-  pn_messenger_t *m = ctx->messenger;
-  pn_selectable_t *sel = ctx->selectable;
-  if (pn_selectable_is_registered(sel) && !ctx->pending) {
-    pn_list_add(m->pending, sel);
-    ctx->pending = true;
-  }
-}
-
-void pni_conn_modified(pn_connection_ctx_t *ctx)
-{
-  pni_connection_update(ctx->selectable);
-  pni_modified((pn_ctx_t *) ctx);
-}
-
-void pni_lnr_modified(pn_listener_ctx_t *lnr)
-{
-  pni_modified((pn_ctx_t *) lnr);
-}
-
-int pn_messenger_process_events(pn_messenger_t *messenger);
-
-static void pni_connection_error(pn_selectable_t *sel)
-{
-  pn_transport_t *transport = pni_transport(sel);
-  pn_transport_close_tail(transport);
-  pn_transport_close_head(transport);
-}
-
-static void pni_connection_readable(pn_selectable_t *sel)
-{
-  pn_connection_ctx_t *context = pni_context(sel);
-  pn_messenger_t *messenger = context->messenger;
-  pn_connection_t *connection = context->connection;
-  pn_transport_t *transport = pni_transport(sel);
-  ssize_t capacity = pn_transport_capacity(transport);
-  if (capacity > 0) {
-    ssize_t n = pn_recv(messenger->io, pn_selectable_get_fd(sel),
-                        pn_transport_tail(transport), capacity);
-    if (n <= 0) {
-      if (n == 0 || !pn_wouldblock(messenger->io)) {
-        if (n < 0) perror("recv");
-        pn_transport_close_tail(transport);
-        if (!(pn_connection_state(connection) & PN_REMOTE_CLOSED)) {
-          pn_error_report("CONNECTION", "connection aborted (remote)");
-        }
-      }
-    } else {
-      int err = pn_transport_process(transport, (size_t)n);
-      if (err)
-        pn_error_copy(messenger->error, pn_transport_error(transport));
-    }
-  }
-
-  pn_messenger_process_events(messenger);
-  pn_messenger_flow(messenger);
-  messenger->worked = true;
-  pni_conn_modified(context);
-}
-
-static void pni_connection_writable(pn_selectable_t *sel)
-{
-  pn_connection_ctx_t *context = pni_context(sel);
-  pn_messenger_t *messenger = context->messenger;
-  pn_transport_t *transport = pni_transport(sel);
-  ssize_t pending = pn_transport_pending(transport);
-  if (pending > 0) {
-    ssize_t n = pn_send(messenger->io, pn_selectable_get_fd(sel),
-                        pn_transport_head(transport), pending);
-    if (n < 0) {
-      if (!pn_wouldblock(messenger->io)) {
-        perror("send");
-        pn_transport_close_head(transport);
-      }
-    } else {
-      pn_transport_pop(transport, n);
-    }
-  }
-
-  pn_messenger_process_events(messenger);
-  pn_messenger_flow(messenger);
-  messenger->worked = true;
-  pni_conn_modified(context);
-}
-
-static void pni_connection_expired(pn_selectable_t *sel)
-{
-  pn_connection_ctx_t *ctx = pni_context(sel);
-  pn_messenger_flow(ctx->messenger);
-  ctx->messenger->worked = true;
-  pni_conn_modified(ctx);
-}
-
-static void pni_messenger_reclaim(pn_messenger_t *messenger, pn_connection_t *conn);
-
-static void pni_connection_finalize(pn_selectable_t *sel)
-{
-  pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pni_selectable_get_context(sel);
-  pn_socket_t fd = pn_selectable_get_fd(sel);
-  pn_close(ctx->messenger->io, fd);
-  pn_list_remove(ctx->messenger->pending, sel);
-  pni_messenger_reclaim(ctx->messenger, ctx->connection);
-}
-
-pn_connection_t *pn_messenger_connection(pn_messenger_t *messenger,
-                                         pn_socket_t sock,
-                                         const char *scheme,
-                                         char *user,
-                                         char *pass,
-                                         char *host,
-                                         char *port,
-                                         pn_listener_ctx_t *lnr);
-
-static void pni_listener_readable(pn_selectable_t *sel)
-{
-  pn_listener_ctx_t *ctx = (pn_listener_ctx_t *) pni_selectable_get_context(sel);
-  pn_subscription_t *sub = ctx->subscription;
-  const char *scheme = pn_subscription_scheme(sub);
-  char name[1024];
-  pn_socket_t sock = pn_accept(ctx->messenger->io, pn_selectable_get_fd(sel), name, 1024);
-
-  pn_transport_t *t = pn_transport();
-  pn_transport_set_server(t);
-  if (ctx->messenger->flags & PN_FLAGS_ALLOW_INSECURE_MECHS) {
-      pn_sasl_t *s = pn_sasl(t);
-      pn_sasl_set_allow_insecure_mechs(s, true);
-  }
-  pn_ssl_t *ssl = pn_ssl(t);
-  pn_ssl_init(ssl, ctx->domain, NULL);
-
-  pn_connection_t *conn = pn_messenger_connection(ctx->messenger, sock, scheme, NULL, NULL, NULL, NULL, ctx);
-  pn_transport_bind(t, conn);
-  pn_decref(t);
-  pni_conn_modified((pn_connection_ctx_t *) pn_connection_get_context(conn));
-}
-
-static void pn_listener_ctx_free(pn_messenger_t *messenger, pn_listener_ctx_t *ctx);
-
-static void pni_listener_finalize(pn_selectable_t *sel)
-{
-  pn_listener_ctx_t *lnr = (pn_listener_ctx_t *) pni_selectable_get_context(sel);
-  pn_messenger_t *messenger = lnr->messenger;
-  pn_close(messenger->io, pn_selectable_get_fd(sel));
-  pn_list_remove(messenger->pending, sel);
-  pn_listener_ctx_free(messenger, lnr);
-}
-
-static bool pn_streq(const char *a, const char *b)
-{
-  return a == b || (a && b && !strcmp(a, b));
-}
-
-static const char *default_port(const char *scheme)
-{
-  if (scheme && pn_streq(scheme, "amqps"))
-    return "5671";
-  else
-    return "5672";
-}
-
-static pn_listener_ctx_t *pn_listener_ctx(pn_messenger_t *messenger,
-                                          const char *scheme,
-                                          const char *host,
-                                          const char *port)
-{
-  pn_socket_t socket = pn_listen(messenger->io, host, port ? port : default_port(scheme));
-  if (socket == PN_INVALID_SOCKET) {
-    pn_error_copy(messenger->error, pn_io_error(messenger->io));
-    pn_error_format(messenger->error, PN_ERR, "CONNECTION ERROR (%s:%s): %s\n",
-                    messenger->address.host, messenger->address.port,
-                    pn_error_text(messenger->error));
-
-    return NULL;
-  }
-
-  pn_listener_ctx_t *ctx = (pn_listener_ctx_t *) pn_class_new(PN_OBJECT, sizeof(pn_listener_ctx_t));
-  ctx->messenger = messenger;
-  ctx->domain = pn_ssl_domain(PN_SSL_MODE_SERVER);
-  if (messenger->certificate) {
-    int err = pn_ssl_domain_set_credentials(ctx->domain, messenger->certificate,
-                                            messenger->private_key,
-                                            messenger->password);
-
-    if (err) {
-      pn_error_format(messenger->error, PN_ERR, "invalid credentials");
-      pn_ssl_domain_free(ctx->domain);
-      pn_free(ctx);
-      pn_close(messenger->io, socket);
-      return NULL;
-    }
-  }
-
-  if (!(scheme && !strcmp(scheme, "amqps"))) {
-    pn_ssl_domain_allow_unsecured_client(ctx->domain);
-  }
-
-  pn_subscription_t *sub = pn_subscription(messenger, scheme, host, port);
-  ctx->subscription = sub;
-  ctx->host = pn_strdup(host);
-  ctx->port = pn_strdup(port);
-
-  pn_selectable_t *selectable = pn_selectable();
-  pn_selectable_set_reading(selectable, true);
-  pn_selectable_on_readable(selectable, pni_listener_readable);
-  pn_selectable_on_release(selectable, pn_selectable_free);
-  pn_selectable_on_finalize(selectable, pni_listener_finalize);
-  pn_selectable_set_fd(selectable, socket);
-  pni_selectable_set_context(selectable, ctx);
-  pn_list_add(messenger->pending, selectable);
-  ctx->selectable = selectable;
-  ctx->pending = true;
-
-  pn_list_add(messenger->listeners, ctx);
-  return ctx;
-}
-
-static void pn_listener_ctx_free(pn_messenger_t *messenger, pn_listener_ctx_t *ctx)
-{
-  pn_list_remove(messenger->listeners, ctx);
-  // XXX: subscriptions are freed when the messenger is freed pn_subscription_free(ctx->subscription);
-  free(ctx->host);
-  free(ctx->port);
-  pn_ssl_domain_free(ctx->domain);
-  pn_free(ctx);
-}
-
-static pn_connection_ctx_t *pn_connection_ctx(pn_messenger_t *messenger,
-                                              pn_connection_t *conn,
-                                              pn_socket_t sock,
-                                              const char *scheme,
-                                              const char *user,
-                                              const char *pass,
-                                              const char *host,
-                                              const char *port,
-                                              pn_listener_ctx_t *lnr)
-{
-  pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pn_connection_get_context(conn);
-  assert(!ctx);
-  ctx = (pn_connection_ctx_t *) malloc(sizeof(pn_connection_ctx_t));
-  ctx->messenger = messenger;
-  ctx->connection = conn;
-  pn_selectable_t *sel = pn_selectable();
-  ctx->selectable = sel;
-  pn_selectable_on_error(sel, pni_connection_error);
-  pn_selectable_on_readable(sel, pni_connection_readable);
-  pn_selectable_on_writable(sel, pni_connection_writable);
-  pn_selectable_on_expired(sel, pni_connection_expired);
-  pn_selectable_on_release(sel, pn_selectable_free);
-  pn_selectable_on_finalize(sel, pni_connection_finalize);
-  pn_selectable_set_fd(ctx->selectable, sock);
-  pni_selectable_set_context(ctx->selectable, ctx);
-  pn_list_add(messenger->pending, ctx->selectable);
-  ctx->pending = true;
-  ctx->scheme = pn_strdup(scheme);
-  ctx->user = pn_strdup(user);
-  ctx->pass = pn_strdup(pass);
-  ctx->host = pn_strdup(host);
-  ctx->port = pn_strdup(port);
-  ctx->listener = lnr;
-  pn_connection_set_context(conn, ctx);
-  return ctx;
-}
-
-static void pn_connection_ctx_free(pn_connection_t *conn)
-{
-  pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pn_connection_get_context(conn);
-  if (ctx) {
-    pni_selectable_set_context(ctx->selectable, NULL);
-    free(ctx->scheme);
-    free(ctx->user);
-    free(ctx->pass);
-    free(ctx->host);
-    free(ctx->port);
-    free(ctx);
-    pn_connection_set_context(conn, NULL);
-  }
-}
-
-#define OUTGOING (0x0000000000000000)
-#define INCOMING (0x1000000000000000)
-
-#define pn_tracker(direction, sequence) ((direction) | (sequence))
-#define pn_tracker_direction(tracker) ((tracker) & (0x1000000000000000))
-#define pn_tracker_sequence(tracker) ((pn_sequence_t) ((tracker) & (0x00000000FFFFFFFF)))
-
-
-static char *build_name(const char *name)
-{
-  static bool seeded = false;
-  // UUID standard format: 8-4-4-4-12 (36 chars, 32 alphanumeric and 4 hypens)
-  static const char *uuid_fmt = "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X";
-
-  int count = 0;
-  char *generated;
-  uint8_t bytes[16];
-  unsigned int r = 0;
-
-  if (name) {
-    return pn_strdup(name);
-  }
-
-  if (!seeded) {
-    int pid = pn_i_getpid();
-    int nowish = (int)pn_i_now();
-    // the lower bits of time are the most random, shift pid to push some
-    // randomness into the higher order bits
-    srand(nowish ^ (pid<<16));
-    seeded = true;
-  }
-
-  while (count < 16) {
-    if (!r) {
-      r =  (unsigned int) rand();
-    }
-
-    bytes[count] = r & 0xFF;
-    r >>= 8;
-    count++;
-  }
-
-  // From RFC4122, the version bits are set to 0100
-  bytes[6] = (bytes[6] & 0x0F) | 0x40;
-
-  // From RFC4122, the top two bits of byte 8 get set to 01
-  bytes[8] = (bytes[8] & 0x3F) | 0x80;
-
-  generated = (char *) malloc(37*sizeof(char));
-  sprintf(generated, uuid_fmt,
-	  bytes[0], bytes[1], bytes[2], bytes[3],
-	  bytes[4], bytes[5], bytes[6], bytes[7],
-	  bytes[8], bytes[9], bytes[10], bytes[11],
-	  bytes[12], bytes[13], bytes[14], bytes[15]);
-  return generated;
-}
-
-struct pn_link_ctx_t {
-  pn_subscription_t *subscription;
-};
-
-// compute the maximum amount of credit each receiving link is
-// entitled to.  The actual credit given to the link depends on what
-// amount of credit is actually available.
-static int per_link_credit( pn_messenger_t *messenger )
-{
-  if (messenger->receivers == 0) return 0;
-  int total = messenger->credit + messenger->distributed;
-  return pn_max(total/messenger->receivers, 1);
-}
-
-static void link_ctx_setup( pn_messenger_t *messenger,
-                            pn_connection_t *connection,
-                            pn_link_t *link )
-{
-  if (pn_link_is_receiver(link)) {
-    messenger->receivers++;
-    pn_link_ctx_t *ctx = (pn_link_ctx_t *) calloc(1, sizeof(pn_link_ctx_t));
-    assert( ctx );
-    assert( !pn_link_get_context(link) );
-    pn_link_set_context( link, ctx );
-    pn_list_add(messenger->blocked, link);
-  }
-}
-
-static void link_ctx_release( pn_messenger_t *messenger, pn_link_t *link )
-{
-  if (pn_link_is_receiver(link)) {
-    pn_link_ctx_t *ctx = (pn_link_ctx_t *) pn_link_get_context( link );
-    if (!ctx) return;
-    assert( messenger->receivers > 0 );
-    messenger->receivers--;
-    if (pn_link_get_drain(link)) {
-      pn_link_set_drain(link, false);
-      assert( messenger->draining > 0 );
-      messenger->draining--;
-    }
-    pn_list_remove(messenger->credited, link);
-    pn_list_remove(messenger->blocked, link);
-    pn_link_set_context( link, NULL );
-    free( ctx );
-  }
-}
-
-static void pni_interruptor_readable(pn_selectable_t *sel)
-{
-  pn_messenger_t *messenger = (pn_messenger_t *) pni_selectable_get_context(sel);
-  char buf[1024];
-  pn_read(messenger->io, pn_selectable_get_fd(sel), buf, 1024);
-  messenger->interrupted = true;
-}
-
-static void pni_interruptor_finalize(pn_selectable_t *sel)
-{
-  pn_messenger_t *messenger = (pn_messenger_t *) pni_selectable_get_context(sel);
-  messenger->interruptor = NULL;
-}
-
-pn_messenger_t *pn_messenger(const char *name)
-{
-  pn_messenger_t *m = (pn_messenger_t *) malloc(sizeof(pn_messenger_t));
-
-  if (m) {
-    m->name = build_name(name);
-    m->certificate = NULL;
-    m->private_key = NULL;
-    m->password = NULL;
-    m->trusted_certificates = NULL;
-    m->timeout = -1;
-    m->blocking = true;
-    m->passive = false;
-    m->io = pn_io();
-    m->pending = pn_list(PN_WEAKREF, 0);
-    m->interruptor = pn_selectable();
-    pn_selectable_set_reading(m->interruptor, true);
-    pn_selectable_on_readable(m->interruptor, pni_interruptor_readable);
-    pn_selectable_on_release(m->interruptor, pn_selectable_free);
-    pn_selectable_on_finalize(m->interruptor, pni_interruptor_finalize);
-    pn_list_add(m->pending, m->interruptor);
-    m->interrupted = false;
-    // Explicitly initialise pipe file descriptors to invalid values in case pipe
-    // fails, if we don't do this m->ctrl[0] could default to 0 - which is stdin.
-    m->ctrl[0] = -1;
-    m->ctrl[1] = -1;
-    pn_pipe(m->io, m->ctrl);
-    pn_selectable_set_fd(m->interruptor, m->ctrl[0]);
-    pni_selectable_set_context(m->interruptor, m);
-    m->listeners = pn_list(PN_WEAKREF, 0);
-    m->connections = pn_list(PN_WEAKREF, 0);
-    m->selector = pn_io_selector(m->io);
-    m->collector = pn_collector();
-    m->credit_mode = LINK_CREDIT_EXPLICIT;
-    m->credit_batch = 1024;
-    m->credit = 0;
-    m->distributed = 0;
-    m->receivers = 0;
-    m->draining = 0;
-    m->credited = pn_list(PN_WEAKREF, 0);
-    m->blocked = pn_list(PN_WEAKREF, 0);
-    m->next_drain = 0;
-    m->next_tag = 0;
-    m->outgoing = pni_store();
-    m->incoming = pni_store();
-    m->subscriptions = pn_list(PN_OBJECT, 0);
-    m->incoming_subscription = NULL;
-    m->error = pn_error();
-    m->routes = pn_transform();
-    m->rewrites = pn_transform();
-    m->outgoing_tracker = 0;
-    m->incoming_tracker = 0;
-    m->address.text = pn_string(NULL);
-    m->original = pn_string(NULL);
-    m->rewritten = pn_string(NULL);
-    m->domain = pn_string(NULL);
-    m->connection_error = 0;
-    m->flags = PN_FLAGS_ALLOW_INSECURE_MECHS; // TODO: Change this back to 0 for the Proton 0.11 release
-    m->snd_settle_mode = -1;    /* Default depends on sender/receiver */
-    m->rcv_settle_mode = PN_RCV_FIRST;
-    m->tracer = NULL;
-    m->ssl_peer_authentication_mode = PN_SSL_VERIFY_PEER_NAME;
-  }
-
-  return m;
-}
-
-int pni_messenger_add_subscription(pn_messenger_t *messenger, pn_subscription_t *subscription)
-{
-  return pn_list_add(messenger->subscriptions, subscription);
-}
-
-
-const char *pn_messenger_name(pn_messenger_t *messenger)
-{
-  return messenger->name;
-}
-
-int pn_messenger_set_certificate(pn_messenger_t *messenger, const char *certificate)
-{
-  if (messenger->certificate) free(messenger->certificate);
-  messenger->certificate = pn_strdup(certificate);
-  return 0;
-}
-
-const char *pn_messenger_get_certificate(pn_messenger_t *messenger)
-{
-  return messenger->certificate;
-}
-
-int pn_messenger_set_private_key(pn_messenger_t *messenger, const char *private_key)
-{
-  if (messenger->private_key) free(messenger->private_key);
-  messenger->private_key = pn_strdup(private_key);
-  return 0;
-}
-
-const char *pn_messenger_get_private_key(pn_messenger_t *messenger)
-{
-  return messenger->private_key;
-}
-
-int pn_messenger_set_password(pn_messenger_t *messenger, const char *password)
-{
-  if (messenger->password) free(messenger->password);
-  messenger->password = pn_strdup(password);
-  return 0;
-}
-
-const char *pn_messenger_get_password(pn_messenger_t *messenger)
-{
-  return messenger->password;
-}
-
-int pn_messenger_set_trusted_certificates(pn_messenger_t *messenger, const char *trusted_certificates)
-{
-  if (messenger->trusted_certificates) free(messenger->trusted_certificates);
-  messenger->trusted_certificates = pn_strdup(trusted_certificates);
-  return 0;
-}
-
-const char *pn_messenger_get_trusted_certificates(pn_messenger_t *messenger)
-{
-  return messenger->trusted_certificates;
-}
-
-int pn_messenger_set_timeout(pn_messenger_t *messenger, int timeout)
-{
-  if (!messenger) return PN_ARG_ERR;
-  messenger->timeout = timeout;
-  return 0;
-}
-
-int pn_messenger_get_timeout(pn_messenger_t *messenger)
-{
-  return messenger ? messenger->timeout : 0;
-}
-
-bool pn_messenger_is_blocking(pn_messenger_t *messenger)
-{
-  assert(messenger);
-  return messenger->blocking;
-}
-
-int pn_messenger_set_blocking(pn_messenger_t *messenger, bool blocking)
-{
-  messenger->blocking = blocking;
-  return 0;
-}
-
-bool pn_messenger_is_passive(pn_messenger_t *messenger)
-{
-  assert(messenger);
-  return messenger->passive;
-}
-
-int pn_messenger_set_passive(pn_messenger_t *messenger, bool passive)
-{
-  messenger->passive = passive;
-  return 0;
-}
-
-pn_selectable_t *pn_messenger_selectable(pn_messenger_t *messenger)
-{
-  assert(messenger);
-  pn_messenger_process_events(messenger);
-  pn_list_t *p = messenger->pending;
-  size_t n = pn_list_size(p);
-  if (n) {
-    pn_selectable_t *s = (pn_selectable_t *) pn_list_get(p, n - 1);
-    pn_list_del(p, n-1, 1);
-    // this is a total hack, messenger has selectables whose context
-    // are the messenger itself and whose context share a common
-    // prefix that is described by pn_ctx_t
-    void *c = pni_selectable_get_context(s);
-    if (c != messenger) {
-      pn_ctx_t *ctx = (pn_ctx_t *) c;
-      ctx->pending = false;
-    }
-    return s;
-  } else {
-    return NULL;
-  }
-}
-
-static void pni_reclaim(pn_messenger_t *messenger)
-{
-  while (pn_list_size(messenger->listeners)) {
-    pn_listener_ctx_t *l = (pn_listener_ctx_t *) pn_list_get(messenger->listeners, 0);
-    pn_listener_ctx_free(messenger, l);
-  }
-
-  while (pn_list_size(messenger->connections)) {
-    pn_connection_t *c = (pn_connection_t *) pn_list_get(messenger->connections, 0);
-    pni_messenger_reclaim(messenger, c);
-  }
-}
-
-void pn_messenger_free(pn_messenger_t *messenger)
-{
-  if (messenger) {
-    pn_free(messenger->domain);
-    pn_free(messenger->rewritten);
-    pn_free(messenger->original);
-    pn_free(messenger->address.text);
-    free(messenger->name);
-    free(messenger->certificate);
-    free(messenger->private_key);
-    free(messenger->password);
-    free(messenger->trusted_certificates);
-    pni_reclaim(messenger);
-    pn_free(messenger->pending);
-    pn_selectable_free(messenger->interruptor);
-    pn_close(messenger->io, messenger->ctrl[0]);
-    pn_close(messenger->io, messenger->ctrl[1]);
-    pn_free(messenger->listeners);
-    pn_free(messenger->connections);
-    pn_selector_free(messenger->selector);
-    pn_collector_free(messenger->collector);
-    pn_error_free(messenger->error);
-    pni_store_free(messenger->incoming);
-    pni_store_free(messenger->outgoing);
-    pn_free(messenger->subscriptions);
-    pn_free(messenger->rewrites);
-    pn_free(messenger->routes);
-    pn_free(messenger->credited);
-    pn_free(messenger->blocked);
-    pn_free(messenger->io);
-    free(messenger);
-  }
-}
-
-int pn_messenger_errno(pn_messenger_t *messenger)
-{
-  if (messenger) {
-    return pn_error_code(messenger->error);
-  } else {
-    return PN_ARG_ERR;
-  }
-}
-
-pn_error_t *pn_messenger_error(pn_messenger_t *messenger)
-{
-  assert(messenger);
-  return messenger->error;
-}
-
-// Run the credit scheduler, grant flow as needed.  Return True if
-// credit allocation for any link has changed.
-bool pn_messenger_flow(pn_messenger_t *messenger)
-{
-  bool updated = false;
-  if (messenger->receivers == 0) {
-    messenger->next_drain = 0;
-    return updated;
-  }
-
-  if (messenger->credit_mode == LINK_CREDIT_AUTO) {
-    // replenish, but limit the max total messages buffered
-    const int max = messenger->receivers * messenger->credit_batch;
-    const int used = messenger->distributed + pn_messenger_incoming(messenger);
-    if (max > used)
-      messenger->credit = max - used;
-  } else if (messenger->credit_mode == LINK_CREDIT_MANUAL) {
-    messenger->next_drain = 0;
-    return false;
-  }
-
-  const int batch = per_link_credit(messenger);
-  while (messenger->credit > 0 && pn_list_size(messenger->blocked)) {
-    pn_link_t *link = (pn_link_t *) pn_list_get(messenger->blocked, 0);
-    pn_list_del(messenger->blocked, 0, 1);
-
-    const int more = pn_min( messenger->credit, batch );
-    messenger->distributed += more;
-    messenger->credit -= more;
-    pn_link_flow(link, more);
-    pn_list_add(messenger->credited, link);
-    updated = true;
-  }
-
-  if (!pn_list_size(messenger->blocked)) {
-    messenger->next_drain = 0;
-  } else {
-    // not enough credit for all links
-    if (!messenger->draining) {
-      pn_logf("%s: let's drain", messenger->name);
-      if (messenger->next_drain == 0) {
-        messenger->next_drain = pn_i_now() + 250;
-        pn_logf("%s: initializing next_drain", messenger->name);
-      } else if (messenger->next_drain <= pn_i_now()) {
-        // initiate drain, free up at most enough to satisfy blocked
-        messenger->next_drain = 0;
-        int needed = pn_list_size(messenger->blocked) * batch;
-        for (size_t i = 0; i < pn_list_size(messenger->credited); i++) {
-          pn_link_t *link = (pn_link_t *) pn_list_get(messenger->credited, i);
-          if (!pn_link_get_drain(link)) {
-            pn_link_set_drain(link, true);
-            needed -= pn_link_remote_credit(link);
-            messenger->draining++;
-            updated = true;
-          }
-
-          if (needed <= 0) {
-            break;
-          }
-        }
-      } else {
-        pn_logf("%s: delaying", messenger->name);
-      }
-    }
-  }
-  return updated;
-}
-
-static int pn_transport_config(pn_messenger_t *messenger,
-                               pn_connection_t *connection)
-{
-  pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pn_connection_get_context(connection);
-  pn_transport_t *transport = pn_connection_transport(connection);
-  if (messenger->tracer)
-    pn_transport_set_tracer(transport, messenger->tracer);
-  if (ctx->scheme && !strcmp(ctx->scheme, "amqps")) {
-    pn_ssl_domain_t *d = pn_ssl_domain(PN_SSL_MODE_CLIENT);
-    if (messenger->certificate) {
-      int err = pn_ssl_domain_set_credentials( d, messenger->certificate,
-                                               messenger->private_key,
-                                               messenger->password);
-      if (err) {
-        pn_ssl_domain_free(d);
-        pn_error_report("CONNECTION", "invalid credentials");
-        return err;
-      }
-    }
-    if (messenger->trusted_certificates) {
-      int err = pn_ssl_domain_set_trusted_ca_db(d, messenger->trusted_certificates);
-      if (err) {
-        pn_ssl_domain_free(d);
-        pn_error_report("CONNECTION", "invalid certificate db");
-        return err;
-      }
-      err = pn_ssl_domain_set_peer_authentication(
-          d, messenger->ssl_peer_authentication_mode, NULL);
-      if (err) {
-        pn_ssl_domain_free(d);
-        pn_error_report("CONNECTION", "error configuring ssl to verify peer");
-      }
-    } else {
-      int err = pn_ssl_domain_set_peer_authentication(d, PN_SSL_ANONYMOUS_PEER, NULL);
-      if (err) {
-        pn_ssl_domain_free(d);
-        pn_error_report("CONNECTION", "error configuring ssl for anonymous peer");
-        return err;
-      }
-    }
-    pn_ssl_t *ssl = pn_ssl(transport);
-    pn_ssl_init(ssl, d, NULL);
-    pn_ssl_domain_free( d );
-  }
-
-  return 0;
-}
-
-static void pn_condition_report(const char *pfx, pn_condition_t *condition)
-{
-  if (pn_condition_is_redirect(condition)) {
-    pn_logf("%s NOTICE (%s) redirecting to %s:%i",
-            pfx,
-            pn_condition_get_name(condition),
-            pn_condition_redirect_host(condition),
-            pn_condition_redirect_port(condition));
-  } else if (pn_condition_is_set(condition)) {
-    char error[1024];
-    pni_snprintf(error, 1024, "(%s) %s",
-             pn_condition_get_name(condition),
-             pn_condition_get_description(condition));
-    pn_error_report(pfx, error);
-  }
-}
-
-int pni_pump_in(pn_messenger_t *messenger, const char *address, pn_link_t *receiver)
-{
-  pn_delivery_t *d = pn_link_current(receiver);
-  if (!pn_delivery_readable(d) || pn_delivery_partial(d)) {
-    return 0;
-  }
-
-  pni_entry_t *entry = pni_store_put(messenger->incoming, address);
-  pn_buffer_t *buf = pni_entry_bytes(entry);
-  pni_entry_set_delivery(entry, d);
-
-  pn_link_ctx_t *ctx = (pn_link_ctx_t *) pn_link_get_context( receiver );
-  pni_entry_set_context(entry, ctx ? ctx->subscription : NULL);
-
-  size_t pending = pn_delivery_pending(d);
-  int err = pn_buffer_ensure(buf, pending + 1);
-  if (err) return pn_error_format(messenger->error, err, "get: error growing buffer");
-  char *encoded = pn_buffer_memory(buf).start;
-  ssize_t n = pn_link_recv(receiver, encoded, pending);
-  if (n != (ssize_t) pending) {
-    return pn_error_format(messenger->error, n,
-                           "didn't receive pending bytes: %" PN_ZI " %" PN_ZI,
-                           n, pending);
-  }
-  n = pn_link_recv(receiver, encoded + pending, 1);
-  pn_link_advance(receiver);
-
-  pn_link_t *link = receiver;
-
-  if (messenger->credit_mode != LINK_CREDIT_MANUAL) {
-    // account for the used credit
-    assert(ctx);
-    assert(messenger->distributed);
-    messenger->distributed--;
-
-    // replenish if low (< 20% maximum batch) and credit available
-    if (!pn_link_get_drain(link) && pn_list_size(messenger->blocked) == 0 &&
-        messenger->credit > 0) {
-      const int max = per_link_credit(messenger);
-      const int lo_thresh = (int)(max * 0.2 + 0.5);
-      if (pn_link_remote_credit(link) < lo_thresh) {
-        const int more =
-            pn_min(messenger->credit, max - pn_link_remote_credit(link));
-        messenger->credit -= more;
-        messenger->distributed += more;
-        pn_link_flow(link, more);
-      }
-    }
-    // check if blocked
-    if (pn_list_index(messenger->blocked, link) < 0 &&
-        pn_link_remote_credit(link) == 0) {
-      pn_list_remove(messenger->credited, link);
-      if (pn_link_get_drain(link)) {
-        pn_link_set_drain(link, false);
-        assert(messenger->draining > 0);
-        messenger->draining--;
-      }
-      pn_list_add(messenger->blocked, link);
-    }
-  }
-
-  if (n != PN_EOS) {
-    return pn_error_format(messenger->error, n, "PN_EOS expected");
-  }
-  pn_buffer_append(buf, encoded, pending); // XXX
-
-  return 0;
-}
-
-void pni_messenger_reclaim_link(pn_messenger_t *messenger, pn_link_t *link)
-{
-  if (pn_link_is_receiver(link) && pn_link_credit(link) > 0) {
-    int credit = pn_link_credit(link);
-    messenger->credit += credit;
-    messenger->distributed -= credit;
-  }
-
-  pn_delivery_t *d = pn_unsettled_head(link);
-  while (d) {
-    pni_entry_t *e = (pni_entry_t *) pn_delivery_get_context(d);
-    if (e) {
-      pni_entry_set_delivery(e, NULL);
-      if (pn_delivery_buffered(d)) {
-        pni_entry_set_status(e, PN_STATUS_ABORTED);
-      }
-    }
-    d = pn_unsettled_next(d);
-  }
-
-  link_ctx_release(messenger, link);
-}
-
-void pni_messenger_reclaim(pn_messenger_t *messenger, pn_connection_t *conn)
-{
-  if (!conn) return;
-
-  pn_link_t *link = pn_link_head(conn, 0);
-  while (link) {
-    pni_messenger_reclaim_link(messenger, link);
-    link = pn_link_next(link, 0);
-  }
-
-  pn_list_remove(messenger->connections, conn);
-  pn_connection_ctx_free(conn);
-  pn_transport_free(pn_connection_transport(conn));
-  pn_connection_free(conn);
-}
-
-pn_connection_t *pn_messenger_connection(pn_messenger_t *messenger,
-                                         pn_socket_t sock,
-                                         const char *scheme,
-                                         char *user,
-                                         char *pass,
-                                         char *host,
-                                         char *port,
-                                         pn_listener_ctx_t *lnr)
-{
-  pn_connection_t *connection = pn_connection();
-  if (!connection) return NULL;
-  pn_connection_collect(connection, messenger->collector);
-  pn_connection_ctx(messenger, connection, sock, scheme, user, pass, host, port, lnr);
-
-  pn_connection_set_container(connection, messenger->name);
-  pn_connection_set_hostname(connection, host);
-  pn_connection_set_user(connection, user);
-  pn_connection_set_password(connection, pass);
-
-  pn_list_add(messenger->connections, connection);
-
-  return connection;
-}
-
-void pn_messenger_process_connection(pn_messenger_t *messenger, pn_event_t *event)
-{
-  pn_connection_t *conn = pn_event_connection(event);
-  pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pn_connection_get_context(conn);
-
-  if (pn_connection_state(conn) & PN_LOCAL_UNINIT) {
-    pn_connection_open(conn);
-  }
-
-  if (pn_connection_state(conn) == (PN_LOCAL_ACTIVE | PN_REMOTE_CLOSED)) {
-    pn_condition_t *condition = pn_connection_remote_condition(conn);
-    pn_condition_report("CONNECTION", condition);
-    pn_connection_close(conn);
-    if (pn_condition_is_redirect(condition)) {
-      const char *host = pn_condition_redirect_host(condition);
-      char buf[1024];
-      sprintf(buf, "%i", pn_condition_redirect_port(condition));
-
-      pn_close(messenger->io, pn_selectable_get_fd(ctx->selectable));
-      pn_socket_t sock = pn_connect(messenger->io, host, buf);
-      pn_selectable_set_fd(ctx->selectable, sock);
-      pn_transport_unbind(pn_connection_transport(conn));
-      pn_connection_reset(conn);
-      pn_transport_t *t = pn_transport();
-      if (messenger->flags & PN_FLAGS_ALLOW_INSECURE_MECHS &&
-          messenger->address.user && messenger->address.pass) {
-        pn_sasl_t *s = pn_sasl(t);
-        pn_sasl_set_allow_insecure_mechs(s, true);
-      }
-      pn_transport_bind(t, conn);
-      pn_decref(t);
-      pn_transport_config(messenger, conn);
-    }
-  }
-}
-
-void pn_messenger_process_session(pn_messenger_t *messenger, pn_event_t *event)
-{
-  pn_session_t *ssn = pn_event_session(event);
-
-  if (pn_session_state(ssn) & PN_LOCAL_UNINIT) {
-    pn_session_open(ssn);
-  }
-
-  if (pn_session_state(ssn) == (PN_LOCAL_ACTIVE | PN_REMOTE_CLOSED)) {
-    pn_session_close(ssn);
-  }
-}
-
-void pn_messenger_process_link(pn_messenger_t *messenger, pn_event_t *event)
-{
-  pn_link_t *link = pn_event_link(event);
-  pn_connection_t *conn = pn_event_connection(event);
-  pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pn_connection_get_context(conn);
-
-  if (pn_link_state(link) & PN_LOCAL_UNINIT) {
-    pn_terminus_copy(pn_link_source(link), pn_link_remote_source(link));
-    pn_terminus_copy(pn_link_target(link), pn_link_remote_target(link));
-    link_ctx_setup( messenger, conn, link );
-    pn_link_open(link);
-    if (pn_link_is_receiver(link)) {
-      pn_listener_ctx_t *lnr = ctx->listener;
-      ((pn_link_ctx_t *)pn_link_get_context(link))->subscription = lnr ? lnr->subscription : NULL;
-    }
-  }
-
-  if (pn_link_state(link) & PN_REMOTE_ACTIVE) {
-    pn_link_ctx_t *ctx = (pn_link_ctx_t *) pn_link_get_context(link);
-    if (ctx) {
-      const char *addr = pn_terminus_get_address(pn_link_remote_source(link));
-      if (ctx->subscription) {
-        pni_subscription_set_address(ctx->subscription, addr);
-      }
-    }
-  }
-
-  if (pn_link_state(link) & PN_REMOTE_CLOSED) {
-    if (PN_LOCAL_ACTIVE & pn_link_state(link)) {
-      pn_condition_report("LINK", pn_link_remote_condition(link));
-      pn_link_close(link);
-      pni_messenger_reclaim_link(messenger, link);
-      pn_link_free(link);
-    }
-  }
-}
-
-int pni_pump_out(pn_messenger_t *messenger, const char *address, pn_link_t *sender);
-
-void pn_messenger_process_flow(pn_messenger_t *messenger, pn_event_t *event)
-{
-  pn_link_t *link = pn_event_link(event);
-
-  if (pn_link_is_sender(link)) {
-    pni_pump_out(messenger, pn_terminus_get_address(pn_link_target(link)), link);
-  } else {
-    // account for any credit left over after draining links has completed
-    if (pn_link_get_drain(link)) {
-      if (!pn_link_draining(link)) {
-        // drain completed!
-        int drained = pn_link_drained(link);
-        messenger->distributed -= drained;
-        messenger->credit += drained;
-        pn_link_set_drain(link, false);
-        messenger->draining--;
-        pn_list_remove(messenger->credited, link);
-        pn_list_add(messenger->blocked, link);
-      }
-    }
-  }
-}
-
-void pn_messenger_process_delivery(pn_messenger_t *messenger, pn_event_t *event)
-{
-  pn_delivery_t *d = pn_event_delivery(event);
-  pn_link_t *link = pn_event_link(event);
-  if (pn_delivery_updated(d)) {
-    if (pn_link_is_sender(link)) {
-      pn_delivery_update(d, pn_delivery_remote_state(d));
-    }
-    pni_entry_t *e = (pni_entry_t *) pn_delivery_get_context(d);
-    if (e) pni_entry_updated(e);
-  }
-  pn_delivery_clear(d);
-  if (pn_delivery_readable(d)) {
-    int err = pni_pump_in(messenger, pn_terminus_get_address(pn_link_source(link)), link);
-    if (err) {
-      pn_logf("%s", pn_error_text(messenger->error));
-    }
-  }
-}
-
-void pn_messenger_process_transport(pn_messenger_t *messenger, pn_event_t *event)
-{
-  pn_connection_t *conn = pn_event_connection(event);
-  pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pn_connection_get_context(conn);
-  if (ctx) {
-    pni_conn_modified(ctx);
-  }
-}
-
-int pn_messenger_process_events(pn_messenger_t *messenger)
-{
-  int processed = 0;
-  pn_event_t *event;
-  while ((event = pn_collector_peek(messenger->collector))) {
-    processed++;
-    switch (pn_event_type(event)) {
-    case PN_CONNECTION_INIT:
-      pn_logf("connection created: %p", (void *) pn_event_connection(event));
-      break;
-    case PN_SESSION_INIT:
-      pn_logf("session created: %p", (void *) pn_event_session(event));
-      break;
-    case PN_LINK_INIT:
-      pn_logf("link created: %p", (void *) pn_event_link(event));
-      break;
-    case PN_CONNECTION_REMOTE_OPEN:
-    case PN_CONNECTION_REMOTE_CLOSE:
-    case PN_CONNECTION_LOCAL_OPEN:
-    case PN_CONNECTION_LOCAL_CLOSE:
-      pn_messenger_process_connection(messenger, event);
-      break;
-    case PN_SESSION_REMOTE_OPEN:
-    case PN_SESSION_REMOTE_CLOSE:
-    case PN_SESSION_LOCAL_OPEN:
-    case PN_SESSION_LOCAL_CLOSE:
-      pn_messenger_process_session(messenger, event);
-      break;
-    case PN_LINK_REMOTE_OPEN:
-    case PN_LINK_REMOTE_CLOSE:
-    case PN_LINK_REMOTE_DETACH:
-    case PN_LINK_LOCAL_OPEN:
-    case PN_LINK_LOCAL_CLOSE:
-    case PN_LINK_LOCAL_DETACH:
-      pn_messenger_process_link(messenger, event);
-      break;
-    case PN_LINK_FLOW:
-      pn_messenger_process_flow(messenger, event);
-      break;
-    case PN_DELIVERY:
-      pn_messenger_process_delivery(messenger, event);
-      break;
-    case PN_TRANSPORT:
-    case PN_TRANSPORT_ERROR:
-    case PN_TRANSPORT_HEAD_CLOSED:
-    case PN_TRANSPORT_TAIL_CLOSED:
-    case PN_TRANSPORT_CLOSED:
-      pn_messenger_process_transport(messenger, event);
-      break;
-    case PN_EVENT_NONE:
-      break;
-    case PN_CONNECTION_BOUND:
-      break;
-    case PN_CONNECTION_UNBOUND:
-      break;
-    case PN_CONNECTION_FINAL:
-      break;
-    case PN_SESSION_FINAL:
-      break;
-    case PN_LINK_FINAL:
-      break;
-    default:
-      break;
-    }
-    pn_collector_pop(messenger->collector);
-  }
-
-  return processed;
-}
-
-/**
- * Function to invoke AMQP related timer events, such as a heartbeat to prevent
- * remote_idle timeout events
- */
-static void pni_messenger_tick(pn_messenger_t *messenger)
-{
-  for (size_t i = 0; i < pn_list_size(messenger->connections); i++) {
-    pn_connection_t *connection =
-        (pn_connection_t *)pn_list_get(messenger->connections, i);
-    pn_transport_t *transport = pn_connection_transport(connection);
-    if (transport) {
-      pn_transport_tick(transport, pn_i_now());
-
-      // if there is pending data, such as an empty heartbeat frame, call
-      // process events. This should kick off the chain of selectables for
-      // reading/writing.
-      ssize_t pending = pn_transport_pending(transport);
-      if (pending > 0) {
-        pn_connection_ctx_t *cctx =
-            (pn_connection_ctx_t *)pn_connection_get_context(connection);
-        pn_messenger_process_events(messenger);
-        pn_messenger_flow(messenger);
-        pni_conn_modified(pni_context(cctx->selectable));
-      }
-    }
-  }
-}
-
-int pn_messenger_process(pn_messenger_t *messenger)
-{
-  bool doMessengerTick = true;
-  pn_selectable_t *sel;
-  int events;
-  while ((sel = pn_selector_next(messenger->selector, &events))) {
-    if (events & PN_READABLE) {
-      pn_selectable_readable(sel);
-    }
-    if (events & PN_WRITABLE) {
-      pn_selectable_writable(sel);
-      doMessengerTick = false;
-    }
-    if (events & PN_EXPIRED) {
-      pn_selectable_expired(sel);
-    }
-    if (events & PN_ERROR) {
-      pn_selectable_error(sel);
-    }
-  }
-  // ensure timer events are processed. Cannot call this inside the while loop
-  // as the timer events are not seen by the selector
-  if (doMessengerTick) {
-    pni_messenger_tick(messenger);
-  }
-  if (messenger->interrupted) {
-    messenger->interrupted = false;
-    return PN_INTR;
-  } else {
-    return 0;
-  }
-}
-
-pn_timestamp_t pn_messenger_deadline(pn_messenger_t *messenger)
-{
-  // If the scheduler detects credit imbalance on the links, wake up
-  // in time to service credit drain
-  return messenger->next_drain;
-}
-
-int pni_wait(pn_messenger_t *messenger, int timeout)
-{
-  bool wake = false;
-  pn_selectable_t *sel;
-  while ((sel = pn_messenger_selectable(messenger))) {
-    if (pn_selectable_is_terminal(sel)) {
-      if (pn_selectable_is_registered(sel)) {
-        pn_selector_remove(messenger->selector, sel);
-      }
-      pn_selectable_free(sel);
-      // we can't wait if we end up freeing anything because we could
-      // be waiting on the stopped predicate which might become true
-      // as a result of the free
-      wake = true;
-    } else if (pn_selectable_is_registered(sel)) {
-      pn_selector_update(messenger->selector, sel);
-    } else {
-      pn_selector_add(messenger->selector, sel);
-      pn_selectable_set_registered(sel, true);
-    }
-  }
-
-  if (wake) return 0;
-
-  return pn_selector_select(messenger->selector, timeout);
-}
-
-int pn_messenger_tsync(pn_messenger_t *messenger, bool (*predicate)(pn_messenger_t *), int timeout)
-{
-  if (messenger->passive) {
-    bool pred = predicate(messenger);
-    return pred ? 0 : PN_INPROGRESS;
-  }
-
-  pn_timestamp_t now = pn_i_now();
-  long int deadline = now + timeout;
-  bool pred;
-
-  while (true) {
-    int error = pn_messenger_process(messenger);
-    pred = predicate(messenger);
-    if (error == PN_INTR) {
-      return pred ? 0 : PN_INTR;
-    }
-    int remaining = deadline - now;
-    if (pred || (timeout >= 0 && remaining < 0)) break;
-
-    pn_timestamp_t mdeadline = pn_messenger_deadline(messenger);
-    if (mdeadline) {
-      if (now >= mdeadline)
-        remaining = 0;
-      else {
-        const int delay = mdeadline - now;
-        remaining = (remaining < 0) ? delay : pn_min( remaining, delay );
-      }
-    }
-    error = pni_wait(messenger, remaining);
-    if (error) return error;
-
-    if (timeout >= 0) {
-      now = pn_i_now();
-    }
-  }
-
-  return pred ? 0 : PN_TIMEOUT;
-}
-
-int pn_messenger_sync(pn_messenger_t *messenger, bool (*predicate)(pn_messenger_t *))
-{
-  if (messenger->blocking) {
-    return pn_messenger_tsync(messenger, predicate, messenger->timeout);
-  } else {
-    int err = pn_messenger_tsync(messenger, predicate, 0);
-    if (err == PN_TIMEOUT) {
-      return PN_INPROGRESS;
-    } else {
-      return err;
-    }
-  }
-}
-
-static void pni_parse(pn_address_t *address);
-pn_connection_t *pn_messenger_resolve(pn_messenger_t *messenger,
-                                      const char *address, char **name);
-int pn_messenger_work(pn_messenger_t *messenger, int timeout);
-
-int pn_messenger_start(pn_messenger_t *messenger)
-{
-  if (!messenger) return PN_ARG_ERR;
-
-  int error = 0;
-
-  // When checking of routes is required we attempt to resolve each route
-  // with a substitution that has a defined scheme, address and port. If
-  // any of theses routes is invalid an appropriate error code will be
-  // returned. Currently no attempt is made to check the name part of the
-  // address, as the intent here is to fail fast if the addressed host
-  // is invalid or unavailable.
-  if (messenger->flags & PN_FLAGS_CHECK_ROUTES) {
-    pn_list_t *substitutions = pn_list(PN_WEAKREF, 0);
-    pn_transform_get_substitutions(messenger->routes, substitutions);
-    for (size_t i = 0; i < pn_list_size(substitutions) && error == 0; i++) {
-      pn_string_t *substitution = (pn_string_t *)pn_list_get(substitutions, i);
-      if (substitution) {
-        pn_address_t addr;
-        addr.text = pn_string(NULL);
-        error = pn_string_copy(addr.text, substitution);
-        if (!error) {
-          pni_parse(&addr);
-          if (addr.scheme && strlen(addr.scheme) > 0 &&
-              !strstr(addr.scheme, "$") && addr.host && strlen(addr.host) > 0 &&
-              !strstr(addr.host, "$") && addr.port && strlen(addr.port) > 0 &&
-              !strstr(addr.port, "$")) {
-            pn_string_t *check_addr = pn_string(NULL);
-            // ipv6 hosts need to be wrapped in [] within a URI
-            if (strstr(addr.host, ":")) {
-              pn_string_format(check_addr, "%s://[%s]:%s/", addr.scheme,
-                               addr.host, addr.port);
-            } else {
-              pn_string_format(check_addr, "%s://%s:%s/", addr.scheme,
-                               addr.host, addr.port);
-            }
-            char *name = NULL;
-            pn_connection_t *connection = pn_messenger_resolve(
-                messenger, pn_string_get(check_addr), &name);
-            pn_free(check_addr);
-            if (!connection) {
-              if (pn_error_code(messenger->error) == 0)
-                pn_error_copy(messenger->error, pn_io_error(messenger->io));
-              pn_error_format(messenger->error, PN_ERR,
-                              "CONNECTION ERROR (%s:%s): %s\n",
-                              messenger->address.host, messenger->address.port,
-                              pn_error_text(messenger->error));
-              error = pn_error_code(messenger->error);
-            } else {
-              // Send and receive outstanding messages until connection
-              // completes or an error occurs
-              int work = pn_messenger_work(messenger, -1);
-              pn_connection_ctx_t *cctx =
-                  (pn_connection_ctx_t *)pn_connection_get_context(connection);
-              while ((work > 0 ||
-                      (pn_connection_state(connection) & PN_REMOTE_UNINIT) ||
-                      pni_connection_pending(cctx->selectable) != (ssize_t)0) &&
-                     pn_error_code(messenger->error) == 0)
-                work = pn_messenger_work(messenger, 0);
-              if (work < 0 && work != PN_TIMEOUT) {
-                error = work;
-              } else {
-                error = pn_error_code(messenger->error);
-              }
-            }
-          }
-          pn_free(addr.text);
-        }
-      }
-    }
-    pn_free(substitutions);
-  }
-
-  return error;
-}
-
-bool pn_messenger_stopped(pn_messenger_t *messenger)
-{
-  return pn_list_size(messenger->connections) == 0 && pn_list_size(messenger->listeners) == 0;
-}
-
-int pn_messenger_stop(pn_messenger_t *messenger)
-{
-  if (!messenger) return PN_ARG_ERR;
-
-  for (size_t i = 0; i < pn_list_size(messenger->connections); i++) {
-    pn_connection_t *conn = (pn_connection_t *) pn_list_get(messenger->connections, i);
-    pn_link_t *link = pn_link_head(conn, PN_LOCAL_ACTIVE);
-    while (link) {
-      pn_link_close(link);
-      link = pn_link_next(link, PN_LOCAL_ACTIVE);
-    }
-    pn_connection_close(conn);
-  }
-
-  for (size_t i = 0; i < pn_list_size(messenger->listeners); i++) {
-    pn_listener_ctx_t *lnr = (pn_listener_ctx_t *) pn_list_get(messenger->listeners, i);
-    pn_selectable_terminate(lnr->selectable);
-    pni_lnr_modified(lnr);
-  }
-
-  return pn_messenger_sync(messenger, pn_messenger_stopped);
-}
-
-static void pni_parse(pn_address_t *address)
-{
-  address->passive = false;
-  address->scheme = NULL;
-  address->user = NULL;
-  address->pass = NULL;
-  address->host = NULL;
-  address->port = NULL;
-  address->name = NULL;
-  pni_parse_url(pn_string_buffer(address->text), &address->scheme, &address->user,
-            &address->pass, &address->host, &address->port, &address->name);
-  if (address->host[0] == '~') {
-    address->passive = true;
-    address->host++;
-  }
-}
-
-static int pni_route(pn_messenger_t *messenger, const char *address)
-{
-  pn_address_t *addr = &messenger->address;
-  int err = pn_transform_apply(messenger->routes, address, addr->text);
-  if (err) return pn_error_format(messenger->error, PN_ERR,
-                                  "transformation error");
-  pni_parse(addr);
-  return 0;
-}
-
-pn_connection_t *pn_messenger_resolve(pn_messenger_t *messenger, const char *address, char **name)
-{
-  assert(messenger);
-  messenger->connection_error = 0;
-  pn_string_t *domain = messenger->domain;
-
-  int err = pni_route(messenger, address);
-  if (err) return NULL;
-
-  bool passive = messenger->address.passive;
-  char *scheme = messenger->address.scheme;
-  char *user = messenger->address.user;
-  char *pass = messenger->address.pass;
-  char *host = messenger->address.host;
-  char *port = messenger->address.port;
-  *name = messenger->address.name;
-
-  if (passive) {
-    for (size_t i = 0; i < pn_list_size(messenger->listeners); i++) {
-      pn_listener_ctx_t *ctx = (pn_listener_ctx_t *) pn_list_get(messenger->listeners, i);
-      if (pn_streq(host, ctx->host) && pn_streq(port, ctx->port)) {
-        return NULL;
-      }
-    }
-
-    pn_listener_ctx(messenger, scheme, host, port);
-    return NULL;
-  }
-
-  pn_string_set(domain, "");
-
-  if (user) {
-    pn_string_addf(domain, "%s@", user);
-  }
-  pn_string_addf(domain, "%s", host);
-  if (port) {
-    pn_string_addf(domain, ":%s", port);
-  }
-
-  for (size_t i = 0; i < pn_list_size(messenger->connections); i++) {
-    pn_connection_t *connection = (pn_connection_t *) pn_list_get(messenger->connections, i);
-    pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pn_connection_get_context(connection);
-    if (pn_streq(scheme, ctx->scheme) && pn_streq(user, ctx->user) &&
-        pn_streq(pass, ctx->pass) && pn_streq(host, ctx->host) &&
-        pn_streq(port, ctx->port)) {
-      return connection;
-    }
-    const char *container = pn_connection_remote_container(connection);
-    if (pn_streq(container, pn_string_get(domain))) {
-      return connection;
-    }
-  }
-
-  pn_socket_t sock = pn_connect(messenger->io, host, port ? port : default_port(scheme));
-  if (sock == PN_INVALID_SOCKET) {
-    pn_error_copy(messenger->error, pn_io_error(messenger->io));
-    pn_error_format(messenger->error, PN_ERR, "CONNECTION ERROR (%s:%s): %s\n",
-                    messenger->address.host, messenger->address.port,
-                    pn_error_text(messenger->error));
-    return NULL;
-  }
-
-  pn_connection_t *connection =
-    pn_messenger_connection(messenger, sock, scheme, user, pass, host, port, NULL);
-  pn_transport_t *transport = pn_transport();
-  if (messenger->flags & PN_FLAGS_ALLOW_INSECURE_MECHS && user && pass) {
-      pn_sasl_t *s = pn_sasl(transport);
-      pn_sasl_set_allow_insecure_mechs(s, true);
-  }
-  pn_transport_bind(transport, connection);
-  pn_decref(transport);
-  pn_connection_ctx_t *ctx = (pn_connection_ctx_t *) pn_connection_get_context(connection);
-  pn_selectable_t *sel = ctx->selectable;
-  err = pn_transport_config(messenger, connection);
-  if (err) {
-    pn_selectable_free(sel);
-    messenger->connection_error = err;
-    return NULL;
-  }
-
-  pn_connection_open(connection);
-
-  return connection;
-}
-
-pn_link_t *pn_messenger_get_link(pn_messenger_t *messenger,
-                                           const char *address, bool sender)
-{
-  char *name = NULL;
-  pn_connection_t *connection = pn_messenger_resolve(messenger, address, &name);
-  if (!connection) return NULL;
-
-  pn_link_t *link = pn_link_head(connection, PN_LOCAL_ACTIVE);
-  while (link) {
-    if (pn_link_is_sender(link) == sender) {
-      const char *terminus = pn_link_is_sender(link) ?
-        pn_terminus_get_address(pn_link_target(link)) :
-        pn_terminus_get_address(pn_link_source(link));
-      if (pn_streq(name, terminus))
-        return link;
-    }
-    link = pn_link_next(link, PN_LOCAL_ACTIVE);
-  }
-  return NULL;
-}
-
-pn_link_t *pn_messenger_link(pn_messenger_t *messenger, const char *address,
-                             bool sender, pn_seconds_t timeout)
-{
-  char *name = NULL;
-  pn_connection_t *connection = pn_messenger_resolve(messenger, address, &name);
-  if (!connection)
-    return NULL;
-  pn_connection_ctx_t *cctx =
-      (pn_connection_ctx_t *)pn_connection_get_context(connection);
-
-  pn_link_t *link = pn_messenger_get_link(messenger, address, sender);
-  if (link)
-    return link;
-
-  pn_session_t *ssn = pn_session(connection);
-  pn_session_open(ssn);
-  if (sender) {
-    link = pn_sender(ssn, "sender-xxx");
-  } else {
-    if (name) {
-      link = pn_receiver(ssn, name);
-    } else {
-      link = pn_receiver(ssn, "");
-    }
-  }
-
-  if ((sender && pn_messenger_get_outgoing_window(messenger)) ||
-      (!sender && pn_messenger_get_incoming_window(messenger))) {
-    if (messenger->snd_settle_mode == -1) { /* Choose default based on sender/receiver */
-      /* For a sender use MIXED so the application can decide whether each
-         message is settled or not. For a receiver request UNSETTLED, since the
-         user set an incoming_window which means they want to decide settlement.
-      */
-      pn_link_set_snd_settle_mode(link, sender ? PN_SND_MIXED : PN_SND_UNSETTLED);
-    } else {                    /* Respect user setting */
-      pn_link_set_snd_settle_mode(link, (pn_snd_settle_mode_t)messenger->snd_settle_mode);
-    }
-    pn_link_set_rcv_settle_mode(link, messenger->rcv_settle_mode);
-  }
-  if (pn_streq(name, "#")) {
-    if (pn_link_is_sender(link)) {
-      pn_terminus_set_dynamic(pn_link_target(link), true);
-    } else {
-      pn_terminus_set_dynamic(pn_link_source(link), true);
-    }
-  } else {
-    pn_terminus_set_address(pn_link_target(link), name);
-    pn_terminus_set_address(pn_link_source(link), name);
-  }
-  link_ctx_setup( messenger, connection, link );
-
-  if (timeout > 0) {
-    pn_terminus_set_expiry_policy(pn_link_target(link), PN_EXPIRE_WITH_LINK);
-    pn_terminus_set_expiry_policy(pn_link_source(link), PN_EXPIRE_WITH_LINK);
-    pn_terminus_set_timeout(pn_link_target(link), timeout);
-    pn_terminus_set_timeout(pn_link_source(link), timeout);
-  }
-
-  if (!sender) {
-    pn_link_ctx_t *ctx = (pn_link_ctx_t *)pn_link_get_context(link);
-    assert( ctx );
-    ctx->subscription = pn_subscription(messenger, cctx->scheme, cctx->host,
-                                        cctx->port);
-  }
-  pn_link_open(link);
-  return link;
-}
-
-pn_link_t *pn_messenger_source(pn_messenger_t *messenger, const char *source,
-                               pn_seconds_t timeout)
-{
-  return pn_messenger_link(messenger, source, false, timeout);
-}
-
-pn_link_t *pn_messenger_target(pn_messenger_t *messenger, const char *target,
-                               pn_seconds_t timeout)
-{
-  return pn_messenger_link(messenger, target, true, timeout);
-}
-
-pn_subscription_t *pn_messenger_subscribe(pn_messenger_t *messenger, const char *source)
-{
-  return pn_messenger_subscribe_ttl(messenger, source, 0);
-}
-
-pn_subscription_t *pn_messenger_subscribe_ttl(pn_messenger_t *messenger,
-                                              const char *source,
-                                              pn_seconds_t timeout)
-{
-  pni_route(messenger, source);
-  if (pn_error_code(messenger->error)) return NULL;
-
-  bool passive = messenger->address.passive;
-  char *scheme = messenger->address.scheme;
-  char *host = messenger->address.host;
-  char *port = messenger->address.port;
-
-  if (passive) {
-    pn_listener_ctx_t *ctx = pn_listener_ctx(messenger, scheme, host, port);
-    if (ctx) {
-      return ctx->subscription;
-    } else {
-      return NULL;
-    }
-  } else {
-    pn_link_t *src = pn_messenger_source(messenger, source, timeout);
-    if (!src) return NULL;
-    pn_link_ctx_t *ctx = (pn_link_ctx_t *) pn_link_get_context( src );
-    return ctx ? ctx->subscription : NULL;
-  }
-}
-
-int pn_messenger_get_outgoing_window(pn_messenger_t *messenger)
-{
-  return pni_store_get_window(messenger->outgoing);
-}
-
-int pn_messenger_set_outgoing_window(pn_messenger_t *messenger, int window)
-{
-  pni_store_set_window(messenger->outgoing, window);
-  return 0;
-}
-
-int pn_messenger_get_incoming_window(pn_messenger_t *messenger)
-{
-  return pni_store_get_window(messenger->incoming);
-}
-
-int pn_messenger_set_incoming_window(pn_messenger_t *messenger, int window)
-{
-  pni_store_set_window(messenger->incoming, window);
-  return 0;
-}
-
-static void outward_munge(pn_messenger_t *mng, pn_message_t *msg)
-{
-  char stackbuf[256];
-  char *heapbuf = NULL;
-  char *buf = stackbuf;
-  const char *address = pn_message_get_reply_to(msg);
-  int len = address ? strlen(address) : 0;
-  if (len > 1 && address[0] == '~' && address[1] == '/') {
-    unsigned needed = len + strlen(mng->name) + 9;
-    if (needed > sizeof(stackbuf)) {
-      heapbuf = (char *) malloc(needed);
-      buf = heapbuf;
-    }
-    sprintf(buf, "amqp://%s/%s", mng->name, address + 2);
-    pn_message_set_reply_to(msg, buf);
-  } else if (len == 1 && address[0] == '~') {
-    unsigned needed = strlen(mng->name) + 8;
-    if (needed > sizeof(stackbuf)) {
-      heapbuf = (char *) malloc(needed);
-      buf = heapbuf;
-    }
-    sprintf(buf, "amqp://%s", mng->name);
-    pn_message_set_reply_to(msg, buf);
-  }
-  if (heapbuf) free (heapbuf);
-}
-
-int pni_bump_out(pn_messenger_t *messenger, const char *address)
-{
-  pni_entry_t *entry = pni_store_get(messenger->outgoing, address);
-  if (!entry) return 0;
-
-  pni_entry_set_status(entry, PN_STATUS_ABORTED);
-  pni_entry_free(entry);
-  return 0;
-}
-
-int pni_pump_out(pn_messenger_t *messenger, const char *address, pn_link_t *sender)
-{
-  pni_entry_t *entry = pni_store_get(messenger->outgoing, address);
-  if (!entry) {
-    pn_link_drained(sender);
-    return 0;
-  }
-
-  pn_buffer_t *buf = pni_entry_bytes(entry);
-  pn_bytes_t bytes = pn_buffer_bytes(buf);
-  const char *encoded = bytes.start;
-  size_t size = bytes.size;
-
-  // XXX: proper tag
-  char tag[8];
-  void *ptr = &tag;
-  uint64_t next = messenger->next_tag++;
-  *((uint64_t *) ptr) = next;
-  pn_delivery_t *d = pn_delivery(sender, pn_dtag(tag, 8));
-  pni_entry_set_delivery(entry, d);
-  ssize_t n = pn_link_send(sender, encoded, size);
-  if (n < 0) {
-    pni_entry_free(entry);
-    return pn_error_format(messenger->error, n, "send error: %s",
-                           pn_error_text(pn_link_error(sender)));
-  } else {
-    pn_link_advance(sender);
-    pni_entry_free(entry);
-    return 0;
-  }
-}
-
-static void pni_default_rewrite(pn_messenger_t *messenger, const char *address,
-                                pn_string_t *dst)
-{
-  pn_address_t *addr = &messenger->address;
-  if (address && strstr(address, "@")) {
-    int err = pn_string_set(addr->text, address);
-    if (err) assert(false);
-    pni_parse(addr);
-    if (addr->user || addr->pass)
-    {
-      pn_string_format(messenger->rewritten, "%s%s%s%s%s%s%s",
-                       addr->scheme ? addr->scheme : "",
-                       addr->scheme ? "://" : "",
-                       addr->host,
-                       addr->port ? ":" : "",
-                       addr->port ? addr->port : "",
-                       addr->name ? "/" : "",
-                       addr->name ? addr->name : "");
-    }
-  }
-}
-
-static void pni_rewrite(pn_messenger_t *messenger, pn_message_t *msg)
-{
-  const char *address = pn_message_get_address(msg);
-  pn_string_set(messenger->original, address);
-
-  int err = pn_transform_apply(messenger->rewrites, address,
-                               messenger->rewritten);
-  if (err) assert(false);
-  if (!pn_transform_matched(messenger->rewrites)) {
-    pni_default_rewrite(messenger, pn_string_get(messenger->rewritten),
-                        messenger->rewritten);
-  }
-  pn_message_set_address(msg, pn_string_get(messenger->rewritten));
-}
-
-static void pni_restore(pn_messenger_t *messenger, pn_message_t *msg)
-{
-  pn_message_set_address(msg, pn_string_get(messenger->original));
-}
-
-int pn_messenger_put(pn_messenger_t *messenger, pn_message_t *msg)
-{
-  if (!messenger) return PN_ARG_ERR;
-  if (!msg) return pn_error_set(messenger->error, PN_ARG_ERR, "null message");
-  outward_munge(messenger, msg);
-  const char *address = pn_message_get_address(msg);
-
-  pni_entry_t *entry = pni_store_put(messenger->outgoing, address);
-  if (!entry)
-    return pn_error_format(messenger->error, PN_ERR, "store error");
-
-  messenger->outgoing_tracker = pn_tracker(OUTGOING, pni_entry_track(entry));
-  pn_buffer_t *buf = pni_entry_bytes(entry);
-
-  pni_rewrite(messenger, msg);
-  while (true) {
-    char *encoded = pn_buffer_memory(buf).start;
-    size_t size = pn_buffer_capacity(buf);
-    int err = pn_message_encode(msg, encoded, &size);
-    if (err == PN_OVERFLOW) {
-      err = pn_buffer_ensure(buf, 2*pn_buffer_capacity(buf));
-      if (err) {
-        pni_entry_free(entry);
-        pni_restore(messenger, msg);
-        return pn_error_format(messenger->error, err, "put: error growing buffer");
-      }
-    } else if (err) {
-      pni_restore(messenger, msg);
-      return pn_error_format(messenger->error, err, "encode error: %s",
-                             pn_message_error(msg));
-    } else {
-      pni_restore(messenger, msg);
-      pn_buffer_append(buf, encoded, size); // XXX
-      pn_link_t *sender = pn_messenger_target(messenger, address, 0);
-      if (!sender) {
-        int err = pn_error_code(messenger->error);
-        if (err) {
-          return err;
-        } else if (messenger->connection_error) {
-          return pni_bump_out(messenger, address);
-        } else {
-          return 0;
-        }
-      } else {
-        return pni_pump_out(messenger, address, sender);
-      }
-    }
-  }
-
-  return PN_ERR;
-}
-
-pn_tracker_t pn_messenger_outgoing_tracker(pn_messenger_t *messenger)
-{
-  assert(messenger);
-  return messenger->outgoing_tracker;
-}
-
-pni_store_t *pn_tracker_store(pn_messenger_t *messenger, pn_tracker_t tracker)
-{
-  if (pn_tracker_direction(tracker) == OUTGOING) {
-    return messenger->outgoing;
-  } else {
-    return messenger->incoming;
-  }
-}
-
-pn_status_t pn_messenger_status(pn_messenger_t *messenger, pn_tracker_t tracker)
-{
-  pni_store_t *store = pn_tracker_store(messenger, tracker);
-  pni_entry_t *e = pni_store_entry(store, pn_tracker_sequence(tracker));
-  if (e) {
-    return pni_entry_get_status(e);
-  } else {
-    return PN_STATUS_UNKNOWN;
-  }
-}
-
-pn_delivery_t *pn_messenger_delivery(pn_messenger_t *messenger,
-                                     pn_tracker_t tracker)
-{
-  pni_store_t *store = pn_tracker_store(messenger, tracker);
-  pni_entry_t *e = pni_store_entry(store, pn_tracker_sequence(tracker));
-  if (e) {
-    return pni_entry_get_delivery(e);
-  } else {
-    return NULL;
-  }
-}
-
-bool pn_messenger_buffered(pn_messenger_t *messenger, pn_tracker_t tracker)
-{
-  pni_store_t *store = pn_tracker_store(messenger, tracker);
-  pni_entry_t *e = pni_store_entry(store, pn_tracker_sequence(tracker));
-  if (e) {
-    pn_delivery_t *d = pni_entry_get_delivery(e);
-    if (d) {
-      bool b = pn_delivery_buffered(d);
-      return b;
-    } else {
-      return true;
-    }
-  } else {
-    return false;
-  }
-}
-
-int pn_messenger_settle(pn_messenger_t *messenger, pn_tracker_t tracker, int flags)
-{
-  pni_store_t *store = pn_tracker_store(messenger, tracker);
-  return pni_store_update(store, pn_tracker_sequence(tracker), PN_STATUS_UNKNOWN, flags, true, true);
-}
-
-// true if all pending output has been sent to peer
-bool pn_messenger_sent(pn_messenger_t *messenger)
-{
-  int total = pni_store_size(messenger->outgoing);
-
-  for (size_t i = 0; i < pn_list_size(messenger->connections); i++)
-  {
-    pn_connection_t *conn = (pn_connection_t *) pn_list_get(messenger->connections, i);
-    // check if transport is done generating output
-    pn_transport_t *transport = pn_connection_transport(conn);
-    if (transport) {
-      if (!pn_transport_quiesced(transport)) {
-        return false;
-      }
-    }
-
-    pn_link_t *link = pn_link_head(conn, PN_LOCAL_ACTIVE);
-    while (link) {
-      if (pn_link_is_sender(link)) {
-        total += pn_link_queued(link);
-
-        pn_delivery_t *d = pn_unsettled_head(link);
-        while (d) {
-          if (!pn_delivery_remote_state(d) && !pn_delivery_settled(d)) {
-            total++;
-          }
-          d = pn_unsettled_next(d);
-        }
-      }
-      link = pn_link_next(link, PN_LOCAL_ACTIVE);
-    }
-  }
-
-  return total <= messenger->send_threshold;
-}
-
-bool pn_messenger_rcvd(pn_messenger_t *messenger)
-{
-  if (pni_store_size(messenger->incoming) > 0) return true;
-
-  for (size_t i = 0; i < pn_list_size(messenger->connections); i++)
-  {
-    pn_connection_t *conn = (pn_connection_t *) pn_list_get(messenger->connections, i);
-
-    pn_delivery_t *d = pn_work_head(conn);
-    while (d) {
-      if (pn_delivery_readable(d) && !pn_delivery_partial(d)) {
-        return true;
-      }
-      d = pn_work_next(d);
-    }
-  }
-
-  if (!pn_list_size(messenger->connections) && !pn_list_size(messenger->listeners)) {
-    return true;
-  } else {
-    return false;
-  }
-}
-
-static bool work_pred(pn_messenger_t *messenger) {
-  return messenger->worked;
-}
-
-int pn_messenger_work(pn_messenger_t *messenger, int timeout)
-{
-  messenger->worked = false;
-  int err = pn_messenger_tsync(messenger, work_pred, timeout);
-  if (err) {
-    return err;
-  }
-  return (int) (messenger->worked ? 1 : 0);
-}
-
-int pni_messenger_work(pn_messenger_t *messenger)
-{
-  if (messenger->blocking) {
-    return pn_messenger_work(messenger, messenger->timeout);
-  } else {
-    int err = pn_messenger_work(messenger, 0);
-    if (err == PN_TIMEOUT) {
-      return PN_INPROGRESS;
-    } else {
-      return err;
-    }
-  }
-}
-
-int pn_messenger_interrupt(pn_messenger_t *messenger)
-{
-  assert(messenger);
-  ssize_t n = pn_write(messenger->io, messenger->ctrl[1], "x", 1);
-  if (n <= 0) {
-    return n;
-  } else {
-    return 0;
-  }
-}
-
-int pn_messenger_send(pn_messenger_t *messenger, int n)
-{
-  if (n == -1) {
-    messenger->send_threshold = 0;
-  } else {
-    messenger->send_threshold = pn_messenger_outgoing(messenger) - n;
-    if (messenger->send_threshold < 0)
-      messenger->send_threshold = 0;
-  }
-  return pn_messenger_sync(messenger, pn_messenger_sent);
-}
-
-int pn_messenger_recv(pn_messenger_t *messenger, int n)
-{
-  if (!messenger) return PN_ARG_ERR;
-  if (messenger->blocking && !pn_list_size(messenger->listeners)
-      && !pn_list_size(messenger->connections))
-    return pn_error_format(messenger->error, PN_STATE_ERR, "no valid sources");
-
-  // re-compute credit, and update credit scheduler
-  if (n == -2) {
-    messenger->credit_mode = LINK_CREDIT_MANUAL;
-  } else if (n == -1) {
-    messenger->credit_mode = LINK_CREDIT_AUTO;
-  } else {
-    messenger->credit_mode = LINK_CREDIT_EXPLICIT;
-    if (n > messenger->distributed)
-      messenger->credit = n - messenger->distributed;
-    else  // cancel unallocated
-      messenger->credit = 0;
-  }
-  pn_messenger_flow(messenger);
-  int err = pn_messenger_sync(messenger, pn_messenger_rcvd);
-  if (err) return err;
-  if (!pn_messenger_incoming(messenger) &&
-      messenger->blocking &&
-      !pn_list_size(messenger->listeners) &&
-      !pn_list_size(messenger->connections)) {
-    return pn_error_format(messenger->error, PN_STATE_ERR, "no valid sources");
-  } else {
-    return 0;
-  }
-}
-
-int pn_messenger_receiving(pn_messenger_t *messenger)
-{
-  assert(messenger);
-  return messenger->credit + messenger->distributed;
-}
-
-int pn_messenger_get(pn_messenger_t *messenger, pn_message_t *msg)
-{
-  if (!messenger) return PN_ARG_ERR;
-
-  pni_entry_t *entry = pni_store_get(messenger->incoming, NULL);
-  // XXX: need to drain credit before returning EOS
-  if (!entry) return PN_EOS;
-
-  messenger->incoming_tracker = pn_tracker(INCOMING, pni_entry_track(entry));
-  pn_buffer_t *buf = pni_entry_bytes(entry);
-  pn_bytes_t bytes = pn_buffer_bytes(buf);
-  const char *encoded = bytes.start;
-  size_t size = bytes.size;
-
-  messenger->incoming_subscription = (pn_subscription_t *) pni_entry_get_context(entry);
-
-  if (msg) {
-    int err = pn_message_decode(msg, encoded, size);
-    pni_entry_free(entry);
-    if (err) {
-      return pn_error_format(messenger->error, err, "error decoding message: %s",
-                             pn_message_error(msg));
-    } else {
-      return 0;
-    }
-  } else {
-    pni_entry_free(entry);
-    return 0;
-  }
-}
-
-pn_tracker_t pn_messenger_incoming_tracker(pn_messenger_t *messenger)
-{
-  assert(messenger);
-  return messenger->incoming_tracker;
-}
-
-pn_subscription_t *pn_messenger_incoming_subscription(pn_messenger_t *messenger)
-{
-  assert(messenger);
-  return messenger->incoming_subscription;
-}
-
-int pn_messenger_accept(pn_messenger_t *messenger, pn_tracker_t tracker, int flags)
-{
-  if (pn_tracker_direction(tracker) != INCOMING) {
-    return pn_error_format(messenger->error, PN_ARG_ERR,
-                           "invalid tracker, incoming tracker required");
-  }
-
-  return pni_store_update(messenger->incoming, pn_tracker_sequence(tracker),
-                          PN_STATUS_ACCEPTED, flags, false, false);
-}
-
-int pn_messenger_reject(pn_messenger_t *messenger, pn_tracker_t tracker, int flags)
-{
-  if (pn_tracker_direction(tracker) != INCOMING) {
-    return pn_error_format(messenger->error, PN_ARG_ERR,
-                           "invalid tracker, incoming tracker required");
-  }
-
-  return pni_store_update(messenger->incoming, pn_tracker_sequence(tracker),
-                          PN_STATUS_REJECTED, flags, false, false);
-}
-
-pn_link_t *pn_messenger_tracker_link(pn_messenger_t *messenger,
-                                               pn_tracker_t tracker)
-{
-  pni_store_t *store = pn_tracker_store(messenger, tracker);
-  pni_entry_t *e = pni_store_entry(store, pn_tracker_sequence(tracker));
-  if (e) {
-    pn_delivery_t *d = pni_entry_get_delivery(e);
-    if (d) {
-      return pn_delivery_link(d);
-    }
-  }
-  return NULL;
-}
-
-int pn_messenger_queued(pn_messenger_t *messenger, bool sender)
-{
-  if (!messenger) return 0;
-
-  int result = 0;
-
-  for (size_t i = 0; i < pn_list_size(messenger->connections); i++) {
-    pn_connection_t *conn = (pn_connection_t *) pn_list_get(messenger->connections, i);
-
-    pn_link_t *link = pn_link_head(conn, PN_LOCAL_ACTIVE);
-    while (link) {
-      if (pn_link_is_sender(link)) {
-        if (sender) {
-          result += pn_link_queued(link);
-        }
-      } else if (!sender) {
-        result += pn_link_queued(link);
-      }
-      link = pn_link_next(link, PN_LOCAL_ACTIVE);
-    }
-  }
-
-  return result;
-}
-
-int pn_messenger_outgoing(pn_messenger_t *messenger)
-{
-  return pni_store_size(messenger->outgoing) + pn_messenger_queued(messenger, true);
-}
-
-int pn_messenger_incoming(pn_messenger_t *messenger)
-{
-  return pni_store_size(messenger->incoming) + pn_messenger_queued(messenger, false);
-}
-
-int pn_messenger_route(pn_messenger_t *messenger, const char *pattern, const char *address)
-{
-  pn_transform_rule(messenger->routes, pattern, address);
-  return 0;
-}
-
-int pn_messenger_rewrite(pn_messenger_t *messenger, const char *pattern, const char *address)
-{
-  pn_transform_rule(messenger->rewrites, pattern, address);
-  return 0;
-}
-
-int pn_messenger_set_flags(pn_messenger_t *messenger, const int flags)
-{
-  if (!messenger)
-    return PN_ARG_ERR;
-  if (flags == 0) {
-    messenger->flags = 0;
-  } else if (flags & (PN_FLAGS_CHECK_ROUTES | PN_FLAGS_ALLOW_INSECURE_MECHS)) {
-    messenger->flags |= flags;
-  } else {
-    return PN_ARG_ERR;
-  }
-  return 0;
-}
-
-int pn_messenger_get_flags(pn_messenger_t *messenger)
-{
-  return messenger ? messenger->flags : 0;
-}
-
-int pn_messenger_set_snd_settle_mode(pn_messenger_t *messenger,
-                                     const pn_snd_settle_mode_t mode)
-{
-  if (!messenger)
-    return PN_ARG_ERR;
-  messenger->snd_settle_mode = mode;
-  return 0;
-}
-
-int pn_messenger_set_rcv_settle_mode(pn_messenger_t *messenger,
-                                     const pn_rcv_settle_mode_t mode)
-{
-  if (!messenger)
-    return PN_ARG_ERR;
-  messenger->rcv_settle_mode = mode;
-  return 0;
-}
-
-void pn_messenger_set_tracer(pn_messenger_t *messenger, pn_tracer_t tracer)
-{
-  assert(messenger);
-  assert(tracer);
-
-  messenger->tracer = tracer;
-}
-
-pn_millis_t pn_messenger_get_remote_idle_timeout(pn_messenger_t *messenger,
-                                                 const char *address)
-{
-  if (!messenger)
-    return PN_ARG_ERR;
-
-  pn_address_t addr;
-  addr.text = pn_string(address);
-  pni_parse(&addr);
-
-  pn_millis_t timeout = -1;
-  for (size_t i = 0; i < pn_list_size(messenger->connections); i++) {
-    pn_connection_t *connection =
-        (pn_connection_t *)pn_list_get(messenger->connections, i);
-    pn_connection_ctx_t *ctx =
-        (pn_connection_ctx_t *)pn_connection_get_context(connection);
-    if (pn_streq(addr.scheme, ctx->scheme) && pn_streq(addr.host, ctx->host) &&
-        pn_streq(addr.port, ctx->port)) {
-      pn_transport_t *transport = pn_connection_transport(connection);
-      if (transport)
-        timeout = pn_transport_get_remote_idle_timeout(transport);
-      break;
-    }
-  }
-  return timeout;
-}
-
-int
-pn_messenger_set_ssl_peer_authentication_mode(pn_messenger_t *messenger,
-                                              const pn_ssl_verify_mode_t mode)
-{
-  if (!messenger)
-    return PN_ARG_ERR;
-  messenger->ssl_peer_authentication_mode = mode;
-  return 0;
-}
diff --git a/proton-c/src/messenger/messenger.h b/proton-c/src/messenger/messenger.h
deleted file mode 100644
index 01b1838..0000000
--- a/proton-c/src/messenger/messenger.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef _PROTON_MESSENGER_H
-#define _PROTON_MESSENGER_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/messenger.h>
-
-int pni_messenger_add_subscription(pn_messenger_t *messenger, pn_subscription_t *subscription);
-int pni_messenger_work(pn_messenger_t *messenger);
-
-#endif /* messenger.h */
diff --git a/proton-c/src/messenger/store.c b/proton-c/src/messenger/store.c
deleted file mode 100644
index 44f24f1..0000000
--- a/proton-c/src/messenger/store.c
+++ /dev/null
@@ -1,442 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/messenger.h>
-#include <proton/engine.h>
-#include <proton/object.h>
-#include <assert.h>
-#ifndef __cplusplus
-#include <stdbool.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-#include "core/util.h"
-#include "store.h"
-
-typedef struct pni_stream_t pni_stream_t;
-
-struct pni_store_t {
-  pni_stream_t *streams;
-  pni_entry_t *store_head;
-  pni_entry_t *store_tail;
-  pn_hash_t *tracked;
-  size_t size;
-  int window;
-  pn_sequence_t lwm;
-  pn_sequence_t hwm;
-};
-
-struct pni_stream_t {
-  pni_store_t *store;
-  pn_string_t *address;
-  pni_entry_t *stream_head;
-  pni_entry_t *stream_tail;
-  pni_stream_t *next;
-};
-
-struct pni_entry_t {
-  pni_stream_t *stream;
-  pni_entry_t *stream_next;
-  pni_entry_t *stream_prev;
-  pni_entry_t *store_next;
-  pni_entry_t *store_prev;
-  pn_buffer_t *bytes;
-  pn_delivery_t *delivery;
-  void *context;
-  pn_status_t status;
-  pn_sequence_t id;
-  bool free;
-};
-
-void pni_entry_finalize(void *object)
-{
-  pni_entry_t *entry = (pni_entry_t *) object;
-  assert(entry->free);
-  pn_delivery_t *d = entry->delivery;
-  if (d) {
-    pn_delivery_settle(d);
-    pni_entry_set_delivery(entry, NULL);
-  }
-}
-
-pni_store_t *pni_store()
-{
-  pni_store_t *store = (pni_store_t *) malloc(sizeof(pni_store_t));
-  if (!store) return NULL;
-
-  store->size = 0;
-  store->streams = NULL;
-  store->store_head = NULL;
-  store->store_tail = NULL;
-  store->window = 0;
-  store->lwm = 0;
-  store->hwm = 0;
-  store->tracked = pn_hash(PN_OBJECT, 0, 0.75);
-
-  return store;
-}
-
-size_t pni_store_size(pni_store_t *store)
-{
-  assert(store);
-  return store->size;
-}
-
-pni_stream_t *pni_stream(pni_store_t *store, const char *address, bool create)
-{
-  assert(store);
-  assert(address);
-
-  pni_stream_t *prev = NULL;
-  pni_stream_t *stream = store->streams;
-  while (stream) {
-    if (!strcmp(pn_string_get(stream->address), address)) {
-      return stream;
-    }
-    prev = stream;
-    stream = stream->next;
-  }
-
-  if (create) {
-    stream = (pni_stream_t *) malloc(sizeof(pni_stream_t));
-    if (stream != NULL) {
-      stream->store = store;
-      stream->address = pn_string(address);
-      stream->stream_head = NULL;
-      stream->stream_tail = NULL;
-      stream->next = NULL;
-
-      if (prev) {
-        prev->next = stream;
-      } else {
-        store->streams = stream;
-      }
-    }
-  }
-
-  return stream;
-}
-
-pni_stream_t *pni_stream_head(pni_store_t *store)
-{
-  assert(store);
-  return store->streams;
-}
-
-pni_stream_t *pni_stream_next(pni_stream_t *stream)
-{
-  assert(stream);
-  return stream->next;
-}
-
-void pni_entry_free(pni_entry_t *entry)
-{
-  if (!entry) return;
-  pni_stream_t *stream = entry->stream;
-  pni_store_t *store = stream->store;
-  LL_REMOVE(stream, stream, entry);
-  LL_REMOVE(store, store, entry);
-  entry->free = true;
-
-  pn_buffer_free(entry->bytes);
-  entry->bytes = NULL;
-  pn_decref(entry);
-  store->size--;
-}
-
-void pni_stream_free(pni_stream_t *stream)
-{
-  if (!stream) return;
-  pni_entry_t *entry;
-  while ((entry = LL_HEAD(stream, stream))) {
-    pni_entry_free(entry);
-  }
-  pn_free(stream->address);
-  stream->address = NULL;
-  free(stream);
-}
-
-void pni_store_free(pni_store_t *store)
-{
-  if (!store) return;
-  pn_free(store->tracked);
-  pni_stream_t *stream = store->streams;
-  while (stream) {
-    pni_stream_t *next = stream->next;
-    pni_stream_free(stream);
-    stream = next;
-  }
-  free(store);
-}
-
-pni_stream_t *pni_stream_put(pni_store_t *store, const char *address)
-{
-  assert(store); assert(address);
-  return pni_stream(store, address, true);
-}
-
-pni_stream_t *pni_stream_get(pni_store_t *store, const char *address)
-{
-  assert(store); assert(address);
-  return pni_stream(store, address, false);
-}
-
-#define CID_pni_entry CID_pn_object
-#define pni_entry_initialize NULL
-#define pni_entry_hashcode NULL
-#define pni_entry_compare NULL
-#define pni_entry_inspect NULL
-
-pni_entry_t *pni_store_put(pni_store_t *store, const char *address)
-{
-  assert(store);
-  static const pn_class_t clazz = PN_CLASS(pni_entry);
-
-  if (!address) address = "";
-  pni_stream_t *stream = pni_stream_put(store, address);
-  if (!stream) return NULL;
-  pni_entry_t *entry = (pni_entry_t *) pn_class_new(&clazz, sizeof(pni_entry_t));
-  if (!entry) return NULL;
-  entry->stream = stream;
-  entry->free = false;
-  entry->stream_next = NULL;
-  entry->stream_prev = NULL;
-  entry->store_next = NULL;
-  entry->store_prev = NULL;
-  entry->delivery = NULL;
-  entry->bytes = pn_buffer(64);
-  entry->status = PN_STATUS_UNKNOWN;
-  LL_ADD(stream, stream, entry);
-  LL_ADD(store, store, entry);
-  store->size++;
-  return entry;
-}
-
-pni_entry_t *pni_store_get(pni_store_t *store, const char *address)
-{
-  assert(store);
-  if (address) {
-    pni_stream_t *stream = pni_stream_get(store, address);
-    if (!stream) return NULL;
-    return LL_HEAD(stream, stream);
-  } else {
-    return LL_HEAD(store, store);
-  }
-}
-
-pn_buffer_t *pni_entry_bytes(pni_entry_t *entry)
-{
-  assert(entry);
-  return entry->bytes;
-}
-
-pn_status_t pni_entry_get_status(pni_entry_t *entry)
-{
-  assert(entry);
-  return entry->status;
-}
-
-void pni_entry_set_status(pni_entry_t *entry, pn_status_t status)
-{
-  assert(entry);
-  entry->status = status;
-}
-
-pn_delivery_t *pni_entry_get_delivery(pni_entry_t *entry)
-{
-  assert(entry);
-  return entry->delivery;
-}
-
-void pni_entry_set_delivery(pni_entry_t *entry, pn_delivery_t *delivery)
-{
-  assert(entry);
-  if (entry->delivery) {
-    pn_delivery_set_context(entry->delivery, NULL);
-  }
-  entry->delivery = delivery;
-  if (delivery) {
-    pn_delivery_set_context(delivery, entry);
-  }
-  pni_entry_updated(entry);
-}
-
-void pni_entry_set_context(pni_entry_t *entry, void *context)
-{
-  assert(entry);
-  entry->context = context;
-}
-
-void *pni_entry_get_context(pni_entry_t *entry)
-{
-  assert(entry);
-  return entry->context;
-}
-
-static pn_status_t disp2status(uint64_t disp)
-{
-  if (!disp) return PN_STATUS_PENDING;
-
-  switch (disp) {
-  case PN_RECEIVED:
-    return PN_STATUS_PENDING;
-  case PN_ACCEPTED:
-    return PN_STATUS_ACCEPTED;
-  case PN_REJECTED:
-    return PN_STATUS_REJECTED;
-  case PN_RELEASED:
-    return PN_STATUS_RELEASED;
-  case PN_MODIFIED:
-    return PN_STATUS_MODIFIED;
-  default:
-    assert(0);
-  }
-
-  return (pn_status_t) 0;
-}
-
-
-void pni_entry_updated(pni_entry_t *entry)
-{
-  assert(entry);
-  pn_delivery_t *d = entry->delivery;
-  if (d) {
-    if (pn_delivery_remote_state(d)) {
-      entry->status = disp2status(pn_delivery_remote_state(d));
-    } else if (pn_delivery_settled(d)) {
-      uint64_t disp = pn_delivery_local_state(d);
-      if (disp) {
-        entry->status = disp2status(disp);
-      } else {
-        entry->status = PN_STATUS_SETTLED;
-      }
-    } else {
-      entry->status = PN_STATUS_PENDING;
-    }
-  }
-}
-
-pn_sequence_t pni_entry_id(pni_entry_t *entry)
-{
-  assert(entry);
-  return entry->id;
-}
-
-pni_entry_t *pni_store_entry(pni_store_t *store, pn_sequence_t id)
-{
-  assert(store);
-  return (pni_entry_t *) pn_hash_get(store->tracked, id);
-}
-
-bool pni_store_tracking(pni_store_t *store, pn_sequence_t id)
-{
-  return (id - store->lwm >= 0) && (store->hwm - id > 0);
-}
-
-pn_sequence_t pni_entry_track(pni_entry_t *entry)
-{
-  assert(entry);
-
-  pni_store_t *store = entry->stream->store;
-  entry->id = store->hwm++;
-  pn_hash_put(store->tracked, entry->id, entry);
-
-  if (store->window >= 0) {
-    while (store->hwm - store->lwm > store->window) {
-      pni_entry_t *e = pni_store_entry(store, store->lwm);
-      if (e) {
-        pn_hash_del(store->tracked, store->lwm);
-      }
-      store->lwm++;
-    }
-  }
-
-  return entry->id;
-}
-
-int pni_store_update(pni_store_t *store, pn_sequence_t id, pn_status_t status,
-                     int flags, bool settle, bool match)
-{
-  assert(store);
-
-  if (!pni_store_tracking(store, id)) {
-    return 0;
-  }
-
-  size_t start;
-  if (PN_CUMULATIVE & flags) {
-    start = store->lwm;
-  } else {
-    start = id;
-  }
-
-  for (pn_sequence_t i = start; i <= id; i++) {
-    pni_entry_t *e = pni_store_entry(store, i);
-    if (e) {
-      pn_delivery_t *d = e->delivery;
-      if (d) {
-        if (!pn_delivery_local_state(d)) {
-          if (match) {
-            pn_delivery_update(d, pn_delivery_remote_state(d));
-          } else {
-            switch (status) {
-            case PN_STATUS_ACCEPTED:
-              pn_delivery_update(d, PN_ACCEPTED);
-              break;
-            case PN_STATUS_REJECTED:
-              pn_delivery_update(d, PN_REJECTED);
-              break;
-            default:
-              break;
-            }
-          }
-
-          pni_entry_updated(e);
-        }
-      }
-      if (settle) {
-        if (d) {
-          pn_delivery_settle(d);
-        }
-        pn_hash_del(store->tracked, e->id);
-      }
-    }
-  }
-
-  while (store->hwm - store->lwm > 0 &&
-         !pn_hash_get(store->tracked, store->lwm)) {
-    store->lwm++;
-  }
-
-  return 0;
-}
-
-int pni_store_get_window(pni_store_t *store)
-{
-  assert(store);
-  return store->window;
-}
-
-void pni_store_set_window(pni_store_t *store, int window)
-{
-  assert(store);
-  store->window = window;
-}
diff --git a/proton-c/src/messenger/store.h b/proton-c/src/messenger/store.h
deleted file mode 100644
index 22bb94e..0000000
--- a/proton-c/src/messenger/store.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef _PROTON_STORE_H
-#define _PROTON_STORE_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "core/buffer.h"
-
-typedef struct pni_store_t pni_store_t;
-typedef struct pni_entry_t pni_entry_t;
-
-pni_store_t *pni_store(void);
-void pni_store_free(pni_store_t *store);
-size_t pni_store_size(pni_store_t *store);
-pni_entry_t *pni_store_put(pni_store_t *store, const char *address);
-pni_entry_t *pni_store_get(pni_store_t *store, const char *address);
-
-pn_buffer_t *pni_entry_bytes(pni_entry_t *entry);
-pn_status_t pni_entry_get_status(pni_entry_t *entry);
-void pni_entry_set_status(pni_entry_t *entry, pn_status_t status);
-pn_delivery_t *pni_entry_get_delivery(pni_entry_t *entry);
-void pni_entry_set_delivery(pni_entry_t *entry, pn_delivery_t *delivery);
-void pni_entry_set_context(pni_entry_t *entry, void *context);
-void *pni_entry_get_context(pni_entry_t *entry);
-void pni_entry_updated(pni_entry_t *entry);
-void pni_entry_free(pni_entry_t *entry);
-
-pn_sequence_t pni_entry_track(pni_entry_t *entry);
-pni_entry_t *pni_store_entry(pni_store_t *store, pn_sequence_t id);
-int pni_store_update(pni_store_t *store, pn_sequence_t id, pn_status_t status,
-                     int flags, bool settle, bool match);
-int pni_store_get_window(pni_store_t *store);
-void pni_store_set_window(pni_store_t *store, int window);
-
-
-#endif /* store.h */
diff --git a/proton-c/src/messenger/subscription.c b/proton-c/src/messenger/subscription.c
deleted file mode 100644
index c26d40a..0000000
--- a/proton-c/src/messenger/subscription.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/messenger.h>
-#include <proton/object.h>
-#include <assert.h>
-#include <string.h>
-
-#include "messenger.h"
-
-struct pn_subscription_t {
-  pn_messenger_t *messenger;
-  pn_string_t *scheme;
-  pn_string_t *host;
-  pn_string_t *port;
-  pn_string_t *address;
-  void *context;
-};
-
-void pn_subscription_initialize(void *obj)
-{
-  pn_subscription_t *sub = (pn_subscription_t *) obj;
-  sub->messenger = NULL;
-  sub->scheme = pn_string(NULL);
-  sub->host = pn_string(NULL);
-  sub->port = pn_string(NULL);
-  sub->address = pn_string(NULL);
-  sub->context = NULL;
-}
-
-void pn_subscription_finalize(void *obj)
-{
-  pn_subscription_t *sub = (pn_subscription_t *) obj;
-  pn_free(sub->scheme);
-  pn_free(sub->host);
-  pn_free(sub->port);
-  pn_free(sub->address);
-}
-
-#define CID_pn_subscription CID_pn_object
-#define pn_subscription_hashcode NULL
-#define pn_subscription_compare NULL
-#define pn_subscription_inspect NULL
-
-pn_subscription_t *pn_subscription(pn_messenger_t *messenger,
-                                   const char *scheme,
-                                   const char *host,
-                                   const char *port)
-{
-  static const pn_class_t clazz = PN_CLASS(pn_subscription);
-  pn_subscription_t *sub = (pn_subscription_t *) pn_class_new(&clazz, sizeof(pn_subscription_t));
-  sub->messenger = messenger;
-  pn_string_set(sub->scheme, scheme);
-  pn_string_set(sub->host, host);
-  pn_string_set(sub->port, port);
-  pni_messenger_add_subscription(messenger, sub);
-  pn_class_decref(PN_OBJECT, sub);
-  return sub;
-}
-
-const char *pn_subscription_scheme(pn_subscription_t *sub)
-{
-  assert(sub);
-  return pn_string_get(sub->scheme);
-}
-
-void *pn_subscription_get_context(pn_subscription_t *sub)
-{
-  assert(sub);
-  return sub->context;
-}
-
-void pn_subscription_set_context(pn_subscription_t *sub, void *context)
-{
-  assert(sub);
-  sub->context = context;
-}
-
-int pni_subscription_set_address(pn_subscription_t *sub, const char *address)
-{
-  assert(sub);
-
-  if (!address) return 0;
-
-  bool absolute = strncmp(address, "amqp:", 5) == 0;
-
-  if (absolute) {
-    return pn_string_set(sub->address, address);
-  } else {
-    pn_string_set(sub->address, "");
-    bool scheme = pn_string_get(sub->scheme);
-    if (scheme) {
-      int e = pn_string_addf(sub->address, "%s:", pn_string_get(sub->scheme));
-      if (e) return e;
-    }
-    if (pn_string_get(sub->host)) {
-      int e = pn_string_addf(sub->address, scheme ? "//%s" : "%s", pn_string_get(sub->host));
-      if (e) return e;
-    }
-    if (pn_string_get(sub->port)) {
-      int e = pn_string_addf(sub->address, ":%s", pn_string_get(sub->port));
-      if (e) return e;
-    }
-    return pn_string_addf(sub->address, "/%s", address);
-  }
-}
-
-const char *pn_subscription_address(pn_subscription_t *sub)
-{
-  assert(sub);
-  while (!pn_string_get(sub->address)) {
-    int err = pni_messenger_work(sub->messenger);
-    if (err < 0) {
-      return NULL;
-    }
-  }
-  return pn_string_get(sub->address);
-}
diff --git a/proton-c/src/messenger/subscription.h b/proton-c/src/messenger/subscription.h
deleted file mode 100644
index a390eb5..0000000
--- a/proton-c/src/messenger/subscription.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef _PROTON_SUBSCRIPTION_H
-#define _PROTON_SUBSCRIPTION_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/messenger.h>
-
-pn_subscription_t *pn_subscription(pn_messenger_t *messenger,
-                                   const char *scheme, const char *host,
-                                   const char *port);
-const char *pn_subscription_scheme(pn_subscription_t *sub);
-int pni_subscription_set_address(pn_subscription_t *sub, const char *address);
-
-#endif /* subscription.h */
diff --git a/proton-c/src/messenger/transform.c b/proton-c/src/messenger/transform.c
deleted file mode 100644
index 9b726f8..0000000
--- a/proton-c/src/messenger/transform.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <string.h>
-#include <assert.h>
-#include <ctype.h>
-#include "transform.h"
-
-typedef struct {
-  const char *start;
-  size_t size;
-} pn_group_t;
-
-#define MAX_GROUP (64)
-
-typedef struct {
-  size_t groups;
-  pn_group_t group[MAX_GROUP];
-} pn_matcher_t;
-
-typedef struct {
-  pn_string_t *pattern;
-  pn_string_t *substitution;
-} pn_rule_t;
-
-struct pn_transform_t {
-  pn_list_t *rules;
-  pn_matcher_t matcher;
-  bool matched;
-};
-
-static void pn_rule_finalize(void *object)
-{
-  pn_rule_t *rule = (pn_rule_t *) object;
-  pn_free(rule->pattern);
-  pn_free(rule->substitution);
-}
-
-#define CID_pn_rule CID_pn_object
-#define pn_rule_initialize NULL
-#define pn_rule_hashcode NULL
-#define pn_rule_compare NULL
-#define pn_rule_inspect NULL
-
-pn_rule_t *pn_rule(const char *pattern, const char *substitution)
-{
-  static const pn_class_t clazz = PN_CLASS(pn_rule);
-  pn_rule_t *rule = (pn_rule_t *) pn_class_new(&clazz, sizeof(pn_rule_t));
-  rule->pattern = pn_string(pattern);
-  rule->substitution = pn_string(substitution);
-  return rule;
-}
-
-static void pn_transform_finalize(void *object)
-{
-  pn_transform_t *transform = (pn_transform_t *) object;
-  pn_free(transform->rules);
-}
-
-#define CID_pn_transform CID_pn_object
-#define pn_transform_initialize NULL
-#define pn_transform_hashcode NULL
-#define pn_transform_compare NULL
-#define pn_transform_inspect NULL
-
-pn_transform_t *pn_transform()
-{
-  static const pn_class_t clazz = PN_CLASS(pn_transform);
-  pn_transform_t *transform = (pn_transform_t *) pn_class_new(&clazz, sizeof(pn_transform_t));
-  transform->rules = pn_list(PN_OBJECT, 0);
-  transform->matched = false;
-  return transform;
-}
-
-void pn_transform_rule(pn_transform_t *transform, const char *pattern,
-                       const char *substitution)
-{
-  assert(transform);
-  pn_rule_t *rule = pn_rule(pattern, substitution);
-  pn_list_add(transform->rules, rule);
-  pn_decref(rule);
-}
-
-static void pni_sub(pn_matcher_t *matcher, size_t group, const char *text, size_t matched)
-{
-  if (group > matcher->groups) {
-    matcher->groups = group;
-  }
-  matcher->group[group].start = text - matched;
-  matcher->group[group].size = matched;
-}
-
-static bool pni_match_r(pn_matcher_t *matcher, const char *pattern, const char *text, size_t group, size_t matched)
-{
-  bool match;
-
-  char p = *pattern;
-  char c = *text;
-
-  switch (p) {
-  case '\0': return c == '\0';
-  case '%':
-  case '*':
-    switch (c) {
-    case '\0':
-      match = pni_match_r(matcher, pattern + 1, text, group + 1, 0);
-      if (match) pni_sub(matcher, group, text, matched);
-      return match;
-    case '/':
-      if (p == '%') {
-        match = pni_match_r(matcher, pattern + 1, text, group + 1, 0);
-        if (match) pni_sub(matcher, group, text, matched);
-        return match;
-      }
-    // Fallthrough
-    default:
-      match = pni_match_r(matcher, pattern, text + 1, group, matched + 1);
-      if (!match) {
-        match = pni_match_r(matcher, pattern + 1, text, group + 1, 0);
-        if (match) pni_sub(matcher, group, text, matched);
-      }
-      return match;
-    }
-  default:
-    return c == p && pni_match_r(matcher, pattern + 1, text + 1, group, 0);
-  }
-}
-
-static bool pni_match(pn_matcher_t *matcher, const char *pattern, const char *text)
-{
-  text = text ? text : "";
-  matcher->groups = 0;
-  if (pni_match_r(matcher, pattern, text, 1, 0)) {
-    matcher->group[0].start = text;
-    matcher->group[0].size = strlen(text);
-    return true;
-  } else {
-    matcher->groups = 0;
-    return false;
-  }
-}
-
-static size_t pni_substitute(pn_matcher_t *matcher, const char *pattern, char *dest, size_t limit)
-{
-  size_t result = 0;
-
-  while (*pattern) {
-    switch (*pattern) {
-    case '$':
-      pattern++;
-      if (*pattern == '$') {
-        if (result < limit) {
-          *dest++ = *pattern;
-        }
-        pattern++;
-        result++;
-      } else {
-        size_t idx = 0;
-        while (isdigit(*pattern)) {
-          idx *= 10;
-          idx += *pattern++ - '0';
-        }
-
-        if (idx <= matcher->groups) {
-          pn_group_t *group = &matcher->group[idx];
-          for (size_t i = 0; i < group->size; i++) {
-            if (result < limit) {
-              *dest++ = group->start[i];
-            }
-            result++;
-          }
-        }
-      }
-      break;
-    default:
-      if (result < limit) {
-        *dest++ = *pattern;
-      }
-      pattern++;
-      result++;
-      break;
-    }
-  }
-
-  if (result < limit) {
-    *dest = '\0';
-  }
-
-  return result;
-}
-
-int pn_transform_apply(pn_transform_t *transform, const char *src,
-                       pn_string_t *dst)
-{
-  for (size_t i = 0; i < pn_list_size(transform->rules); i++)
-  {
-    pn_rule_t *rule = (pn_rule_t *) pn_list_get(transform->rules, i);
-    if (pni_match(&transform->matcher, pn_string_get(rule->pattern), src)) {
-      transform->matched = true;
-      if (!pn_string_get(rule->substitution)) {
-        return pn_string_set(dst, NULL);
-      }
-
-      while (true) {
-        size_t capacity = pn_string_capacity(dst);
-        size_t n = pni_substitute(&transform->matcher,
-                                  pn_string_get(rule->substitution),
-                                  pn_string_buffer(dst), capacity);
-        int err = pn_string_resize(dst, n);
-        if (err) return err;
-        if (n <= capacity) {
-          return 0;
-        }
-      }
-    }
-  }
-
-  transform->matched = false;
-  return pn_string_set(dst, src);
-}
-
-bool pn_transform_matched(pn_transform_t *transform)
-{
-  return transform->matched;
-}
-
-int pn_transform_get_substitutions(pn_transform_t *transform,
-                                   pn_list_t *substitutions)
-{
-  int size = pn_list_size(transform->rules);
-  for (size_t i = 0; i < (size_t)size; i++) {
-    pn_rule_t *rule = (pn_rule_t *)pn_list_get(transform->rules, i);
-    pn_list_add(substitutions, rule->substitution);
-  }
-
-  return size;
-}
diff --git a/proton-c/src/messenger/transform.h b/proton-c/src/messenger/transform.h
deleted file mode 100644
index 3288f6c..0000000
--- a/proton-c/src/messenger/transform.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef _PROTON_TRANSFORM_H
-#define _PROTON_TRANSFORM_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "core/buffer.h"
-
-#include <proton/object.h>
-
-typedef struct pn_transform_t pn_transform_t;
-
-pn_transform_t *pn_transform(void);
-void pn_transform_rule(pn_transform_t *transform, const char *pattern,
-                       const char *substitution);
-int pn_transform_apply(pn_transform_t *transform, const char *src,
-                       pn_string_t *dest);
-bool pn_transform_matched(pn_transform_t *transform);
-int pn_transform_get_substitutions(pn_transform_t *transform,
-                                   pn_list_t *substitutions);
-
-#endif /* transform.h */
diff --git a/proton-c/src/platform/platform.c b/proton-c/src/platform/platform.c
deleted file mode 100644
index 393f75c..0000000
--- a/proton-c/src/platform/platform.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "platform.h"
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifdef PN_WINAPI
-#include <windows.h>
-int pn_i_getpid() {
-  return (int) GetCurrentProcessId();
-}
-#else
-#include <unistd.h>
-int pn_i_getpid() {
-  return (int) getpid();
-}
-#endif
-
-void pni_vfatal(const char *fmt, va_list ap)
-{
-  vfprintf(stderr, fmt, ap);
-  abort();
-}
-
-void pni_fatal(const char *fmt, ...)
-{
-  va_list ap;
-  va_start(ap, fmt);
-  pni_vfatal(fmt, ap);
-  va_end(ap);
-}
-
-/* Allow for systems that do not implement clock_gettime()*/
-#ifdef USE_CLOCK_GETTIME
-#include <time.h>
-pn_timestamp_t pn_i_now(void)
-{
-  struct timespec now;
-  if (clock_gettime(CLOCK_REALTIME, &now)) pni_fatal("clock_gettime() failed\n");
-  return ((pn_timestamp_t)now.tv_sec) * 1000 + (now.tv_nsec / 1000000);
-}
-#elif defined(USE_WIN_FILETIME)
-#include <windows.h>
-pn_timestamp_t pn_i_now(void)
-{
-  FILETIME now;
-  GetSystemTimeAsFileTime(&now);
-  ULARGE_INTEGER t;
-  t.u.HighPart = now.dwHighDateTime;
-  t.u.LowPart = now.dwLowDateTime;
-  // Convert to milliseconds and adjust base epoch
-  return t.QuadPart / 10000 - 11644473600000;
-}
-#else
-#include <sys/time.h>
-pn_timestamp_t pn_i_now(void)
-{
-  struct timeval now;
-  if (gettimeofday(&now, NULL)) pni_fatal("gettimeofday failed\n");
-  return ((pn_timestamp_t)now.tv_sec) * 1000 + (now.tv_usec / 1000);
-}
-#endif
-
-#include <string.h>
-#include <stdio.h>
-static void pn_i_strerror(int errnum, char *buf, size_t buflen)
-{
-  // PROTON-1029 provide a simple default in case strerror fails
-  pni_snprintf(buf, buflen, "errno: %d", errnum);
-#ifdef USE_STRERROR_R
-  strerror_r(errnum, buf, buflen);
-#elif USE_STRERROR_S
-  strerror_s(buf, buflen, errnum);
-#elif USE_OLD_STRERROR
-  strncpy(buf, strerror(errnum), buflen);
-#endif
-}
-
-int pn_i_error_from_errno(pn_error_t *error, const char *msg)
-{
-  char err[1024];
-  pn_i_strerror(errno, err, 1024);
-  int code = PN_ERR;
-  if (errno == EINTR)
-      code = PN_INTR;
-  return pn_error_format(error, code, "%s: %s", msg, err);
-}
-
-#ifdef USE_ATOLL
-#include <stdlib.h>
-int64_t pn_i_atoll(const char* num) {
-  return atoll(num);
-}
-#elif USE_ATOI64
-#include <stdlib.h>
-int64_t pn_i_atoll(const char* num) {
-  return _atoi64(num);
-}
-#else
-#error "Don't know how to convert int64_t values on this platform"
-#endif
diff --git a/proton-c/src/platform/platform.h b/proton-c/src/platform/platform.h
deleted file mode 100644
index d846cda..0000000
--- a/proton-c/src/platform/platform.h
+++ /dev/null
@@ -1,93 +0,0 @@
-#ifndef PROTON_PLATFORM_H
-#define PROTON_PLATFORM_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/types.h"
-#include "proton/error.h"
-
-/** Get the current PID
- *
- * @return process id
- * @internal
- */
-int pn_i_getpid(void);
-
-
-/** Get the current time in pn_timestamp_t format.
- *
- * Returns current time in milliseconds since Unix Epoch,
- * as defined by AMQP 1.0
- *
- * @return current time
- * @internal
- */
-pn_timestamp_t pn_i_now(void);
-
-/** Generate system error message.
- *
- * Populate the proton error structure based on the last system error
- * code.
- *
- * @param[in] error the proton error structure
- * @param[in] msg the descriptive context message
- * @return error->code
- *
- * @internal
- */
-int pn_i_error_from_errno(pn_error_t *error, const char *msg);
-
-/** Provide C99 atoll functinality.
- *
- * @param[in] num the string representation of the number.
- * @return the integer value.
- *
- * @internal
- */
-int64_t pn_i_atoll(const char* num);
-
-int pni_snprintf(char *buf, size_t count, const char *fmt, ...);
-int pni_vsnprintf(char *buf, size_t count, const char *fmt, va_list ap);
-
-#ifndef _MSC_VER
-
-#define pni_snprintf snprintf
-#define pni_vsnprintf vsnprintf
-
-#else
-
-#if !defined(S_ISDIR)
-# define S_ISDIR(X) ((X) & _S_IFDIR)
-#endif
-
-#endif
-
-#if defined _MSC_VER || defined _OPENVMS
-#if !defined(va_copy)
-#define va_copy(d,s) ((d) = (s))
-#endif
-#endif
-
-// Low level pretty rubbish URL parser
-void pni_parse_url(char *url, char **scheme, char **user, char **pass, char **host, char **port, char **path);
-
-#endif /* platform.h */
diff --git a/proton-c/src/platform/platform_fmt.h b/proton-c/src/platform/platform_fmt.h
deleted file mode 100644
index 17f95f3..0000000
--- a/proton-c/src/platform/platform_fmt.h
+++ /dev/null
@@ -1,85 +0,0 @@
-#ifndef _PROTON_SRC_PLATFORM_FMT_H
-#define _PROTON_SRC_PLATFORM_FMT_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*
- * Platform dependent type-specific format specifiers for PRIx and %z
- * for use with printf.  PRIx defs are normally available in
- * inttypes.h (C99), but extra steps are required for C++, and they
- * are not available in Visual Studio at all.
- * Visual studio uses "%I" for size_t instead of "%z".
- */
-
-#ifndef __cplusplus
-
-// normal case
-#include <inttypes.h>
-#define PN_ZI "zi"
-#define PN_ZU "zu"
-
-#ifdef _OPENVMS
-
-#undef PN_ZI
-#undef PN_ZU
-#define PN_ZI "i"
-#define PN_ZU "u"
-#define PRIu64 "llu"
-#define PRIu8 "u"
-#define PRIu16 "u"
-#define PRIu32 "u"
-#define PRIu64 "llu"
-
-#define PRIi8 "i"
-#define PRIi16 "i"
-#define PRIi32 "i"
-#define PRIi64 "lli"
-
-#endif /* _OPENVMS */
-
-#else
-
-#ifdef _MSC_VER
-#define PRIu8 "u"
-#define PRIu16 "u"
-#define PRIu32 "u"
-#define PRIu64 "I64u"
-
-#define PRIi8 "i"
-#define PRIi16 "i"
-#define PRIi32 "i"
-#define PRIi64 "I64i"
-
-#define PN_ZI "Ii"
-#define PN_ZU "Iu"
-#else
-// Normal C++
-#define __STDC_FORMAT_MACROS
-#include <inttypes.h>
-#define PN_ZI "zi"
-#define PN_ZU "zu"
-
-#endif /* _MSC_VER */
-
-#endif /* __cplusplus */
-
-#endif /* platform_fmt.h */
diff --git a/proton-c/src/protocol.h.py b/proton-c/src/protocol.h.py
deleted file mode 100644
index 0f58906..0000000
--- a/proton-c/src/protocol.h.py
+++ /dev/null
@@ -1,146 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-from protocol import *
-
-print("/* generated */")
-print("#ifndef _PROTON_PROTOCOL_H")
-print("#define _PROTON_PROTOCOL_H 1")
-print()
-print("#include \"proton/type_compat.h\"")
-
-fields = {}
-
-for type in TYPES:
-  fidx = 0
-  for f in type.query["field"]:
-    print("#define %s_%s (%s)" % (field_kw(type), field_kw(f), fidx))
-    fidx += 1
-
-idx = 0
-
-for type in TYPES:
-  desc = type["descriptor"]
-  name = type["@name"].upper().replace("-", "_")
-  print("#define %s_SYM (\"%s\")" % (name, desc["@name"]))
-  hi, lo = [int(x, 0) for x in desc["@code"].split(":")]
-  code = (hi << 32) + lo
-  print("#define %s ((uint64_t) %s)" % (name, code))
-  fields[code] = (type["@name"], [f["@name"] for f in type.query["field"]])
-  idx += 1
-
-print("""
-#include <stddef.h>
-
-typedef struct {
-  const unsigned char name_index;
-  const unsigned char first_field_index;
-  const unsigned char field_count;
-} pn_fields_t;
-
-extern const pn_fields_t FIELDS[];
-extern const uint16_t FIELD_NAME[];
-extern const uint16_t FIELD_FIELDS[];
-""")
-
-print('struct FIELD_STRINGS {')
-print('  const char STRING0[sizeof("")];')
-strings = set()
-for name, fnames in fields.values():
-    strings.add(name)
-    strings.update(fnames)
-for str in strings:
-    istr = str.replace("-", "_");
-    print('  const char FIELD_STRINGS_%s[sizeof("%s")];' % (istr, str))
-print("};")
-print()
-
-print("extern const struct FIELD_STRINGS FIELD_STRINGPOOL;")
-print("#ifdef DEFINE_FIELDS")
-print()
-
-print('const struct FIELD_STRINGS FIELD_STRINGPOOL = {')
-print('  "",')
-for str in strings:
-    print('  "%s",'% str)
-print("};")
-print()
-print("/* This is an array of offsets into FIELD_STRINGPOOL */")
-print("const uint16_t FIELD_NAME[] = {")
-print("  offsetof(struct FIELD_STRINGS, STRING0),")
-index = 1
-for i in range(256):
-  if i in fields:
-    name, fnames = fields[i]
-    iname = name.replace("-", "_");
-    print('  offsetof(struct FIELD_STRINGS, FIELD_STRINGS_%s), /* %d */' % (iname, index))
-    index += 1
-print("};")
-
-print("/* This is an array of offsets into FIELD_STRINGPOOL */")
-print("const uint16_t FIELD_FIELDS[] = {")
-print("  offsetof(struct FIELD_STRINGS, STRING0),")
-index = 1
-for i in range(256):
-  if i in fields:
-    name, fnames = fields[i]
-    if fnames:
-      for f in fnames:
-        ifname = f.replace("-", "_");
-        print('  offsetof(struct FIELD_STRINGS, FIELD_STRINGS_%s), /* %d (%s) */' % (ifname, index, name))
-        index += 1
-print("};")
-
-print("const pn_fields_t FIELDS[] = {")
-
-name_count = 1
-field_count = 1
-field_min = 256
-field_max = 0
-for i in range(256):
-  if i in fields:
-    if i>field_max: field_max = i
-    if i<field_min: field_min = i
-
-for i in range(field_min, field_max+1):
-  if i in fields:
-    name, fnames = fields[i]
-    if fnames:
-      print('  {%d, %d, %d}, /* %d (%s) */' % (name_count, field_count, len(fnames), i, name))
-      field_count += len(fnames)
-    else:
-      print('  {%d, 0, 0}, /* %d (%s) */' % (name_count, i, name))
-    name_count += 1
-    if i>field_max: field_max = i
-    if i<field_min: field_min = i
-  else:
-    print('  {0, 0, 0}, /* %d */' % i)
-
-print("};")
-print()
-print("#endif")
-print()
-print('enum {')
-print('  FIELD_MIN = %d,' % field_min)
-print('  FIELD_MAX = %d' % field_max)
-print('};')
-print()
-print("#endif /* protocol.h */")
diff --git a/proton-c/src/protocol.py b/proton-c/src/protocol.py
deleted file mode 100644
index 3f04973..0000000
--- a/proton-c/src/protocol.py
+++ /dev/null
@@ -1,121 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-import mllib, os, sys
-
-doc = mllib.xml_parse(os.path.join(os.path.dirname(__file__), "transport.xml"))
-mdoc = mllib.xml_parse(os.path.join(os.path.dirname(__file__), "messaging.xml"))
-tdoc = mllib.xml_parse(os.path.join(os.path.dirname(__file__), "transactions.xml"))
-sdoc = mllib.xml_parse(os.path.join(os.path.dirname(__file__), "security.xml"))
-
-def eq(attr, value):
-  return lambda nd: nd[attr] == value
-
-TYPEStmp = doc.query["amqp/section/type", eq("@class", "composite")] + \
-    mdoc.query["amqp/section/type", eq("@class", "composite")] + \
-    tdoc.query["amqp/section/type", eq("@class", "composite")] + \
-    sdoc.query["amqp/section/type", eq("@class", "composite")] + \
-    mdoc.query["amqp/section/type", eq("@provides", "section")]
-TYPES = []
-for ty in TYPEStmp:
-  if not ty in TYPES:
-    TYPES.append(ty)
-RESTRICTIONS = {}
-COMPOSITES = {}
-
-for type in doc.query["amqp/section/type"] + mdoc.query["amqp/section/type"] + \
-    sdoc.query["amqp/section/type"] + tdoc.query["amqp/section/type"]:
-
-  source = type["@source"]
-  if source:
-    RESTRICTIONS[type["@name"]] = source
-  if type["@class"] == "composite":
-    COMPOSITES[type["@name"]] = type
-
-def resolve(name):
-  if name in RESTRICTIONS:
-    return resolve(RESTRICTIONS[name])
-  else:
-    return name
-
-TYPEMAP = {
-  "boolean": ("bool", "", ""),
-  "binary": ("pn_binary_t", "*", ""),
-  "string": ("wchar_t", "*", ""),
-  "symbol": ("char", "*", ""),
-  "ubyte": ("uint8_t", "", ""),
-  "ushort": ("uint16_t", "", ""),
-  "uint": ("uint32_t", "", ""),
-  "ulong": ("uint64_t", "", ""),
-  "timestamp": ("uint64_t", "", ""),
-  "list": ("pn_list_t", "*", ""),
-  "map": ("pn_map_t", "*", ""),
-  "box": ("pn_box_t", "*", ""),
-  "*": ("pn_object_t", "*", "")
-  }
-
-CONSTRUCTORS = {
-  "boolean": "boolean",
-  "string": "string",
-  "symbol": "symbol",
-  "ubyte": "ubyte",
-  "ushort": "ushort",
-  "uint": "uint",
-  "ulong": "ulong",
-  "timestamp": "ulong"
-  }
-
-NULLABLE = set(["string", "symbol"])
-
-def fname(field):
-  return field["@name"].replace("-", "_")
-
-def tname(t):
-  return t["@name"].replace("-", "_")
-
-def multi(f):
-  return f["@multiple"] == "true"
-
-def ftype(field):
-  if multi(field):
-    return "list"
-  elif field["@type"] in COMPOSITES:
-    return "box"
-  else:
-    return resolve(field["@type"]).replace("-", "_")
-
-def fconstruct(field, expr):
-  type = ftype(field)
-  if type in CONSTRUCTORS:
-    result = "pn_%s(mem, %s)" % (CONSTRUCTORS[type], expr)
-    if type in NULLABLE:
-      result = "%s ? %s : NULL" % (expr, result)
-  else:
-    result = expr
-  if multi(field):
-    result = "pn_box(mem, pn_boolean(mem, true), %s)" % result
-  return result
-
-def declaration(field):
-  name = fname(field)
-  type = ftype(field)
-  t, pre, post = TYPEMAP.get(type, (type, "", ""))
-  return t, "%s%s%s" % (pre, name, post)
-
-def field_kw(field):
-  return fname(field).upper()
diff --git a/proton-c/src/reactor/acceptor.c b/proton-c/src/reactor/acceptor.c
deleted file mode 100644
index a044748..0000000
--- a/proton-c/src/reactor/acceptor.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/sasl.h>
-#include <proton/transport.h>
-#include <proton/connection.h>
-
-#include "io.h"
-#include "reactor.h"
-#include "selectable.h"
-#include "selector.h"
-
-#include <string.h>
-
-pn_selectable_t *pn_reactor_selectable_transport(pn_reactor_t *reactor, pn_socket_t sock, pn_transport_t *transport);
-
-PN_HANDLE(PNI_ACCEPTOR_HANDLER)
-PN_HANDLE(PNI_ACCEPTOR_SSL_DOMAIN)
-PN_HANDLE(PNI_ACCEPTOR_CONNECTION)
-
-void pni_acceptor_readable(pn_selectable_t *sel) {
-  pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(sel);
-  char name[1024];
-  pn_socket_t sock = pn_accept(pni_reactor_io(reactor), pn_selectable_get_fd(sel), name, 1024);
-  pn_handler_t *handler = (pn_handler_t *) pn_record_get(pn_selectable_attachments(sel), PNI_ACCEPTOR_HANDLER);
-  if (!handler) { handler = pn_reactor_get_handler(reactor); }
-  pn_record_t *record = pn_selectable_attachments(sel);
-  pn_ssl_domain_t *ssl_domain = (pn_ssl_domain_t *) pn_record_get(record, PNI_ACCEPTOR_SSL_DOMAIN);
-  pn_connection_t *conn = pn_reactor_connection(reactor, handler);
-  if (name[0]) { // store the peer address of connection in <host>:<port> format
-    char *port = strrchr(name, ':');   // last : separates the port #
-    *port++ = '\0';
-    pni_reactor_set_connection_peer_address(conn, name, port);
-  }
-  pn_transport_t *trans = pn_transport();
-  pn_transport_set_server(trans);
-  if (ssl_domain) {
-    pn_ssl_t *ssl = pn_ssl(trans);
-    pn_ssl_init(ssl, ssl_domain, 0);
-  }
-  pn_transport_bind(trans, conn);
-  pn_decref(trans);
-  pn_reactor_selectable_transport(reactor, sock, trans);
-  record = pn_connection_attachments(conn);
-  pn_record_def(record, PNI_ACCEPTOR_CONNECTION, PN_OBJECT);
-  pn_record_set(record, PNI_ACCEPTOR_CONNECTION, sel);
-
-}
-
-void pni_acceptor_finalize(pn_selectable_t *sel) {
-  pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(sel);
-  if (pn_selectable_get_fd(sel) != PN_INVALID_SOCKET) {
-    pn_close(pni_reactor_io(reactor), pn_selectable_get_fd(sel));
-  }
-}
-
-pn_acceptor_t *pn_reactor_acceptor(pn_reactor_t *reactor, const char *host, const char *port, pn_handler_t *handler) {
-  pn_socket_t socket = pn_listen(pni_reactor_io(reactor), host, port);
-  if (socket == PN_INVALID_SOCKET) {
-    return NULL;
-  }
-  pn_selectable_t *sel = pn_reactor_selectable(reactor);
-  pn_selectable_set_fd(sel, socket);
-  pn_selectable_on_readable(sel, pni_acceptor_readable);
-  pn_selectable_on_finalize(sel, pni_acceptor_finalize);
-  pni_record_init_reactor(pn_selectable_attachments(sel), reactor);
-  pn_record_t *record = pn_selectable_attachments(sel);
-  pn_record_def(record, PNI_ACCEPTOR_HANDLER, PN_OBJECT);
-  pn_record_set(record, PNI_ACCEPTOR_HANDLER, handler);
-  pn_selectable_set_reading(sel, true);
-  pn_reactor_update(reactor, sel);
-  return (pn_acceptor_t *) sel;
-}
-
-void pn_acceptor_close(pn_acceptor_t *acceptor) {
-  pn_selectable_t *sel = (pn_selectable_t *) acceptor;
-  if (!pn_selectable_is_terminal(sel)) {
-    pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(sel);
-    pn_socket_t socket = pn_selectable_get_fd(sel);
-    pn_close(pni_reactor_io(reactor), socket);
-    pn_selectable_set_fd(sel, PN_INVALID_SOCKET);
-    pn_selectable_terminate(sel);
-    pn_reactor_update(reactor, sel);
-  }
-}
-
-void pn_acceptor_set_ssl_domain(pn_acceptor_t *acceptor, pn_ssl_domain_t *domain)
-{
-  pn_selectable_t *sel = (pn_selectable_t *) acceptor;
-  pn_record_t *record = pn_selectable_attachments(sel);
-  pn_record_def(record, PNI_ACCEPTOR_SSL_DOMAIN, PN_VOID);
-  pn_record_set(record, PNI_ACCEPTOR_SSL_DOMAIN, domain);
-}
-
-pn_acceptor_t *pn_connection_acceptor(pn_connection_t *conn) {
-  // Return the acceptor that created the connection or NULL if an outbound connection
-  pn_record_t *record = pn_connection_attachments(conn);
-  return (pn_acceptor_t *) pn_record_get(record, PNI_ACCEPTOR_CONNECTION);
-}
diff --git a/proton-c/src/reactor/connection.c b/proton-c/src/reactor/connection.c
deleted file mode 100644
index 4bc8b8d..0000000
--- a/proton-c/src/reactor/connection.c
+++ /dev/null
@@ -1,370 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/connection.h>
-#include <proton/object.h>
-#include <proton/sasl.h>
-#include <proton/ssl.h>
-#include <proton/transport.h>
-#include <proton/url.h>
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include "io.h"
-#include "selectable.h"
-#include "reactor.h"
-
-// XXX: overloaded for both directions
-PN_HANDLE(PN_TRANCTX)
-PN_HANDLE(PNI_CONN_PEER_ADDRESS)
-
-void pni_reactor_set_connection_peer_address(pn_connection_t *connection,
-                                             const char *host,
-                                             const char *port)
-{
-    pn_url_t *url = pn_url();
-    pn_url_set_host(url, host);
-    pn_url_set_port(url, port);
-    pn_record_t *record = pn_connection_attachments(connection);
-    if (!pn_record_has(record, PNI_CONN_PEER_ADDRESS)) {
-      pn_record_def(record, PNI_CONN_PEER_ADDRESS, PN_OBJECT);
-    }
-    pn_record_set(record, PNI_CONN_PEER_ADDRESS, url);
-    pn_decref(url);
-}
-
-static pn_transport_t *pni_transport(pn_selectable_t *sel) {
-  pn_record_t *record = pn_selectable_attachments(sel);
-  return (pn_transport_t *) pn_record_get(record, PN_TRANCTX);
-}
-
-static ssize_t pni_connection_capacity(pn_selectable_t *sel)
-{
-  pn_transport_t *transport = pni_transport(sel);
-  ssize_t capacity = pn_transport_capacity(transport);
-  if (capacity < 0) {
-    if (pn_transport_closed(transport)) {
-      pn_selectable_terminate(sel);
-    }
-  }
-  return capacity;
-}
-
-static ssize_t pni_connection_pending(pn_selectable_t *sel)
-{
-  pn_transport_t *transport = pni_transport(sel);
-  ssize_t pending = pn_transport_pending(transport);
-  if (pending < 0) {
-    if (pn_transport_closed(transport)) {
-      pn_selectable_terminate(sel);
-    }
-  }
-  return pending;
-}
-
-static pn_timestamp_t pni_connection_deadline(pn_selectable_t *sel)
-{
-  pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(sel);
-  pn_transport_t *transport = pni_transport(sel);
-  pn_timestamp_t deadline = pn_transport_tick(transport, pn_reactor_now(reactor));
-  return deadline;
-}
-
-static void pni_connection_update(pn_selectable_t *sel) {
-  ssize_t c = pni_connection_capacity(sel);
-  ssize_t p = pni_connection_pending(sel);
-  pn_selectable_set_reading(sel, c > 0);
-  pn_selectable_set_writing(sel, p > 0);
-  pn_selectable_set_deadline(sel, pni_connection_deadline(sel));
-}
-
-void pni_handle_transport(pn_reactor_t *reactor, pn_event_t *event) {
-  assert(reactor);
-  pn_transport_t *transport = pn_event_transport(event);
-  pn_record_t *record = pn_transport_attachments(transport);
-  pn_selectable_t *sel = (pn_selectable_t *) pn_record_get(record, PN_TRANCTX);
-  if (sel && !pn_selectable_is_terminal(sel)) {
-    pni_connection_update(sel);
-    pn_reactor_update(reactor, sel);
-  }
-}
-
-pn_selectable_t *pn_reactor_selectable_transport(pn_reactor_t *reactor, pn_socket_t sock, pn_transport_t *transport);
-
-void pni_handle_open(pn_reactor_t *reactor, pn_event_t *event) {
-  assert(reactor);
-  assert(event);
-
-  pn_connection_t *conn = pn_event_connection(event);
-  if (!(pn_connection_state(conn) & PN_REMOTE_UNINIT)) {
-    return;
-  }
-
-  pn_transport_t *transport = pn_transport();
-  pn_transport_bind(transport, conn);
-  pn_decref(transport);
-}
-
-void pni_handle_bound(pn_reactor_t *reactor, pn_event_t *event) {
-  assert(reactor);
-  assert(event);
-
-  pn_connection_t *conn = pn_event_connection(event);
-  pn_transport_t *transport = pn_event_transport(event);
-  pn_record_t *record = pn_connection_attachments(conn);
-  pn_url_t *url = (pn_url_t *)pn_record_get(record, PNI_CONN_PEER_ADDRESS);
-  const char *host = NULL;
-  const char *port = "5672";
-  pn_string_t *str = NULL;
-
-  // link the new transport to its reactor:
-  pni_record_init_reactor(pn_transport_attachments(transport), reactor);
-
-  if (pn_connection_acceptor(conn) != NULL) {
-      // this connection was created by the acceptor.  There is already a
-      // socket assigned to this connection.  Nothing needs to be done.
-      return;
-  }
-
-  if (url) {
-      host = pn_url_get_host(url);
-      const char *uport = pn_url_get_port(url);
-      if (uport) {
-          port = uport;
-      } else {
-          const char *scheme = pn_url_get_scheme(url);
-          if (scheme && strcmp(scheme, "amqps") == 0) {
-              port = "5671";
-          }
-      }
-      if (!pn_connection_get_user(conn)) {
-          // user did not manually set auth info
-          const char *user = pn_url_get_username(url);
-          if (user) pn_connection_set_user(conn, user);
-          const char *passwd = pn_url_get_password(url);
-          if (passwd) pn_connection_set_password(conn, passwd);
-      }
-  } else {
-      // for backward compatibility, see if the connection's hostname can be
-      // used for the remote address.  See JIRA PROTON-1133
-      const char *hostname = pn_connection_get_hostname(conn);
-      if (hostname) {
-          str = pn_string(hostname);
-          char *h = pn_string_buffer(str);
-          // see if a port has been included in the hostname.  This is not
-          // allowed by the spec, but the old reactor interface allowed it.
-          char *colon = strrchr(h, ':');
-          if (colon) {
-              *colon = '\0';
-              port = colon + 1;
-          }
-          host = h;
-      }
-  }
-
-  if (!host) {
-      // error: no address configured
-      pn_condition_t *cond = pn_transport_condition(transport);
-      pn_condition_set_name(cond, "proton:io");
-      pn_condition_set_description(cond, "Connection failed: no address configured");
-      pn_transport_close_tail(transport);
-      pn_transport_close_head(transport);
-  } else {
-      pn_socket_t sock = pn_connect(pni_reactor_io(reactor), host, port);
-      // invalid sockets are ignored by poll, so we need to do this manualy
-      if (sock == PN_INVALID_SOCKET) {
-          pn_condition_t *cond = pn_transport_condition(transport);
-          pn_condition_set_name(cond, "proton:io");
-          pn_condition_set_description(cond, pn_error_text(pn_reactor_error(reactor)));
-          pn_transport_close_tail(transport);
-          pn_transport_close_head(transport);
-      } else {
-          pn_reactor_selectable_transport(reactor, sock, transport);
-      }
-  }
-  pn_free(str);
-}
-
-void pni_handle_final(pn_reactor_t *reactor, pn_event_t *event) {
-  assert(reactor);
-  assert(event);
-  pn_connection_t *conn = pn_event_connection(event);
-  pn_list_remove(pn_reactor_children(reactor), conn);
-}
-
-static void pni_connection_readable(pn_selectable_t *sel)
-{
-  pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(sel);
-  pn_transport_t *transport = pni_transport(sel);
-  ssize_t capacity = pn_transport_capacity(transport);
-  if (capacity > 0) {
-    ssize_t n = pn_recv(pni_reactor_io(reactor), pn_selectable_get_fd(sel),
-                        pn_transport_tail(transport), capacity);
-    if (n <= 0) {
-      if (n == 0 || !pn_wouldblock(pni_reactor_io(reactor))) {
-        if (n < 0) {
-          pn_condition_t *cond = pn_transport_condition(transport);
-          pn_condition_set_name(cond, "proton:io");
-          pn_condition_set_description(cond, pn_error_text(pn_reactor_error(reactor)));
-        }
-        pn_transport_close_tail(transport);
-      }
-    } else {
-      pn_transport_process(transport, (size_t)n);
-    }
-  }
-
-  ssize_t newcap = pn_transport_capacity(transport);
-  //occasionally transport events aren't generated when expected, so
-  //the following hack ensures we always update the selector
-  if (1 || newcap != capacity) {
-    pni_connection_update(sel);
-    pn_reactor_update(reactor, sel);
-  }
-}
-
-static void pni_connection_writable(pn_selectable_t *sel)
-{
-  pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(sel);
-  pn_transport_t *transport = pni_transport(sel);
-  ssize_t pending = pn_transport_pending(transport);
-  if (pending > 0) {
-    ssize_t n = pn_send(pni_reactor_io(reactor), pn_selectable_get_fd(sel),
-                        pn_transport_head(transport), pending);
-    if (n < 0) {
-      if (!pn_wouldblock(pni_reactor_io(reactor))) {
-        pn_condition_t *cond = pn_transport_condition(transport);
-        if (!pn_condition_is_set(cond)) {
-          pn_condition_set_name(cond, "proton:io");
-          pn_condition_set_description(cond, pn_error_text(pn_reactor_error(reactor)));
-        }
-        pn_transport_close_head(transport);
-      }
-    } else {
-      pn_transport_pop(transport, n);
-    }
-  }
-
-  ssize_t newpending = pn_transport_pending(transport);
-  if (newpending != pending) {
-    pni_connection_update(sel);
-    pn_reactor_update(reactor, sel);
-  }
-}
-
-static void pni_connection_error(pn_selectable_t *sel) {
-  pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(sel);
-  pn_transport_t *transport = pni_transport(sel);
-  pn_transport_close_head(transport);
-  pn_transport_close_tail(transport);
-  pn_selectable_terminate(sel);
-  pn_reactor_update(reactor, sel);
-}
-
-static void pni_connection_expired(pn_selectable_t *sel) {
-  pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(sel);
-  pn_transport_t *transport = pni_transport(sel);
-  pn_timestamp_t deadline = pn_transport_tick(transport, pn_reactor_now(reactor));
-  pn_selectable_set_deadline(sel, deadline);
-  ssize_t c = pni_connection_capacity(sel);
-  ssize_t p = pni_connection_pending(sel);
-  pn_selectable_set_reading(sel, c > 0);
-  pn_selectable_set_writing(sel, p > 0);
-  pn_reactor_update(reactor, sel);
-}
-
-static void pni_connection_finalize(pn_selectable_t *sel) {
-  pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(sel);
-  pn_transport_t *transport = pni_transport(sel);
-  pn_record_t *record = pn_transport_attachments(transport);
-  pn_record_set(record, PN_TRANCTX, NULL);
-  pn_socket_t fd = pn_selectable_get_fd(sel);
-  pn_close(pni_reactor_io(reactor), fd);
-}
-
-pn_selectable_t *pn_reactor_selectable_transport(pn_reactor_t *reactor, pn_socket_t sock, pn_transport_t *transport) {
-  pn_selectable_t *sel = pn_reactor_selectable(reactor);
-  pn_selectable_set_fd(sel, sock);
-  pn_selectable_on_readable(sel, pni_connection_readable);
-  pn_selectable_on_writable(sel, pni_connection_writable);
-  pn_selectable_on_error(sel, pni_connection_error);
-  pn_selectable_on_expired(sel, pni_connection_expired);
-  pn_selectable_on_finalize(sel, pni_connection_finalize);
-  pn_record_t *record = pn_selectable_attachments(sel);
-  pn_record_def(record, PN_TRANCTX, PN_OBJECT);
-  pn_record_set(record, PN_TRANCTX, transport);
-  pn_record_t *tr = pn_transport_attachments(transport);
-  pn_record_def(tr, PN_TRANCTX, PN_WEAKREF);
-  pn_record_set(tr, PN_TRANCTX, sel);
-  pni_connection_update(sel);
-  pn_reactor_update(reactor, sel);
-  return sel;
-}
-
-pn_connection_t *pn_reactor_connection(pn_reactor_t *reactor, pn_handler_t *handler) {
-  assert(reactor);
-  pn_connection_t *connection = pn_connection();
-  pn_record_t *record = pn_connection_attachments(connection);
-  pn_record_set_handler(record, handler);
-  pn_connection_collect(connection, pn_reactor_collector(reactor));
-  pn_list_add(pn_reactor_children(reactor), connection);
-  pni_record_init_reactor(record, reactor);
-  pn_decref(connection);
-  return connection;
-}
-
-pn_connection_t *pn_reactor_connection_to_host(pn_reactor_t *reactor,
-                                               const char *host,
-                                               const char *port,
-                                               pn_handler_t *handler) {
-    pn_connection_t *connection = pn_reactor_connection(reactor, handler);
-    pn_reactor_set_connection_host(reactor, connection, host, port);
-    return connection;
-}
-
-
-void pn_reactor_set_connection_host(pn_reactor_t *reactor,
-                                    pn_connection_t *connection,
-                                    const char *host,
-                                    const char *port)
-{
-    (void)reactor;  // ignored
-    if (pn_connection_acceptor(connection) != NULL) {
-        // this is an inbound connection created by the acceptor. The peer
-        // address cannot be modified.
-        return;
-    }
-    pni_reactor_set_connection_peer_address(connection, host, port);
-}
-
-
-const char *pn_reactor_get_connection_address(pn_reactor_t *reactor,
-                                              pn_connection_t *connection)
-{
-    (void)reactor;  // ignored
-    if (!connection) return NULL;
-    pn_record_t *record = pn_connection_attachments(connection);
-    pn_url_t *url = (pn_url_t *)pn_record_get(record, PNI_CONN_PEER_ADDRESS);
-    if (url) {
-        return pn_url_str(url);
-    }
-    return NULL;
-}
diff --git a/proton-c/src/reactor/handler.c b/proton-c/src/reactor/handler.c
deleted file mode 100644
index 2f86afd..0000000
--- a/proton-c/src/reactor/handler.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/object.h>
-#include <proton/reactor.h>
-#include <proton/event.h>
-#include <string.h>
-#include <assert.h>
-
-struct pn_handler_t {
-  void (*dispatch) (pn_handler_t *, pn_event_t *, pn_event_type_t);
-  void (*finalize) (pn_handler_t *);
-  pn_list_t *children;
-};
-
-void pn_handler_initialize(void *object) {
-  pn_handler_t *handler = (pn_handler_t *) object;
-  handler->dispatch = NULL;
-  handler->children = NULL;
-}
-
-void pn_handler_finalize(void *object) {
-  pn_handler_t *handler = (pn_handler_t *) object;
-  if (handler->finalize) {
-    handler->finalize(handler);
-  }
-  pn_free(handler->children);
-}
-
-#define pn_handler_hashcode NULL
-#define pn_handler_compare NULL
-#define pn_handler_inspect NULL
-
-pn_handler_t *pn_handler(void (*dispatch)(pn_handler_t *, pn_event_t *, pn_event_type_t)) {
-  return pn_handler_new(dispatch, 0, NULL);
-}
-
-pn_handler_t *pn_handler_new(void (*dispatch)(pn_handler_t *, pn_event_t *, pn_event_type_t), size_t size,
-                             void (*finalize)(pn_handler_t *)) {
-  static const pn_class_t clazz = PN_CLASS(pn_handler);
-  pn_handler_t *handler = (pn_handler_t *) pn_class_new(&clazz, sizeof(pn_handler_t) + size);
-  handler->dispatch = dispatch;
-  handler->finalize = finalize;
-  memset(pn_handler_mem(handler), 0, size);
-  return handler;
-}
-
-void pn_handler_free(pn_handler_t *handler) {
-  if (handler) {
-    if (handler->children) {
-      size_t n = pn_list_size(handler->children);
-      for (size_t i = 0; i < n; i++) {
-        void *child = pn_list_get(handler->children, i);
-        pn_decref(child);
-      }
-    }
-
-    pn_decref(handler);
-  }
-}
-
-void *pn_handler_mem(pn_handler_t *handler) {
-  return (void *) (handler + 1);
-}
-
-void pn_handler_add(pn_handler_t *handler, pn_handler_t *child) {
-  assert(handler);
-  if (!handler->children) {
-    handler->children = pn_list(PN_OBJECT, 0);
-  }
-  pn_list_add(handler->children, child);
-}
-
-void pn_handler_clear(pn_handler_t *handler) {
-  assert(handler);
-  if (handler->children) {
-    pn_list_clear(handler->children);
-  }
-}
-
-void pn_handler_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) {
-  assert(handler);
-  if (handler->dispatch) {
-    handler->dispatch(handler, event, type);
-  }
-  if (handler->children) {
-    size_t n = pn_list_size(handler->children);
-    for (size_t i = 0; i < n; i++) {
-      pn_handler_t *child = (pn_handler_t *) pn_list_get(handler->children, i);
-      pn_handler_dispatch(child, event, type);
-    }
-  }
-}
diff --git a/proton-c/src/reactor/io.h b/proton-c/src/reactor/io.h
deleted file mode 100644
index 24596ec..0000000
--- a/proton-c/src/reactor/io.h
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef PROTON_IO_H
-#define PROTON_IO_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "selector.h"
-
-#include <proton/import_export.h>
-#include <proton/error.h>
-#include <proton/type_compat.h>
-#include <stddef.h>
-
-/**
- * A ::pn_io_t manages IO for a group of pn_socket_t handles.  A
- * pn_io_t object may have zero or one pn_selector_t selectors
- * associated with it (see ::pn_io_selector()).  If one is associated,
- * all the pn_socket_t handles managed by a pn_io_t must use that
- * pn_selector_t instance.
- *
- * The pn_io_t interface is single-threaded. All methods are intended
- * to be used by one thread at a time, except that multiple threads
- * may use:
- *
- *   ::pn_write()
- *   ::pn_send()
- *   ::pn_recv()
- *   ::pn_close()
- *   ::pn_selector_select()
- *
- * provided at most one thread is calling ::pn_selector_select() and
- * the other threads are operating on separate pn_socket_t handles.
- */
-typedef struct pn_io_t pn_io_t;
-
-pn_io_t *pn_io(void);
-void pn_io_free(pn_io_t *io);
-pn_error_t *pn_io_error(pn_io_t *io);
-pn_socket_t pn_connect(pn_io_t *io, const char *host, const char *port);
-pn_socket_t pn_listen(pn_io_t *io, const char *host, const char *port);
-
-pn_socket_t pn_accept(pn_io_t *io, pn_socket_t socket, char *name, size_t size);
-void pn_close(pn_io_t *io, pn_socket_t socket);
-ssize_t pn_send(pn_io_t *io, pn_socket_t socket, const void *buf, size_t size);
-ssize_t pn_recv(pn_io_t *io, pn_socket_t socket, void *buf, size_t size);
-int pn_pipe(pn_io_t *io, pn_socket_t *dest);
-ssize_t pn_read(pn_io_t *io, pn_socket_t socket, void *buf, size_t size);
-ssize_t pn_write(pn_io_t *io, pn_socket_t socket, const void *buf, size_t size);
-bool pn_wouldblock(pn_io_t *io);
-pn_selector_t *pn_io_selector(pn_io_t *io);
-
-#endif /* io.h */
diff --git a/proton-c/src/reactor/io/posix/io.c b/proton-c/src/reactor/io/posix/io.c
deleted file mode 100644
index 5a0de3b..0000000
--- a/proton-c/src/reactor/io/posix/io.c
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "reactor/io.h"
-#include "reactor/selector.h"
-#include "platform/platform.h" // pn_i_error_from_errno
-
-#include <proton/object.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <netdb.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <assert.h>
-
-#define MAX_HOST (1024)
-#define MAX_SERV (64)
-
-struct pn_io_t {
-  char host[MAX_HOST];
-  char serv[MAX_SERV];
-  pn_error_t *error;
-  pn_selector_t *selector;
-  bool wouldblock;
-};
-
-void pn_io_initialize(void *obj)
-{
-  pn_io_t *io = (pn_io_t *) obj;
-  io->error = pn_error();
-  io->wouldblock = false;
-  io->selector = NULL;
-}
-
-void pn_io_finalize(void *obj)
-{
-  pn_io_t *io = (pn_io_t *) obj;
-  pn_error_free(io->error);
-}
-
-#define pn_io_hashcode NULL
-#define pn_io_compare NULL
-#define pn_io_inspect NULL
-
-pn_io_t *pn_io(void)
-{
-  static const pn_class_t clazz = PN_CLASS(pn_io);
-  pn_io_t *io = (pn_io_t *) pn_class_new(&clazz, sizeof(pn_io_t));
-  return io;
-}
-
-void pn_io_free(pn_io_t *io)
-{
-  pn_free(io);
-}
-
-pn_error_t *pn_io_error(pn_io_t *io)
-{
-  assert(io);
-  return io->error;
-}
-
-int pn_pipe(pn_io_t *io, pn_socket_t *dest)
-{
-  int n = pipe(dest);
-  if (n) {
-    pn_i_error_from_errno(io->error, "pipe");
-  }
-
-  return n;
-}
-
-static void pn_configure_sock(pn_io_t *io, pn_socket_t sock) {
-  // this would be nice, but doesn't appear to exist on linux
-  /*
-  int set = 1;
-  if (!setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, (void *)&set, sizeof(int))) {
-    pn_i_error_from_errno(io->error, "setsockopt");
-  };
-  */
-
-  int flags = fcntl(sock, F_GETFL);
-  flags |= O_NONBLOCK;
-
-  if (fcntl(sock, F_SETFL, flags) < 0) {
-    pn_i_error_from_errno(io->error, "fcntl");
-  }
-
-  //
-  // Disable the Nagle algorithm on TCP connections.
-  //
-  // Note:  It would be more correct for the "level" argument to be SOL_TCP.  However, there
-  //        are portability issues with this macro so we use IPPROTO_TCP instead.
-  //
-  int tcp_nodelay = 1;
-  if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (void*) &tcp_nodelay, sizeof(tcp_nodelay)) < 0) {
-    pn_i_error_from_errno(io->error, "setsockopt");
-  }
-}
-
-static inline int pn_create_socket(int af, int protocol);
-
-pn_socket_t pn_listen(pn_io_t *io, const char *host, const char *port)
-{
-  struct addrinfo *addr;
-  struct addrinfo hints = {0, AF_UNSPEC, SOCK_STREAM};
-  int code = getaddrinfo(host, port, &hints, &addr);
-  if (code) {
-    pn_error_format(io->error, PN_ERR, "getaddrinfo(%s, %s): %s\n", host, port, gai_strerror(code));
-    return PN_INVALID_SOCKET;
-  }
-
-  pn_socket_t sock = pn_create_socket(addr->ai_family, addr->ai_protocol);
-  if (sock == PN_INVALID_SOCKET) {
-    freeaddrinfo(addr);
-    pn_i_error_from_errno(io->error, "pn_create_socket");
-    return PN_INVALID_SOCKET;
-  }
-
-  int optval = 1;
-  if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) == -1) {
-    pn_i_error_from_errno(io->error, "setsockopt");
-    freeaddrinfo(addr);
-    close(sock);
-    return PN_INVALID_SOCKET;
-  }
-
-  if (bind(sock, addr->ai_addr, addr->ai_addrlen) == -1) {
-    pn_i_error_from_errno(io->error, "bind");
-    freeaddrinfo(addr);
-    close(sock);
-    return PN_INVALID_SOCKET;
-  }
-
-  freeaddrinfo(addr);
-
-  if (listen(sock, 50) == -1) {
-    pn_i_error_from_errno(io->error, "listen");
-    close(sock);
-    return PN_INVALID_SOCKET;
-  }
-
-  return sock;
-}
-
-pn_socket_t pn_connect(pn_io_t *io, const char *host, const char *port)
-{
-  struct addrinfo *addr;
-  struct addrinfo hints = {0, AF_UNSPEC, SOCK_STREAM};
-  int code = getaddrinfo(host, port, &hints, &addr);
-  if (code) {
-    pn_error_format(io->error, PN_ERR, "getaddrinfo(%s, %s): %s", host, port, gai_strerror(code));
-    return PN_INVALID_SOCKET;
-  }
-
-  pn_socket_t sock = pn_create_socket(addr->ai_family, addr->ai_protocol);
-  if (sock == PN_INVALID_SOCKET) {
-    pn_i_error_from_errno(io->error, "pn_create_socket");
-    freeaddrinfo(addr);
-    return PN_INVALID_SOCKET;
-  }
-
-  pn_configure_sock(io, sock);
-
-  if (connect(sock, addr->ai_addr, addr->ai_addrlen) == -1) {
-    if (errno != EINPROGRESS) {
-      pn_i_error_from_errno(io->error, "connect");
-      freeaddrinfo(addr);
-      close(sock);
-      return PN_INVALID_SOCKET;
-    }
-  }
-
-  freeaddrinfo(addr);
-
-  return sock;
-}
-
-pn_socket_t pn_accept(pn_io_t *io, pn_socket_t socket, char *name, size_t size)
-{
-  struct sockaddr_storage addr;
-  socklen_t addrlen = sizeof(addr);
-  *name = '\0';
-  pn_socket_t sock = accept(socket, (struct sockaddr *) &addr, &addrlen);
-  if (sock == PN_INVALID_SOCKET) {
-    pn_i_error_from_errno(io->error, "accept");
-    return sock;
-  } else {
-    int code;
-    if ((code = getnameinfo((struct sockaddr *) &addr, addrlen, io->host, MAX_HOST, io->serv, MAX_SERV, 0))) {
-      pn_error_format(io->error, PN_ERR, "getnameinfo: %s\n", gai_strerror(code));
-      if (close(sock) == -1)
-        pn_i_error_from_errno(io->error, "close");
-      return PN_INVALID_SOCKET;
-    } else {
-      pn_configure_sock(io, sock);
-      pni_snprintf(name, size, "%s:%s", io->host, io->serv);
-      return sock;
-    }
-  }
-}
-
-/* Abstract away turning off SIGPIPE */
-#ifdef MSG_NOSIGNAL
-ssize_t pn_send(pn_io_t *io, pn_socket_t socket, const void *buf, size_t len) {
-  ssize_t count = send(socket, buf, len, MSG_NOSIGNAL);
-  io->wouldblock = (errno == EAGAIN || errno == EWOULDBLOCK);
-  if (count < 0) { pn_i_error_from_errno(io->error, "send"); }
-  return count;
-}
-
-static inline int pn_create_socket(int af, int protocol) {
-  return socket(af, SOCK_STREAM, protocol);
-}
-#elif defined(SO_NOSIGPIPE)
-ssize_t pn_send(pn_io_t *io, pn_socket_t socket, const void *buf, size_t size) {
-  ssize_t count = send(socket, buf, size, 0);
-  io->wouldblock = (errno == EAGAIN || errno == EWOULDBLOCK);
-  if (count < 0) { pn_i_error_from_errno(io->error, "send"); }
-  return count;
-}
-
-static inline int pn_create_socket(int af, int protocol) {
-  int sock;
-  sock = socket(af, SOCK_STREAM, protocol);
-  if (sock == -1) return sock;
-
-  int optval = 1;
-  if (setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, &optval, sizeof(optval)) == -1) {
-    close(sock);
-    return -1;
-  }
-  return sock;
-}
-#else
-
-#include <signal.h>
-
-static inline int pn_create_socket(int af, int protocol) {
-  return socket(af, SOCK_STREAM, protocol);
-}
-
-static ssize_t nosigpipe_send(int fd, const void *buffer, size_t size) {
-  sigset_t pendingSignals, oldSignals, newSignals;
-  ssize_t count;
-  int sendErrno, sigmaskErr;
-
-  sigpending(&pendingSignals);
-  int sigpipeIsPending = sigismember(&pendingSignals, SIGPIPE);
-  if (!sigpipeIsPending) {
-    sigemptyset(&newSignals);
-    sigaddset(&newSignals, SIGPIPE);
-    if (sigmaskErr = pthread_sigmask(SIG_BLOCK, (const sigset_t *)&newSignals, (sigset_t *)&oldSignals))
-    {
-      errno = sigmaskErr;
-      return -1;
-    }
-  }
-
-  count = send(fd, buffer, size, 0);
-  if (!sigpipeIsPending) {
-    sendErrno = errno;
-    if (count == -1 && errno == EPIPE) {
-      while (-1 == sigtimedwait(&newSignals, NULL, &(struct timespec){ 0, 0 }) && errno == EINTR)
-        ; //do nothing
-    }
-    if (sigmaskErr = pthread_sigmask(SIG_SETMASK, (const sigset_t *)&oldSignals, (sigset_t *)NULL))
-    {
-      errno = sigmaskErr;
-      return -1;
-    }
-    errno = sendErrno;
-  }
-  return count;
-}
-
-ssize_t pn_send(pn_io_t *io, pn_socket_t socket, const void *buf, size_t size) {
-  ssize_t count = nosigpipe_send(socket, buf, size);
-  io->wouldblock = (errno == EAGAIN || errno == EWOULDBLOCK);
-  if (count < 0) { pn_i_error_from_errno(io->error, "send"); }
-  return count;
-}
-#endif
-
-ssize_t pn_recv(pn_io_t *io, pn_socket_t socket, void *buf, size_t size)
-{
-  ssize_t count = recv(socket, buf, size, 0);
-  io->wouldblock = count < 0 && (errno == EAGAIN || errno == EWOULDBLOCK);
-  if (count < 0) { pn_i_error_from_errno(io->error, "recv"); }
-  return count;
-}
-
-ssize_t pn_write(pn_io_t *io, pn_socket_t socket, const void *buf, size_t size)
-{
-  return write(socket, buf, size);
-}
-
-ssize_t pn_read(pn_io_t *io, pn_socket_t socket, void *buf, size_t size)
-{
-  return read(socket, buf, size);
-}
-
-void pn_close(pn_io_t *io, pn_socket_t socket)
-{
-  close(socket);
-}
-
-bool pn_wouldblock(pn_io_t *io)
-{
-  return io->wouldblock;
-}
-
-pn_selector_t *pn_io_selector(pn_io_t *io)
-{
-  if (io->selector == NULL)
-    io->selector = pni_selector();
-  return io->selector;
-}
diff --git a/proton-c/src/reactor/io/posix/selector.c b/proton-c/src/reactor/io/posix/selector.c
deleted file mode 100644
index bf6882a..0000000
--- a/proton-c/src/reactor/io/posix/selector.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "core/util.h"
-#include "platform/platform.h" // pn_i_now, pn_i_error_from_errno
-#include "reactor/io.h"
-#include "reactor/selector.h"
-#include "reactor/selectable.h"
-
-#include <proton/error.h>
-
-#include <poll.h>
-#include <stdlib.h>
-#include <assert.h>
-
-struct pn_selector_t {
-  struct pollfd *fds;
-  pn_timestamp_t *deadlines;
-  size_t capacity;
-  pn_list_t *selectables;
-  size_t current;
-  pn_timestamp_t awoken;
-  pn_error_t *error;
-};
-
-void pn_selector_initialize(void *obj)
-{
-  pn_selector_t *selector = (pn_selector_t *) obj;
-  selector->fds = NULL;
-  selector->deadlines = NULL;
-  selector->capacity = 0;
-  selector->selectables = pn_list(PN_WEAKREF, 0);
-  selector->current = 0;
-  selector->awoken = 0;
-  selector->error = pn_error();
-}
-
-void pn_selector_finalize(void *obj)
-{
-  pn_selector_t *selector = (pn_selector_t *) obj;
-  free(selector->fds);
-  free(selector->deadlines);
-  pn_free(selector->selectables);
-  pn_error_free(selector->error);
-}
-
-#define pn_selector_hashcode NULL
-#define pn_selector_compare NULL
-#define pn_selector_inspect NULL
-
-pn_selector_t *pni_selector(void)
-{
-  static const pn_class_t clazz = PN_CLASS(pn_selector);
-  pn_selector_t *selector = (pn_selector_t *) pn_class_new(&clazz, sizeof(pn_selector_t));
-  return selector;
-}
-
-void pn_selector_add(pn_selector_t *selector, pn_selectable_t *selectable)
-{
-  assert(selector);
-  assert(selectable);
-  assert(pni_selectable_get_index(selectable) < 0);
-
-  if (pni_selectable_get_index(selectable) < 0) {
-    pn_list_add(selector->selectables, selectable);
-    size_t size = pn_list_size(selector->selectables);
-
-    if (selector->capacity < size) {
-      selector->fds = (struct pollfd *) realloc(selector->fds, size*sizeof(struct pollfd));
-      selector->deadlines = (pn_timestamp_t *) realloc(selector->deadlines, size*sizeof(pn_timestamp_t));
-      selector->capacity = size;
-    }
-
-    pni_selectable_set_index(selectable, size - 1);
-  }
-
-  pn_selector_update(selector, selectable);
-}
-
-void pn_selector_update(pn_selector_t *selector, pn_selectable_t *selectable)
-{
-  int idx = pni_selectable_get_index(selectable);
-  assert(idx >= 0);
-  selector->fds[idx].fd = pn_selectable_get_fd(selectable);
-  selector->fds[idx].events = 0;
-  selector->fds[idx].revents = 0;
-  if (pn_selectable_is_reading(selectable)) {
-    selector->fds[idx].events |= POLLIN;
-  }
-  if (pn_selectable_is_writing(selectable)) {
-    selector->fds[idx].events |= POLLOUT;
-  }
-  selector->deadlines[idx] = pn_selectable_get_deadline(selectable);
-}
-
-void pn_selector_remove(pn_selector_t *selector, pn_selectable_t *selectable)
-{
-  assert(selector);
-  assert(selectable);
-
-  int idx = pni_selectable_get_index(selectable);
-  assert(idx >= 0);
-  pn_list_del(selector->selectables, idx, 1);
-  size_t size = pn_list_size(selector->selectables);
-  for (size_t i = idx; i < size; i++) {
-    pn_selectable_t *sel = (pn_selectable_t *) pn_list_get(selector->selectables, i);
-    pni_selectable_set_index(sel, i);
-    selector->fds[i] = selector->fds[i + 1];
-  }
-
-  pni_selectable_set_index(selectable, -1);
-
-  if (selector->current >= (size_t) idx) {
-    selector->current--;
-  }
-}
-
-size_t pn_selector_size(pn_selector_t *selector) {
-  assert(selector);
-  return pn_list_size(selector->selectables);
-}
-
-int pn_selector_select(pn_selector_t *selector, int timeout)
-{
-  assert(selector);
-
-  size_t size = pn_list_size(selector->selectables);
-
-  if (timeout) {
-    pn_timestamp_t deadline = 0;
-    for (size_t i = 0; i < size; i++) {
-      pn_timestamp_t d = selector->deadlines[i];
-      if (d)
-        deadline = (deadline == 0) ? d : pn_min(deadline, d);
-    }
-
-    if (deadline) {
-      pn_timestamp_t now = pn_i_now();
-      int64_t delta = deadline - now;
-      if (delta < 0) {
-        timeout = 0;
-      } else if (delta < timeout) {
-        timeout = delta;
-      }
-    }
-  }
-
-  int error = 0;
-  int result = poll(selector->fds, size, timeout);
-  if (result == -1) {
-    error = pn_i_error_from_errno(selector->error, "poll");
-  } else {
-    selector->current = 0;
-    selector->awoken = pn_i_now();
-  }
-
-  return error;
-}
-
-pn_selectable_t *pn_selector_next(pn_selector_t *selector, int *events)
-{
-  pn_list_t *l = selector->selectables;
-  size_t size = pn_list_size(l);
-  while (selector->current < size) {
-    pn_selectable_t *sel = (pn_selectable_t *) pn_list_get(l, selector->current);
-    struct pollfd *pfd = &selector->fds[selector->current];
-    pn_timestamp_t deadline = selector->deadlines[selector->current];
-    int ev = 0;
-    if (pfd->revents & POLLIN) {
-      ev |= PN_READABLE;
-    }
-    if ((pfd->revents & POLLERR) ||
-        (pfd->revents & POLLHUP) ||
-        (pfd->revents & POLLNVAL)) {
-      ev |= PN_ERROR;
-    }
-    if (pfd->revents & POLLOUT) {
-      ev |= PN_WRITABLE;
-    }
-    if (deadline && selector->awoken >= deadline) {
-      ev |= PN_EXPIRED;
-    }
-    selector->current++;
-    if (ev) {
-      *events = ev;
-      return sel;
-    }
-  }
-  return NULL;
-}
-
-void pn_selector_free(pn_selector_t *selector)
-{
-  assert(selector);
-  pn_free(selector);
-}
diff --git a/proton-c/src/reactor/io/windows/io.c b/proton-c/src/reactor/io/windows/io.c
deleted file mode 100644
index 07692d1..0000000
--- a/proton-c/src/reactor/io/windows/io.c
+++ /dev/null
@@ -1,464 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#define FD_SETSIZE 2048
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0501
-#endif
-#if _WIN32_WINNT < 0x0501
-#error "Proton requires Windows API support for XP or later."
-#endif
-#include <winsock2.h>
-#include <mswsock.h>
-#include <Ws2tcpip.h>
-
-#include "reactor/io.h"
-#include "reactor/selector.h"
-
-#include "platform/platform.h"
-#include "iocp.h"
-#include "core/util.h"
-
-#include <proton/object.h>
-
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <assert.h>
-
-int pni_win32_error(pn_error_t *error, const char *msg, HRESULT code)
-{
-  // Error code can be from GetLastError or WSAGetLastError,
-  char err[1024] = {0};
-  FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS |
-                FORMAT_MESSAGE_MAX_WIDTH_MASK, NULL, code, 0, (LPSTR)&err, sizeof(err), NULL);
-  return pn_error_format(error, PN_ERR, "%s: %s", msg, err);
-}
-
-static void io_log(const char *fmt, ...)
-{
-  va_list ap;
-  va_start(ap, fmt);
-  vfprintf(stderr, fmt, ap);
-  va_end(ap);
-  fflush(stderr);
-}
-
-struct pn_io_t {
-  char host[NI_MAXHOST];
-  char serv[NI_MAXSERV];
-  pn_error_t *error;
-  bool trace;
-  bool wouldblock;
-  iocp_t *iocp;
-};
-
-void pn_io_initialize(void *obj)
-{
-  pn_io_t *io = (pn_io_t *) obj;
-  io->error = pn_error();
-  io->wouldblock = false;
-  io->trace = pn_env_bool("PN_TRACE_DRV");
-
-  /* Request WinSock 2.2 */
-  WORD wsa_ver = MAKEWORD(2, 2);
-  WSADATA unused;
-  int err = WSAStartup(wsa_ver, &unused);
-  if (err) {
-    pni_win32_error(io->error, "WSAStartup", WSAGetLastError());
-    fprintf(stderr, "Can't load WinSock: %s\n", pn_error_text(io->error));
-  }
-  io->iocp = pni_iocp();
-}
-
-void pn_io_finalize(void *obj)
-{
-  pn_io_t *io = (pn_io_t *) obj;
-  pn_selector_t *sel = io->iocp->selector;
-  pn_free(io->iocp);
-  if (sel)
-    pn_decref(sel);
-  pn_error_free(io->error);
-  WSACleanup();
-}
-
-#define pn_io_hashcode NULL
-#define pn_io_compare NULL
-#define pn_io_inspect
-
-pn_io_t *pn_io(void)
-{
-  static const pn_class_t clazz = PN_CLASS(pn_io);
-  pn_io_t *io = (pn_io_t *) pn_class_new(&clazz, sizeof(pn_io_t));
-  return io;
-}
-
-void pn_io_free(pn_io_t *io)
-{
-  pn_free(io);
-}
-
-pn_error_t *pn_io_error(pn_io_t *io)
-{
-  assert(io);
-  return io->error;
-}
-
-static void ensure_unique(pn_io_t *io, pn_socket_t new_socket)
-{
-  // A brand new socket can have the same HANDLE value as a previous
-  // one after a socketclose.  If the application closes one itself
-  // (i.e. not using pn_close), we don't find out about it until here.
-  iocpdesc_t *iocpd = pni_iocpdesc_map_get(io->iocp, new_socket);
-  if (iocpd) {
-    if (io->trace)
-      io_log("Stale external socket reference discarded\n");
-    // Re-use means former socket instance was closed
-    assert(iocpd->ops_in_progress == 0);
-    assert(iocpd->external);
-    // Clean up the straggler as best we can
-    pn_socket_t sock = iocpd->socket;
-    iocpd->socket = INVALID_SOCKET;
-    pni_iocpdesc_map_del(io->iocp, sock);  // may free the iocpdesc_t depending on refcount
-  }
-}
-
-
-/*
- * This heavyweight surrogate pipe could be replaced with a normal Windows pipe
- * now that select() is no longer used.  If interrupt semantics are all that is
- * needed, a simple user space counter and reserved completion status would
- * probably suffice.
- */
-static int pni_socket_pair(pn_io_t *io, SOCKET sv[2]);
-
-int pn_pipe(pn_io_t *io, pn_socket_t *dest)
-{
-  int n = pni_socket_pair(io, dest);
-  if (n) {
-    pni_win32_error(io->error, "pipe", WSAGetLastError());
-  }
-  return n;
-}
-
-static void pn_configure_sock(pn_io_t *io, pn_socket_t sock) {
-  //
-  // Disable the Nagle algorithm on TCP connections.
-  //
-  int flag = 1;
-  if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(flag)) != 0) {
-    perror("setsockopt");
-  }
-
-  u_long nonblock = 1;
-  if (ioctlsocket(sock, FIONBIO, &nonblock)) {
-    perror("ioctlsocket");
-  }
-}
-
-static inline pn_socket_t pni_create_socket(int domain, int protocol);
-
-static const char *amqp_service(const char *port) {
-  // Help older Windows to know about amqp[s] ports
-  if (port) {
-    if (!strcmp("amqp", port)) return "5672";
-    if (!strcmp("amqps", port)) return "5671";
-  }
-  return port;
-}
-
-pn_socket_t pn_listen(pn_io_t *io, const char *host, const char *port)
-{
-  struct addrinfo *addr;
-  int code = getaddrinfo(host, amqp_service(port), NULL, &addr);
-  if (code) {
-    pn_error_format(io->error, PN_ERR, "getaddrinfo(%s, %s): %s\n", host, port, gai_strerror(code));
-    return INVALID_SOCKET;
-  }
-
-  pn_socket_t sock = pni_create_socket(addr->ai_family, addr->ai_protocol);
-  if (sock == INVALID_SOCKET) {
-    pni_win32_error(io->error, "pni_create_socket", WSAGetLastError());
-    return INVALID_SOCKET;
-  }
-  ensure_unique(io, sock);
-
-  bool optval = 1;
-  if (setsockopt(sock, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (const char *) &optval,
-                 sizeof(optval)) == -1) {
-    pni_win32_error(io->error, "setsockopt", WSAGetLastError());
-    closesocket(sock);
-    return INVALID_SOCKET;
-  }
-
-  if (bind(sock, addr->ai_addr, addr->ai_addrlen) == -1) {
-    pni_win32_error(io->error, "bind", WSAGetLastError());
-    freeaddrinfo(addr);
-    closesocket(sock);
-    return INVALID_SOCKET;
-  }
-  freeaddrinfo(addr);
-
-  if (listen(sock, 50) == -1) {
-    pni_win32_error(io->error, "listen", WSAGetLastError());
-    closesocket(sock);
-    return INVALID_SOCKET;
-  }
-
-  if (io->iocp->selector) {
-    iocpdesc_t *iocpd = pni_iocpdesc_create(io->iocp, sock, false);
-    if (!iocpd) {
-      pn_i_error_from_errno(io->error, "register");
-      closesocket(sock);
-      return INVALID_SOCKET;
-    }
-    pni_iocpdesc_start(iocpd);
-  }
-
-  return sock;
-}
-
-pn_socket_t pn_connect(pn_io_t *io, const char *hostarg, const char *port)
-{
-  // convert "0.0.0.0" to "127.0.0.1" on Windows for outgoing sockets
-  const char *host = strcmp("0.0.0.0", hostarg) ? hostarg : "127.0.0.1";
-
-  struct addrinfo *addr;
-  int code = getaddrinfo(host, amqp_service(port), NULL, &addr);
-  if (code) {
-    pn_error_format(io->error, PN_ERR, "getaddrinfo(%s, %s): %s", host, port, gai_strerror(code));
-    return INVALID_SOCKET;
-  }
-
-  pn_socket_t sock = pni_create_socket(addr->ai_family, addr->ai_protocol);
-  if (sock == INVALID_SOCKET) {
-    pni_win32_error(io->error, "proton pni_create_socket", WSAGetLastError());
-    freeaddrinfo(addr);
-    return INVALID_SOCKET;
-  }
-
-  ensure_unique(io, sock);
-  pn_configure_sock(io, sock);
-
-  if (io->iocp->selector) {
-    return pni_iocp_begin_connect(io->iocp, sock, addr, io->error);
-  } else {
-    if (connect(sock, addr->ai_addr, addr->ai_addrlen) != 0) {
-      if (WSAGetLastError() != WSAEWOULDBLOCK) {
-	pni_win32_error(io->error, "connect", WSAGetLastError());
-	freeaddrinfo(addr);
-	closesocket(sock);
-	return INVALID_SOCKET;
-      }
-    }
-
-    freeaddrinfo(addr);
-    return sock;
-  }
-}
-
-pn_socket_t pn_accept(pn_io_t *io, pn_socket_t listen_sock, char *name, size_t size)
-{
-  struct sockaddr_storage addr;
-  socklen_t addrlen = sizeof(addr);
-  iocpdesc_t *listend = pni_iocpdesc_map_get(io->iocp, listen_sock);
-  pn_socket_t accept_sock;
-
-  *name = '\0';
-  if (listend)
-    accept_sock = pni_iocp_end_accept(listend, (struct sockaddr *) &addr, &addrlen, &io->wouldblock, io->error);
-  else {
-    // User supplied socket
-    accept_sock = accept(listen_sock, (struct sockaddr *) &addr, &addrlen);
-    if (accept_sock == INVALID_SOCKET)
-      pni_win32_error(io->error, "sync accept", WSAGetLastError());
-  }
-
-  if (accept_sock == INVALID_SOCKET)
-    return accept_sock;
-
-  int code = getnameinfo((struct sockaddr *) &addr, addrlen, io->host, NI_MAXHOST,
-                         io->serv, NI_MAXSERV, 0);
-  if (code)
-    code = getnameinfo((struct sockaddr *) &addr, addrlen, io->host, NI_MAXHOST,
-                       io->serv, NI_MAXSERV, NI_NUMERICHOST | NI_NUMERICSERV);
-  if (code) {
-    pn_error_format(io->error, PN_ERR, "getnameinfo: %s\n", gai_strerror(code));
-    pn_close(io, accept_sock);
-    return INVALID_SOCKET;
-  } else {
-    pn_configure_sock(io, accept_sock);
-    pni_snprintf(name, size, "%s:%s", io->host, io->serv);
-    if (listend) {
-      pni_iocpdesc_start(pni_iocpdesc_map_get(io->iocp, accept_sock));
-    }
-    return accept_sock;
-  }
-}
-
-static inline pn_socket_t pni_create_socket(int domain, int protocol) {
-  return socket(domain, SOCK_STREAM, protocol);
-}
-
-ssize_t pn_send(pn_io_t *io, pn_socket_t sockfd, const void *buf, size_t len) {
-  ssize_t count;
-  iocpdesc_t *iocpd = pni_iocpdesc_map_get(io->iocp, sockfd);
-  if (iocpd) {
-    count = pni_iocp_begin_write(iocpd, buf, len, &io->wouldblock, io->error);
-  } else {
-    count = send(sockfd, (const char *) buf, len, 0);
-    io->wouldblock = count < 0 && WSAGetLastError() == WSAEWOULDBLOCK;
-  }
-  return count;
-}
-
-ssize_t pn_recv(pn_io_t *io, pn_socket_t socket, void *buf, size_t size)
-{
-  ssize_t count;
-  iocpdesc_t *iocpd = pni_iocpdesc_map_get(io->iocp, socket);
-  if (iocpd) {
-    count = pni_iocp_recv(iocpd, buf, size, &io->wouldblock, io->error);
-  } else {
-    count = recv(socket, (char *) buf, size, 0);
-    io->wouldblock = count < 0 && WSAGetLastError() == WSAEWOULDBLOCK;
-  }
-  return count;
-}
-
-ssize_t pn_write(pn_io_t *io, pn_socket_t socket, const void *buf, size_t size)
-{
-  // non-socket io is mapped to socket io for now.  See pn_pipe()
-  return pn_send(io, socket, buf, size);
-}
-
-ssize_t pn_read(pn_io_t *io, pn_socket_t socket, void *buf, size_t size)
-{
-  return pn_recv(io, socket, buf, size);
-}
-
-void pn_close(pn_io_t *io, pn_socket_t socket)
-{
-  iocpdesc_t *iocpd = pni_iocpdesc_map_get(io->iocp, socket);
-  if (iocpd)
-    pni_iocp_begin_close(iocpd);
-  else {
-    closesocket(socket);
-  }
-}
-
-bool pn_wouldblock(pn_io_t *io)
-{
-  return io->wouldblock;
-}
-
-pn_selector_t *pn_io_selector(pn_io_t *io)
-{
-  if (io->iocp->selector == NULL) {
-    io->iocp->selector = pni_selector_create(io->iocp);
-    pn_incref(io->iocp->selector);
-  }
-  return io->iocp->selector;
-}
-
-static void configure_pipe_socket(pn_io_t *io, pn_socket_t sock)
-{
-  u_long v = 1;
-  ioctlsocket (sock, FIONBIO, &v);
-  ensure_unique(io, sock);
-  iocpdesc_t *iocpd = pni_iocpdesc_create(io->iocp, sock, false);
-  pni_iocpdesc_start(iocpd);
-}
-
-
-static int pni_socket_pair (pn_io_t *io, SOCKET sv[2]) {
-  // no socketpair on windows.  provide pipe() semantics using sockets
-  struct protoent * pe_tcp = getprotobyname("tcp");
-  if (pe_tcp == NULL) {
-    perror("getprotobyname");
-    return -1;
-  }
-
-  SOCKET sock = socket(AF_INET, SOCK_STREAM, pe_tcp->p_proto);
-  if (sock == INVALID_SOCKET) {
-    perror("socket");
-    return -1;
-  }
-
-  BOOL b = 1;
-  if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const char *) &b, sizeof(b)) == -1) {
-    perror("setsockopt");
-    closesocket(sock);
-    return -1;
-  }
-  else {
-    struct sockaddr_in addr = {0};
-    addr.sin_family = AF_INET;
-    addr.sin_port = 0;
-    addr.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
-
-    if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
-      perror("bind");
-      closesocket(sock);
-      return -1;
-    }
-  }
-
-  if (listen(sock, 50) == -1) {
-    perror("listen");
-    closesocket(sock);
-    return -1;
-  }
-
-  if ((sv[1] = socket(AF_INET, SOCK_STREAM, pe_tcp->p_proto)) == INVALID_SOCKET) {
-    perror("sock1");
-    closesocket(sock);
-    return -1;
-  }
-  else {
-    struct sockaddr addr = {0};
-    int l = sizeof(addr);
-    if (getsockname(sock, &addr, &l) == -1) {
-      perror("getsockname");
-      closesocket(sock);
-      return -1;
-    }
-
-    if (connect(sv[1], &addr, sizeof(addr)) == -1) {
-      int err = WSAGetLastError();
-      fprintf(stderr, "connect wsaerrr %d\n", err);
-      closesocket(sock);
-      closesocket(sv[1]);
-      return -1;
-    }
-
-    if ((sv[0] = accept(sock, &addr, &l)) == INVALID_SOCKET) {
-      perror("accept");
-      closesocket(sock);
-      closesocket(sv[1]);
-      return -1;
-    }
-  }
-
-  configure_pipe_socket(io, sv[0]);
-  configure_pipe_socket(io, sv[1]);
-  closesocket(sock);
-  return 0;
-}
diff --git a/proton-c/src/reactor/io/windows/iocp.c b/proton-c/src/reactor/io/windows/iocp.c
deleted file mode 100644
index 8a1a64a..0000000
--- a/proton-c/src/reactor/io/windows/iocp.c
+++ /dev/null
@@ -1,1179 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0501
-#endif
-#if _WIN32_WINNT < 0x0501
-#error "Proton requires Windows API support for XP or later."
-#endif
-#include <winsock2.h>
-#include <mswsock.h>
-#include <Ws2tcpip.h>
-
-#include "reactor/io.h"
-#include "reactor/selector.h"
-
-#include "iocp.h"
-#include "platform/platform.h"
-#include "core/util.h"
-
-#include <proton/object.h>
-#include <proton/error.h>
-#include <proton/transport.h>
-
-#include <assert.h>
-
-/*
- * Windows IO Completion Port support for Proton.
- *
- * Overlapped writes are used to avoid lengthy stalls between write
- * completion and starting a new write.  Non-overlapped reads are used
- * since Windows accumulates inbound traffic without stalling and
- * managing read buffers would not avoid a memory copy at the pn_read
- * boundary.
- *
- * A socket must not get a Windows closesocket() unless the
- * application has called pn_close on the socket or a global
- * pn_io_finalize().  On error, the internal accounting for
- * write_closed or read_closed may be updated along with the external
- * event notification.  A socket may be closed if it is never added to
- * the iocpdesc_map or is on its way out of the map.
- */
-
-// Max number of overlapped accepts per listener
-#define IOCP_MAX_ACCEPTS 10
-
-// AcceptEx squishes the local and remote addresses and optional data
-// all together when accepting the connection. Reserve enough for
-// IPv6 addresses, even if the socket is IPv4. The 16 bytes padding
-// per address is required by AcceptEx.
-#define IOCP_SOCKADDRMAXLEN (sizeof(sockaddr_in6) + 16)
-#define IOCP_SOCKADDRBUFLEN (2 * IOCP_SOCKADDRMAXLEN)
-
-static void iocp_log(const char *fmt, ...)
-{
-  va_list ap;
-  va_start(ap, fmt);
-  vfprintf(stderr, fmt, ap);
-  va_end(ap);
-  fflush(stderr);
-}
-
-static void set_iocp_error_status(pn_error_t *error, int code, HRESULT status)
-{
-  char buf[512];
-  if (FormatMessage(FORMAT_MESSAGE_MAX_WIDTH_MASK | FORMAT_MESSAGE_FROM_SYSTEM,
-                    0, status, 0, buf, sizeof(buf), 0))
-    pn_error_set(error, code, buf);
-  else {
-    fprintf(stderr, "pn internal Windows error: %lu\n", GetLastError());
-  }
-}
-
-static void reap_check(iocpdesc_t *);
-static void bind_to_completion_port(iocpdesc_t *iocpd);
-static void iocp_shutdown(iocpdesc_t *iocpd);
-static void start_reading(iocpdesc_t *iocpd);
-static bool is_listener(iocpdesc_t *iocpd);
-static void release_sys_sendbuf(SOCKET s);
-
-static void iocpdesc_fail(iocpdesc_t *iocpd, HRESULT status, const char* text)
-{
-  pni_win32_error(iocpd->error, text, status);
-  if (iocpd->iocp->iocp_trace) {
-    iocp_log("connection terminated: %s\n", pn_error_text(iocpd->error));
-  }
-  iocpd->write_closed = true;
-  iocpd->read_closed = true;
-  iocpd->poll_error = true;
-  pni_events_update(iocpd, iocpd->events & ~(PN_READABLE | PN_WRITABLE));
-}
-
-// Helper functions to use specialized IOCP AcceptEx() and ConnectEx()
-static LPFN_ACCEPTEX lookup_accept_ex(SOCKET s)
-{
-  GUID guid = WSAID_ACCEPTEX;
-  DWORD bytes = 0;
-  LPFN_ACCEPTEX fn;
-  WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &guid, sizeof(guid),
-           &fn, sizeof(fn), &bytes, NULL, NULL);
-  assert(fn);
-  return fn;
-}
-
-static LPFN_CONNECTEX lookup_connect_ex(SOCKET s)
-{
-  GUID guid = WSAID_CONNECTEX;
-  DWORD bytes = 0;
-  LPFN_CONNECTEX fn;
-  WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &guid, sizeof(guid),
-           &fn, sizeof(fn), &bytes, NULL, NULL);
-  assert(fn);
-  return fn;
-}
-
-static LPFN_GETACCEPTEXSOCKADDRS lookup_get_accept_ex_sockaddrs(SOCKET s)
-{
-  GUID guid = WSAID_GETACCEPTEXSOCKADDRS;
-  DWORD bytes = 0;
-  LPFN_GETACCEPTEXSOCKADDRS fn;
-  WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &guid, sizeof(guid),
-           &fn, sizeof(fn), &bytes, NULL, NULL);
-  assert(fn);
-  return fn;
-}
-
-// match accept socket to listener socket
-static iocpdesc_t *create_same_type_socket(iocpdesc_t *iocpd)
-{
-  sockaddr_storage sa;
-  socklen_t salen = sizeof(sa);
-  if (getsockname(iocpd->socket, (sockaddr*)&sa, &salen) == -1)
-    return NULL;
-  SOCKET s = socket(sa.ss_family, SOCK_STREAM, 0); // Currently only work with SOCK_STREAM
-  if (s == INVALID_SOCKET)
-    return NULL;
-  return pni_iocpdesc_create(iocpd->iocp, s, false);
-}
-
-static bool is_listener(iocpdesc_t *iocpd)
-{
-  return iocpd && iocpd->acceptor;
-}
-
-// === Async accept processing
-
-typedef struct {
-  iocp_result_t base;
-  iocpdesc_t *new_sock;
-  char address_buffer[IOCP_SOCKADDRBUFLEN];
-  DWORD unused;
-} accept_result_t;
-
-static accept_result_t *accept_result(iocpdesc_t *listen_sock) {
-  accept_result_t *result = (accept_result_t *)calloc(1, sizeof(accept_result_t));
-  if (result) {
-    result->base.type = IOCP_ACCEPT;
-    result->base.iocpd = listen_sock;
-  }
-  return result;
-}
-
-static void reset_accept_result(accept_result_t *result) {
-  memset(&result->base.overlapped, 0, sizeof (OVERLAPPED));
-  memset(&result->address_buffer, 0, IOCP_SOCKADDRBUFLEN);
-}
-
-struct pni_acceptor_t {
-  int accept_queue_size;
-  pn_list_t *accepts;
-  iocpdesc_t *listen_sock;
-  bool signalled;
-  LPFN_ACCEPTEX fn_accept_ex;
-  LPFN_GETACCEPTEXSOCKADDRS fn_get_accept_ex_sockaddrs;
-};
-
-#define pni_acceptor_compare NULL
-#define pni_acceptor_inspect NULL
-#define pni_acceptor_hashcode NULL
-
-static void pni_acceptor_initialize(void *object)
-{
-  pni_acceptor_t *acceptor = (pni_acceptor_t *) object;
-  acceptor->accepts = pn_list(PN_VOID, IOCP_MAX_ACCEPTS);
-}
-
-static void pni_acceptor_finalize(void *object)
-{
-  pni_acceptor_t *acceptor = (pni_acceptor_t *) object;
-  size_t len = pn_list_size(acceptor->accepts);
-  for (size_t i = 0; i < len; i++)
-    free(pn_list_get(acceptor->accepts, i));
-  pn_free(acceptor->accepts);
-}
-
-static pni_acceptor_t *pni_acceptor(iocpdesc_t *iocpd)
-{
-  static const pn_cid_t CID_pni_acceptor = CID_pn_void;
-  static const pn_class_t clazz = PN_CLASS(pni_acceptor);
-  pni_acceptor_t *acceptor = (pni_acceptor_t *) pn_class_new(&clazz, sizeof(pni_acceptor_t));
-  acceptor->listen_sock = iocpd;
-  acceptor->accept_queue_size = 0;
-  acceptor->signalled = false;
-  pn_socket_t sock = acceptor->listen_sock->socket;
-  acceptor->fn_accept_ex = lookup_accept_ex(sock);
-  acceptor->fn_get_accept_ex_sockaddrs = lookup_get_accept_ex_sockaddrs(sock);
-  return acceptor;
-}
-
-static void begin_accept(pni_acceptor_t *acceptor, accept_result_t *result)
-{
-  if (acceptor->listen_sock->closing) {
-    if (result) {
-      free(result);
-      acceptor->accept_queue_size--;
-    }
-    if (acceptor->accept_queue_size == 0)
-      acceptor->signalled = true;
-    return;
-  }
-
-  if (result) {
-    reset_accept_result(result);
-  } else {
-    if (acceptor->accept_queue_size < IOCP_MAX_ACCEPTS &&
-        pn_list_size(acceptor->accepts) == acceptor->accept_queue_size ) {
-      result = accept_result(acceptor->listen_sock);
-      acceptor->accept_queue_size++;
-    } else {
-      // an async accept is still pending or max concurrent accepts already hit
-      return;
-    }
-  }
-
-  result->new_sock = create_same_type_socket(acceptor->listen_sock);
-  if (result->new_sock) {
-    // Not yet connected.
-    result->new_sock->read_closed = true;
-    result->new_sock->write_closed = true;
-
-    bool success = acceptor->fn_accept_ex(acceptor->listen_sock->socket, result->new_sock->socket,
-                     result->address_buffer, 0, IOCP_SOCKADDRMAXLEN, IOCP_SOCKADDRMAXLEN,
-                     &result->unused, (LPOVERLAPPED) result);
-    if (!success && WSAGetLastError() != ERROR_IO_PENDING) {
-      result->base.status = WSAGetLastError();
-      pn_list_add(acceptor->accepts, result);
-      pni_events_update(acceptor->listen_sock, acceptor->listen_sock->events | PN_READABLE);
-    } else {
-      acceptor->listen_sock->ops_in_progress++;
-      // This socket is equally involved in the async operation.
-      result->new_sock->ops_in_progress++;
-    }
-  } else {
-    iocpdesc_fail(acceptor->listen_sock, WSAGetLastError(), "create accept socket");
-  }
-}
-
-static void complete_accept(accept_result_t *result, HRESULT status)
-{
-  result->new_sock->ops_in_progress--;
-  iocpdesc_t *ld = result->base.iocpd;
-  if (ld->read_closed) {
-    if (!result->new_sock->closing)
-      pni_iocp_begin_close(result->new_sock);
-    free(result);    // discard
-    reap_check(ld);
-  } else {
-    result->base.status = status;
-    pn_list_add(ld->acceptor->accepts, result);
-    pni_events_update(ld, ld->events | PN_READABLE);
-  }
-}
-
-pn_socket_t pni_iocp_end_accept(iocpdesc_t *ld, sockaddr *addr, socklen_t *addrlen, bool *would_block, pn_error_t *error)
-{
-  if (!is_listener(ld)) {
-    set_iocp_error_status(error, PN_ERR, WSAEOPNOTSUPP);
-    return INVALID_SOCKET;
-  }
-  if (ld->read_closed) {
-    set_iocp_error_status(error, PN_ERR, WSAENOTSOCK);
-    return INVALID_SOCKET;
-  }
-  if (pn_list_size(ld->acceptor->accepts) == 0) {
-    if (ld->events & PN_READABLE && ld->iocp->iocp_trace)
-      iocp_log("listen socket readable with no available accept completions\n");
-    *would_block = true;
-    return INVALID_SOCKET;
-  }
-
-  accept_result_t *result = (accept_result_t *) pn_list_get(ld->acceptor->accepts, 0);
-  pn_list_del(ld->acceptor->accepts, 0, 1);
-  if (!pn_list_size(ld->acceptor->accepts))
-    pni_events_update(ld, ld->events & ~PN_READABLE);  // No pending accepts
-
-  pn_socket_t accept_sock;
-  if (result->base.status) {
-    accept_sock = INVALID_SOCKET;
-    pni_win32_error(ld->error, "accept failure", result->base.status);
-    if (ld->iocp->iocp_trace)
-      iocp_log("%s\n", pn_error_text(ld->error));
-    // App never sees this socket so close it here.
-    pni_iocp_begin_close(result->new_sock);
-  } else {
-    accept_sock = result->new_sock->socket;
-    // AcceptEx special setsockopt:
-    setsockopt(accept_sock, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT, (char*)&ld->socket,
-                  sizeof (SOCKET));
-    if (addr && addrlen && *addrlen > 0) {
-      sockaddr_storage *local_addr = NULL;
-      sockaddr_storage *remote_addr = NULL;
-      int local_addrlen, remote_addrlen;
-      LPFN_GETACCEPTEXSOCKADDRS fn = ld->acceptor->fn_get_accept_ex_sockaddrs;
-      fn(result->address_buffer, 0, IOCP_SOCKADDRMAXLEN, IOCP_SOCKADDRMAXLEN,
-         (SOCKADDR **) &local_addr, &local_addrlen, (SOCKADDR **) &remote_addr,
-         &remote_addrlen);
-      *addrlen = pn_min(*addrlen, remote_addrlen);
-      memmove(addr, remote_addr, *addrlen);
-    }
-  }
-
-  if (accept_sock != INVALID_SOCKET) {
-    // Connected.
-    result->new_sock->read_closed = false;
-    result->new_sock->write_closed = false;
-  }
-
-  // Done with the completion result, so reuse it
-  result->new_sock = NULL;
-  begin_accept(ld->acceptor, result);
-  return accept_sock;
-}
-
-
-// === Async connect processing
-
-typedef struct {
-  iocp_result_t base;
-  char address_buffer[IOCP_SOCKADDRBUFLEN];
-  struct addrinfo *addrinfo;
-} connect_result_t;
-
-#define connect_result_initialize NULL
-#define connect_result_compare NULL
-#define connect_result_inspect NULL
-#define connect_result_hashcode NULL
-
-static void connect_result_finalize(void *object)
-{
-  connect_result_t *result = (connect_result_t *) object;
-  // Do not release addrinfo until ConnectEx completes
-  if (result->addrinfo)
-    freeaddrinfo(result->addrinfo);
-}
-
-static connect_result_t *connect_result(iocpdesc_t *iocpd, struct addrinfo *addr) {
-  static const pn_cid_t CID_connect_result = CID_pn_void;
-  static const pn_class_t clazz = PN_CLASS(connect_result);
-  connect_result_t *result = (connect_result_t *) pn_class_new(&clazz, sizeof(connect_result_t));
-  if (result) {
-    memset(result, 0, sizeof(connect_result_t));
-    result->base.type = IOCP_CONNECT;
-    result->base.iocpd = iocpd;
-    result->addrinfo = addr;
-  }
-  return result;
-}
-
-pn_socket_t pni_iocp_begin_connect(iocp_t *iocp, pn_socket_t sock, struct addrinfo *addr, pn_error_t *error)
-{
-  // addr lives for the duration of the async connect.  Caller has passed ownership here.
-  // See connect_result_finalize().
-  // Use of Windows-specific ConnectEx() requires our socket to be "loosely" pre-bound:
-  sockaddr_storage sa;
-  memset(&sa, 0, sizeof(sa));
-  sa.ss_family = addr->ai_family;
-  if (bind(sock, (SOCKADDR *) &sa, addr->ai_addrlen)) {
-    pni_win32_error(error, "begin async connection", WSAGetLastError());
-    if (iocp->iocp_trace)
-      iocp_log("%s\n", pn_error_text(error));
-    closesocket(sock);
-    freeaddrinfo(addr);
-    return INVALID_SOCKET;
-  }
-
-  iocpdesc_t *iocpd = pni_iocpdesc_create(iocp, sock, false);
-  bind_to_completion_port(iocpd);
-  LPFN_CONNECTEX fn_connect_ex = lookup_connect_ex(iocpd->socket);
-  connect_result_t *result = connect_result(iocpd, addr);
-  DWORD unused;
-  bool success = fn_connect_ex(iocpd->socket, result->addrinfo->ai_addr, result->addrinfo->ai_addrlen,
-                               NULL, 0, &unused, (LPOVERLAPPED) result);
-  if (!success && WSAGetLastError() != ERROR_IO_PENDING) {
-    pni_win32_error(error, "ConnectEx failure", WSAGetLastError());
-    pn_free(result);
-    iocpd->write_closed = true;
-    iocpd->read_closed = true;
-    if (iocp->iocp_trace)
-      iocp_log("%s\n", pn_error_text(error));
-  } else {
-    iocpd->ops_in_progress++;
-  }
-  return sock;
-}
-
-static void complete_connect(connect_result_t *result, HRESULT status)
-{
-  iocpdesc_t *iocpd = result->base.iocpd;
-  if (iocpd->closing) {
-    pn_free(result);
-    reap_check(iocpd);
-    return;
-  }
-
-  if (status) {
-    iocpdesc_fail(iocpd, status, "Connect failure");
-    // Posix sets selectable events as follows:
-    pni_events_update(iocpd, PN_READABLE | PN_EXPIRED);
-  } else {
-    release_sys_sendbuf(iocpd->socket);
-    if (setsockopt(iocpd->socket, SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT,  NULL, 0)) {
-      iocpdesc_fail(iocpd, WSAGetLastError(), "Internal connect failure (update context)");
-    } else {
-      pni_events_update(iocpd, PN_WRITABLE);
-      start_reading(iocpd);
-    }
-  }
-  pn_free(result);
-  return;
-}
-
-
-// === Async writes
-
-static bool write_in_progress(iocpdesc_t *iocpd)
-{
-  return pni_write_pipeline_size(iocpd->pipeline) != 0;
-}
-
-write_result_t *pni_write_result(iocpdesc_t *iocpd, const char *buf, size_t buflen)
-{
-  write_result_t *result = (write_result_t *) calloc(sizeof(write_result_t), 1);
-  if (result) {
-    result->base.type = IOCP_WRITE;
-    result->base.iocpd = iocpd;
-    result->buffer.start = buf;
-    result->buffer.size = buflen;
-  }
-  return result;
-}
-
-static int submit_write(write_result_t *result, const void *buf, size_t len)
-{
-  WSABUF wsabuf;
-  wsabuf.buf = (char *) buf;
-  wsabuf.len = len;
-  memset(&result->base.overlapped, 0, sizeof (OVERLAPPED));
-  return WSASend(result->base.iocpd->socket, &wsabuf, 1, NULL, 0,
-                 (LPOVERLAPPED) result, 0);
-}
-
-ssize_t pni_iocp_begin_write(iocpdesc_t *iocpd, const void *buf, size_t len, bool *would_block, pn_error_t *error)
-{
-  if (len == 0) return 0;
-  *would_block = false;
-  if (is_listener(iocpd)) {
-    set_iocp_error_status(error, PN_ERR, WSAEOPNOTSUPP);
-    return INVALID_SOCKET;
-  }
-  if (iocpd->closing) {
-    set_iocp_error_status(error, PN_ERR, WSAESHUTDOWN);
-    return SOCKET_ERROR;
-  }
-  if (iocpd->write_closed) {
-    assert(pn_error_code(iocpd->error));
-    pn_error_copy(error, iocpd->error);
-    if (iocpd->iocp->iocp_trace)
-      iocp_log("write error: %s\n", pn_error_text(error));
-    return SOCKET_ERROR;
-  }
-  if (len == 0) return 0;
-  if (!(iocpd->events & PN_WRITABLE)) {
-    *would_block = true;
-    return SOCKET_ERROR;
-  }
-
-  size_t written = 0;
-  size_t requested = len;
-  const char *outgoing = (const char *) buf;
-  size_t available = pni_write_pipeline_reserve(iocpd->pipeline, len);
-  if (!available) {
-    *would_block = true;
-    return SOCKET_ERROR;
-  }
-
-  for (size_t wr_count = 0; wr_count < available; wr_count++) {
-    write_result_t *result = pni_write_pipeline_next(iocpd->pipeline);
-    assert(result);
-    result->base.iocpd = iocpd;
-    ssize_t actual_len = pn_min(len, result->buffer.size);
-    result->requested = actual_len;
-    memmove((void *)result->buffer.start, outgoing, actual_len);
-    outgoing += actual_len;
-    written += actual_len;
-    len -= actual_len;
-
-    int werror = submit_write(result, result->buffer.start, actual_len);
-    if (werror && WSAGetLastError() != ERROR_IO_PENDING) {
-      pni_write_pipeline_return(iocpd->pipeline, result);
-      iocpdesc_fail(iocpd, WSAGetLastError(), "overlapped send");
-      return SOCKET_ERROR;
-    }
-    iocpd->ops_in_progress++;
-  }
-
-  if (!pni_write_pipeline_writable(iocpd->pipeline))
-    pni_events_update(iocpd, iocpd->events & ~PN_WRITABLE);
-  return written;
-}
-
-/*
- * Note: iocp write completion is not "bytes on the wire", it is "peer
- * acked the sent bytes".  Completion can be seconds on a slow
- * consuming peer.
- */
-static void complete_write(write_result_t *result, DWORD xfer_count, HRESULT status)
-{
-  iocpdesc_t *iocpd = result->base.iocpd;
-  if (iocpd->closing) {
-    pni_write_pipeline_return(iocpd->pipeline, result);
-    if (!iocpd->write_closed && !write_in_progress(iocpd))
-      iocp_shutdown(iocpd);
-    reap_check(iocpd);
-    return;
-  }
-  if (status == 0 && xfer_count > 0) {
-    if (xfer_count != result->requested) {
-      // Is this recoverable?  How to preserve order if multiple overlapped writes?
-      pni_write_pipeline_return(iocpd->pipeline, result);
-      iocpdesc_fail(iocpd, WSA_OPERATION_ABORTED, "Partial overlapped write on socket");
-      return;
-    } else {
-      // Success.
-      pni_write_pipeline_return(iocpd->pipeline, result);
-      if (pni_write_pipeline_writable(iocpd->pipeline))
-        pni_events_update(iocpd, iocpd->events | PN_WRITABLE);
-      return;
-    }
-  }
-  // Other error
-  pni_write_pipeline_return(iocpd->pipeline, result);
-  if (status == WSAECONNABORTED || status == WSAECONNRESET || status == WSAENOTCONN
-      || status == ERROR_NETNAME_DELETED) {
-    iocpd->write_closed = true;
-    iocpd->poll_error = true;
-    pni_events_update(iocpd, iocpd->events & ~PN_WRITABLE);
-    pni_win32_error(iocpd->error, "Remote close or timeout", status);
-  } else {
-    iocpdesc_fail(iocpd, status, "IOCP async write error");
-  }
-}
-
-
-// === Async reads
-
-struct read_result_t {
-  iocp_result_t base;
-  size_t drain_count;
-  char unused_buf[1];
-};
-
-static read_result_t *read_result(iocpdesc_t *iocpd)
-{
-  read_result_t *result = (read_result_t *) calloc(sizeof(read_result_t), 1);
-  if (result) {
-    result->base.type = IOCP_READ;
-    result->base.iocpd = iocpd;
-  }
-  return result;
-}
-
-static void begin_zero_byte_read(iocpdesc_t *iocpd)
-{
-  if (iocpd->read_in_progress) return;
-  if (iocpd->read_closed) {
-    pni_events_update(iocpd, iocpd->events | PN_READABLE);
-    return;
-  }
-
-  read_result_t *result = iocpd->read_result;
-  memset(&result->base.overlapped, 0, sizeof (OVERLAPPED));
-  DWORD flags = 0;
-  WSABUF wsabuf;
-  wsabuf.buf = result->unused_buf;
-  wsabuf.len = 0;
-  int rc = WSARecv(iocpd->socket, &wsabuf, 1, NULL, &flags,
-                       &result->base.overlapped, 0);
-  if (rc && WSAGetLastError() != ERROR_IO_PENDING) {
-    iocpdesc_fail(iocpd, WSAGetLastError(), "IOCP read error");
-    return;
-  }
-  iocpd->ops_in_progress++;
-  iocpd->read_in_progress = true;
-}
-
-static void drain_until_closed(iocpdesc_t *iocpd) {
-  size_t max_drain = 16 * 1024;
-  char buf[512];
-  read_result_t *result = iocpd->read_result;
-  while (result->drain_count < max_drain) {
-    int rv = recv(iocpd->socket, buf, 512, 0);
-    if (rv > 0)
-      result->drain_count += rv;
-    else if (rv == 0) {
-      iocpd->read_closed = true;
-      return;
-    } else if (WSAGetLastError() == WSAEWOULDBLOCK) {
-      // wait a little longer
-      start_reading(iocpd);
-      return;
-    }
-    else
-      break;
-  }
-  // Graceful close indication unlikely, force the issue
-  if (iocpd->iocp->iocp_trace)
-    if (result->drain_count >= max_drain)
-      iocp_log("graceful close on reader abandoned (too many chars)\n");
-    else
-      iocp_log("graceful close on reader abandoned: %d\n", WSAGetLastError());
-  iocpd->read_closed = true;
-}
-
-
-static void complete_read(read_result_t *result, DWORD xfer_count, HRESULT status)
-{
-  iocpdesc_t *iocpd = result->base.iocpd;
-  iocpd->read_in_progress = false;
-
-  if (iocpd->closing) {
-    // Application no longer reading, but we are looking for a zero length read
-    if (!iocpd->read_closed)
-      drain_until_closed(iocpd);
-    reap_check(iocpd);
-    return;
-  }
-
-  if (status == 0 && xfer_count == 0) {
-    // Success.
-    pni_events_update(iocpd, iocpd->events | PN_READABLE);
-  } else {
-    iocpdesc_fail(iocpd, status, "IOCP read complete error");
-  }
-}
-
-ssize_t pni_iocp_recv(iocpdesc_t *iocpd, void *buf, size_t size, bool *would_block, pn_error_t *error)
-{
-  if (size == 0) return 0;
-  *would_block = false;
-  if (is_listener(iocpd)) {
-    set_iocp_error_status(error, PN_ERR, WSAEOPNOTSUPP);
-    return SOCKET_ERROR;
-  }
-  if (iocpd->closing) {
-    // Previous call to pn_close()
-    set_iocp_error_status(error, PN_ERR, WSAESHUTDOWN);
-    return SOCKET_ERROR;
-  }
-  if (iocpd->read_closed) {
-    if (pn_error_code(iocpd->error))
-      pn_error_copy(error, iocpd->error);
-    else
-      set_iocp_error_status(error, PN_ERR, WSAENOTCONN);
-    return SOCKET_ERROR;
-  }
-
-  int count = recv(iocpd->socket, (char *) buf, size, 0);
-  if (count > 0) {
-    pni_events_update(iocpd, iocpd->events & ~PN_READABLE);
-    begin_zero_byte_read(iocpd);
-    return (ssize_t) count;
-  } else if (count == 0) {
-    iocpd->read_closed = true;
-    return 0;
-  }
-  if (WSAGetLastError() == WSAEWOULDBLOCK)
-    *would_block = true;
-  else {
-    set_iocp_error_status(error, PN_ERR, WSAGetLastError());
-    iocpd->read_closed = true;
-  }
-  return SOCKET_ERROR;
-}
-
-static void start_reading(iocpdesc_t *iocpd)
-{
-  begin_zero_byte_read(iocpd);
-}
-
-
-// === The iocp descriptor
-
-static void pni_iocpdesc_initialize(void *object)
-{
-  iocpdesc_t *iocpd = (iocpdesc_t *) object;
-  memset(iocpd, 0, sizeof(iocpdesc_t));
-  iocpd->socket = INVALID_SOCKET;
-}
-
-static void pni_iocpdesc_finalize(void *object)
-{
-  iocpdesc_t *iocpd = (iocpdesc_t *) object;
-  pn_free(iocpd->acceptor);
-  pn_error_free(iocpd->error);
-   if (iocpd->pipeline)
-    if (write_in_progress(iocpd))
-      iocp_log("iocp descriptor write leak\n");
-    else
-      pn_free(iocpd->pipeline);
-  if (iocpd->read_in_progress)
-    iocp_log("iocp descriptor read leak\n");
-  else
-    free(iocpd->read_result);
-}
-
-static uintptr_t pni_iocpdesc_hashcode(void *object)
-{
-  iocpdesc_t *iocpd = (iocpdesc_t *) object;
-  return iocpd->socket;
-}
-
-#define pni_iocpdesc_compare NULL
-#define pni_iocpdesc_inspect NULL
-
-// Reference counted in the iocpdesc map, zombie_list, selector.
-static iocpdesc_t *pni_iocpdesc(pn_socket_t s)
-{
-  static const pn_cid_t CID_pni_iocpdesc = CID_pn_void;
-  static pn_class_t clazz = PN_CLASS(pni_iocpdesc);
-  iocpdesc_t *iocpd = (iocpdesc_t *) pn_class_new(&clazz, sizeof(iocpdesc_t));
-  assert(iocpd);
-  iocpd->socket = s;
-  return iocpd;
-}
-
-static bool is_listener_socket(pn_socket_t s)
-{
-  BOOL tval = false;
-  int tvalsz = sizeof(tval);
-  int code = getsockopt(s, SOL_SOCKET, SO_ACCEPTCONN, (char *)&tval, &tvalsz);
-  return code == 0 && tval;
-}
-
-iocpdesc_t *pni_iocpdesc_create(iocp_t *iocp, pn_socket_t s, bool external) {
-  assert (s != INVALID_SOCKET);
-  assert(!pni_iocpdesc_map_get(iocp, s));
-  bool listening = is_listener_socket(s);
-  iocpdesc_t *iocpd = pni_iocpdesc(s);
-  iocpd->iocp = iocp;
-  if (iocpd) {
-    iocpd->external = external;
-    iocpd->error = pn_error();
-    if (listening) {
-      iocpd->acceptor = pni_acceptor(iocpd);
-    } else {
-      iocpd->pipeline = pni_write_pipeline(iocpd);
-      iocpd->read_result = read_result(iocpd);
-    }
-    pni_iocpdesc_map_push(iocpd);
-  }
-  return iocpd;
-}
-
-iocpdesc_t *pni_deadline_desc(iocp_t *iocp) {
-  // Non IO descriptor for selector deadlines.  Do not add to iocpdesc map or
-  // zombie list.  Selector responsible to free/decref object.
-  iocpdesc_t *iocpd = pni_iocpdesc(PN_INVALID_SOCKET);
-  iocpd->iocp = iocp;
-  iocpd->deadline_desc = true;
-  return iocpd;
-}
-
-// === Fast lookup of a socket's iocpdesc_t
-
-iocpdesc_t *pni_iocpdesc_map_get(iocp_t *iocp, pn_socket_t s) {
-  iocpdesc_t *iocpd = (iocpdesc_t *) pn_hash_get(iocp->iocpdesc_map, s);
-  return iocpd;
-}
-
-void pni_iocpdesc_map_push(iocpdesc_t *iocpd) {
-  pn_hash_put(iocpd->iocp->iocpdesc_map, iocpd->socket, iocpd);
-  pn_decref(iocpd);
-  assert(pn_refcount(iocpd) == 1);
-}
-
-void pni_iocpdesc_map_del(iocp_t *iocp, pn_socket_t s) {
-  pn_hash_del(iocp->iocpdesc_map, (uintptr_t) s);
-}
-
-static void bind_to_completion_port(iocpdesc_t *iocpd)
-{
-  if (iocpd->bound) return;
-  if (!iocpd->iocp->completion_port) {
-    iocpdesc_fail(iocpd, WSAEINVAL, "Incomplete setup, no completion port.");
-    return;
-  }
-
-  if (CreateIoCompletionPort ((HANDLE) iocpd->socket, iocpd->iocp->completion_port, 0, 0))
-    iocpd->bound = true;
-  else {
-    iocpdesc_fail(iocpd, GetLastError(), "IOCP socket setup.");
-  }
-}
-
-static void release_sys_sendbuf(SOCKET s)
-{
-  // Set the socket's send buffer size to zero.
-  int sz = 0;
-  int status = setsockopt(s, SOL_SOCKET, SO_SNDBUF, (const char *)&sz, sizeof(int));
-  assert(status == 0);
-}
-
-void pni_iocpdesc_start(iocpdesc_t *iocpd)
-{
-  if (iocpd->bound) return;
-  bind_to_completion_port(iocpd);
-  if (is_listener(iocpd)) {
-    begin_accept(iocpd->acceptor, NULL);
-  }
-  else {
-    release_sys_sendbuf(iocpd->socket);
-    pni_events_update(iocpd, PN_WRITABLE);
-    start_reading(iocpd);
-  }
-}
-
-static void complete(iocp_result_t *result, bool success, DWORD num_transferred) {
-  result->iocpd->ops_in_progress--;
-  DWORD status = success ? 0 : GetLastError();
-
-  switch (result->type) {
-  case IOCP_ACCEPT:
-    complete_accept((accept_result_t *) result, status);
-    break;
-  case IOCP_CONNECT:
-    complete_connect((connect_result_t *) result, status);
-    break;
-  case IOCP_WRITE:
-    complete_write((write_result_t *) result, num_transferred, status);
-    break;
-  case IOCP_READ:
-    complete_read((read_result_t *) result, num_transferred, status);
-    break;
-  default:
-    assert(false);
-  }
-}
-
-void pni_iocp_drain_completions(iocp_t *iocp)
-{
-  while (true) {
-    DWORD timeout_ms = 0;
-    DWORD num_transferred = 0;
-    ULONG_PTR completion_key = 0;
-    OVERLAPPED *overlapped = 0;
-
-    bool good_op = GetQueuedCompletionStatus (iocp->completion_port, &num_transferred,
-                                               &completion_key, &overlapped, timeout_ms);
-    if (!overlapped)
-      return;  // timed out
-    iocp_result_t *result = (iocp_result_t *) overlapped;
-    complete(result, good_op, num_transferred);
-  }
-}
-
-// returns: -1 on error, 0 on timeout, 1 successful completion
-int pni_iocp_wait_one(iocp_t *iocp, int timeout, pn_error_t *error) {
-  DWORD win_timeout = (timeout < 0) ? INFINITE : (DWORD) timeout;
-  DWORD num_transferred = 0;
-  ULONG_PTR completion_key = 0;
-  OVERLAPPED *overlapped = 0;
-
-  bool good_op = GetQueuedCompletionStatus (iocp->completion_port, &num_transferred,
-                                            &completion_key, &overlapped, win_timeout);
-  if (!overlapped)
-    if (GetLastError() == WAIT_TIMEOUT)
-      return 0;
-    else {
-      if (error)
-        pni_win32_error(error, "GetQueuedCompletionStatus", GetLastError());
-      return -1;
-    }
-
-  iocp_result_t *result = (iocp_result_t *) overlapped;
-  complete(result, good_op, num_transferred);
-  return 1;
-}
-
-// === Close (graceful and otherwise)
-
-// zombie_list is for sockets transitioning out of iocp on their way to zero ops_in_progress
-// and fully closed.
-
-static void zombie_list_add(iocpdesc_t *iocpd)
-{
-  assert(iocpd->closing);
-  if (!iocpd->ops_in_progress) {
-    // No need to make a zombie.
-    if (iocpd->socket != INVALID_SOCKET) {
-      closesocket(iocpd->socket);
-      iocpd->socket = INVALID_SOCKET;
-      iocpd->read_closed = true;
-    }
-    return;
-  }
-  // Allow 2 seconds for graceful shutdown before releasing socket resource.
-  iocpd->reap_time = pn_i_now() + 2000;
-  pn_list_add(iocpd->iocp->zombie_list, iocpd);
-}
-
-static void reap_check(iocpdesc_t *iocpd)
-{
-  if (iocpd->closing && !iocpd->ops_in_progress) {
-    if (iocpd->socket != INVALID_SOCKET) {
-      closesocket(iocpd->socket);
-      iocpd->socket = INVALID_SOCKET;
-    }
-    pn_list_remove(iocpd->iocp->zombie_list, iocpd);
-    // iocpd is decref'ed and possibly released
-  }
-}
-
-pn_timestamp_t pni_zombie_deadline(iocp_t *iocp)
-{
-  if (pn_list_size(iocp->zombie_list)) {
-    iocpdesc_t *iocpd = (iocpdesc_t *) pn_list_get(iocp->zombie_list, 0);
-    return iocpd->reap_time;
-  }
-  return 0;
-}
-
-void pni_zombie_check(iocp_t *iocp, pn_timestamp_t now)
-{
-  pn_list_t *zl = iocp->zombie_list;
-  // Look for stale zombies that should have been reaped by "now"
-  for (size_t idx = 0; idx < pn_list_size(zl); idx++) {
-    iocpdesc_t *iocpd = (iocpdesc_t *) pn_list_get(zl, idx);
-    if (iocpd->reap_time > now)
-      return;
-    if (iocpd->socket == INVALID_SOCKET)
-      continue;
-    assert(iocpd->ops_in_progress > 0);
-    if (iocp->iocp_trace)
-      iocp_log("async close: graceful close timeout exceeded\n");
-    closesocket(iocpd->socket);
-    iocpd->socket = INVALID_SOCKET;
-    iocpd->read_closed = true;
-    // outstanding ops should complete immediately now
-  }
-}
-
-static void drain_zombie_completions(iocp_t *iocp)
-{
-  // No more pn_selector_select() from App, but zombies still need care and feeding
-  // until their outstanding async actions complete.
-  pni_iocp_drain_completions(iocp);
-
-  // Discard any that have no pending async IO
-  size_t sz = pn_list_size(iocp->zombie_list);
-  for (size_t idx = 0; idx < sz;) {
-    iocpdesc_t *iocpd = (iocpdesc_t *) pn_list_get(iocp->zombie_list, idx);
-    if (!iocpd->ops_in_progress) {
-      pn_list_del(iocp->zombie_list, idx, 1);
-      sz--;
-    } else {
-      idx++;
-    }
-  }
-
-  unsigned shutdown_grace = 2000;
-  char *override = getenv("PN_SHUTDOWN_GRACE");
-  if (override) {
-    int grace = atoi(override);
-    if (grace > 0 && grace < 60000)
-      shutdown_grace = (unsigned) grace;
-  }
-  pn_timestamp_t now = pn_i_now();
-  pn_timestamp_t deadline = now + shutdown_grace;
-
-  while (pn_list_size(iocp->zombie_list)) {
-    if (now >= deadline)
-      break;
-    int rv = pni_iocp_wait_one(iocp, deadline - now, NULL);
-    if (rv < 0) {
-      iocp_log("unexpected IOCP failure on Proton IO shutdown %d\n", GetLastError());
-      break;
-    }
-    now = pn_i_now();
-  }
-  if (now >= deadline && pn_list_size(iocp->zombie_list) && iocp->iocp_trace)
-    // Should only happen if really slow TCP handshakes, i.e. total network failure
-    iocp_log("network failure on Proton shutdown\n");
-}
-
-static pn_list_t *iocp_map_close_all(iocp_t *iocp)
-{
-  // Zombify stragglers, i.e. no pn_close() from the application.
-  pn_list_t *externals = pn_list(PN_OBJECT, 0);
-  for (pn_handle_t entry = pn_hash_head(iocp->iocpdesc_map); entry;
-       entry = pn_hash_next(iocp->iocpdesc_map, entry)) {
-    iocpdesc_t *iocpd = (iocpdesc_t *) pn_hash_value(iocp->iocpdesc_map, entry);
-    // Just listeners first.
-    if (is_listener(iocpd)) {
-      if (iocpd->external) {
-        // Owned by application, just keep a temporary reference to it.
-        // iocp_result_t structs must not be free'd until completed or
-        // the completion port is closed.
-        if (iocpd->ops_in_progress)
-          pn_list_add(externals, iocpd);
-        pni_iocpdesc_map_del(iocp, iocpd->socket);
-      } else {
-        // Make it a zombie.
-        pni_iocp_begin_close(iocpd);
-      }
-    }
-  }
-  pni_iocp_drain_completions(iocp);
-
-  for (pn_handle_t entry = pn_hash_head(iocp->iocpdesc_map); entry;
-       entry = pn_hash_next(iocp->iocpdesc_map, entry)) {
-    iocpdesc_t *iocpd = (iocpdesc_t *) pn_hash_value(iocp->iocpdesc_map, entry);
-    if (iocpd->external) {
-      iocpd->read_closed = true;   // Do not consume from read side
-      iocpd->write_closed = true;  // Do not shutdown write side
-      if (iocpd->ops_in_progress)
-        pn_list_add(externals, iocpd);
-      pni_iocpdesc_map_del(iocp, iocpd->socket);
-    } else {
-      // Make it a zombie.
-      pni_iocp_begin_close(iocpd);
-    }
-  }
-  return externals;
-}
-
-static void zombie_list_hard_close_all(iocp_t *iocp)
-{
-  pni_iocp_drain_completions(iocp);
-  size_t zs = pn_list_size(iocp->zombie_list);
-  for (size_t i = 0; i < zs; i++) {
-    iocpdesc_t *iocpd = (iocpdesc_t *) pn_list_get(iocp->zombie_list, i);
-    if (iocpd->socket != INVALID_SOCKET) {
-      closesocket(iocpd->socket);
-      iocpd->socket = INVALID_SOCKET;
-      iocpd->read_closed = true;
-      iocpd->write_closed = true;
-    }
-  }
-  pni_iocp_drain_completions(iocp);
-
-  // Zombies should be all gone.  Do a sanity check.
-  zs = pn_list_size(iocp->zombie_list);
-  int remaining = 0;
-  int ops = 0;
-  for (size_t i = 0; i < zs; i++) {
-    iocpdesc_t *iocpd = (iocpdesc_t *) pn_list_get(iocp->zombie_list, i);
-    remaining++;
-    ops += iocpd->ops_in_progress;
-  }
-  if (remaining)
-    iocp_log("Proton: %d unfinished close operations (ops count = %d)\n", remaining, ops);
-}
-
-static void iocp_shutdown(iocpdesc_t *iocpd)
-{
-  if (iocpd->socket == PN_INVALID_SOCKET)
-    return;    // Hard close in progress
-  if (shutdown(iocpd->socket, SD_SEND)) {
-    int err = WSAGetLastError();
-    if (err != WSAECONNABORTED && err != WSAECONNRESET && err != WSAENOTCONN)
-      if (iocpd->iocp->iocp_trace)
-        iocp_log("socket shutdown failed %d\n", err);
-  }
-  iocpd->write_closed = true;
-}
-
-void pni_iocp_begin_close(iocpdesc_t *iocpd)
-{
-  assert (!iocpd->closing);
-  if (is_listener(iocpd)) {
-    // Listening socket is easy.  Close the socket which will cancel async ops.
-    pn_socket_t old_sock = iocpd->socket;
-    iocpd->socket = INVALID_SOCKET;
-    iocpd->closing = true;
-    iocpd->read_closed = true;
-    iocpd->write_closed = true;
-    closesocket(old_sock);
-    // Pending accepts will now complete.  Zombie can die when all consumed.
-    zombie_list_add(iocpd);
-    pni_iocpdesc_map_del(iocpd->iocp, old_sock);  // may pn_free *iocpd
-  } else {
-    // Continue async operation looking for graceful close confirmation or timeout.
-    pn_socket_t old_sock = iocpd->socket;
-    iocpd->closing = true;
-    if (!iocpd->write_closed && !write_in_progress(iocpd))
-      iocp_shutdown(iocpd);
-    zombie_list_add(iocpd);
-    pni_iocpdesc_map_del(iocpd->iocp, old_sock);  // may pn_free *iocpd
-  }
-}
-
-
-// === iocp_t
-
-#define pni_iocp_hashcode NULL
-#define pni_iocp_compare NULL
-#define pni_iocp_inspect NULL
-
-void pni_iocp_initialize(void *obj)
-{
-  iocp_t *iocp = (iocp_t *) obj;
-  memset(iocp, 0, sizeof(iocp_t));
-  pni_shared_pool_create(iocp);
-  iocp->completion_port = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0);
-  assert(iocp->completion_port != NULL);
-  iocp->iocpdesc_map = pn_hash(PN_OBJECT, 0, 0.75);
-  iocp->zombie_list = pn_list(PN_OBJECT, 0);
-  iocp->iocp_trace = pn_env_bool("PN_TRACE_DRV");
-  iocp->selector = NULL;
-}
-
-void pni_iocp_finalize(void *obj)
-{
-  iocp_t *iocp = (iocp_t *) obj;
-  // Move sockets to closed state, except external sockets.
-  pn_list_t *externals = iocp_map_close_all(iocp);
-  // Now everything with ops_in_progress is in the zombie_list or the externals list.
-  assert(!pn_hash_head(iocp->iocpdesc_map));
-  pn_free(iocp->iocpdesc_map);
-
-  drain_zombie_completions(iocp);    // Last chance for graceful close
-  zombie_list_hard_close_all(iocp);
-  CloseHandle(iocp->completion_port);  // This cancels all our async ops
-  iocp->completion_port = NULL;
-
-  if (pn_list_size(externals) && iocp->iocp_trace)
-    iocp_log("%d external sockets not closed and removed from Proton IOCP control\n", pn_list_size(externals));
-
-  // Now safe to free everything that might be touched by a former async operation.
-  pn_free(externals);
-  pn_free(iocp->zombie_list);
-  pni_shared_pool_free(iocp);
-}
-
-iocp_t *pni_iocp()
-{
-  static const pn_cid_t CID_pni_iocp = CID_pn_void;
-  static const pn_class_t clazz = PN_CLASS(pni_iocp);
-  iocp_t *iocp = (iocp_t *) pn_class_new(&clazz, sizeof(iocp_t));
-  return iocp;
-}
diff --git a/proton-c/src/reactor/io/windows/iocp.h b/proton-c/src/reactor/io/windows/iocp.h
deleted file mode 100644
index 07f47be..0000000
--- a/proton-c/src/reactor/io/windows/iocp.h
+++ /dev/null
@@ -1,136 +0,0 @@
-#ifndef PROTON_SRC_IOCP_H
-#define PROTON_SRC_IOCP_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/selectable.h>
-#include <proton/type_compat.h>
-
-typedef struct pni_acceptor_t pni_acceptor_t;
-typedef struct write_result_t write_result_t;
-typedef struct read_result_t read_result_t;
-typedef struct write_pipeline_t write_pipeline_t;
-typedef struct iocpdesc_t iocpdesc_t;
-
-
-// One per pn_io_t.
-
-struct iocp_t {
-  HANDLE completion_port;
-  pn_hash_t *iocpdesc_map;
-  pn_list_t *zombie_list;
-  int shared_pool_size;
-  char *shared_pool_memory;
-  write_result_t **shared_results;
-  write_result_t **available_results;
-  size_t shared_available_count;
-  size_t writer_count;
-  int loopback_bufsize;
-  bool iocp_trace;
-  pn_selector_t *selector;
-};
-
-
-// One for each socket.
-// This iocpdesc_t structure is ref counted by the iocpdesc_map, zombie_list,
-// selector->iocp_descriptors list.  It should remain ref counted in the
-// zombie_list until ops_in_progress == 0 or the completion port is closed.
-
-struct iocpdesc_t {
-  pn_socket_t socket;
-  iocp_t *iocp;
-  pni_acceptor_t *acceptor;
-  pn_error_t *error;
-  int ops_in_progress;
-  bool read_in_progress;
-  write_pipeline_t *pipeline;
-  read_result_t *read_result;
-  bool external;       // true if socket set up outside Proton
-  bool bound;          // associted with the completion port
-  bool closing;        // pn_close called by application
-  bool read_closed;    // EOF or read error
-  bool write_closed;   // shutdown sent or write error
-  bool poll_error;     // flag posix-like POLLERR/POLLHUP/POLLNVAL
-  bool deadline_desc;  // Socket-less deadline descriptor for selectors
-  pn_selector_t *selector;
-  pn_selectable_t *selectable;
-  int events;
-  int interests;
-  pn_timestamp_t deadline;
-  iocpdesc_t *triggered_list_next;
-  iocpdesc_t *triggered_list_prev;
-  iocpdesc_t *deadlines_next;
-  iocpdesc_t *deadlines_prev;
-  pn_timestamp_t reap_time;;
-};
-
-typedef enum { IOCP_ACCEPT, IOCP_CONNECT, IOCP_READ, IOCP_WRITE } iocp_type_t;
-
-typedef struct {
-  OVERLAPPED overlapped;
-  iocp_type_t type;
-  iocpdesc_t *iocpd;
-  HRESULT status;
-} iocp_result_t;
-
-struct write_result_t {
-  iocp_result_t base;
-  size_t requested;
-  bool in_use;
-  pn_bytes_t buffer;
-};
-
-iocpdesc_t *pni_iocpdesc_create(iocp_t *, pn_socket_t s, bool external);
-iocpdesc_t *pni_iocpdesc_map_get(iocp_t *, pn_socket_t s);
-iocpdesc_t *pni_deadline_desc(iocp_t *);
-void pni_iocpdesc_map_del(iocp_t *, pn_socket_t s);
-void pni_iocpdesc_map_push(iocpdesc_t *iocpd);
-void pni_iocpdesc_start(iocpdesc_t *iocpd);
-void pni_iocp_drain_completions(iocp_t *);
-int pni_iocp_wait_one(iocp_t *, int timeout, pn_error_t *);
-void pni_iocp_start_accepting(iocpdesc_t *iocpd);
-pn_socket_t pni_iocp_end_accept(iocpdesc_t *ld, sockaddr *addr, socklen_t *addrlen, bool *would_block, pn_error_t *error);
-pn_socket_t pni_iocp_begin_connect(iocp_t *, pn_socket_t sock, struct addrinfo *addr, pn_error_t *error);
-ssize_t pni_iocp_begin_write(iocpdesc_t *, const void *, size_t, bool *, pn_error_t *);
-ssize_t pni_iocp_recv(iocpdesc_t *iocpd, void *buf, size_t size, bool *would_block, pn_error_t *error);
-void pni_iocp_begin_close(iocpdesc_t *iocpd);
-iocp_t *pni_iocp();
-
-void pni_events_update(iocpdesc_t *iocpd, int events);
-write_result_t *pni_write_result(iocpdesc_t *iocpd, const char *buf, size_t buflen);
-write_pipeline_t *pni_write_pipeline(iocpdesc_t *iocpd);
-size_t pni_write_pipeline_size(write_pipeline_t *);
-bool pni_write_pipeline_writable(write_pipeline_t *);
-void pni_write_pipeline_return(write_pipeline_t *, write_result_t *);
-size_t pni_write_pipeline_reserve(write_pipeline_t *, size_t);
-write_result_t *pni_write_pipeline_next(write_pipeline_t *);
-void pni_shared_pool_create(iocp_t *);
-void pni_shared_pool_free(iocp_t *);
-void pni_zombie_check(iocp_t *, pn_timestamp_t);
-pn_timestamp_t pni_zombie_deadline(iocp_t *);
-
-pn_selector_t *pni_selector_create(iocp_t *iocp);
-
-int pni_win32_error(pn_error_t *error, const char *msg, HRESULT code);
-
-#endif /* iocp.h */
diff --git a/proton-c/src/reactor/io/windows/selector.c b/proton-c/src/reactor/io/windows/selector.c
deleted file mode 100644
index 15da73b..0000000
--- a/proton-c/src/reactor/io/windows/selector.c
+++ /dev/null
@@ -1,384 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0501
-#endif
-#if _WIN32_WINNT < 0x0501
-#error "Proton requires Windows API support for XP or later."
-#endif
-#include <winsock2.h>
-#include <Ws2tcpip.h>
-
-#include "reactor/io.h"
-#include "reactor/selectable.h"
-#include "reactor/selector.h"
-
-#include "iocp.h"
-#include "platform/platform.h"
-#include "core/util.h"
-
-#include <proton/object.h>
-#include <proton/error.h>
-#include <assert.h>
-
-static void interests_update(iocpdesc_t *iocpd, int interests);
-static void deadlines_update(iocpdesc_t *iocpd, pn_timestamp_t t);
-
-struct pn_selector_t {
-  iocp_t *iocp;
-  pn_list_t *selectables;
-  pn_list_t *iocp_descriptors;
-  size_t current;
-  iocpdesc_t *current_triggered;
-  pn_timestamp_t awoken;
-  pn_error_t *error;
-  iocpdesc_t *triggered_list_head;
-  iocpdesc_t *triggered_list_tail;
-  iocpdesc_t *deadlines_head;
-  iocpdesc_t *deadlines_tail;
-};
-
-void pn_selector_initialize(void *obj)
-{
-  pn_selector_t *selector = (pn_selector_t *) obj;
-  selector->iocp = NULL;
-  selector->selectables = pn_list(PN_WEAKREF, 0);
-  selector->iocp_descriptors = pn_list(PN_OBJECT, 0);
-  selector->current = 0;
-  selector->current_triggered = NULL;
-  selector->awoken = 0;
-  selector->error = pn_error();
-  selector->triggered_list_head = NULL;
-  selector->triggered_list_tail = NULL;
-  selector->deadlines_head = NULL;
-  selector->deadlines_tail = NULL;
-}
-
-void pn_selector_finalize(void *obj)
-{
-  pn_selector_t *selector = (pn_selector_t *) obj;
-  pn_free(selector->selectables);
-  pn_free(selector->iocp_descriptors);
-  pn_error_free(selector->error);
-  selector->iocp->selector = NULL;
-}
-
-#define pn_selector_hashcode NULL
-#define pn_selector_compare NULL
-#define pn_selector_inspect NULL
-
-pn_selector_t *pni_selector()
-{
-  static const pn_class_t clazz = PN_CLASS(pn_selector);
-  pn_selector_t *selector = (pn_selector_t *) pn_class_new(&clazz, sizeof(pn_selector_t));
-  return selector;
-}
-
-pn_selector_t *pni_selector_create(iocp_t *iocp)
-{
-  pn_selector_t *selector = pni_selector();
-  selector->iocp = iocp;
-  return selector;
-}
-
-void pn_selector_add(pn_selector_t *selector, pn_selectable_t *selectable)
-{
-  assert(selector);
-  assert(selectable);
-  assert(pni_selectable_get_index(selectable) < 0);
-  pn_socket_t sock = pn_selectable_get_fd(selectable);
-  iocpdesc_t *iocpd = NULL;
-
-  if (pni_selectable_get_index(selectable) < 0) {
-    pn_list_add(selector->selectables, selectable);
-    pn_list_add(selector->iocp_descriptors, NULL);
-    size_t size = pn_list_size(selector->selectables);
-    pni_selectable_set_index(selectable, size - 1);
-  }
-
-  pn_selector_update(selector, selectable);
-}
-
-void pn_selector_update(pn_selector_t *selector, pn_selectable_t *selectable)
-{
-  // A selectable's fd may switch from PN_INVALID_SCOKET to a working socket between
-  // update calls.  If a selectable without a valid socket has a deadline, we need
-  // a dummy iocpdesc_t to participate in the deadlines list.
-  int idx = pni_selectable_get_index(selectable);
-  assert(idx >= 0);
-  pn_timestamp_t deadline = pn_selectable_get_deadline(selectable);
-  pn_socket_t sock = pn_selectable_get_fd(selectable);
-  iocpdesc_t *iocpd = (iocpdesc_t *) pn_list_get(selector->iocp_descriptors, idx);
-
-  if (!iocpd && deadline && sock == PN_INVALID_SOCKET) {
-    iocpd = pni_deadline_desc(selector->iocp);
-    assert(iocpd);
-    pn_list_set(selector->iocp_descriptors, idx, iocpd);
-    pn_decref(iocpd);  // life is solely tied to iocp_descriptors list
-    iocpd->selector = selector;
-    iocpd->selectable = selectable;
-  }
-  else if (iocpd && iocpd->deadline_desc && sock != PN_INVALID_SOCKET) {
-    // Switching to a real socket.  Stop using a deadline descriptor.
-    deadlines_update(iocpd, 0);
-    // decref descriptor in list and pick up a real iocpd below
-    pn_list_set(selector->iocp_descriptors, idx, NULL);
-    iocpd = NULL;
-  }
-
-  // The selectables socket may be set long after it has been added
-  if (!iocpd && sock != PN_INVALID_SOCKET) {
-    iocpd = pni_iocpdesc_map_get(selector->iocp, sock);
-    if (!iocpd) {
-      // Socket created outside proton.  Hook it up to iocp.
-      iocpd = pni_iocpdesc_create(selector->iocp, sock, true);
-      assert(iocpd);
-      if (iocpd)
-        pni_iocpdesc_start(iocpd);
-    }
-    if (iocpd) {
-      pn_list_set(selector->iocp_descriptors, idx, iocpd);
-      iocpd->selector = selector;
-      iocpd->selectable = selectable;
-    }
-  }
-
-  if (iocpd) {
-    assert(sock == iocpd->socket || iocpd->closing);
-    int interests = PN_ERROR; // Always
-    if (pn_selectable_is_reading(selectable)) {
-      interests |= PN_READABLE;
-    }
-    if (pn_selectable_is_writing(selectable)) {
-      interests |= PN_WRITABLE;
-    }
-    if (deadline) {
-      interests |= PN_EXPIRED;
-    }
-    interests_update(iocpd, interests);
-    deadlines_update(iocpd, deadline);
-  }
-}
-
-void pn_selector_remove(pn_selector_t *selector, pn_selectable_t *selectable)
-{
-  assert(selector);
-  assert(selectable);
-
-  int idx = pni_selectable_get_index(selectable);
-  assert(idx >= 0);
-  iocpdesc_t *iocpd = (iocpdesc_t *) pn_list_get(selector->iocp_descriptors, idx);
-  if (iocpd) {
-    if (selector->current_triggered == iocpd)
-      selector->current_triggered = iocpd->triggered_list_next;
-    interests_update(iocpd, 0);
-    deadlines_update(iocpd, 0);
-    assert(selector->triggered_list_head != iocpd && !iocpd->triggered_list_prev);
-    assert(selector->deadlines_head != iocpd && !iocpd->deadlines_prev);
-    iocpd->selector = NULL;
-    iocpd->selectable = NULL;
-  }
-  pn_list_del(selector->selectables, idx, 1);
-  pn_list_del(selector->iocp_descriptors, idx, 1);
-  size_t size = pn_list_size(selector->selectables);
-  for (size_t i = idx; i < size; i++) {
-    pn_selectable_t *sel = (pn_selectable_t *) pn_list_get(selector->selectables, i);
-    pni_selectable_set_index(sel, i);
-  }
-
-  pni_selectable_set_index(selectable, -1);
-
-  if (selector->current >= (size_t) idx) {
-    selector->current--;
-  }
-}
-
-size_t pn_selector_size(pn_selector_t *selector) {
-  assert(selector);
-  return pn_list_size(selector->selectables);
-}
-
-int pn_selector_select(pn_selector_t *selector, int timeout)
-{
-  assert(selector);
-  pn_error_clear(selector->error);
-  pn_timestamp_t deadline = 0;
-  pn_timestamp_t now = pn_i_now();
-
-  if (timeout) {
-    if (selector->deadlines_head)
-      deadline = selector->deadlines_head->deadline;
-  }
-  if (deadline) {
-    int64_t delta = deadline - now;
-    if (delta < 0) {
-      delta = 0;
-    }
-    if (timeout < 0)
-      timeout = delta;
-    else if (timeout > delta)
-      timeout = delta;
-  }
-  deadline = (timeout >= 0) ? now + timeout : 0;
-
-  // Process all currently available completions, even if matched events available
-  pni_iocp_drain_completions(selector->iocp);
-  pni_zombie_check(selector->iocp, now);
-  // Loop until an interested event is matched, or until deadline
-  while (true) {
-    if (selector->triggered_list_head)
-      break;
-    if (deadline && deadline <= now)
-      break;
-    pn_timestamp_t completion_deadline = deadline;
-    pn_timestamp_t zd = pni_zombie_deadline(selector->iocp);
-    if (zd)
-      completion_deadline = completion_deadline ? pn_min(zd, completion_deadline) : zd;
-
-    int completion_timeout = (!completion_deadline) ? -1 : completion_deadline - now;
-    int rv = pni_iocp_wait_one(selector->iocp, completion_timeout, selector->error);
-    if (rv < 0)
-      return pn_error_code(selector->error);
-
-    now = pn_i_now();
-    if (zd && zd <= now) {
-      pni_zombie_check(selector->iocp, now);
-    }
-  }
-
-  selector->current = 0;
-  selector->awoken = now;
-  for (iocpdesc_t *iocpd = selector->deadlines_head; iocpd; iocpd = iocpd->deadlines_next) {
-    if (iocpd->deadline <= now)
-      pni_events_update(iocpd, iocpd->events | PN_EXPIRED);
-    else
-      break;
-  }
-  selector->current_triggered = selector->triggered_list_head;
-  return pn_error_code(selector->error);
-}
-
-pn_selectable_t *pn_selector_next(pn_selector_t *selector, int *events)
-{
-  if (selector->current_triggered) {
-    iocpdesc_t *iocpd = selector->current_triggered;
-    *events = iocpd->interests & iocpd->events;
-    selector->current_triggered = iocpd->triggered_list_next;
-    return iocpd->selectable;
-  }
-  return NULL;
-}
-
-void pn_selector_free(pn_selector_t *selector)
-{
-  assert(selector);
-  pn_free(selector);
-}
-
-
-static void triggered_list_add(pn_selector_t *selector, iocpdesc_t *iocpd)
-{
-  if (iocpd->triggered_list_prev || selector->triggered_list_head == iocpd)
-    return; // already in list
-  LL_ADD(selector, triggered_list, iocpd);
-}
-
-static void triggered_list_remove(pn_selector_t *selector, iocpdesc_t *iocpd)
-{
-  if (!iocpd->triggered_list_prev && selector->triggered_list_head != iocpd)
-    return; // not in list
-  LL_REMOVE(selector, triggered_list, iocpd);
-  iocpd->triggered_list_prev = NULL;
-  iocpd->triggered_list_next = NULL;
-}
-
-
-void pni_events_update(iocpdesc_t *iocpd, int events)
-{
-  // If set, a poll error is permanent
-  if (iocpd->poll_error)
-    events |= PN_ERROR;
-  if (iocpd->events == events)
-    return;
-  iocpd->events = events;
-  if (iocpd->selector) {
-    if (iocpd->events & iocpd->interests)
-      triggered_list_add(iocpd->selector, iocpd);
-    else
-      triggered_list_remove(iocpd->selector, iocpd);
-  }
-}
-
-static void interests_update(iocpdesc_t *iocpd, int interests)
-{
-  int old_interests = iocpd->interests;
-  if (old_interests == interests)
-    return;
-  iocpd->interests = interests;
-  if (iocpd->selector) {
-    if (iocpd->events & iocpd->interests)
-      triggered_list_add(iocpd->selector, iocpd);
-    else
-      triggered_list_remove(iocpd->selector, iocpd);
-  }
-}
-
-static void deadlines_remove(pn_selector_t *selector, iocpdesc_t *iocpd)
-{
-  if (!iocpd->deadlines_prev && selector->deadlines_head != iocpd)
-    return; // not in list
-  LL_REMOVE(selector, deadlines, iocpd);
-  iocpd->deadlines_prev = NULL;
-  iocpd->deadlines_next = NULL;
-}
-
-
-static void deadlines_update(iocpdesc_t *iocpd, pn_timestamp_t deadline)
-{
-  if (deadline == iocpd->deadline)
-    return;
-
-  iocpd->deadline = deadline;
-  pn_selector_t *selector = iocpd->selector;
-  if (!deadline) {
-    deadlines_remove(selector, iocpd);
-    pni_events_update(iocpd, iocpd->events & ~PN_EXPIRED);
-  } else {
-    if (iocpd->deadlines_prev || selector->deadlines_head == iocpd) {
-      deadlines_remove(selector, iocpd);
-      pni_events_update(iocpd, iocpd->events & ~PN_EXPIRED);
-    }
-    iocpdesc_t *dl_iocpd = LL_HEAD(selector, deadlines);
-    while (dl_iocpd && dl_iocpd->deadline <= deadline)
-      dl_iocpd = dl_iocpd->deadlines_next;
-    if (dl_iocpd) {
-      // insert
-      iocpd->deadlines_prev = dl_iocpd->deadlines_prev;
-      iocpd->deadlines_next = dl_iocpd;
-      dl_iocpd->deadlines_prev = iocpd;
-      if (selector->deadlines_head == dl_iocpd)
-        selector->deadlines_head = iocpd;
-    } else {
-      LL_ADD(selector, deadlines, iocpd);  // append
-    }
-  }
-}
diff --git a/proton-c/src/reactor/io/windows/write_pipeline.c b/proton-c/src/reactor/io/windows/write_pipeline.c
deleted file mode 100644
index 905c7f6..0000000
--- a/proton-c/src/reactor/io/windows/write_pipeline.c
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*
- * A simple write buffer pool.  Each socket has a dedicated "primary"
- * buffer and can borrow from a shared pool with limited size tuning.
- * Could enhance e.g. with separate pools per network interface and fancier
- * memory tuning based on interface speed, system resources, and
- * number of connections, etc.
- */
-
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0501
-#endif
-#if _WIN32_WINNT < 0x0501
-#error "Proton requires Windows API support for XP or later."
-#endif
-#include <winsock2.h>
-#include <Ws2tcpip.h>
-
-#include "reactor/io.h"
-#include "reactor/selector.h"
-#include "reactor/selectable.h"
-
-#include "iocp.h"
-#include "core/util.h"
-
-#include <proton/error.h>
-#include <proton/object.h>
-
-#include <assert.h>
-
-// Max overlapped writes per socket
-#define IOCP_MAX_OWRITES 16
-// Write buffer size
-#define IOCP_WBUFSIZE 16384
-
-static void pipeline_log(const char *fmt, ...)
-{
-    va_list ap;
-    va_start(ap, fmt);
-    vfprintf(stderr, fmt, ap);
-    va_end(ap);
-    fflush(stderr);
-}
-
-void pni_shared_pool_create(iocp_t *iocp)
-{
-  // TODO: more pools (or larger one) when using multiple non-loopback interfaces
-  iocp->shared_pool_size = 16;
-  char *env = getenv("PNI_WRITE_BUFFERS"); // Internal: for debugging
-  if (env) {
-    int sz = atoi(env);
-    if (sz >= 0 && sz < 256) {
-      iocp->shared_pool_size = sz;
-    }
-  }
-  iocp->loopback_bufsize = 0;
-  env = getenv("PNI_LB_BUFSIZE"); // Internal: for debugging
-  if (env) {
-    int sz = atoi(env);
-    if (sz >= 0 && sz <= 128 * 1024) {
-      iocp->loopback_bufsize = sz;
-    }
-  }
-
-  if (iocp->shared_pool_size) {
-    iocp->shared_pool_memory = (char *) VirtualAlloc(NULL, IOCP_WBUFSIZE * iocp->shared_pool_size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
-    HRESULT status = GetLastError();
-    if (!iocp->shared_pool_memory) {
-      perror("Proton write buffer pool allocation failure\n");
-      iocp->shared_pool_size = 0;
-      iocp->shared_available_count = 0;
-      return;
-    }
-
-    iocp->shared_results = (write_result_t **) malloc(iocp->shared_pool_size * sizeof(write_result_t *));
-    iocp->available_results = (write_result_t **) malloc(iocp->shared_pool_size * sizeof(write_result_t *));
-    iocp->shared_available_count = iocp->shared_pool_size;
-    char *mem = iocp->shared_pool_memory;
-    for (int i = 0; i < iocp->shared_pool_size; i++) {
-      iocp->shared_results[i] = iocp->available_results[i] = pni_write_result(NULL, mem, IOCP_WBUFSIZE);
-      mem += IOCP_WBUFSIZE;
-    }
-  }
-}
-
-void pni_shared_pool_free(iocp_t *iocp)
-{
-  for (int i = 0; i < iocp->shared_pool_size; i++) {
-    write_result_t *result = iocp->shared_results[i];
-    if (result->in_use)
-      pipeline_log("Proton buffer pool leak\n");
-    else
-      free(result);
-  }
-  if (iocp->shared_pool_size) {
-    free(iocp->shared_results);
-    free(iocp->available_results);
-    if (iocp->shared_pool_memory) {
-      if (!VirtualFree(iocp->shared_pool_memory, 0, MEM_RELEASE)) {
-        perror("write buffers release failed");
-      }
-      iocp->shared_pool_memory = NULL;
-    }
-  }
-}
-
-static void shared_pool_push(write_result_t *result)
-{
-  iocp_t *iocp = result->base.iocpd->iocp;
-  assert(iocp->shared_available_count < iocp->shared_pool_size);
-  iocp->available_results[iocp->shared_available_count++] = result;
-}
-
-static write_result_t *shared_pool_pop(iocp_t *iocp)
-{
-  return iocp->shared_available_count ? iocp->available_results[--iocp->shared_available_count] : NULL;
-}
-
-struct write_pipeline_t {
-  iocpdesc_t *iocpd;
-  size_t pending_count;
-  write_result_t *primary;
-  size_t reserved_count;
-  size_t next_primary_index;
-  size_t depth;
-  bool is_writer;
-};
-
-#define write_pipeline_compare NULL
-#define write_pipeline_inspect NULL
-#define write_pipeline_hashcode NULL
-
-static void write_pipeline_initialize(void *object)
-{
-  write_pipeline_t *pl = (write_pipeline_t *) object;
-  pl->pending_count = 0;
-  const char *pribuf = (const char *) malloc(IOCP_WBUFSIZE);
-  pl->primary = pni_write_result(NULL, pribuf, IOCP_WBUFSIZE);
-  pl->depth = 0;
-  pl->is_writer = false;
-}
-
-static void write_pipeline_finalize(void *object)
-{
-  write_pipeline_t *pl = (write_pipeline_t *) object;
-  free((void *)pl->primary->buffer.start);
-  free(pl->primary);
-}
-
-write_pipeline_t *pni_write_pipeline(iocpdesc_t *iocpd)
-{
-  static const pn_cid_t CID_write_pipeline = CID_pn_void;
-  static const pn_class_t clazz = PN_CLASS(write_pipeline);
-  write_pipeline_t *pipeline = (write_pipeline_t *) pn_class_new(&clazz, sizeof(write_pipeline_t));
-  pipeline->iocpd = iocpd;
-  pipeline->primary->base.iocpd = iocpd;
-  return pipeline;
-}
-
-static void confirm_as_writer(write_pipeline_t *pl)
-{
-  if (!pl->is_writer) {
-    iocp_t *iocp = pl->iocpd->iocp;
-    iocp->writer_count++;
-    pl->is_writer = true;
-  }
-}
-
-static void remove_as_writer(write_pipeline_t *pl)
-{
-  if (!pl->is_writer)
-    return;
-  iocp_t *iocp = pl->iocpd->iocp;
-  assert(iocp->writer_count);
-  pl->is_writer = false;
-  iocp->writer_count--;
-}
-
-/*
- * Optimal depth will depend on properties of the NIC, server, and driver.  For now,
- * just distinguish between loopback interfaces and the rest.  Optimizations in the
- * loopback stack allow decent performance with depth 1 and actually cause major
- * performance hiccups if set to large values.
- */
-static void set_depth(write_pipeline_t *pl)
-{
-  pl->depth = 1;
-  sockaddr_storage sa;
-  socklen_t salen = sizeof(sa);
-  char buf[INET6_ADDRSTRLEN];
-  DWORD buflen = sizeof(buf);
-
-  if (getsockname(pl->iocpd->socket,(sockaddr*) &sa, &salen) == 0 &&
-      getnameinfo((sockaddr*) &sa, salen, buf, buflen, NULL, 0, NI_NUMERICHOST) == 0) {
-    if ((sa.ss_family == AF_INET6 && strcmp(buf, "::1")) ||
-        (sa.ss_family == AF_INET && strncmp(buf, "127.", 4))) {
-      // not loopback
-      pl->depth = IOCP_MAX_OWRITES;
-    } else {
-      iocp_t *iocp = pl->iocpd->iocp;
-      if (iocp->loopback_bufsize) {
-        const char *p = (const char *) realloc((void *) pl->primary->buffer.start, iocp->loopback_bufsize);
-        if (p) {
-          pl->primary->buffer.start = p;
-          pl->primary->buffer.size = iocp->loopback_bufsize;
-        }
-      }
-    }
-  }
-}
-
-// Reserve as many buffers as possible for count bytes.
-size_t pni_write_pipeline_reserve(write_pipeline_t *pl, size_t count)
-{
-  if (pl->primary->in_use)
-    return 0;  // I.e. io->wouldblock
-  if (!pl->depth)
-    set_depth(pl);
-  if (pl->depth == 1) {
-    // always use the primary
-    pl->reserved_count = 1;
-    pl->next_primary_index = 0;
-    return 1;
-  }
-
-  iocp_t *iocp = pl->iocpd->iocp;
-  confirm_as_writer(pl);
-  size_t wanted = (count / IOCP_WBUFSIZE);
-  if (count % IOCP_WBUFSIZE)
-    wanted++;
-  size_t pending = pl->pending_count;
-  assert(pending < pl->depth);
-  size_t bufs = pn_min(wanted, pl->depth - pending);
-  // Can draw from shared pool or the primary... but share with others.
-  size_t writers = iocp->writer_count;
-  size_t shared_count = (iocp->shared_available_count + writers - 1) / writers;
-  bufs = pn_min(bufs, shared_count + 1);
-  pl->reserved_count = pending + bufs;
-
-  if (bufs == wanted &&
-      pl->reserved_count < (pl->depth / 2) &&
-      iocp->shared_available_count > (2 * writers + bufs)) {
-    // No shortage: keep the primary as spare for future use
-    pl->next_primary_index = pl->reserved_count;
-  } else if (bufs == 1) {
-    pl->next_primary_index = pending;
-  } else {
-    // let approx 1/3 drain before replenishing
-    pl->next_primary_index = ((pl->reserved_count + 2) / 3) - 1;
-    if (pl->next_primary_index < pending)
-      pl->next_primary_index = pending;
-  }
-  return bufs;
-}
-
-write_result_t *pni_write_pipeline_next(write_pipeline_t *pl)
-{
-  size_t sz = pl->pending_count;
-  if (sz >= pl->reserved_count)
-    return NULL;
-  write_result_t *result;
-  if (sz == pl->next_primary_index) {
-    result = pl->primary;
-  } else {
-    assert(pl->iocpd->iocp->shared_available_count > 0);
-    result = shared_pool_pop(pl->iocpd->iocp);
-  }
-
-  result->in_use = true;
-  pl->pending_count++;
-  return result;
-}
-
-void pni_write_pipeline_return(write_pipeline_t *pl, write_result_t *result)
-{
-  result->in_use = false;
-  pl->pending_count--;
-  pl->reserved_count = 0;
-  if (result != pl->primary)
-    shared_pool_push(result);
-  if (pl->pending_count == 0)
-    remove_as_writer(pl);
-}
-
-bool pni_write_pipeline_writable(write_pipeline_t *pl)
-{
-  // Only writable if not full and we can guarantee a buffer:
-  return pl->pending_count < pl->depth && !pl->primary->in_use;
-}
-
-size_t pni_write_pipeline_size(write_pipeline_t *pl)
-{
-  return pl->pending_count;
-}
diff --git a/proton-c/src/reactor/reactor.c b/proton-c/src/reactor/reactor.c
deleted file mode 100644
index abf5d1e..0000000
--- a/proton-c/src/reactor/reactor.c
+++ /dev/null
@@ -1,500 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "io.h"
-#include "reactor.h"
-#include "selectable.h"
-#include "platform/platform.h" // pn_i_now
-
-#include <proton/object.h>
-#include <proton/handlers.h>
-#include <proton/event.h>
-#include <proton/transport.h>
-#include <proton/connection.h>
-#include <proton/session.h>
-#include <proton/link.h>
-#include <proton/delivery.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <assert.h>
-
-struct pn_reactor_t {
-  pn_record_t *attachments;
-  pn_io_t *io;
-  pn_collector_t *collector;
-  pn_handler_t *global;
-  pn_handler_t *handler;
-  pn_list_t *children;
-  pn_timer_t *timer;
-  pn_socket_t wakeup[2];
-  pn_selectable_t *selectable;
-  pn_event_type_t previous;
-  pn_timestamp_t now;
-  int selectables;
-  int timeout;
-  bool yield;
-  bool stop;
-};
-
-pn_timestamp_t pn_reactor_mark(pn_reactor_t *reactor) {
-  assert(reactor);
-  reactor->now = pn_i_now();
-  return reactor->now;
-}
-
-pn_timestamp_t pn_reactor_now(pn_reactor_t *reactor) {
-  assert(reactor);
-  return reactor->now;
-}
-
-static void pn_reactor_initialize(pn_reactor_t *reactor) {
-  reactor->attachments = pn_record();
-  reactor->io = pn_io();
-  reactor->collector = pn_collector();
-  reactor->global = pn_iohandler();
-  reactor->handler = pn_handler(NULL);
-  reactor->children = pn_list(PN_OBJECT, 0);
-  reactor->timer = pn_timer(reactor->collector);
-  reactor->wakeup[0] = PN_INVALID_SOCKET;
-  reactor->wakeup[1] = PN_INVALID_SOCKET;
-  reactor->selectable = NULL;
-  reactor->previous = PN_EVENT_NONE;
-  reactor->selectables = 0;
-  reactor->timeout = 0;
-  reactor->yield = false;
-  reactor->stop = false;
-  pn_reactor_mark(reactor);
-}
-
-static void pn_reactor_finalize(pn_reactor_t *reactor) {
-  for (int i = 0; i < 2; i++) {
-    if (reactor->wakeup[i] != PN_INVALID_SOCKET) {
-      pn_close(reactor->io, reactor->wakeup[i]);
-    }
-  }
-  pn_decref(reactor->attachments);
-  pn_decref(reactor->collector);
-  pn_decref(reactor->global);
-  pn_decref(reactor->handler);
-  pn_decref(reactor->children);
-  pn_decref(reactor->timer);
-  pn_decref(reactor->io);
-}
-
-#define pn_reactor_hashcode NULL
-#define pn_reactor_compare NULL
-#define pn_reactor_inspect NULL
-
-PN_CLASSDEF(pn_reactor)
-
-pn_reactor_t *pn_reactor() {
-  pn_reactor_t *reactor = pn_reactor_new();
-  int err = pn_pipe(reactor->io, reactor->wakeup);
-  if (err) {
-    pn_free(reactor);
-    return NULL;
-  } else {
-    return reactor;
-  }
-}
-
-pn_record_t *pn_reactor_attachments(pn_reactor_t *reactor) {
-  assert(reactor);
-  return reactor->attachments;
-}
-
-pn_millis_t pn_reactor_get_timeout(pn_reactor_t *reactor) {
-  assert(reactor);
-  return reactor->timeout;
-}
-
-void pn_reactor_set_timeout(pn_reactor_t *reactor, pn_millis_t timeout) {
-  assert(reactor);
-  reactor->timeout = timeout;
-}
-
-void pn_reactor_free(pn_reactor_t *reactor) {
-  if (reactor) {
-    pn_collector_release(reactor->collector);
-    pn_handler_free(reactor->handler);
-    reactor->handler = NULL;
-    pn_decref(reactor);
-  }
-}
-
-pn_handler_t *pn_reactor_get_global_handler(pn_reactor_t *reactor) {
-  assert(reactor);
-  return reactor->global;
-}
-
-void pn_reactor_set_global_handler(pn_reactor_t *reactor, pn_handler_t *handler) {
-  assert(reactor);
-  pn_decref(reactor->global);
-  reactor->global = handler;
-  pn_incref(reactor->global);
-}
-
-pn_handler_t *pn_reactor_get_handler(pn_reactor_t *reactor) {
-  assert(reactor);
-  return reactor->handler;
-}
-
-void pn_reactor_set_handler(pn_reactor_t *reactor, pn_handler_t *handler) {
-  assert(reactor);
-  pn_decref(reactor->handler);
-  reactor->handler = handler;
-  pn_incref(reactor->handler);
-}
-
-pn_io_t *pni_reactor_io(pn_reactor_t *reactor) {
-  assert(reactor);
-  return reactor->io;
-}
-
-pn_error_t *pn_reactor_error(pn_reactor_t *reactor) {
-  assert(reactor);
-  return pn_io_error(reactor->io);
-}
-
-pn_collector_t *pn_reactor_collector(pn_reactor_t *reactor) {
-  assert(reactor);
-  return reactor->collector;
-}
-
-pn_list_t *pn_reactor_children(pn_reactor_t *reactor) {
-  assert(reactor);
-  return reactor->children;
-}
-
-static void pni_selectable_release(pn_selectable_t *selectable) {
-  pn_reactor_t *reactor = (pn_reactor_t *) pni_selectable_get_context(selectable);
-  pn_incref(selectable);
-  if (pn_list_remove(reactor->children, selectable)) {
-    reactor->selectables--;
-  }
-  pn_decref(selectable);
-}
-
-pn_selectable_t *pn_reactor_selectable(pn_reactor_t *reactor) {
-  assert(reactor);
-  pn_selectable_t *sel = pn_selectable();
-  pn_selectable_collect(sel, reactor->collector);
-  pn_collector_put(reactor->collector, PN_OBJECT, sel, PN_SELECTABLE_INIT);
-  pni_selectable_set_context(sel, reactor);
-  pn_list_add(reactor->children, sel);
-  pn_selectable_on_release(sel, pni_selectable_release);
-  pn_decref(sel);
-  reactor->selectables++;
-  return sel;
-}
-
-PN_HANDLE(PNI_TERMINATED)
-
-void pn_reactor_update(pn_reactor_t *reactor, pn_selectable_t *selectable) {
-  assert(reactor);
-  pn_record_t *record = pn_selectable_attachments(selectable);
-  if (!pn_record_has(record, PNI_TERMINATED)) {
-    if (pn_selectable_is_terminal(selectable)) {
-      pn_record_def(record, PNI_TERMINATED, PN_VOID);
-      pn_collector_put(reactor->collector, PN_OBJECT, selectable, PN_SELECTABLE_FINAL);
-    } else {
-      pn_collector_put(reactor->collector, PN_OBJECT, selectable, PN_SELECTABLE_UPDATED);
-    }
-  }
-}
-
-void pni_handle_final(pn_reactor_t *reactor, pn_event_t *event);
-
-static void pni_reactor_dispatch_post(pn_reactor_t *reactor, pn_event_t *event) {
-  assert(reactor);
-  assert(event);
-  switch (pn_event_type(event)) {
-  case PN_CONNECTION_FINAL:
-    pni_handle_final(reactor, event);
-    break;
-  default:
-    break;
-  }
-}
-
-PN_HANDLE(PN_HANDLER)
-
-pn_handler_t *pn_record_get_handler(pn_record_t *record) {
-  assert(record);
-  return (pn_handler_t *) pn_record_get(record, PN_HANDLER);
-}
-
-void pn_record_set_handler(pn_record_t *record, pn_handler_t *handler) {
-  assert(record);
-  pn_record_def(record, PN_HANDLER, PN_OBJECT);
-  pn_record_set(record, PN_HANDLER, handler);
-}
-
-PN_HANDLE(PN_REACTOR)
-
-pn_reactor_t *pni_record_get_reactor(pn_record_t *record) {
-  return (pn_reactor_t *) pn_record_get(record, PN_REACTOR);
-}
-
-void pni_record_init_reactor(pn_record_t *record, pn_reactor_t *reactor) {
-  pn_record_def(record, PN_REACTOR, PN_WEAKREF);
-  pn_record_set(record, PN_REACTOR, reactor);
-}
-
-static pn_connection_t *pni_object_connection(const pn_class_t *clazz, void *object) {
-  switch (pn_class_id(clazz)) {
-  case CID_pn_delivery:
-    return pn_session_connection(pn_link_session(pn_delivery_link((pn_delivery_t *) object)));
-  case CID_pn_link:
-    return pn_session_connection(pn_link_session((pn_link_t *) object));
-  case CID_pn_session:
-    return pn_session_connection((pn_session_t *) object);
-  case CID_pn_connection:
-    return (pn_connection_t *) object;
-  case CID_pn_transport:
-    return pn_transport_connection((pn_transport_t *) object);
-  default:
-    return NULL;
-  }
-}
-
-static pn_reactor_t *pni_reactor(pn_selectable_t *sel) {
-  return (pn_reactor_t *) pni_selectable_get_context(sel);
-}
-
-pn_reactor_t *pn_class_reactor(const pn_class_t *clazz, void *object) {
-  switch (pn_class_id(clazz)) {
-  case CID_pn_reactor:
-    return (pn_reactor_t *) object;
-  case CID_pn_task:
-    return pni_record_get_reactor(pn_task_attachments((pn_task_t *) object));
-  case CID_pn_transport:
-    return pni_record_get_reactor(pn_transport_attachments((pn_transport_t *) object));
-  case CID_pn_delivery:
-  case CID_pn_link:
-  case CID_pn_session:
-  case CID_pn_connection:
-    {
-      pn_connection_t *conn = pni_object_connection(clazz, object);
-      pn_record_t *record = pn_connection_attachments(conn);
-      return pni_record_get_reactor(record);
-    }
-  case CID_pn_selectable:
-    {
-      pn_selectable_t *sel = (pn_selectable_t *) object;
-      return pni_reactor(sel);
-    }
-  default:
-    return NULL;
-  }
-}
-
-pn_reactor_t *pn_object_reactor(void *object) {
-  return pn_class_reactor(pn_object_reify(object), object);
-}
-
-pn_reactor_t *pn_event_reactor(pn_event_t *event) {
-  const pn_class_t *clazz = pn_event_class(event);
-  void *context = pn_event_context(event);
-  return pn_class_reactor(clazz, context);
-}
-
-pn_handler_t *pn_event_handler(pn_event_t *event, pn_handler_t *default_handler) {
-  pn_handler_t *handler = NULL;
-  pn_link_t *link = pn_event_link(event);
-  if (link) {
-    handler = pn_record_get_handler(pn_link_attachments(link));
-    if (handler) { return handler; }
-  }
-  pn_session_t *session = pn_event_session(event);
-  if (session) {
-    handler = pn_record_get_handler(pn_session_attachments(session));
-    if (handler) { return handler; }
-  }
-  pn_connection_t *connection = pn_event_connection(event);
-  if (connection) {
-    handler = pn_record_get_handler(pn_connection_attachments(connection));
-    if (handler) { return handler; }
-  }
-  switch (pn_class_id(pn_event_class(event))) {
-  case CID_pn_task:
-    handler = pn_record_get_handler(pn_task_attachments((pn_task_t *) pn_event_context(event)));
-    if (handler) { return handler; }
-    break;
-  case CID_pn_selectable:
-    handler = pn_record_get_handler(pn_selectable_attachments((pn_selectable_t *) pn_event_context(event)));
-    if (handler) { return handler; }
-    break;
-  default:
-    break;
-  }
-  return default_handler;
-}
-
-pn_task_t *pn_reactor_schedule(pn_reactor_t *reactor, int delay, pn_handler_t *handler) {
-  pn_task_t *task = pn_timer_schedule(reactor->timer, reactor->now + delay);
-  pn_record_t *record = pn_task_attachments(task);
-  pni_record_init_reactor(record, reactor);
-  pn_record_set_handler(record, handler);
-  if (reactor->selectable) {
-    pn_selectable_set_deadline(reactor->selectable, pn_timer_deadline(reactor->timer));
-    pn_reactor_update(reactor, reactor->selectable);
-  }
-  return task;
-}
-
-void pni_event_print(pn_event_t *event) {
-  pn_string_t *str = pn_string(NULL);
-  pn_inspect(event, str);
-  printf("%s\n", pn_string_get(str));
-  pn_free(str);
-}
-
-bool pni_reactor_more(pn_reactor_t *reactor) {
-  assert(reactor);
-  return pn_timer_tasks(reactor->timer) || reactor->selectables > 1;
-}
-
-void pn_reactor_yield(pn_reactor_t *reactor) {
-  assert(reactor);
-  reactor->yield = true;
-}
-
-bool pn_reactor_quiesced(pn_reactor_t *reactor) {
-  assert(reactor);
-  pn_event_t *event = pn_collector_peek(reactor->collector);
-  // no events
-  if (!event) { return true; }
-  // more than one event
-  if (pn_collector_more(reactor->collector)) { return false; }
-  // if we have just one event then we are quiesced if the quiesced event
-  return pn_event_type(event) == PN_REACTOR_QUIESCED;
-}
-
-pn_handler_t *pn_event_root(pn_event_t *event)
-{
-  pn_handler_t *h = pn_record_get_handler(pn_event_attachments(event));
-  return h;
-}
-
-static void pni_event_set_root(pn_event_t *event, pn_handler_t *handler) {
-  pn_record_set_handler(pn_event_attachments(event), handler);
-}
-
-bool pn_reactor_process(pn_reactor_t *reactor) {
-  assert(reactor);
-  pn_reactor_mark(reactor);
-  pn_event_type_t previous = PN_EVENT_NONE;
-  while (true) {
-    pn_event_t *event = pn_collector_peek(reactor->collector);
-    //pni_event_print(event);
-    if (event) {
-      if (reactor->yield) {
-        reactor->yield = false;
-        return true;
-      }
-      reactor->yield = false;
-      pn_incref(event);
-      pn_handler_t *handler = pn_event_handler(event, reactor->handler);
-      pn_event_type_t type = pn_event_type(event);
-      pni_event_set_root(event, handler);
-      pn_handler_dispatch(handler, event, type);
-      pni_event_set_root(event, reactor->global);
-      pn_handler_dispatch(reactor->global, event, type);
-      pni_reactor_dispatch_post(reactor, event);
-      previous = reactor->previous = type;
-      pn_decref(event);
-      pn_collector_pop(reactor->collector);
-    } else if (!reactor->stop && pni_reactor_more(reactor)) {
-      if (previous != PN_REACTOR_QUIESCED && reactor->previous != PN_REACTOR_FINAL) {
-        pn_collector_put(reactor->collector, PN_OBJECT, reactor, PN_REACTOR_QUIESCED);
-      } else {
-        return true;
-      }
-    } else {
-      if (reactor->selectable) {
-        pn_selectable_terminate(reactor->selectable);
-        pn_reactor_update(reactor, reactor->selectable);
-        reactor->selectable = NULL;
-      } else {
-        pn_collector_put(reactor->collector, PN_OBJECT, reactor, PN_REACTOR_FINAL);
-        return false;
-      }
-    }
-  }
-}
-
-static void pni_timer_expired(pn_selectable_t *sel) {
-  pn_reactor_t *reactor = pni_reactor(sel);
-  pn_timer_tick(reactor->timer, reactor->now);
-  pn_selectable_set_deadline(sel, pn_timer_deadline(reactor->timer));
-  pn_reactor_update(reactor, sel);
-}
-
-static void pni_timer_readable(pn_selectable_t *sel) {
-  char buf[64];
-  pn_reactor_t *reactor = pni_reactor(sel);
-  pn_socket_t fd = pn_selectable_get_fd(sel);
-  pn_read(reactor->io, fd, buf, 64);
-  pni_timer_expired(sel);
-}
-
-pn_selectable_t *pni_timer_selectable(pn_reactor_t *reactor) {
-  pn_selectable_t *sel = pn_reactor_selectable(reactor);
-  pn_selectable_set_fd(sel, reactor->wakeup[0]);
-  pn_selectable_on_readable(sel, pni_timer_readable);
-  pn_selectable_on_expired(sel, pni_timer_expired);
-  pn_selectable_set_reading(sel, true);
-  pn_selectable_set_deadline(sel, pn_timer_deadline(reactor->timer));
-  pn_reactor_update(reactor, sel);
-  return sel;
-}
-
-int pn_reactor_wakeup(pn_reactor_t *reactor) {
-  assert(reactor);
-  ssize_t n = pn_write(reactor->io, reactor->wakeup[1], "x", 1);
-  if (n < 0) {
-    return (int) n;
-  } else {
-    return 0;
-  }
-}
-
-void pn_reactor_start(pn_reactor_t *reactor) {
-  assert(reactor);
-  pn_collector_put(reactor->collector, PN_OBJECT, reactor, PN_REACTOR_INIT);
-  reactor->selectable = pni_timer_selectable(reactor);
-}
-
-void pn_reactor_stop(pn_reactor_t *reactor) {
-  assert(reactor);
-  reactor->stop = true;
-}
-
-void pn_reactor_run(pn_reactor_t *reactor) {
-  assert(reactor);
-  pn_reactor_set_timeout(reactor, 3141);
-  pn_reactor_start(reactor);
-  while (pn_reactor_process(reactor)) {}
-  pn_reactor_process(reactor);
-  pn_collector_release(reactor->collector);
-}
diff --git a/proton-c/src/reactor/reactor.h b/proton-c/src/reactor/reactor.h
deleted file mode 100644
index bfb397c..0000000
--- a/proton-c/src/reactor/reactor.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef _PROTON_SRC_REACTOR_H
-#define _PROTON_SRC_REACTOR_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/reactor.h>
-#include <proton/url.h>
-
-void pni_record_init_reactor(pn_record_t *record, pn_reactor_t *reactor);
-void pni_reactor_set_connection_peer_address(pn_connection_t *connection,
-                                             const char *host,
-                                             const char *port);
-pn_io_t *pni_reactor_io(pn_reactor_t *reactor);
-
-#endif /* src/reactor.h */
diff --git a/proton-c/src/reactor/selectable.c b/proton-c/src/reactor/selectable.c
deleted file mode 100644
index b42ad1f..0000000
--- a/proton-c/src/reactor/selectable.c
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "selectable.h"
-
-#include <proton/error.h>
-
-#include "io.h"
-
-#include <assert.h>
-#include <stdlib.h>
-
-pn_selectables_t *pn_selectables(void)
-{
-  return pn_iterator();
-}
-
-pn_selectable_t *pn_selectables_next(pn_selectables_t *selectables)
-{
-  return (pn_selectable_t *) pn_iterator_next(selectables);
-}
-
-void pn_selectables_free(pn_selectables_t *selectables)
-{
-  pn_free(selectables);
-}
-
-struct pn_selectable_t {
-  pn_socket_t fd;
-  int index;
-  pn_record_t *attachments;
-  void (*readable)(pn_selectable_t *);
-  void (*writable)(pn_selectable_t *);
-  void (*error)(pn_selectable_t *);
-  void (*expired)(pn_selectable_t *);
-  void (*release) (pn_selectable_t *);
-  void (*finalize)(pn_selectable_t *);
-  pn_collector_t *collector;
-  pn_timestamp_t deadline;
-  bool reading;
-  bool writing;
-  bool registered;
-  bool terminal;
-};
-
-void pn_selectable_initialize(pn_selectable_t *sel)
-{
-  sel->fd = PN_INVALID_SOCKET;
-  sel->index = -1;
-  sel->attachments = pn_record();
-  sel->readable = NULL;
-  sel->writable = NULL;
-  sel->error = NULL;
-  sel->expired = NULL;
-  sel->release = NULL;
-  sel->finalize = NULL;
-  sel->collector = NULL;
-  sel->deadline = 0;
-  sel->reading = false;
-  sel->writing = false;
-  sel->registered = false;
-  sel->terminal = false;
-}
-
-void pn_selectable_finalize(pn_selectable_t *sel)
-{
-  if (sel->finalize) {
-    sel->finalize(sel);
-  }
-  pn_decref(sel->attachments);
-  pn_decref(sel->collector);
-}
-
-#define pn_selectable_hashcode NULL
-#define pn_selectable_inspect NULL
-#define pn_selectable_compare NULL
-
-PN_CLASSDEF(pn_selectable)
-
-pn_selectable_t *pn_selectable(void)
-{
-  return pn_selectable_new();
-}
-
-bool pn_selectable_is_reading(pn_selectable_t *sel) {
-  assert(sel);
-  return sel->reading;
-}
-
-void pn_selectable_set_reading(pn_selectable_t *sel, bool reading) {
-  assert(sel);
-  sel->reading = reading;
-}
-
-bool pn_selectable_is_writing(pn_selectable_t *sel) {
-  assert(sel);
-  return sel->writing;
-}
-
-void pn_selectable_set_writing(pn_selectable_t *sel, bool writing) {
-  assert(sel);
-  sel->writing = writing;
-}
-
-pn_timestamp_t pn_selectable_get_deadline(pn_selectable_t *sel) {
-  assert(sel);
-  return sel->deadline;
-}
-
-void pn_selectable_set_deadline(pn_selectable_t *sel, pn_timestamp_t deadline) {
-  assert(sel);
-  sel->deadline = deadline;
-}
-
-void pn_selectable_on_readable(pn_selectable_t *sel, void (*readable)(pn_selectable_t *)) {
-  assert(sel);
-  sel->readable = readable;
-}
-
-void pn_selectable_on_writable(pn_selectable_t *sel, void (*writable)(pn_selectable_t *)) {
-  assert(sel);
-  sel->writable = writable;
-}
-
-void pn_selectable_on_error(pn_selectable_t *sel, void (*error)(pn_selectable_t *)) {
-  assert(sel);
-  sel->error = error;
-}
-
-void pn_selectable_on_expired(pn_selectable_t *sel, void (*expired)(pn_selectable_t *)) {
-  assert(sel);
-  sel->expired = expired;
-}
-
-void pn_selectable_on_release(pn_selectable_t *sel, void (*release)(pn_selectable_t *)) {
-  assert(sel);
-  sel->release = release;
-}
-
-void pn_selectable_on_finalize(pn_selectable_t *sel, void (*finalize)(pn_selectable_t *)) {
-  assert(sel);
-  sel->finalize = finalize;
-}
-
-pn_record_t *pn_selectable_attachments(pn_selectable_t *sel) {
-  return sel->attachments;
-}
-
-void *pni_selectable_get_context(pn_selectable_t *selectable)
-{
-  assert(selectable);
-  return pn_record_get(selectable->attachments, PN_LEGCTX);
-}
-
-void pni_selectable_set_context(pn_selectable_t *selectable, void *context)
-{
-  assert(selectable);
-  pn_record_set(selectable->attachments, PN_LEGCTX, context);
-}
-
-int pni_selectable_get_index(pn_selectable_t *selectable)
-{
-  assert(selectable);
-  return selectable->index;
-}
-
-void pni_selectable_set_index(pn_selectable_t *selectable, int index)
-{
-  assert(selectable);
-  selectable->index = index;
-}
-
-pn_socket_t pn_selectable_get_fd(pn_selectable_t *selectable)
-{
-  assert(selectable);
-  return selectable->fd;
-}
-
-void pn_selectable_set_fd(pn_selectable_t *selectable, pn_socket_t fd)
-{
-  assert(selectable);
-  selectable->fd = fd;
-}
-
-void pn_selectable_readable(pn_selectable_t *selectable)
-{
-  assert(selectable);
-  if (selectable->readable) {
-    selectable->readable(selectable);
-  }
-}
-
-void pn_selectable_writable(pn_selectable_t *selectable)
-{
-  assert(selectable);
-  if (selectable->writable) {
-    selectable->writable(selectable);
-  }
-}
-
-void pn_selectable_error(pn_selectable_t *selectable)
-{
-  assert(selectable);
-  if (selectable->error) {
-    selectable->error(selectable);
-  }
-}
-
-void pn_selectable_expired(pn_selectable_t *selectable)
-{
-  assert(selectable);
-  if (selectable->expired) {
-    selectable->expired(selectable);
-  }
-}
-
-bool pn_selectable_is_registered(pn_selectable_t *selectable)
-{
-  assert(selectable);
-  return selectable->registered;
-}
-
-void pn_selectable_set_registered(pn_selectable_t *selectable, bool registered)
-{
-  assert(selectable);
-  selectable->registered = registered;
-}
-
-bool pn_selectable_is_terminal(pn_selectable_t *selectable)
-{
-  assert(selectable);
-  return selectable->terminal;
-}
-
-void pn_selectable_terminate(pn_selectable_t *selectable)
-{
-  assert(selectable);
-  selectable->terminal = true;
-}
-
-void pn_selectable_release(pn_selectable_t *selectable)
-{
-  assert(selectable);
-  if (selectable->release) {
-    selectable->release(selectable);
-  }
-}
-
-void pn_selectable_free(pn_selectable_t *selectable)
-{
-  pn_decref(selectable);
-}
-
-static void pni_readable(pn_selectable_t *selectable) {
-  pn_collector_put(selectable->collector, PN_OBJECT, selectable, PN_SELECTABLE_READABLE);
-}
-
-static void pni_writable(pn_selectable_t *selectable) {
-  pn_collector_put(selectable->collector, PN_OBJECT, selectable, PN_SELECTABLE_WRITABLE);
-}
-
-static void pni_error(pn_selectable_t *selectable) {
-  pn_collector_put(selectable->collector, PN_OBJECT, selectable, PN_SELECTABLE_ERROR);
-}
-
-static void pni_expired(pn_selectable_t *selectable) {
-  pn_collector_put(selectable->collector, PN_OBJECT, selectable, PN_SELECTABLE_EXPIRED);
-}
-
-void pn_selectable_collect(pn_selectable_t *selectable, pn_collector_t *collector) {
-  assert(selectable);
-  pn_decref(selectable->collector);
-  selectable->collector = collector;
-  pn_incref(selectable->collector);
-
-  if (collector) {
-    pn_selectable_on_readable(selectable, pni_readable);
-    pn_selectable_on_writable(selectable, pni_writable);
-    pn_selectable_on_error(selectable, pni_error);
-    pn_selectable_on_expired(selectable, pni_expired);
-  }
-}
diff --git a/proton-c/src/reactor/selectable.h b/proton-c/src/reactor/selectable.h
deleted file mode 100644
index 7a5b80b..0000000
--- a/proton-c/src/reactor/selectable.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef _PROTON_SRC_SELECTABLE_H
-#define _PROTON_SRC_SELECTABLE_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#ifndef __cplusplus
-#include <stdbool.h>
-#endif
-
-#include <proton/selectable.h>
-
-void *pni_selectable_get_context(pn_selectable_t *selectable);
-void pni_selectable_set_context(pn_selectable_t *selectable, void *context);
-int pni_selectable_get_index(pn_selectable_t *selectable);
-void pni_selectable_set_index(pn_selectable_t *selectable, int index);
-
-#endif /* selectable.h */
diff --git a/proton-c/src/reactor/selector.h b/proton-c/src/reactor/selector.h
deleted file mode 100644
index 2a1e31f..0000000
--- a/proton-c/src/reactor/selector.h
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef PROTON_SELECTOR_H
-#define PROTON_SELECTOR_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/selectable.h>
-#include <proton/type_compat.h>
-
-#define PN_READABLE (1)
-#define PN_WRITABLE (2)
-#define PN_EXPIRED (4)
-#define PN_ERROR (8)
-
-/**
- * A ::pn_selector_t provides a selection mechanism that allows
- * efficient monitoring of a large number of Proton connections and
- * listeners.
- *
- * External (non-Proton) sockets may also be monitored, either solely
- * for event notification (read, write, and timer) or event
- * notification and use with pn_io_t interfaces.
- */
-typedef struct pn_selector_t pn_selector_t;
-
-pn_selector_t *pni_selector(void);
-void pn_selector_free(pn_selector_t *selector);
-void pn_selector_add(pn_selector_t *selector, pn_selectable_t *selectable);
-void pn_selector_update(pn_selector_t *selector, pn_selectable_t *selectable);
-void pn_selector_remove(pn_selector_t *selector, pn_selectable_t *selectable);
-size_t pn_selector_size(pn_selector_t *selector);
-int pn_selector_select(pn_selector_t *select, int timeout);
-pn_selectable_t *pn_selector_next(pn_selector_t *select, int *events);
-
-#endif /* selector.h */
diff --git a/proton-c/src/reactor/timer.c b/proton-c/src/reactor/timer.c
deleted file mode 100644
index bfd768e..0000000
--- a/proton-c/src/reactor/timer.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/object.h>
-#include <proton/reactor.h>
-#include <assert.h>
-
-struct pn_task_t {
-  pn_list_t *pool;
-  pn_record_t *attachments;
-  pn_timestamp_t deadline;
-  bool cancelled;
-};
-
-void pn_task_initialize(pn_task_t *task) {
-  task->pool = NULL;
-  task->attachments = pn_record();
-  task->deadline = 0;
-  task->cancelled = false;
-}
-
-void pn_task_finalize(pn_task_t *task) {
-  // if we are the last reference to the pool then don't put ourselves
-  // into it
-  if (task->pool && pn_refcount(task->pool) > 1) {
-    pn_record_clear(task->attachments);
-    pn_list_add(task->pool, task);
-    pn_decref(task->pool);
-    task->pool = NULL;
-  } else {
-    pn_decref(task->pool);
-    pn_decref(task->attachments);
-  }
-}
-
-intptr_t pn_task_compare(pn_task_t *a, pn_task_t *b) {
-  return a->deadline - b->deadline;
-}
-
-#define pn_task_inspect NULL
-#define pn_task_hashcode NULL
-
-PN_CLASSDEF(pn_task)
-
-pn_task_t *pn_task(void) {
-  pn_task_t *task = pn_task_new();
-  return task;
-}
-
-pn_record_t *pn_task_attachments(pn_task_t *task) {
-  assert(task);
-  return task->attachments;
-}
-
-void pn_task_cancel(pn_task_t *task) {
-    assert(task);
-    task->cancelled = true;
-}
-
-//
-// timer
-//
-
-struct pn_timer_t {
-  pn_list_t *pool;
-  pn_list_t *tasks;
-  pn_collector_t *collector;
-};
-
-static void pn_timer_initialize(pn_timer_t *timer) {
-  timer->pool = pn_list(PN_OBJECT, 0);
-  timer->tasks = pn_list(PN_OBJECT, 0);
-}
-
-static void pn_timer_finalize(pn_timer_t *timer) {
-  pn_decref(timer->pool);
-  pn_free(timer->tasks);
-}
-
-#define pn_timer_inspect NULL
-#define pn_timer_compare NULL
-#define pn_timer_hashcode NULL
-
-PN_CLASSDEF(pn_timer)
-
-pn_timer_t *pn_timer(pn_collector_t *collector) {
-  pn_timer_t *timer = pn_timer_new();
-  timer->collector = collector;
-  return timer;
-}
-
-pn_task_t *pn_timer_schedule(pn_timer_t *timer,  pn_timestamp_t deadline) {
-  pn_task_t *task = (pn_task_t *) pn_list_pop(timer->pool);
-  if (!task) {
-    task = pn_task();
-  }
-  task->pool = timer->pool;
-  pn_incref(task->pool);
-  task->deadline = deadline;
-  task->cancelled = false;
-  pn_list_minpush(timer->tasks, task);
-  pn_decref(task);
-  return task;
-}
-
-void pni_timer_flush_cancelled(pn_timer_t *timer) {
-    while (pn_list_size(timer->tasks)) {
-        pn_task_t *task = (pn_task_t *) pn_list_get(timer->tasks, 0);
-        if (task->cancelled) {
-            pn_task_t *min = (pn_task_t *) pn_list_minpop(timer->tasks);
-            assert(min == task);
-            pn_decref(min);
-        } else {
-            break;
-        }
-    }
-}
-
-pn_timestamp_t pn_timer_deadline(pn_timer_t *timer) {
-  assert(timer);
-  pni_timer_flush_cancelled(timer);
-  if (pn_list_size(timer->tasks)) {
-    pn_task_t *task = (pn_task_t *) pn_list_get(timer->tasks, 0);
-    return task->deadline;
-  } else {
-    return 0;
-  }
-}
-
-void pn_timer_tick(pn_timer_t *timer, pn_timestamp_t now) {
-  assert(timer);
-  while (pn_list_size(timer->tasks)) {
-    pn_task_t *task = (pn_task_t *) pn_list_get(timer->tasks, 0);
-    if (now >= task->deadline) {
-      pn_task_t *min = (pn_task_t *) pn_list_minpop(timer->tasks);
-      assert(min == task);
-      if (!min->cancelled)
-          pn_collector_put(timer->collector, PN_OBJECT, min, PN_TIMER_TASK);
-      pn_decref(min);
-    } else {
-      break;
-    }
-  }
-}
-
-int pn_timer_tasks(pn_timer_t *timer) {
-  assert(timer);
-  pni_timer_flush_cancelled(timer);
-  return pn_list_size(timer->tasks);
-}
diff --git a/proton-c/src/sasl/cyrus_sasl.c b/proton-c/src/sasl/cyrus_sasl.c
deleted file mode 100644
index 0d81489..0000000
--- a/proton-c/src/sasl/cyrus_sasl.c
+++ /dev/null
@@ -1,523 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "core/config.h"
-#include "core/engine-internal.h"
-#include "sasl-internal.h"
-
-
-#include <sasl/sasl.h>
-#include <pthread.h>
-
-// If the version of Cyrus SASL is too early for sasl_client_done()/sasl_server_done()
-// don't do any global clean up as it's not safe to use just sasl_done() for an
-// executable that uses both client and server parts of Cyrus SASL, because it can't
-// be called twice.
-#if SASL_VERSION_FULL<0x020118
-# define sasl_client_done()
-# define sasl_server_done()
-#endif
-
-static const char *amqp_service = "amqp";
-
-static bool pni_check_sasl_result(sasl_conn_t *conn, int r, pn_transport_t *logger)
-{
-    if (r==SASL_OK) return true;
-
-    const char* err = conn ? sasl_errdetail(conn) : sasl_errstring(r, NULL, NULL);
-    if (logger->trace & PN_TRACE_DRV)
-        pn_transport_logf(logger, "sasl error: %s", err);
-    pn_condition_t* c = pn_transport_condition(logger);
-    pn_condition_set_name(c, "proton:io:sasl_error");
-    pn_condition_set_description(c, err);
-    return false;
-}
-
-// Cyrus wrappers
-static void pni_cyrus_interact(pni_sasl_t *sasl, sasl_interact_t *interact)
-{
-  for (sasl_interact_t *i = interact; i->id!=SASL_CB_LIST_END; i++) {
-    switch (i->id) {
-    case SASL_CB_USER:
-      i->result = 0;
-      i->len = 0;
-      break;
-    case SASL_CB_AUTHNAME:
-      i->result = sasl->username;
-      i->len = strlen(sasl->username);
-      break;
-    case SASL_CB_PASS:
-      i->result = sasl->password;
-      i->len = strlen(sasl->password);
-      break;
-    default:
-      fprintf(stderr, "(%s): %s - %s\n", i->challenge, i->prompt, i->defresult);
-    }
-  }
-}
-
-int pni_sasl_impl_list_mechs(pn_transport_t *transport, char **mechlist)
-{
-  pni_sasl_t *sasl = transport->sasl;
-  sasl_conn_t *cyrus_conn = (sasl_conn_t*)sasl->impl_context;
-  int count = 0;
-  if (cyrus_conn) {
-    const char *result = NULL;
-
-    int r = sasl_listmech(cyrus_conn, NULL, "", " ", "", &result, NULL, &count);
-    if (pni_check_sasl_result(cyrus_conn, r, transport)) {
-      if (result && *result) {
-        *mechlist = pn_strdup(result);
-      }
-    }
-  }
-  return count;
-}
-
-// Set up callbacks to use interact
-static const sasl_callback_t pni_user_password_callbacks[] = {
-    {SASL_CB_USER, NULL, NULL},
-    {SASL_CB_AUTHNAME, NULL, NULL},
-    {SASL_CB_PASS, NULL, NULL},
-    {SASL_CB_LIST_END, NULL, NULL},
-};
-
-static const sasl_callback_t pni_user_callbacks[] = {
-    {SASL_CB_USER, NULL, NULL},
-    {SASL_CB_AUTHNAME, NULL, NULL},
-    {SASL_CB_LIST_END, NULL, NULL},
-};
-
-// Machinery to initialise the cyrus library only once even in a multithreaded environment
-// Relies on pthreads.
-static char *pni_cyrus_config_dir = NULL;
-static const char *pni_cyrus_config_name = "proton-server";
-static pthread_mutex_t pni_cyrus_mutex = PTHREAD_MUTEX_INITIALIZER;
-static bool pni_cyrus_client_started = false;
-static bool pni_cyrus_server_started = false;
-
-__attribute__((destructor))
-static void pni_cyrus_finish(void) {
-  pthread_mutex_lock(&pni_cyrus_mutex);
-  if (pni_cyrus_client_started) sasl_client_done();
-  if (pni_cyrus_server_started) sasl_server_done();
-  pthread_mutex_unlock(&pni_cyrus_mutex);
-}
-
-static int pni_cyrus_client_init_rc = SASL_OK;
-static void pni_cyrus_client_once(void) {
-  pthread_mutex_lock(&pni_cyrus_mutex);
-  int result = SASL_OK;
-  if (pni_cyrus_config_dir) {
-    result = sasl_set_path(SASL_PATH_TYPE_CONFIG, pni_cyrus_config_dir);
-  }
-  if (result==SASL_OK) {
-    result = sasl_client_init(NULL);
-  }
-  pni_cyrus_client_started = true;
-  pni_cyrus_client_init_rc = result;
-  pthread_mutex_unlock(&pni_cyrus_mutex);
-}
-
-static int pni_cyrus_server_init_rc = SASL_OK;
-static void pni_cyrus_server_once(void) {
-  pthread_mutex_lock(&pni_cyrus_mutex);
-  int result = SASL_OK;
-  if (pni_cyrus_config_dir) {
-    result = sasl_set_path(SASL_PATH_TYPE_CONFIG, pni_cyrus_config_dir);
-  }
-  if (result==SASL_OK) {
-    result = sasl_server_init(NULL, pni_cyrus_config_name);
-  }
-  pni_cyrus_server_started = true;
-  pni_cyrus_server_init_rc = result;
-  pthread_mutex_unlock(&pni_cyrus_mutex);
-}
-
-static pthread_once_t pni_cyrus_client_init = PTHREAD_ONCE_INIT;
-static void pni_cyrus_client_start(void) {
-    pthread_once(&pni_cyrus_client_init, pni_cyrus_client_once);
-}
-static pthread_once_t pni_cyrus_server_init = PTHREAD_ONCE_INIT;
-static void pni_cyrus_server_start(void) {
-  pthread_once(&pni_cyrus_server_init, pni_cyrus_server_once);
-}
-
-bool pni_init_client(pn_transport_t* transport) {
-  pni_sasl_t *sasl = transport->sasl;
-  int result;
-  sasl_conn_t *cyrus_conn = NULL;
-  do {
-    if (sasl->config_dir) {
-      pni_cyrus_config_dir = sasl->config_dir;
-    }
-
-    pni_cyrus_client_start();
-    result = pni_cyrus_client_init_rc;
-    if (result!=SASL_OK) break;
-
-    const sasl_callback_t *callbacks = sasl->username ? sasl->password ? pni_user_password_callbacks : pni_user_callbacks : NULL;
-    result = sasl_client_new(amqp_service,
-                             sasl->remote_fqdn,
-                             NULL, NULL,
-                             callbacks, 0,
-                             &cyrus_conn);
-    if (result!=SASL_OK) break;
-    sasl->impl_context = cyrus_conn;
-
-    sasl_security_properties_t secprops = {0};
-    secprops.security_flags =
-      ( sasl->allow_insecure_mechs ? 0 : SASL_SEC_NOPLAINTEXT ) |
-      ( transport->auth_required ? SASL_SEC_NOANONYMOUS : 0 ) ;
-    secprops.min_ssf = 0;
-    secprops.max_ssf = 2048;
-    secprops.maxbufsize = PN_SASL_MAX_BUFFSIZE;
-
-    result = sasl_setprop(cyrus_conn, SASL_SEC_PROPS, &secprops);
-    if (result!=SASL_OK) break;
-
-    sasl_ssf_t ssf = sasl->external_ssf;
-    result = sasl_setprop(cyrus_conn, SASL_SSF_EXTERNAL, &ssf);
-    if (result!=SASL_OK) break;
-
-    const char *extid = sasl->external_auth;
-    if (extid) {
-      result = sasl_setprop(cyrus_conn, SASL_AUTH_EXTERNAL, extid);
-    }
-  } while (false);
-  cyrus_conn = (sasl_conn_t*) sasl->impl_context;
-  return pni_check_sasl_result(cyrus_conn, result, transport);
-}
-
-static int pni_wrap_client_start(pni_sasl_t *sasl, const char *mechs, const char **mechusing)
-{
-    int result;
-    sasl_interact_t *client_interact=NULL;
-    const char *out;
-    unsigned outlen;
-
-    sasl_conn_t *cyrus_conn = (sasl_conn_t*)sasl->impl_context;
-    do {
-
-        result = sasl_client_start(cyrus_conn,
-                                   mechs,
-                                   &client_interact,
-                                   &out, &outlen,
-                                   mechusing);
-        if (result==SASL_INTERACT) {
-            pni_cyrus_interact(sasl, client_interact);
-        }
-    } while (result==SASL_INTERACT);
-
-    sasl->bytes_out.start = out;
-    sasl->bytes_out.size = outlen;
-    return result;
-}
-
-bool pni_process_mechanisms(pn_transport_t *transport, const char *mechs)
-{
-    pni_sasl_t *sasl = transport->sasl;
-    sasl_conn_t *cyrus_conn = (sasl_conn_t*)sasl->impl_context;
-    const char *mech_selected;
-    int result = pni_wrap_client_start(sasl, mechs, &mech_selected);
-    switch (result) {
-        case SASL_OK:
-        case SASL_CONTINUE:
-          sasl->selected_mechanism = pn_strdup(mech_selected);
-          return true;
-        case SASL_NOMECH:
-        default:
-          pni_check_sasl_result(cyrus_conn, result, transport);
-          return false;
-    }
-}
-
-
-static int pni_wrap_client_step(pni_sasl_t *sasl, const pn_bytes_t *in)
-{
-    sasl_conn_t *cyrus_conn = (sasl_conn_t*)sasl->impl_context;
-    sasl_interact_t *client_interact=NULL;
-    const char *out;
-    unsigned outlen;
-
-    int result;
-    do {
-
-        result = sasl_client_step(cyrus_conn,
-                                  in->start, in->size,
-                                  &client_interact,
-                                  &out, &outlen);
-        if (result==SASL_INTERACT) {
-            pni_cyrus_interact(sasl, client_interact);
-        }
-    } while (result==SASL_INTERACT);
-
-    sasl->bytes_out.start = out;
-    sasl->bytes_out.size = outlen;
-    return result;
-}
-
-void pni_process_challenge(pn_transport_t *transport, const pn_bytes_t *recv)
-{
-    pni_sasl_t *sasl = transport->sasl;
-    sasl_conn_t *cyrus_conn = (sasl_conn_t*)sasl->impl_context;
-    int result = pni_wrap_client_step(sasl, recv);
-    switch (result) {
-        case SASL_OK:
-            // Authenticated
-            // TODO: Documented that we need to call sasl_client_step() again to be sure!;
-        case SASL_CONTINUE:
-            // Need to send a response
-            pni_sasl_set_desired_state(transport, SASL_POSTED_RESPONSE);
-            break;
-        default:
-            pni_check_sasl_result(cyrus_conn, result, transport);
-
-            // Failed somehow - equivalent to failing authentication
-            sasl->outcome = PN_SASL_AUTH;
-            pni_sasl_set_desired_state(transport, SASL_RECVED_OUTCOME_FAIL);
-            break;
-    }
-}
-
-bool pni_init_server(pn_transport_t* transport)
-{
-  pni_sasl_t *sasl = transport->sasl;
-  int result;
-  sasl_conn_t *cyrus_conn = NULL;
-  do {
-    if (sasl->config_dir) {
-      pni_cyrus_config_dir = sasl->config_dir;
-    }
-
-    if (sasl->config_name) {
-      pni_cyrus_config_name = sasl->config_name;
-    }
-
-    pni_cyrus_server_start();
-    result = pni_cyrus_server_init_rc;
-    if (result!=SASL_OK) break;
-
-    result = sasl_server_new(amqp_service, NULL, NULL, NULL, NULL, NULL, 0, &cyrus_conn);
-    if (result!=SASL_OK) break;
-    sasl->impl_context = cyrus_conn;
-
-    sasl_security_properties_t secprops = {0};
-    secprops.security_flags =
-      ( sasl->allow_insecure_mechs ? 0 : SASL_SEC_NOPLAINTEXT ) |
-      ( transport->auth_required ? SASL_SEC_NOANONYMOUS : 0 ) ;
-    secprops.min_ssf = 0;
-    secprops.max_ssf = 2048;
-    secprops.maxbufsize = PN_SASL_MAX_BUFFSIZE;
-
-    result = sasl_setprop(cyrus_conn, SASL_SEC_PROPS, &secprops);
-    if (result!=SASL_OK) break;
-
-    sasl_ssf_t ssf = sasl->external_ssf;
-    result = sasl_setprop(cyrus_conn, SASL_SSF_EXTERNAL, &ssf);
-    if (result!=SASL_OK) break;
-
-    const char *extid = sasl->external_auth;
-    if (extid) {
-    result = sasl_setprop(cyrus_conn, SASL_AUTH_EXTERNAL, extid);
-    }
-  } while (false);
-  cyrus_conn = (sasl_conn_t*) sasl->impl_context;
-  return pni_check_sasl_result(cyrus_conn, result, transport);
-}
-
-static int pni_wrap_server_start(pni_sasl_t *sasl, const char *mech_selected, const pn_bytes_t *in)
-{
-    int result;
-    const char *out;
-    unsigned outlen;
-    sasl_conn_t *cyrus_conn = (sasl_conn_t*)sasl->impl_context;
-    const char *in_bytes = in->start;
-    size_t in_size = in->size;
-    // Interop hack for ANONYMOUS - some of the earlier versions of proton will send and no data
-    // with an anonymous init because it is optional. It seems that Cyrus wants an empty string here
-    // or it will challenge, which the earlier implementation is not prepared for.
-    // However we can't just always use an empty string as the CRAM-MD5 mech won't allow any data in the server start
-    if (!in_bytes && strcmp(mech_selected, "ANONYMOUS")==0) {
-        in_bytes = "";
-        in_size = 0;
-    }
-    result = sasl_server_start(cyrus_conn,
-                               mech_selected,
-                               in_bytes, in_size,
-                               &out, &outlen);
-
-    sasl->bytes_out.start = out;
-    sasl->bytes_out.size = outlen;
-    return result;
-}
-
-static void pni_process_server_result(pn_transport_t *transport, int result)
-{
-    pni_sasl_t *sasl = transport->sasl;
-    sasl_conn_t *cyrus_conn = (sasl_conn_t*)sasl->impl_context;
-    switch (result) {
-        case SASL_OK:
-            // Authenticated
-            sasl->outcome = PN_SASL_OK;
-            transport->authenticated = true;
-            // Get username from SASL
-            const void* value;
-            sasl_getprop(cyrus_conn, SASL_USERNAME, &value);
-            sasl->username = (const char*) value;
-            if (transport->trace & PN_TRACE_DRV)
-              pn_transport_logf(transport, "Authenticated user: %s with mechanism %s", sasl->username, sasl->selected_mechanism);
-            pni_sasl_set_desired_state(transport, SASL_POSTED_OUTCOME);
-            break;
-        case SASL_CONTINUE:
-            // Need to send a challenge
-            pni_sasl_set_desired_state(transport, SASL_POSTED_CHALLENGE);
-            break;
-        default:
-            pni_check_sasl_result(cyrus_conn, result, transport);
-
-            // Failed to authenticate
-            sasl->outcome = PN_SASL_AUTH;
-            pni_sasl_set_desired_state(transport, SASL_POSTED_OUTCOME);
-            break;
-    }
-}
-
-void pni_process_init(pn_transport_t *transport, const char *mechanism, const pn_bytes_t *recv)
-{
-    pni_sasl_t *sasl = transport->sasl;
-
-    int result = pni_wrap_server_start(sasl, mechanism, recv);
-    if (result==SASL_OK) {
-        // We need to filter out a supplied mech in in the inclusion list
-        // as the client could have used a mech that we support, but that
-        // wasn't on the list we sent.
-        if (!pni_included_mech(sasl->included_mechanisms, pn_bytes(strlen(mechanism), mechanism))) {
-            sasl_conn_t *cyrus_conn = (sasl_conn_t*)sasl->impl_context;
-            sasl_seterror(cyrus_conn, 0, "Client mechanism not in mechanism inclusion list.");
-            result = SASL_FAIL;
-        }
-    }
-    pni_process_server_result(transport, result);
-}
-
-static int pni_wrap_server_step(pni_sasl_t *sasl, const pn_bytes_t *in)
-{
-    int result;
-    const char *out;
-    unsigned outlen;
-    sasl_conn_t *cyrus_conn = (sasl_conn_t*)sasl->impl_context;
-    result = sasl_server_step(cyrus_conn,
-                              in->start, in->size,
-                              &out, &outlen);
-
-    sasl->bytes_out.start = out;
-    sasl->bytes_out.size = outlen;
-    return result;
-}
-
-void pni_process_response(pn_transport_t *transport, const pn_bytes_t *recv)
-{
-    pni_sasl_t *sasl = transport->sasl;
-    int result = pni_wrap_server_step(sasl, recv);
-    pni_process_server_result(transport, result);
-}
-
-bool pni_sasl_impl_can_encrypt(pn_transport_t *transport)
-{
-  if (!transport->sasl->impl_context) return false;
-
-  sasl_conn_t *cyrus_conn = (sasl_conn_t*)transport->sasl->impl_context;
-  // Get SSF to find out if we need to encrypt or not
-  const void* value;
-  int r = sasl_getprop(cyrus_conn, SASL_SSF, &value);
-  if (r != SASL_OK) {
-    // TODO: Should log an error here too, maybe assert here
-    return false;
-  }
-  int ssf = *(int *) value;
-  if (ssf > 0) {
-    return true;
-  }
-  return false;
-}
-
-ssize_t pni_sasl_impl_max_encrypt_size(pn_transport_t *transport)
-{
-  if (!transport->sasl->impl_context) return PN_ERR;
-
-  sasl_conn_t *cyrus_conn = (sasl_conn_t*)transport->sasl->impl_context;
-  const void* value;
-  int r = sasl_getprop(cyrus_conn, SASL_MAXOUTBUF, &value);
-  if (r != SASL_OK) {
-    // TODO: Should log an error here too, maybe assert here
-    return PN_ERR;
-  }
-  int outbuf_size = *(int *) value;
-  return outbuf_size -
-    // XXX: this  is a clientside workaround/hack to make GSSAPI work as the Cyrus SASL
-    // GSSAPI plugin seems to return an incorrect value for the buffer size on the client
-    // side, which is greater than the value returned on the server side. Actually using
-    // the entire client side buffer will cause a server side error due to a buffer overrun.
-    (transport->sasl->client? 60 : 0);
-}
-
-ssize_t pni_sasl_impl_encode(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out)
-{
-  if ( in.size==0 ) return 0;
-  sasl_conn_t *cyrus_conn = (sasl_conn_t*)transport->sasl->impl_context;
-  const char *output;
-  unsigned int outlen;
-  int r = sasl_encode(cyrus_conn, in.start, in.size, &output, &outlen);
-  if (outlen==0) return 0;
-  if ( pni_check_sasl_result(cyrus_conn, r, transport) ) {
-    *out = pn_bytes(outlen, output);
-    return outlen;
-  }
-  return PN_ERR;
-}
-
-ssize_t pni_sasl_impl_decode(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out)
-{
-  if ( in.size==0 ) return 0;
-  sasl_conn_t *cyrus_conn = (sasl_conn_t*)transport->sasl->impl_context;
-  const char *output;
-  unsigned int outlen;
-  int r = sasl_decode(cyrus_conn, in.start, in.size, &output, &outlen);
-  if (outlen==0) return 0;
-  if ( pni_check_sasl_result(cyrus_conn, r, transport) ) {
-    *out = pn_bytes(outlen, output);
-    return outlen;
-  }
-  return PN_ERR;
-}
-
-void pni_sasl_impl_free(pn_transport_t *transport)
-{
-    sasl_conn_t *cyrus_conn = (sasl_conn_t*)transport->sasl->impl_context;
-    sasl_dispose(&cyrus_conn);
-    transport->sasl->impl_context = cyrus_conn;
-}
-
-bool pn_sasl_extended(void)
-{
-  return true;
-}
diff --git a/proton-c/src/sasl/none_sasl.c b/proton-c/src/sasl/none_sasl.c
deleted file mode 100644
index 0408a8f..0000000
--- a/proton-c/src/sasl/none_sasl.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "sasl-internal.h"
-
-#include "core/engine-internal.h"
-
-static const char ANONYMOUS[] = "ANONYMOUS";
-static const char EXTERNAL[] = "EXTERNAL";
-static const char PLAIN[] = "PLAIN";
-
-bool pni_init_server(pn_transport_t* transport)
-{
-  return true;
-}
-
-bool pni_init_client(pn_transport_t* transport)
-{
-  return true;
-}
-
-void pni_sasl_impl_free(pn_transport_t *transport)
-{
-  free(transport->sasl->impl_context);
-}
-
-// Client handles ANONYMOUS or PLAIN mechanisms if offered
-bool pni_process_mechanisms(pn_transport_t *transport, const char *mechs)
-{
-  // Check whether offered EXTERNAL, PLAIN or ANONYMOUS
-  // Look for "EXTERNAL" in mechs
-  const char *found = strstr(mechs, EXTERNAL);
-  // Make sure that string is separated and terminated and allowed
-  if (found && (found==mechs || found[-1]==' ') && (found[8]==0 || found[8]==' ') &&
-      pni_included_mech(transport->sasl->included_mechanisms, pn_bytes(8, found))) {
-    transport->sasl->selected_mechanism = pn_strdup(EXTERNAL);
-    if (transport->sasl->username) {
-      size_t size = strlen(transport->sasl->username);
-      char *iresp = (char *) malloc(size);
-      if (!iresp) return false;
-
-      transport->sasl->impl_context = iresp;
-
-      memmove(iresp, transport->sasl->username, size);
-      transport->sasl->bytes_out.start = iresp;
-      transport->sasl->bytes_out.size =  size;
-    } else {
-      static const char empty[] = "";
-      transport->sasl->bytes_out.start = empty;
-      transport->sasl->bytes_out.size =  0;
-    }
-    return true;
-  }
-
-  // Look for "PLAIN" in mechs
-  found = strstr(mechs, PLAIN);
-  // Make sure that string is separated and terminated, allowed
-  // and we have a username and password and connection is encrypted or we allow insecure
-  if (found && (found==mechs || found[-1]==' ') && (found[5]==0 || found[5]==' ') &&
-      pni_included_mech(transport->sasl->included_mechanisms, pn_bytes(5, found)) &&
-      (transport->sasl->external_ssf > 0 || transport->sasl->allow_insecure_mechs) &&
-      transport->sasl->username && transport->sasl->password) {
-    transport->sasl->selected_mechanism = pn_strdup(PLAIN);
-    size_t usize = strlen(transport->sasl->username);
-    size_t psize = strlen(transport->sasl->password);
-    size_t size = usize + psize + 2;
-    char *iresp = (char *) malloc(size);
-    if (!iresp) return false;
-
-    transport->sasl->impl_context = iresp;
-
-    iresp[0] = 0;
-    memmove(&iresp[1], transport->sasl->username, usize);
-    iresp[usize + 1] = 0;
-    memmove(&iresp[usize + 2], transport->sasl->password, psize);
-    transport->sasl->bytes_out.start = iresp;
-    transport->sasl->bytes_out.size =  size;
-
-    // Zero out password and dealloc
-    free(memset(transport->sasl->password, 0, psize));
-    transport->sasl->password = NULL;
-
-    return true;
-  }
-
-  // Look for "ANONYMOUS" in mechs
-  found = strstr(mechs, ANONYMOUS);
-  // Make sure that string is separated and terminated and allowed
-  if (found && (found==mechs || found[-1]==' ') && (found[9]==0 || found[9]==' ') &&
-      pni_included_mech(transport->sasl->included_mechanisms, pn_bytes(9, found))) {
-    transport->sasl->selected_mechanism = pn_strdup(ANONYMOUS);
-    if (transport->sasl->username) {
-      size_t size = strlen(transport->sasl->username);
-      char *iresp = (char *) malloc(size);
-      if (!iresp) return false;
-
-      transport->sasl->impl_context = iresp;
-
-      memmove(iresp, transport->sasl->username, size);
-      transport->sasl->bytes_out.start = iresp;
-      transport->sasl->bytes_out.size =  size;
-    } else {
-      static const char anon[] = "anonymous";
-      transport->sasl->bytes_out.start = anon;
-      transport->sasl->bytes_out.size =  sizeof anon-1;
-    }
-    return true;
-  }
-  return false;
-}
-
-// Server will offer only ANONYMOUS and EXTERNAL if appropriate
-int pni_sasl_impl_list_mechs(pn_transport_t *transport, char **mechlist)
-{
-  // If we have an external authid then we can offer EXTERNAL
-  if (transport->sasl && transport->sasl->external_auth) {
-    *mechlist = pn_strdup("EXTERNAL ANONYMOUS");
-    return 2;
-  } else {
-    *mechlist = pn_strdup("ANONYMOUS");
-    return 1;
-  }
-}
-
-void pni_process_init(pn_transport_t *transport, const char *mechanism, const pn_bytes_t *recv)
-{
-  // Check that mechanism is ANONYMOUS and it is allowed
-  if (strcmp(mechanism, ANONYMOUS)==0 &&
-      pni_included_mech(transport->sasl->included_mechanisms, pn_bytes(sizeof(ANONYMOUS)-1, ANONYMOUS))) {
-    transport->sasl->username = "anonymous";
-    transport->sasl->outcome = PN_SASL_OK;
-    transport->authenticated = true;
-    pni_sasl_set_desired_state(transport, SASL_POSTED_OUTCOME);
-  } else if (strcmp(mechanism, EXTERNAL)==0 &&
-      transport->sasl->external_auth &&
-      pni_included_mech(transport->sasl->included_mechanisms, pn_bytes(sizeof(EXTERNAL)-1, EXTERNAL))) {
-    transport->sasl->username = transport->sasl->external_auth;
-    transport->sasl->outcome = PN_SASL_OK;
-    transport->authenticated = true;
-    pni_sasl_set_desired_state(transport, SASL_POSTED_OUTCOME);
-  } else {
-    transport->sasl->outcome = PN_SASL_AUTH;
-    pni_sasl_set_desired_state(transport, SASL_POSTED_OUTCOME);
-  }
-}
-
-/* The default implementation neither sends nor receives challenges or responses */
-void pni_process_challenge(pn_transport_t *transport, const pn_bytes_t *recv)
-{
-}
-
-void pni_process_response(pn_transport_t *transport, const pn_bytes_t *recv)
-{
-}
-
-bool pni_sasl_impl_can_encrypt(pn_transport_t *transport)
-{
-  return false;
-}
-
-ssize_t pni_sasl_impl_max_encrypt_size(pn_transport_t *transport)
-{
-  return 0;
-}
-
-ssize_t pni_sasl_impl_encode(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out)
-{
-  return 0;
-}
-
-ssize_t pni_sasl_impl_decode(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out)
-{
-  return 0;
-}
-
-bool pn_sasl_extended(void)
-{
-  return false;
-}
diff --git a/proton-c/src/sasl/sasl-internal.h b/proton-c/src/sasl/sasl-internal.h
deleted file mode 100644
index 2873777..0000000
--- a/proton-c/src/sasl/sasl-internal.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#ifndef PROTON_SASL_INTERNAL_H
-#define PROTON_SASL_INTERNAL_H 1
-
-#include "core/buffer.h"
-#include "core/engine-internal.h"
-
-#include "proton/types.h"
-#include "proton/sasl.h"
-
-
-// SASL APIs used by transport code
-void pn_sasl_free(pn_transport_t *transport);
-void pni_sasl_set_user_password(pn_transport_t *transport, const char *user, const char *password);
-void pni_sasl_set_remote_hostname(pn_transport_t *transport, const char* fqdn);
-void pni_sasl_set_external_security(pn_transport_t *transport, int ssf, const char *authid);
-
-// Internal SASL authenticator interface
-void pni_sasl_impl_free(pn_transport_t *transport);
-int  pni_sasl_impl_list_mechs(pn_transport_t *transport, char **mechlist);
-bool pni_init_server(pn_transport_t *transport);
-void pni_process_init(pn_transport_t *transport, const char *mechanism, const pn_bytes_t *recv);
-void pni_process_response(pn_transport_t *transport, const pn_bytes_t *recv);
-
-bool pni_init_client(pn_transport_t *transport);
-bool pni_process_mechanisms(pn_transport_t *transport, const char *mechs);
-void pni_process_challenge(pn_transport_t *transport, const pn_bytes_t *recv);
-
-// Internal SASL security layer interface
-bool pni_sasl_impl_can_encrypt(pn_transport_t *transport);
-ssize_t pni_sasl_impl_max_encrypt_size(pn_transport_t *transport);
-ssize_t pni_sasl_impl_encode(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out);
-ssize_t pni_sasl_impl_decode(pn_transport_t *transport, pn_bytes_t in, pn_bytes_t *out);
-
-
-// Shared SASL API used by the actual SASL authenticators
-enum pni_sasl_state {
-  SASL_NONE,
-  SASL_POSTED_INIT,
-  SASL_POSTED_MECHANISMS,
-  SASL_POSTED_RESPONSE,
-  SASL_POSTED_CHALLENGE,
-  SASL_RECVED_OUTCOME_SUCCEED,
-  SASL_RECVED_OUTCOME_FAIL,
-  SASL_POSTED_OUTCOME,
-  SASL_ERROR
-};
-
-struct pni_sasl_t {
-  void *impl_context;
-  char *selected_mechanism;
-  char *included_mechanisms;
-  const char *username;
-  char *password;
-  char *config_name;
-  char *config_dir;
-  const char *remote_fqdn;
-  char *external_auth;
-  int external_ssf;
-  size_t max_encrypt_size;
-  pn_buffer_t* decoded_buffer;
-  pn_buffer_t* encoded_buffer;
-  pn_bytes_t bytes_out;
-  pn_sasl_outcome_t outcome;
-  enum pni_sasl_state desired_state;
-  enum pni_sasl_state last_state;
-  bool allow_insecure_mechs;
-  bool client;
-};
-
-// Shared Utility used by sasl implementations
-void pni_split_mechs(char *mechlist, const char* included_mechs, char *mechs[], int *count);
-bool pni_included_mech(const char *included_mech_list, pn_bytes_t s);
-void pni_sasl_set_desired_state(pn_transport_t *transport, enum pni_sasl_state desired_state);
-
-#endif /* sasl-internal.h */
diff --git a/proton-c/src/sasl/sasl.c b/proton-c/src/sasl/sasl.c
deleted file mode 100644
index 69fb6b2..0000000
--- a/proton-c/src/sasl/sasl.c
+++ /dev/null
@@ -1,713 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "sasl-internal.h"
-
-#include "core/autodetect.h"
-#include "core/dispatch_actions.h"
-#include "core/engine-internal.h"
-#include "core/util.h"
-#include "protocol.h"
-
-#include "proton/ssl.h"
-#include "proton/types.h"
-
-#include <assert.h>
-
-static inline pni_sasl_t *get_sasl_internal(pn_sasl_t *sasl)
-{
-  // The external pn_sasl_t is really a pointer to the internal pni_transport_t
-  return sasl ? ((pn_transport_t *)sasl)->sasl : NULL;
-}
-
-static ssize_t pn_input_read_sasl_header(pn_transport_t* transport, unsigned int layer, const char* bytes, size_t available);
-static ssize_t pn_input_read_sasl(pn_transport_t *transport, unsigned int layer, const char *bytes, size_t available);
-static ssize_t pn_input_read_sasl_encrypt(pn_transport_t *transport, unsigned int layer, const char *bytes, size_t available);
-static ssize_t pn_output_write_sasl_header(pn_transport_t* transport, unsigned int layer, char* bytes, size_t size);
-static ssize_t pn_output_write_sasl(pn_transport_t *transport, unsigned int layer, char *bytes, size_t available);
-static ssize_t pn_output_write_sasl_encrypt(pn_transport_t *transport, unsigned int layer, char *bytes, size_t available);
-static void pn_error_sasl(pn_transport_t* transport, unsigned int layer);
-
-const pn_io_layer_t sasl_header_layer = {
-    pn_input_read_sasl_header,
-    pn_output_write_sasl_header,
-    pn_error_sasl,
-    NULL,
-    NULL
-};
-
-const pn_io_layer_t sasl_write_header_layer = {
-    pn_input_read_sasl,
-    pn_output_write_sasl_header,
-    pn_error_sasl,
-    NULL,
-    NULL
-};
-
-const pn_io_layer_t sasl_read_header_layer = {
-    pn_input_read_sasl_header,
-    pn_output_write_sasl,
-    pn_error_sasl,
-    NULL,
-    NULL
-};
-
-const pn_io_layer_t sasl_layer = {
-    pn_input_read_sasl,
-    pn_output_write_sasl,
-    pn_error_sasl,
-    NULL,
-    NULL
-};
-
-const pn_io_layer_t sasl_encrypt_layer = {
-    pn_input_read_sasl_encrypt,
-    pn_output_write_sasl_encrypt,
-    NULL,
-    NULL,
-    NULL
-};
-
-#define SASL_HEADER ("AMQP\x03\x01\x00\x00")
-#define SASL_HEADER_LEN 8
-
-static bool pni_sasl_is_server_state(enum pni_sasl_state state)
-{
-  return state==SASL_NONE
-      || state==SASL_POSTED_MECHANISMS
-      || state==SASL_POSTED_CHALLENGE
-      || state==SASL_POSTED_OUTCOME
-      || state==SASL_ERROR;
-}
-
-static bool pni_sasl_is_client_state(enum pni_sasl_state state)
-{
-  return state==SASL_NONE
-      || state==SASL_POSTED_INIT
-      || state==SASL_POSTED_RESPONSE
-      || state==SASL_RECVED_OUTCOME_SUCCEED
-      || state==SASL_RECVED_OUTCOME_FAIL
-      || state==SASL_ERROR;
-}
-
-static bool pni_sasl_is_final_input_state(pni_sasl_t *sasl)
-{
-  enum pni_sasl_state desired_state = sasl->desired_state;
-  return desired_state==SASL_RECVED_OUTCOME_SUCCEED
-      || desired_state==SASL_RECVED_OUTCOME_FAIL
-      || desired_state==SASL_ERROR
-      || desired_state==SASL_POSTED_OUTCOME;
-}
-
-static bool pni_sasl_is_final_output_state(pni_sasl_t *sasl)
-{
-  enum pni_sasl_state last_state = sasl->last_state;
-  return last_state==SASL_RECVED_OUTCOME_SUCCEED
-      || last_state==SASL_RECVED_OUTCOME_FAIL
-      || last_state==SASL_ERROR
-      || last_state==SASL_POSTED_OUTCOME;
-}
-
-static void pni_emit(pn_transport_t *transport)
-{
-  if (transport->connection && transport->connection->collector) {
-    pn_collector_t *collector = transport->connection->collector;
-    pn_collector_put(collector, PN_OBJECT, transport, PN_TRANSPORT);
-  }
-}
-
-void pni_sasl_set_desired_state(pn_transport_t *transport, enum pni_sasl_state desired_state)
-{
-  pni_sasl_t *sasl = transport->sasl;
-  if (sasl->last_state > desired_state) {
-    if (transport->trace & PN_TRACE_DRV)
-      pn_transport_logf(transport, "Trying to send SASL frame (%d), but illegal: already in later state (%d)", desired_state, sasl->last_state);
-  } else if (sasl->client && !pni_sasl_is_client_state(desired_state)) {
-    if (transport->trace & PN_TRACE_DRV)
-      pn_transport_logf(transport, "Trying to send server SASL frame (%d) on a client", desired_state);
-  } else if (!sasl->client && !pni_sasl_is_server_state(desired_state)) {
-    if (transport->trace & PN_TRACE_DRV)
-      pn_transport_logf(transport, "Trying to send client SASL frame (%d) on a server", desired_state);
-  } else {
-    // If we need to repeat CHALLENGE or RESPONSE frames adjust current state to seem
-    // like they haven't been sent yet
-    if (sasl->last_state==desired_state && desired_state==SASL_POSTED_RESPONSE) {
-      sasl->last_state = SASL_POSTED_INIT;
-    }
-    if (sasl->last_state==desired_state && desired_state==SASL_POSTED_CHALLENGE) {
-      sasl->last_state = SASL_POSTED_MECHANISMS;
-    }
-    sasl->desired_state = desired_state;
-    // Don't emit transport event on error as there will be a TRANSPORT_ERROR event
-    if (desired_state != SASL_ERROR) pni_emit(transport);
-  }
-}
-
-// Post SASL frame
-static void pni_post_sasl_frame(pn_transport_t *transport)
-{
-  pni_sasl_t *sasl = transport->sasl;
-  pn_bytes_t out = sasl->bytes_out;
-  enum pni_sasl_state desired_state = sasl->desired_state;
-  while (sasl->desired_state > sasl->last_state) {
-    switch (desired_state) {
-    case SASL_POSTED_INIT:
-      pn_post_frame(transport, SASL_FRAME_TYPE, 0, "DL[sz]", SASL_INIT, sasl->selected_mechanism,
-                    out.size, out.start);
-      pni_emit(transport);
-      break;
-    case SASL_POSTED_MECHANISMS: {
-      // TODO: Hardcoded limit of 16 mechanisms
-      char *mechs[16];
-      char *mechlist = NULL;
-
-      int count = 0;
-      if (pni_sasl_impl_list_mechs(transport, &mechlist) > 0) {
-        pni_split_mechs(mechlist, sasl->included_mechanisms, mechs, &count);
-      }
-
-      pn_post_frame(transport, SASL_FRAME_TYPE, 0, "DL[@T[*s]]", SASL_MECHANISMS, PN_SYMBOL, count, mechs);
-      free(mechlist);
-      pni_emit(transport);
-      break;
-    }
-    case SASL_POSTED_RESPONSE:
-      pn_post_frame(transport, SASL_FRAME_TYPE, 0, "DL[z]", SASL_RESPONSE, out.size, out.start);
-      pni_emit(transport);
-      break;
-    case SASL_POSTED_CHALLENGE:
-      if (sasl->last_state < SASL_POSTED_MECHANISMS) {
-        desired_state = SASL_POSTED_MECHANISMS;
-        continue;
-      }
-      pn_post_frame(transport, SASL_FRAME_TYPE, 0, "DL[z]", SASL_CHALLENGE, out.size, out.start);
-      pni_emit(transport);
-      break;
-    case SASL_POSTED_OUTCOME:
-      if (sasl->last_state < SASL_POSTED_MECHANISMS) {
-        desired_state = SASL_POSTED_MECHANISMS;
-        continue;
-      }
-      pn_post_frame(transport, SASL_FRAME_TYPE, 0, "DL[B]", SASL_OUTCOME, sasl->outcome);
-      pni_emit(transport);
-      if (sasl->outcome!=PN_SASL_OK) {
-        pn_do_error(transport, "amqp:unauthorized-access", "Failed to authenticate client [mech=%s]", transport->sasl->selected_mechanism);
-        desired_state = SASL_ERROR;
-      }
-      break;
-    case SASL_RECVED_OUTCOME_SUCCEED:
-      if (sasl->last_state < SASL_POSTED_INIT) {
-        desired_state = SASL_POSTED_INIT;
-        continue;
-      }
-      break;
-    case SASL_RECVED_OUTCOME_FAIL:
-      pn_do_error(transport, "amqp:unauthorized-access", "Authentication failed [mech=%s]", transport->sasl->selected_mechanism);
-      desired_state = SASL_ERROR;
-      break;
-    case SASL_ERROR:
-      break;
-    case SASL_NONE:
-      return;
-    }
-    sasl->last_state = desired_state;
-    desired_state = sasl->desired_state;
-  }
-}
-
-static void pn_error_sasl(pn_transport_t* transport, unsigned int layer)
-{
-  transport->close_sent = true;
-  pni_sasl_set_desired_state(transport, SASL_ERROR);
-}
-
-static ssize_t pn_input_read_sasl_header(pn_transport_t* transport, unsigned int layer, const char* bytes, size_t available)
-{
-  bool eos = pn_transport_capacity(transport)==PN_EOS;
-  pni_protocol_type_t protocol = pni_sniff_header(bytes, available);
-  switch (protocol) {
-  case PNI_PROTOCOL_AMQP_SASL:
-    if (transport->io_layers[layer] == &sasl_read_header_layer) {
-        transport->io_layers[layer] = &sasl_layer;
-    } else {
-        transport->io_layers[layer] = &sasl_write_header_layer;
-    }
-    if (transport->trace & PN_TRACE_FRM)
-        pn_transport_logf(transport, "  <- %s", "SASL");
-    pni_sasl_set_external_security(transport, pn_ssl_get_ssf((pn_ssl_t*)transport), pn_ssl_get_remote_subject((pn_ssl_t*)transport));
-    return SASL_HEADER_LEN;
-  case PNI_PROTOCOL_INSUFFICIENT:
-    if (!eos) return 0;
-    /* Fallthru */
-  default:
-    break;
-  }
-  char quoted[1024];
-  pn_quote_data(quoted, 1024, bytes, available);
-  pn_do_error(transport, "amqp:connection:framing-error",
-              "%s header mismatch: %s ['%s']%s", "SASL", pni_protocol_name(protocol), quoted,
-              !eos ? "" : " (connection aborted)");
-  pn_set_error_layer(transport);
-  return PN_EOS;
-}
-
-static void pni_sasl_start_server_if_needed(pn_transport_t *transport)
-{
-  pni_sasl_t *sasl = transport->sasl;
-  if (!sasl->client && sasl->desired_state<SASL_POSTED_MECHANISMS) {
-    if (!pni_init_server(transport)) return;
-
-    // Setup to send SASL mechanisms frame
-    pni_sasl_set_desired_state(transport, SASL_POSTED_MECHANISMS);
-  }
-}
-
-static ssize_t pn_input_read_sasl(pn_transport_t* transport, unsigned int layer, const char* bytes, size_t available)
-{
-  pni_sasl_t *sasl = transport->sasl;
-
-  bool eos = pn_transport_capacity(transport)==PN_EOS;
-  if (eos) {
-    pn_do_error(transport, "amqp:connection:framing-error", "connection aborted");
-    pn_set_error_layer(transport);
-    return PN_EOS;
-  }
-
-  pni_sasl_start_server_if_needed(transport);
-
-  if (!pni_sasl_is_final_input_state(sasl)) {
-    return pn_dispatcher_input(transport, bytes, available, false, &transport->halt);
-  }
-
-  if (!pni_sasl_is_final_output_state(sasl)) {
-    return pni_passthru_layer.process_input(transport, layer, bytes, available);
-  }
-
-  if (pni_sasl_impl_can_encrypt(transport)) {
-    sasl->max_encrypt_size = pni_sasl_impl_max_encrypt_size(transport);
-    if (transport->trace & PN_TRACE_DRV)
-      pn_transport_logf(transport, "SASL Encryption enabled: buffer=%d", sasl->max_encrypt_size);
-    transport->io_layers[layer] = &sasl_encrypt_layer;
-  } else {
-    transport->io_layers[layer] = &pni_passthru_layer;
-  }
-  return transport->io_layers[layer]->process_input(transport, layer, bytes, available);
-}
-
-static ssize_t pn_input_read_sasl_encrypt(pn_transport_t* transport, unsigned int layer, const char* bytes, size_t available)
-{
-  pn_buffer_t *in = transport->sasl->decoded_buffer;
-  const size_t max_buffer = transport->sasl->max_encrypt_size;
-  for (size_t processed = 0; processed<available;) {
-    pn_bytes_t decoded = pn_bytes(0, NULL);
-    size_t decode_size = (available-processed)<=max_buffer?(available-processed):max_buffer;
-    ssize_t size = pni_sasl_impl_decode(transport, pn_bytes(decode_size, bytes+processed), &decoded);
-    if (size<0) return size;
-    if (size>0) {
-      size = pn_buffer_append(in, decoded.start, decoded.size);
-      if (size) return size;
-    }
-    processed += decode_size;
-  }
-  pn_bytes_t decoded = pn_buffer_bytes(in);
-  size_t processed_size = 0;
-  while (processed_size < decoded.size) {
-    ssize_t size = pni_passthru_layer.process_input(transport, layer, decoded.start+processed_size, decoded.size-processed_size);
-    if (size==0) break;
-    if (size<0) return size;
-    pn_buffer_trim(in, size, 0);
-    processed_size += size;
-  }
-  return available;
-}
-
-static ssize_t pn_output_write_sasl_header(pn_transport_t *transport, unsigned int layer, char *bytes, size_t size)
-{
-  if (transport->trace & PN_TRACE_FRM)
-    pn_transport_logf(transport, "  -> %s", "SASL");
-  assert(size >= SASL_HEADER_LEN);
-  memmove(bytes, SASL_HEADER, SASL_HEADER_LEN);
-  if (transport->io_layers[layer]==&sasl_write_header_layer) {
-      transport->io_layers[layer] = &sasl_layer;
-  } else {
-      transport->io_layers[layer] = &sasl_read_header_layer;
-  }
-  return SASL_HEADER_LEN;
-}
-
-static ssize_t pn_output_write_sasl(pn_transport_t* transport, unsigned int layer, char* bytes, size_t available)
-{
-  pni_sasl_t *sasl = transport->sasl;
-
-  // this accounts for when pn_do_error is invoked, e.g. by idle timeout
-  if (transport->close_sent) return PN_EOS;
-
-  pni_sasl_start_server_if_needed(transport);
-
-  pni_post_sasl_frame(transport);
-
-  if (transport->available != 0 || !pni_sasl_is_final_output_state(sasl)) {
-    return pn_dispatcher_output(transport, bytes, available);
-  }
-
-  if (!pni_sasl_is_final_input_state(sasl)) {
-    return pni_passthru_layer.process_output(transport, layer, bytes, available );
-  }
-
-  // We only get here if there is nothing to output and we're in a final state
-  if (sasl->outcome != PN_SASL_OK) {
-    return PN_EOS;
-  }
-
-  // We know that auth succeeded or we're not in final input state
-  if (pni_sasl_impl_can_encrypt(transport)) {
-    sasl->max_encrypt_size = pni_sasl_impl_max_encrypt_size(transport);
-    if (transport->trace & PN_TRACE_DRV)
-      pn_transport_logf(transport, "SASL Encryption enabled: buffer=%d", sasl->max_encrypt_size);
-    transport->io_layers[layer] = &sasl_encrypt_layer;
-  } else {
-    transport->io_layers[layer] = &pni_passthru_layer;
-  }
-  return transport->io_layers[layer]->process_output(transport, layer, bytes, available);
-}
-
-static ssize_t pn_output_write_sasl_encrypt(pn_transport_t* transport, unsigned int layer, char* bytes, size_t available)
-{
-  ssize_t clear_size = pni_passthru_layer.process_output(transport, layer, bytes, available );
-  if (clear_size<0) return clear_size;
-
-  const ssize_t max_buffer = transport->sasl->max_encrypt_size;
-  pn_buffer_t *out = transport->sasl->encoded_buffer;
-  for (ssize_t processed = 0; processed<clear_size;) {
-    pn_bytes_t encoded = pn_bytes(0, NULL);
-    ssize_t encode_size = (clear_size-processed)<=max_buffer?(clear_size-processed):max_buffer;
-    ssize_t size = pni_sasl_impl_encode(transport, pn_bytes(encode_size, bytes+processed), &encoded);
-    if (size<0) return size;
-    if (size>0) {
-      size = pn_buffer_append(out, encoded.start, encoded.size);
-      if (size) return size;
-    }
-    processed += encode_size;
-  }
-  ssize_t size = pn_buffer_get(out, 0, available, bytes);
-  pn_buffer_trim(out, size, 0);
-  return size;
-}
-
-// Look for symbol in the mech include list - not particlarly efficient,
-// but probably not used enough to matter.
-//
-// Note that if there is no inclusion list then every mech is implicitly included.
-bool pni_included_mech(const char *included_mech_list, pn_bytes_t s)
-{
-  if (!included_mech_list) return true;
-
-  const char * end_list = included_mech_list+strlen(included_mech_list);
-  size_t len = s.size;
-  const char *c = included_mech_list;
-  while (c!=NULL) {
-    // If there are not enough chars left in the list no matches
-    if ((ptrdiff_t)len > end_list-c) return false;
-
-    // Is word equal with a space or end of string afterwards?
-    if (pn_strncasecmp(c, s.start, len)==0 && (c[len]==' ' || c[len]==0) ) return true;
-
-    c = strchr(c, ' ');
-    c = c ? c+1 : NULL;
-  }
-  return false;
-}
-
-// This takes a space separated list and zero terminates it in place
-// whilst adding pointers to the existing strings in a string array.
-// This means that you can't free the original storage until you have
-// finished with the resulting list.
-void pni_split_mechs(char *mechlist, const char* included_mechs, char *mechs[], int *count)
-{
-  char *start = mechlist;
-  char *end = start;
-
-  while (*end) {
-    if (*end == ' ') {
-      if (start != end) {
-        *end = '\0';
-        if (pni_included_mech(included_mechs, pn_bytes(end-start, start))) {
-          mechs[(*count)++] = start;
-        }
-      }
-      end++;
-      start = end;
-    } else {
-      end++;
-    }
-  }
-
-  if (start != end) {
-    if (pni_included_mech(included_mechs, pn_bytes(end-start, start))) {
-      mechs[(*count)++] = start;
-    }
-  }
-}
-
-pn_sasl_t *pn_sasl(pn_transport_t *transport)
-{
-  if (!transport->sasl) {
-    pni_sasl_t *sasl = (pni_sasl_t *) malloc(sizeof(pni_sasl_t));
-
-    const char *sasl_config_path = getenv("PN_SASL_CONFIG_PATH");
-
-    sasl->impl_context = NULL;
-    sasl->client = !transport->server;
-    sasl->selected_mechanism = NULL;
-    sasl->included_mechanisms = NULL;
-    sasl->username = NULL;
-    sasl->password = NULL;
-    sasl->config_name = NULL;
-    sasl->config_dir =  sasl_config_path ? pn_strdup(sasl_config_path) : NULL;
-    sasl->remote_fqdn = NULL;
-    sasl->external_auth = NULL;
-    sasl->external_ssf = 0;
-    sasl->outcome = PN_SASL_NONE;
-    sasl->impl_context = NULL;
-    sasl->decoded_buffer = pn_buffer(0);
-    sasl->encoded_buffer = pn_buffer(0);
-    sasl->bytes_out.size = 0;
-    sasl->bytes_out.start = NULL;
-    sasl->desired_state = SASL_NONE;
-    sasl->last_state = SASL_NONE;
-    sasl->allow_insecure_mechs = false;
-
-    transport->sasl = sasl;
-  }
-
-  // The actual external pn_sasl_t pointer is a pointer to its enclosing pn_transport_t
-  return (pn_sasl_t *)transport;
-}
-
-void pn_sasl_free(pn_transport_t *transport)
-{
-  if (transport) {
-    pni_sasl_t *sasl = transport->sasl;
-    if (sasl) {
-      free(sasl->selected_mechanism);
-      free(sasl->included_mechanisms);
-      free(sasl->password);
-      free(sasl->config_name);
-      free(sasl->config_dir);
-      free(sasl->external_auth);
-
-      // CYRUS_SASL
-      if (sasl->impl_context) {
-          pni_sasl_impl_free(transport);
-      }
-      pn_buffer_free(sasl->decoded_buffer);
-      pn_buffer_free(sasl->encoded_buffer);
-      free(sasl);
-    }
-  }
-}
-
-void pni_sasl_set_remote_hostname(pn_transport_t * transport, const char * fqdn)
-{
-  pni_sasl_t *sasl = transport->sasl;
-  sasl->remote_fqdn = fqdn;
-}
-
-void pni_sasl_set_user_password(pn_transport_t *transport, const char *user, const char *password)
-{
-  pni_sasl_t *sasl = transport->sasl;
-  sasl->username = user;
-  free(sasl->password);
-  sasl->password = password ? pn_strdup(password) : NULL;
-}
-
-void pni_sasl_set_external_security(pn_transport_t *transport, int ssf, const char *authid)
-{
-  pni_sasl_t *sasl = transport->sasl;
-  sasl->external_ssf = ssf;
-  free(sasl->external_auth);
-  sasl->external_auth = authid ? pn_strdup(authid) : NULL;
-}
-
-const char *pn_sasl_get_user(pn_sasl_t *sasl0)
-{
-    pni_sasl_t *sasl = get_sasl_internal(sasl0);
-    return sasl->username;
-}
-
-const char *pn_sasl_get_mech(pn_sasl_t *sasl0)
-{
-    pni_sasl_t *sasl = get_sasl_internal(sasl0);
-    return sasl->selected_mechanism;
-}
-
-void pn_sasl_allowed_mechs(pn_sasl_t *sasl0, const char *mechs)
-{
-    pni_sasl_t *sasl = get_sasl_internal(sasl0);
-    free(sasl->included_mechanisms);
-    sasl->included_mechanisms = mechs ? pn_strdup(mechs) : NULL;
-}
-
-void pn_sasl_set_allow_insecure_mechs(pn_sasl_t *sasl0, bool insecure)
-{
-    pni_sasl_t *sasl = get_sasl_internal(sasl0);
-    sasl->allow_insecure_mechs = insecure;
-}
-
-bool pn_sasl_get_allow_insecure_mechs(pn_sasl_t *sasl0)
-{
-    pni_sasl_t *sasl = get_sasl_internal(sasl0);
-    return sasl->allow_insecure_mechs;
-}
-
-void pn_sasl_config_name(pn_sasl_t *sasl0, const char *name)
-{
-    pni_sasl_t *sasl = get_sasl_internal(sasl0);
-    free(sasl->config_name);
-    sasl->config_name = pn_strdup(name);
-}
-
-void pn_sasl_config_path(pn_sasl_t *sasl0, const char *dir)
-{
-    pni_sasl_t *sasl = get_sasl_internal(sasl0);
-    free(sasl->config_dir);
-    sasl->config_dir = pn_strdup(dir);
-}
-
-void pn_sasl_done(pn_sasl_t *sasl0, pn_sasl_outcome_t outcome)
-{
-  pni_sasl_t *sasl = get_sasl_internal(sasl0);
-  if (sasl) {
-    sasl->outcome = outcome;
-  }
-}
-
-pn_sasl_outcome_t pn_sasl_outcome(pn_sasl_t *sasl0)
-{
-  pni_sasl_t *sasl = get_sasl_internal(sasl0);
-  return sasl ? sasl->outcome : PN_SASL_NONE;
-}
-
-// Received Server side
-int pn_do_init(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload)
-{
-  pni_sasl_t *sasl = transport->sasl;
-  pn_bytes_t mech;
-  pn_bytes_t recv;
-  int err = pn_data_scan(args, "D.[sz]", &mech, &recv);
-  if (err) return err;
-  sasl->selected_mechanism = pn_strndup(mech.start, mech.size);
-
-  pni_process_init(transport, sasl->selected_mechanism, &recv);
-
-  return 0;
-}
-
-// Received client side
-int pn_do_mechanisms(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload)
-{
-  pni_sasl_t *sasl = transport->sasl;
-
-  // This scanning relies on pn_data_scan leaving the pn_data_t cursors
-  // where they are after finishing the scan
-  pn_string_t *mechs = pn_string("");
-
-  // Try array of symbols for mechanism list
-  bool array = false;
-  int err = pn_data_scan(args, "D.[?@[", &array);
-  if (err) return err;
-
-  if (array) {
-    // Now keep checking for end of array and pull a symbol
-    while(pn_data_next(args)) {
-      pn_bytes_t s = pn_data_get_symbol(args);
-      if (pni_included_mech(transport->sasl->included_mechanisms, s)) {
-        pn_string_addf(mechs, "%*s ", (int)s.size, s.start);
-      }
-    }
-
-    if (pn_string_size(mechs)) {
-        pn_string_buffer(mechs)[pn_string_size(mechs)-1] = 0;
-    }
-  } else {
-    // No array of symbols; try single symbol
-    pn_data_rewind(args);
-    pn_bytes_t symbol;
-    int err = pn_data_scan(args, "D.[s]", &symbol);
-    if (err) return err;
-
-    pn_string_setn(mechs, symbol.start, symbol.size);
-  }
-
-  if (pni_init_client(transport) &&
-      pn_string_size(mechs) &&
-      pni_process_mechanisms(transport, pn_string_get(mechs))) {
-    pni_sasl_set_desired_state(transport, SASL_POSTED_INIT);
-  } else {
-    sasl->outcome = PN_SASL_PERM;
-    pni_sasl_set_desired_state(transport, SASL_RECVED_OUTCOME_FAIL);
-  }
-
-  pn_free(mechs);
-  return 0;
-}
-
-// Received client side
-int pn_do_challenge(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload)
-{
-  pn_bytes_t recv;
-  int err = pn_data_scan(args, "D.[z]", &recv);
-  if (err) return err;
-
-  pni_process_challenge(transport, &recv);
-
-  return 0;
-}
-
-// Received server side
-int pn_do_response(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload)
-{
-  pn_bytes_t recv;
-  int err = pn_data_scan(args, "D.[z]", &recv);
-  if (err) return err;
-
-  pni_process_response(transport, &recv);
-
-  return 0;
-}
-
-// Received client side
-int pn_do_outcome(pn_transport_t *transport, uint8_t frame_type, uint16_t channel, pn_data_t *args, const pn_bytes_t *payload)
-{
-  uint8_t outcome;
-  int err = pn_data_scan(args, "D.[B]", &outcome);
-  if (err) return err;
-
-  pni_sasl_t *sasl = transport->sasl;
-  sasl->outcome = (pn_sasl_outcome_t) outcome;
-  bool authenticated = sasl->outcome==PN_SASL_OK;
-  transport->authenticated = authenticated;
-  pni_sasl_set_desired_state(transport, authenticated ? SASL_RECVED_OUTCOME_SUCCEED : SASL_RECVED_OUTCOME_FAIL);
-
-  return 0;
-}
-
-
diff --git a/proton-c/src/security.xml b/proton-c/src/security.xml
deleted file mode 100644
index c6ac018..0000000
--- a/proton-c/src/security.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-Copyright Bank of America, N.A., Barclays Bank PLC, Cisco Systems, Credit
-Suisse, Deutsche Boerse, Envoy Technologies Inc., Goldman Sachs, HCL
-Technologies Ltd, IIT Software GmbH, iMatix Corporation, INETCO Systems Limited,
-Informatica Corporation, JPMorgan Chase & Co., Kaazing Corporation, N.A,
-Microsoft Corporation, my-Channels, Novell, Progress Software, Red Hat Inc.,
-Software AG, Solace Systems Inc., StormMQ Ltd., Tervela Inc., TWIST Process
-Innovations Ltd, VMware, Inc., and WS02 Inc. 2006-2011. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-3. The name of the author may not be used to endorse or promote products
-derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--->
-
-<amqp name="security" xmlns="http://www.amqp.org/schema/amqp.xsd">
-  <section name="tls">
-    <definition name="TLS-MAJOR" value="1"/>
-    <definition name="TLS-MINOR" value="0"/>
-    <definition name="TLS-REVISION" value="0"/>
-  </section>
-  <section name="sasl">
-    <type name="sasl-mechanisms" class="composite" source="list" provides="sasl-frame">
-      <descriptor name="amqp:sasl-mechanisms:list" code="0x00000000:0x00000040"/>
-      <field name="sasl-server-mechanisms" type="symbol" mandatory="true" multiple="true"/>
-    </type>
-    <type name="sasl-init" class="composite" source="list" provides="sasl-frame">
-      <descriptor name="amqp:sasl-init:list" code="0x00000000:0x00000041"/>
-      <field name="mechanism" type="symbol" mandatory="true"/>
-      <field name="initial-response" type="binary"/>
-      <field name="hostname" type="string"/>
-    </type>
-    <type name="sasl-challenge" class="composite" source="list" provides="sasl-frame">
-      <descriptor name="amqp:sasl-challenge:list" code="0x00000000:0x00000042"/>
-      <field name="challenge" type="binary" mandatory="true"/>
-    </type>
-    <type name="sasl-response" class="composite" source="list" provides="sasl-frame">
-      <descriptor name="amqp:sasl-response:list" code="0x00000000:0x00000043"/>
-      <field name="response" type="binary" mandatory="true"/>
-    </type>
-    <type name="sasl-outcome" class="composite" source="list" provides="sasl-frame">
-      <descriptor name="amqp:sasl-outcome:list" code="0x00000000:0x00000044"/>
-      <field name="code" type="sasl-code" mandatory="true"/>
-      <field name="additional-data" type="binary"/>
-    </type>
-    <type name="sasl-code" class="restricted" source="ubyte">
-      <choice name="ok" value="0"/>
-      <choice name="auth" value="1"/>
-      <choice name="sys" value="2"/>
-      <choice name="sys-perm" value="3"/>
-      <choice name="sys-temp" value="4"/>
-    </type>
-    <definition name="SASL-MAJOR" value="1"/>
-    <definition name="SASL-MINOR" value="0"/>
-    <definition name="SASL-REVISION" value="0"/>
-  </section>
-</amqp>
diff --git a/proton-c/src/ssl/PLATFORM_NOTES.md b/proton-c/src/ssl/PLATFORM_NOTES.md
deleted file mode 100644
index 1c4c517..0000000
--- a/proton-c/src/ssl/PLATFORM_NOTES.md
+++ /dev/null
@@ -1,82 +0,0 @@
-Proton SSL/TLS implementations have platform dependent formats for specifying
-private and public key information.
-
-OpenSSL
-=======
-
-On OpenSSL (POSIX) based systems, certificates and their private keys are
-specified separately in two files: the public X509 certificate in PEM format
-and the password protected PKCS#8 encoded private key.
-
-  `pn_ssl_domain_set_credentials(path_to_public_x509.pem,  
-                path_to_private_pkcs8.pem, password_for_pkcs8)`
-
-
-A database of trusted Certificate Authority certificates may be specified as a
-path to a file or a directory.  In the former case, the file consists of one
-or more X509 certificates in PEM format concatenated together.  In the latter
-case, the directory contains a file for each X509 certificate in PEM format
-and indexed by (i.e. the file name is derived from) the X509 `-subject_hash`
-of the certificate's name.  See
-[here](https://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.htm)
-for more details.
-
-
-SChannel
-========
-
-On SChannel (Windows) based systems, trust and identity certificates are
-stored in certificate stores, which may be file based or system/registry
-based.  The former are in PKCS#12 format and the latter are typically managed
-by the Microsoft graphical management console.  The public and private keys
-are stored together, except in the case of trusted authority certificates
-which only contain the public key information.
-
-To specify a certificate:
-
-  `pn_ssl_domain_set_credentials(store, certificate_friendly_name,  
-                 password_for_store)`
-
-File based stores are specified by their relative or absolute path names.
-Registry stores are specified by their names (which are case insensitive)
-preceded by "ss:" for "Current User" system stores or "lmss:" for "Local
-Machine" system stores.  Examples:
-
-  "ss:Personal" specifies the Personal store for the Current User.
-
-  "lmss:AMQP" specifies a registry store called "AMQP" for the Local Machine
-  context.
-
-  "ss:Root" specifies the Trusted Root Certificate Authorities store for the
-  Current User.
-
-If a store contains a single certificate, the friendly name is optional.  The
-password may be null in the case of a registry store that is not password
-protected.
-
-Trusted root certificates must be placed in a store that is not password
-protected.
-
-In the special case that the peer certificate chain being verified requires
-revocation checking, the trusted root certificate must be present in both the
-trust store specified to Proton and also in the Windows "Trusted Root
-Certificate Authorities" system store.  Such certificate chains are usually
-managed by a central corporate network administrator or by a recognized
-certificate authority in which case the trusted root is often already present
-in the system store.  This requirement can be worked around by creating a
-special purpose CA database for Proton that includes the target peer's
-certificate (making it trusted, with the caution that you must consider the
-security implications of bypassing the revocation check).
-
-Existing OpenSSL keys (say `xx_x509.pem` and `xx_private_key.pem`) can be
-converted to PKCS#12 by the command:
-
-  `openssl pkcs12 -export -out xx_windows.p12 -passin pass:password \  
-          -passout pass:password -inkey xx_private_key.pem -in xx_x509.pem \  
-          -name xx_friendlyname`
-
-To create a PKCS#12 trust store from a Certificate Authority's public X509
-certificate with an empty password:
-
-  `openssl pkcs12 -export -out trust_store.p12 -in ca-certificate.pem \  
-          -name ca-certificate -nokeys -passout pass:`
diff --git a/proton-c/src/ssl/openssl.c b/proton-c/src/ssl/openssl.c
deleted file mode 100644
index 0d7c40b..0000000
--- a/proton-c/src/ssl/openssl.c
+++ /dev/null
@@ -1,1434 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "platform/platform.h"
-#include "core/util.h"
-#include "core/engine-internal.h"
-
-#include <proton/ssl.h>
-#include <proton/engine.h>
-
-// openssl on windows expects the user to have already included
-// winsock.h
-
-#ifdef _MSC_VER
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0501
-#endif
-#if _WIN32_WINNT < 0x0501
-#error "Proton requires Windows API support for XP or later."
-#endif
-#include <winsock2.h>
-#include <mswsock.h>
-#include <Ws2tcpip.h>
-#endif
-
-
-#include <openssl/ssl.h>
-#include <openssl/dh.h>
-#include <openssl/err.h>
-#include <openssl/x509v3.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <assert.h>
-
-
-/** @file
- * SSL/TLS support API.
- *
- * This file contains an OpenSSL-based implemention of the SSL/TLS API.
- */
-
-static int ssl_initialized;
-static int ssl_ex_data_index;
-static int ssl_session_ex_data_index;
-
-typedef struct pn_ssl_session_t pn_ssl_session_t;
-
-struct pn_ssl_domain_t {
-
-  SSL_CTX       *ctx;
-
-  char *keyfile_pw;
-
-  // settings used for all connections
-  char *trusted_CAs;
-
-  int   ref_count;
-  pn_ssl_mode_t mode;
-  pn_ssl_verify_mode_t verify_mode;
-
-  bool has_ca_db;       // true when CA database configured
-  bool has_certificate; // true when certificate configured
-  bool allow_unsecured;
-};
-
-
-struct pni_ssl_t {
-  pn_ssl_domain_t  *domain;
-  const char    *session_id;
-  const char *peer_hostname;
-  SSL *ssl;
-
-  BIO *bio_ssl;         // i/o from/to SSL socket layer
-  BIO *bio_ssl_io;      // SSL "half" of network-facing BIO
-  BIO *bio_net_io;      // socket-side "half" of network-facing BIO
-  // buffers for holding I/O from "applications" above SSL
-#define APP_BUF_SIZE    (4*1024)
-  char *outbuf;
-  char *inbuf;
-
-  ssize_t app_input_closed;   // error code returned by upper layer process input
-  ssize_t app_output_closed;  // error code returned by upper layer process output
-
-  size_t out_size;
-  size_t out_count;
-  size_t in_size;
-  size_t in_count;
-
-  bool ssl_shutdown;    // BIO_ssl_shutdown() called on socket.
-  bool ssl_closed;      // shutdown complete, or SSL error
-  bool read_blocked;    // SSL blocked until more network data is read
-  bool write_blocked;   // SSL blocked until data is written to network
-
-  char *subject;
-  X509 *peer_certificate;
-};
-
-static inline pn_transport_t *get_transport_internal(pn_ssl_t *ssl)
-{
-    // The external pn_sasl_t is really a pointer to the internal pni_transport_t
-    return ((pn_transport_t *)ssl);
-}
-
-static inline pni_ssl_t *get_ssl_internal(pn_ssl_t *ssl)
-{
-    // The external pn_sasl_t is really a pointer to the internal pni_transport_t
-    return ssl ? ((pn_transport_t *)ssl)->ssl : NULL;
-}
-
-// define two sets of allowable ciphers: those that require authentication, and those
-// that do not require authentication (anonymous).  See ciphers(1).
-#define CIPHERS_AUTHENTICATE    "ALL:!aNULL:!eNULL:@STRENGTH"
-#define CIPHERS_ANONYMOUS       "ALL:aNULL:!eNULL:@STRENGTH"
-
-/* */
-static int keyfile_pw_cb(char *buf, int size, int rwflag, void *userdata);
-static void handle_error_ssl( pn_transport_t *transport, unsigned int layer);
-static ssize_t process_input_ssl( pn_transport_t *transport, unsigned int layer, const char *input_data, size_t len);
-static ssize_t process_output_ssl( pn_transport_t *transport, unsigned int layer, char *input_data, size_t len);
-static ssize_t process_input_done(pn_transport_t *transport, unsigned int layer, const char *input_data, size_t len);
-static ssize_t process_output_done(pn_transport_t *transport, unsigned int layer, char *input_data, size_t len);
-static int init_ssl_socket(pn_transport_t *, pni_ssl_t *);
-static void release_ssl_socket( pni_ssl_t * );
-static size_t buffered_output( pn_transport_t *transport );
-static X509 *get_peer_certificate(pni_ssl_t *ssl);
-
-static void ssl_vlog(pn_transport_t *transport, const char *fmt, va_list ap)
-{
-  if (transport) {
-    if (PN_TRACE_DRV & transport->trace) {
-      pn_transport_vlogf(transport, fmt, ap);
-    }
-  } else {
-    pn_transport_vlogf(transport, fmt, ap);
-  }
-}
-
-static void ssl_log(pn_transport_t *transport, const char *fmt, ...)
-{
-  va_list ap;
-  va_start(ap, fmt);
-  ssl_vlog(transport, fmt, ap);
-  va_end(ap);
-}
-
-static void ssl_log_flush(pn_transport_t* transport)
-{
-  char buf[128];        // see "man ERR_error_string_n()"
-  unsigned long err = ERR_get_error();
-  while (err) {
-    ERR_error_string_n(err, buf, sizeof(buf));
-    ssl_log(transport, "%s", buf);
-    err = ERR_get_error();
-  }
-}
-
-// log an error and dump the SSL error stack
-static void ssl_log_error(const char *fmt, ...)
-{
-  if (fmt) {
-    va_list ap;
-    va_start(ap, fmt);
-    ssl_vlog(NULL, fmt, ap);
-    va_end(ap);
-  }
-
-  ssl_log_flush(NULL);
-}
-
-static void ssl_log_clear_data(pn_transport_t *transport, const char *data, size_t len)
-{
-  if (PN_TRACE_RAW & transport->trace) {
-    fprintf(stderr, "SSL decrypted data: \"");
-    pn_fprint_data( stderr, data, len );
-    fprintf(stderr, "\"\n");
-  }
-}
-
-// unrecoverable SSL failure occured, notify transport and generate error code.
-static int ssl_failed(pn_transport_t *transport)
-{
-  pni_ssl_t *ssl = transport->ssl;
-  SSL_set_shutdown(ssl->ssl, SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
-  ssl->ssl_closed = true;
-  ssl->app_input_closed = ssl->app_output_closed = PN_EOS;
-  // fake a shutdown so the i/o processing code will close properly
-  SSL_set_shutdown(ssl->ssl, SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
-  // try to grab the first SSL error to add to the failure log
-  char buf[128] = "Unknown error.";
-  unsigned long ssl_err = ERR_get_error();
-  if (ssl_err) {
-    ERR_error_string_n( ssl_err, buf, sizeof(buf) );
-  }
-  ssl_log_flush(transport);    // spit out any remaining errors to the log file
-  pn_do_error(transport, "amqp:connection:framing-error", "SSL Failure: %s", buf);
-  return PN_EOS;
-}
-
-/* match the DNS name pattern from the peer certificate against our configured peer
-   hostname */
-static bool match_dns_pattern( const char *hostname,
-                               const char *pattern, int plen )
-{
-  int slen = (int) strlen(hostname);
-  if (memchr( pattern, '*', plen ) == NULL)
-    return (plen == slen &&
-            pn_strncasecmp( pattern, hostname, plen ) == 0);
-
-  /* dns wildcarded pattern - RFC2818 */
-  char plabel[64];   /* max label length < 63 - RFC1034 */
-  char slabel[64];
-
-  while (plen > 0 && slen > 0) {
-    const char *cptr;
-    int len;
-
-    cptr = (const char *) memchr( pattern, '.', plen );
-    len = (cptr) ? cptr - pattern : plen;
-    if (len > (int) sizeof(plabel) - 1) return false;
-    memcpy( plabel, pattern, len );
-    plabel[len] = 0;
-    if (cptr) ++len;    // skip matching '.'
-    pattern += len;
-    plen -= len;
-
-    cptr = (const char *) memchr( hostname, '.', slen );
-    len = (cptr) ? cptr - hostname : slen;
-    if (len > (int) sizeof(slabel) - 1) return false;
-    memcpy( slabel, hostname, len );
-    slabel[len] = 0;
-    if (cptr) ++len;    // skip matching '.'
-    hostname += len;
-    slen -= len;
-
-    char *star = strchr( plabel, '*' );
-    if (!star) {
-      if (pn_strcasecmp( plabel, slabel )) return false;
-    } else {
-      *star = '\0';
-      char *prefix = plabel;
-      int prefix_len = strlen(prefix);
-      char *suffix = star + 1;
-      int suffix_len = strlen(suffix);
-      if (prefix_len && pn_strncasecmp( prefix, slabel, prefix_len )) return false;
-      if (suffix_len && pn_strncasecmp( suffix,
-                                     slabel + (strlen(slabel) - suffix_len),
-                                     suffix_len )) return false;
-    }
-  }
-
-  return plen == slen;
-}
-
-// Certificate chain verification callback: return 1 if verified,
-// 0 if remote cannot be verified (fail handshake).
-//
-static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx)
-{
-  if (!preverify_ok || X509_STORE_CTX_get_error_depth(ctx) != 0)
-    // already failed, or not at peer cert in chain
-    return preverify_ok;
-
-  X509 *cert = X509_STORE_CTX_get_current_cert(ctx);
-  SSL *ssn = (SSL *) X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx());
-  if (!ssn) {
-    pn_transport_logf(NULL, "Error: unexpected error - SSL session info not available for peer verify!");
-    return 0;  // fail connection
-  }
-
-  pn_transport_t *transport = (pn_transport_t *)SSL_get_ex_data(ssn, ssl_ex_data_index);
-  if (!transport) {
-    pn_transport_logf(NULL, "Error: unexpected error - SSL context info not available for peer verify!");
-    return 0;  // fail connection
-  }
-
-  pni_ssl_t *ssl = transport->ssl;
-  if (ssl->domain->verify_mode != PN_SSL_VERIFY_PEER_NAME) return preverify_ok;
-  if (!ssl->peer_hostname) {
-    pn_transport_logf(transport, "Error: configuration error: PN_SSL_VERIFY_PEER_NAME configured, but no peer hostname set!");
-    return 0;  // fail connection
-  }
-
-  ssl_log(transport, "Checking identifying name in peer cert against '%s'", ssl->peer_hostname);
-
-  bool matched = false;
-
-  /* first check any SubjectAltName entries, as per RFC2818 */
-  GENERAL_NAMES *sans = (GENERAL_NAMES *) X509_get_ext_d2i(cert, NID_subject_alt_name, NULL, NULL);
-  if (sans) {
-    int name_ct = sk_GENERAL_NAME_num( sans );
-    int i;
-    for (i = 0; !matched && i < name_ct; ++i) {
-      GENERAL_NAME *name = sk_GENERAL_NAME_value( sans, i );
-      if (name->type == GEN_DNS) {
-        ASN1_STRING *asn1 = name->d.dNSName;
-        if (asn1 && asn1->data && asn1->length) {
-          unsigned char *str;
-          int len = ASN1_STRING_to_UTF8( &str, asn1 );
-          if (len >= 0) {
-            ssl_log(transport, "SubjectAltName (dns) from peer cert = '%.*s'", len, str );
-            matched = match_dns_pattern( ssl->peer_hostname, (const char *)str, len );
-            OPENSSL_free( str );
-          }
-        }
-      }
-    }
-    GENERAL_NAMES_free( sans );
-  }
-
-  /* if no general names match, try the CommonName from the subject */
-  X509_NAME *name = X509_get_subject_name(cert);
-  int i = -1;
-  while (!matched && (i = X509_NAME_get_index_by_NID(name, NID_commonName, i)) >= 0) {
-    X509_NAME_ENTRY *ne = X509_NAME_get_entry(name, i);
-    ASN1_STRING *name_asn1 = X509_NAME_ENTRY_get_data(ne);
-    if (name_asn1) {
-      unsigned char *str;
-      int len = ASN1_STRING_to_UTF8( &str, name_asn1);
-      if (len >= 0) {
-        ssl_log(transport, "commonName from peer cert = '%.*s'", len, str);
-        matched = match_dns_pattern( ssl->peer_hostname, (const char *)str, len );
-        OPENSSL_free(str);
-      }
-    }
-  }
-
-  if (!matched) {
-    ssl_log(transport, "Error: no name matching %s found in peer cert - rejecting handshake.",
-          ssl->peer_hostname);
-    preverify_ok = 0;
-#ifdef X509_V_ERR_APPLICATION_VERIFICATION
-    X509_STORE_CTX_set_error( ctx, X509_V_ERR_APPLICATION_VERIFICATION );
-#endif
-  } else {
-    ssl_log(transport, "Name from peer cert matched - peer is valid.");
-  }
-  return preverify_ok;
-}
-
-
-// this code was generated using the command:
-// "openssl dhparam -C -2 2048"
-static DH *get_dh2048(void)
-{
-  static const unsigned char dh2048_p[]={
-    0xAE,0xF7,0xE9,0x66,0x26,0x7A,0xAC,0x0A,0x6F,0x1E,0xCD,0x81,
-    0xBD,0x0A,0x10,0x7E,0xFA,0x2C,0xF5,0x2D,0x98,0xD4,0xE7,0xD9,
-    0xE4,0x04,0x8B,0x06,0x85,0xF2,0x0B,0xA3,0x90,0x15,0x56,0x0C,
-    0x8B,0xBE,0xF8,0x48,0xBB,0x29,0x63,0x75,0x12,0x48,0x9D,0x7E,
-    0x7C,0x24,0xB4,0x3A,0x38,0x7E,0x97,0x3C,0x77,0x95,0xB0,0xA2,
-    0x72,0xB6,0xE9,0xD8,0xB8,0xFA,0x09,0x1B,0xDC,0xB3,0x80,0x6E,
-    0x32,0x0A,0xDA,0xBB,0xE8,0x43,0x88,0x5B,0xAB,0xC3,0xB2,0x44,
-    0xE1,0x95,0x85,0x0A,0x0D,0x13,0xE2,0x02,0x1E,0x96,0x44,0xCF,
-    0xA0,0xD8,0x46,0x32,0x68,0x63,0x7F,0x68,0xB3,0x37,0x52,0xCE,
-    0x3A,0x4E,0x48,0x08,0x7F,0xD5,0x53,0x00,0x59,0xA8,0x2C,0xCB,
-    0x51,0x64,0x3D,0x5F,0xEF,0x0E,0x5F,0xE6,0xAF,0xD9,0x1E,0xA2,
-    0x35,0x64,0x37,0xD7,0x4C,0xC9,0x24,0xFD,0x2F,0x75,0xBB,0x3A,
-    0x15,0x82,0x76,0x4D,0xC2,0x8B,0x1E,0xB9,0x4B,0xA1,0x33,0xCF,
-    0xAA,0x3B,0x7C,0xC2,0x50,0x60,0x6F,0x45,0x69,0xD3,0x6B,0x88,
-    0x34,0x9B,0xE4,0xF8,0xC6,0xC7,0x5F,0x10,0xA1,0xBA,0x01,0x8C,
-    0xDA,0xD1,0xA3,0x59,0x9C,0x97,0xEA,0xC3,0xF6,0x02,0x55,0x5C,
-    0x92,0x1A,0x39,0x67,0x17,0xE2,0x9B,0x27,0x8D,0xE8,0x5C,0xE9,
-    0xA5,0x94,0xBB,0x7E,0x16,0x6F,0x53,0x5A,0x6D,0xD8,0x03,0xC2,
-    0xAC,0x7A,0xCD,0x22,0x98,0x8E,0x33,0x2A,0xDE,0xAB,0x12,0xC0,
-    0x0B,0x7C,0x0C,0x20,0x70,0xD9,0x0B,0xAE,0x0B,0x2F,0x20,0x9B,
-    0xA4,0xED,0xFD,0x49,0x0B,0xE3,0x4A,0xF6,0x28,0xB3,0x98,0xB0,
-    0x23,0x1C,0x09,0x33,
-  };
-  static const unsigned char dh2048_g[]={
-    0x02,
-  };
-  DH *dh;
-
-  if ((dh=DH_new()) == NULL) return(NULL);
-  dh->p=BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL);
-  dh->g=BN_bin2bn(dh2048_g,sizeof(dh2048_g),NULL);
-  if ((dh->p == NULL) || (dh->g == NULL))
-    { DH_free(dh); return(NULL); }
-  return(dh);
-}
-
-typedef struct {
-  const char *id;
-  SSL_SESSION *session;
-} ssl_cache_visit_data;
-
-static void SSL_SESSION_cache_visitor(SSL_SESSION *session, ssl_cache_visit_data *data)
-{
-  const char *cached_id = (const char*)SSL_SESSION_get_ex_data(session, ssl_session_ex_data_index);
-  if (!cached_id) return;
-  
-  if ( strcmp(cached_id, data->id)==0 ) {
-    data->session = session;
-  }
-}
-
-static void SSL_SESSION_visit_caster(void *s, void * d) {
-    SSL_SESSION_cache_visitor((SSL_SESSION*) s, (ssl_cache_visit_data*) d);
-}
-
-static SSL_SESSION *ssn_cache_find( pn_ssl_domain_t *domain, const char *id )
-{
-  if (!id) return NULL;
-
-  ssl_cache_visit_data visitor = {id, NULL};
-  lh_SSL_SESSION_doall_arg(SSL_CTX_sessions(domain->ctx), &SSL_SESSION_visit_caster, ssl_cache_visit_data, &visitor);
-  return visitor.session;
-}
-
-// Set up/tear down ssl session ex data
-int ssl_session_ex_data_init(void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp) {
-  return CRYPTO_set_ex_data(ad, idx, NULL);
-}
-
-void ssl_session_ex_data_fini(void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp) {
-  free(CRYPTO_get_ex_data(ad, idx));
-}
-
-/** Public API - visible to application code */
-
-bool pn_ssl_present(void)
-{
-  return true;
-}
-
-pn_ssl_domain_t *pn_ssl_domain( pn_ssl_mode_t mode )
-{
-  if (!ssl_initialized) {
-    ssl_initialized = 1;
-    SSL_library_init();
-    SSL_load_error_strings();
-    OpenSSL_add_all_algorithms();
-    ssl_ex_data_index = SSL_get_ex_new_index( 0, (void *) "org.apache.qpid.proton.ssl",
-                                              NULL, NULL, NULL);
-    ssl_session_ex_data_index = SSL_SESSION_get_ex_new_index(0, (void *)"ssl session data",
-                                                             &ssl_session_ex_data_init, NULL, &ssl_session_ex_data_fini);
-  }
-
-  pn_ssl_domain_t *domain = (pn_ssl_domain_t *) calloc(1, sizeof(pn_ssl_domain_t));
-  if (!domain) return NULL;
-
-  domain->ref_count = 1;
-  domain->mode = mode;
-
-  // enable all supported protocol versions, then explicitly disable the
-  // known vulnerable ones.  This should allow us to use the latest version
-  // of the TLS standard that the installed library supports.
-  switch(mode) {
-  case PN_SSL_MODE_CLIENT:
-    domain->ctx = SSL_CTX_new(SSLv23_client_method()); // and TLSv1+
-    SSL_CTX_set_session_cache_mode(domain->ctx, SSL_SESS_CACHE_CLIENT);
-    if (!domain->ctx) {
-      ssl_log_error("Unable to initialize OpenSSL context.");
-      free(domain);
-      return NULL;
-    }
-    break;
-
-  case PN_SSL_MODE_SERVER:
-    domain->ctx = SSL_CTX_new(SSLv23_server_method()); // and TLSv1+
-    if (!domain->ctx) {
-      ssl_log_error("Unable to initialize OpenSSL context.");
-      free(domain);
-      return NULL;
-    }
-    break;
-
-  default:
-    pn_transport_logf(NULL, "Invalid value for pn_ssl_mode_t: %d", mode);
-    free(domain);
-    return NULL;
-  }
-  const long reject_insecure = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3;
-  SSL_CTX_set_options(domain->ctx, reject_insecure);
-#ifdef SSL_OP_NO_COMPRESSION
-  // Mitigate the CRIME vulnerability
-  SSL_CTX_set_options(domain->ctx, SSL_OP_NO_COMPRESSION);
-#endif
-
-  // by default, allow anonymous ciphers so certificates are not required 'out of the box'
-  if (!SSL_CTX_set_cipher_list( domain->ctx, CIPHERS_ANONYMOUS )) {
-    ssl_log_error("Failed to set cipher list to %s", CIPHERS_ANONYMOUS);
-    pn_ssl_domain_free(domain);
-    return NULL;
-  }
-
-  // ditto: by default do not authenticate the peer (can be done by SASL).
-  if (pn_ssl_domain_set_peer_authentication( domain, PN_SSL_ANONYMOUS_PEER, NULL )) {
-    pn_ssl_domain_free(domain);
-    return NULL;
-  }
-
-  DH *dh = get_dh2048();
-  if (dh) {
-    SSL_CTX_set_tmp_dh(domain->ctx, dh);
-    DH_free(dh);
-    SSL_CTX_set_options(domain->ctx, SSL_OP_SINGLE_DH_USE);
-  }
-
-  return domain;
-}
-
-void pn_ssl_domain_free( pn_ssl_domain_t *domain )
-{
-  if (--domain->ref_count == 0) {
-
-    if (domain->ctx) SSL_CTX_free(domain->ctx);
-    if (domain->keyfile_pw) free(domain->keyfile_pw);
-    if (domain->trusted_CAs) free(domain->trusted_CAs);
-    free(domain);
-  }
-}
-
-
-int pn_ssl_domain_set_credentials( pn_ssl_domain_t *domain,
-                               const char *certificate_file,
-                               const char *private_key_file,
-                               const char *password)
-{
-  if (!domain || !domain->ctx) return -1;
-
-  if (SSL_CTX_use_certificate_chain_file(domain->ctx, certificate_file) != 1) {
-    ssl_log_error("SSL_CTX_use_certificate_chain_file( %s ) failed", certificate_file);
-    return -3;
-  }
-
-  if (password) {
-    domain->keyfile_pw = pn_strdup(password);  // @todo: obfuscate me!!!
-    SSL_CTX_set_default_passwd_cb(domain->ctx, keyfile_pw_cb);
-    SSL_CTX_set_default_passwd_cb_userdata(domain->ctx, domain->keyfile_pw);
-  }
-
-  if (SSL_CTX_use_PrivateKey_file(domain->ctx, private_key_file, SSL_FILETYPE_PEM) != 1) {
-    ssl_log_error("SSL_CTX_use_PrivateKey_file( %s ) failed", private_key_file);
-    return -4;
-  }
-
-  if (SSL_CTX_check_private_key(domain->ctx) != 1) {
-    ssl_log_error("The key file %s is not consistent with the certificate %s",
-                   private_key_file, certificate_file);
-    return -5;
-  }
-
-  domain->has_certificate = true;
-
-  // bug in older versions of OpenSSL: servers may request client cert even if anonymous
-  // cipher was negotiated.  TLSv1 will reject such a request.  Hack: once a cert is
-  // configured, allow only authenticated ciphers.
-  if (!SSL_CTX_set_cipher_list( domain->ctx, CIPHERS_AUTHENTICATE )) {
-      ssl_log_error("Failed to set cipher list to %s", CIPHERS_AUTHENTICATE);
-      return -6;
-  }
-
-  return 0;
-}
-
-
-int pn_ssl_domain_set_trusted_ca_db(pn_ssl_domain_t *domain,
-                                    const char *certificate_db)
-{
-  if (!domain) return -1;
-
-  // certificates can be either a file or a directory, which determines how it is passed
-  // to SSL_CTX_load_verify_locations()
-  struct stat sbuf;
-  if (stat( certificate_db, &sbuf ) != 0) {
-    pn_transport_logf(NULL, "stat(%s) failed: %s", certificate_db, strerror(errno));
-    return -1;
-  }
-
-  const char *file;
-  const char *dir;
-  if (S_ISDIR(sbuf.st_mode)) {
-    dir = certificate_db;
-    file = NULL;
-  } else {
-    dir = NULL;
-    file = certificate_db;
-  }
-
-  if (SSL_CTX_load_verify_locations( domain->ctx, file, dir ) != 1) {
-    ssl_log_error("SSL_CTX_load_verify_locations( %s ) failed", certificate_db);
-    return -1;
-  }
-
-  domain->has_ca_db = true;
-
-  return 0;
-}
-
-
-int pn_ssl_domain_set_peer_authentication(pn_ssl_domain_t *domain,
-                                          const pn_ssl_verify_mode_t mode,
-                                          const char *trusted_CAs)
-{
-  if (!domain) return -1;
-
-  switch (mode) {
-  case PN_SSL_VERIFY_PEER:
-  case PN_SSL_VERIFY_PEER_NAME:
-
-    if (!domain->has_ca_db) {
-      pn_transport_logf(NULL, "Error: cannot verify peer without a trusted CA configured.\n"
-                 "       Use pn_ssl_domain_set_trusted_ca_db()");
-      return -1;
-    }
-
-    if (domain->mode == PN_SSL_MODE_SERVER) {
-      // openssl requires that server connections supply a list of trusted CAs which is
-      // sent to the client
-      if (!trusted_CAs) {
-        pn_transport_logf(NULL, "Error: a list of trusted CAs must be provided.");
-        return -1;
-      }
-      if (!domain->has_certificate) {
-        pn_transport_logf(NULL, "Error: Server cannot verify peer without configuring a certificate.\n"
-                   "       Use pn_ssl_domain_set_credentials()");
-      }
-
-      if (domain->trusted_CAs) free(domain->trusted_CAs);
-      domain->trusted_CAs = pn_strdup( trusted_CAs );
-      STACK_OF(X509_NAME) *cert_names;
-      cert_names = SSL_load_client_CA_file( domain->trusted_CAs );
-      if (cert_names != NULL)
-        SSL_CTX_set_client_CA_list(domain->ctx, cert_names);
-      else {
-        pn_transport_logf(NULL, "Error: Unable to process file of trusted CAs: %s", trusted_CAs);
-        return -1;
-      }
-    }
-
-    SSL_CTX_set_verify( domain->ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
-                        verify_callback);
-#if (OPENSSL_VERSION_NUMBER < 0x00905100L)
-    SSL_CTX_set_verify_depth(domain->ctx, 1);
-#endif
-    break;
-
-  case PN_SSL_ANONYMOUS_PEER:   // hippie free love mode... :)
-    SSL_CTX_set_verify( domain->ctx, SSL_VERIFY_NONE, NULL );
-    break;
-
-  default:
-    pn_transport_logf(NULL, "Invalid peer authentication mode given." );
-    return -1;
-  }
-
-  domain->verify_mode = mode;
-  return 0;
-}
-
-const pn_io_layer_t ssl_layer = {
-    process_input_ssl,
-    process_output_ssl,
-    handle_error_ssl,
-    NULL,
-    buffered_output
-};
-
-const pn_io_layer_t ssl_input_closed_layer = {
-    process_input_done,
-    process_output_ssl,
-    handle_error_ssl,
-    NULL,
-    buffered_output
-};
-
-const pn_io_layer_t ssl_output_closed_layer = {
-    process_input_ssl,
-    process_output_done,
-    handle_error_ssl,
-    NULL,
-    buffered_output
-};
-
-const pn_io_layer_t ssl_closed_layer = {
-    process_input_done,
-    process_output_done,
-    handle_error_ssl,
-    NULL,
-    buffered_output
-};
-
-int pn_ssl_init(pn_ssl_t *ssl0, pn_ssl_domain_t *domain, const char *session_id)
-{
-  pn_transport_t *transport = get_transport_internal(ssl0);
-  pni_ssl_t *ssl = transport->ssl;
-  if (!ssl || !domain || ssl->domain) return -1;
-
-  ssl->domain = domain;
-  domain->ref_count++;
-  if (session_id && domain->mode == PN_SSL_MODE_CLIENT)
-    ssl->session_id = pn_strdup(session_id);
-
-  // If SSL doesn't specifically allow skipping encryption, require SSL
-  // TODO: This is a probably a stop-gap until allow_unsecured is removed
-  if (!domain->allow_unsecured) transport->encryption_required = true;
-
-  return init_ssl_socket(transport, ssl);
-}
-
-
-int pn_ssl_domain_allow_unsecured_client(pn_ssl_domain_t *domain)
-{
-  if (!domain) return -1;
-  if (domain->mode != PN_SSL_MODE_SERVER) {
-    pn_transport_logf(NULL, "Cannot permit unsecured clients - not a server.");
-    return -1;
-  }
-  domain->allow_unsecured = true;
-  return 0;
-}
-
-int pn_ssl_get_ssf(pn_ssl_t *ssl0)
-{
-  const SSL_CIPHER *c;
-
-  pni_ssl_t *ssl = get_ssl_internal(ssl0);
-  if (ssl && ssl->ssl && (c = SSL_get_current_cipher( ssl->ssl ))) {
-    return SSL_CIPHER_get_bits(c, NULL);
-  }
-  return 0;
-}
-
-bool pn_ssl_get_cipher_name(pn_ssl_t *ssl0, char *buffer, size_t size )
-{
-  const SSL_CIPHER *c;
-
-  pni_ssl_t *ssl = get_ssl_internal(ssl0);
-  *buffer = '\0';
-  if (ssl->ssl && (c = SSL_get_current_cipher( ssl->ssl ))) {
-    const char *v = SSL_CIPHER_get_name(c);
-    if (v) {
-      pni_snprintf( buffer, size, "%s", v );
-      return true;
-    }
-  }
-  return false;
-}
-
-bool pn_ssl_get_protocol_name(pn_ssl_t *ssl0, char *buffer, size_t size )
-{
-  const SSL_CIPHER *c;
-
-  pni_ssl_t *ssl = get_ssl_internal(ssl0);
-  *buffer = '\0';
-  if (ssl->ssl && (c = SSL_get_current_cipher( ssl->ssl ))) {
-    const char *v = SSL_CIPHER_get_version(c);
-    if (v) {
-      pni_snprintf( buffer, size, "%s", v );
-      return true;
-    }
-  }
-  return false;
-}
-
-
-void pn_ssl_free(pn_transport_t *transport)
-{
-  pni_ssl_t *ssl = transport->ssl;
-  if (!ssl) return;
-  ssl_log(transport, "SSL socket freed." );
-  release_ssl_socket( ssl );
-  if (ssl->domain) pn_ssl_domain_free(ssl->domain);
-  if (ssl->session_id) free((void *)ssl->session_id);
-  if (ssl->peer_hostname) free((void *)ssl->peer_hostname);
-  if (ssl->inbuf) free((void *)ssl->inbuf);
-  if (ssl->outbuf) free((void *)ssl->outbuf);
-  if (ssl->subject) free(ssl->subject);
-  if (ssl->peer_certificate) X509_free(ssl->peer_certificate);
-  free(ssl);
-}
-
-pn_ssl_t *pn_ssl(pn_transport_t *transport)
-{
-  if (!transport) return NULL;
-  if (transport->ssl) return (pn_ssl_t *) transport;
-
-  pni_ssl_t *ssl = (pni_ssl_t *) calloc(1, sizeof(pni_ssl_t));
-  if (!ssl) return NULL;
-  ssl->out_size = APP_BUF_SIZE;
-  uint32_t max_frame = pn_transport_get_max_frame(transport);
-  ssl->in_size =  max_frame ? max_frame : APP_BUF_SIZE;
-  ssl->outbuf = (char *)malloc(ssl->out_size);
-  if (!ssl->outbuf) {
-    free(ssl);
-    return NULL;
-  }
-  ssl->inbuf =  (char *)malloc(ssl->in_size);
-  if (!ssl->inbuf) {
-    free(ssl->outbuf);
-    free(ssl);
-    return NULL;
-  }
-
-  transport->ssl = ssl;
-
-  // Set up hostname from any bound connection
-  if (transport->connection) {
-    if (pn_string_size(transport->connection->hostname)) {
-      pn_ssl_set_peer_hostname((pn_ssl_t *) transport, pn_string_get(transport->connection->hostname));
-    }
-  }
-
-  return (pn_ssl_t *) transport;
-}
-
-
-/** Private: */
-
-static int keyfile_pw_cb(char *buf, int size, int rwflag, void *userdata)
-{
-    strncpy(buf, (char *)userdata, size);   // @todo: un-obfuscate me!!!
-    buf[size - 1] = '\0';
-    return(strlen(buf));
-}
-
-
-static int start_ssl_shutdown(pn_transport_t *transport)
-{
-  pni_ssl_t *ssl = transport->ssl;
-  if (!ssl->ssl_shutdown) {
-    ssl_log(transport, "Shutting down SSL connection...");
-    if (ssl->session_id) {
-      // Attach the session id to the session before we close the connection
-      // So that if we find it in the cache later we can figure out the session id
-      char *id = pn_strdup( ssl->session_id ); 
-      SSL_SESSION *session = SSL_get_session( ssl->ssl );
-      if (session) {
-        ssl_log(transport, "Saving SSL session as %s", ssl->session_id );
-        SSL_SESSION_set_ex_data(session, ssl_session_ex_data_index, id);
-      }
-    }
-    ssl->ssl_shutdown = true;
-    BIO_ssl_shutdown( ssl->bio_ssl );
-  }
-  return 0;
-}
-
-
-//////// SSL Connections
-
-
-// take data from the network, and pass it into SSL.  Attempt to read decrypted data from
-// SSL socket and pass it to the application.
-static ssize_t process_input_ssl( pn_transport_t *transport, unsigned int layer, const char *input_data, size_t available)
-{
-  pni_ssl_t *ssl = transport->ssl;
-  if (ssl->ssl == NULL && init_ssl_socket(transport, ssl)) return PN_EOS;
-
-  ssl_log( transport, "process_input_ssl( data size=%d )",available );
-
-  ssize_t consumed = 0;
-  bool work_pending;
-  bool shutdown_input = (available == 0);  // caller is closed
-
-  do {
-    work_pending = false;
-
-    // Write to network bio as much as possible, consuming bytes/available
-
-    if (available > 0) {
-      int written = BIO_write( ssl->bio_net_io, input_data, available );
-      if (written > 0) {
-        input_data += written;
-        available -= written;
-        consumed += written;
-        ssl->read_blocked = false;
-        work_pending = (available > 0);
-        ssl_log( transport, "Wrote %d bytes to BIO Layer, %d left over", written, available );
-      }
-    } else if (shutdown_input) {
-      // lower layer (caller) has closed.  Close the WRITE side of the BIO.  This will cause
-      // an EOF to be passed to SSL once all pending inbound data has been consumed.
-      ssl_log( transport, "Lower layer closed - shutting down BIO write side");
-      (void)BIO_shutdown_wr( ssl->bio_net_io );
-      shutdown_input = false;
-    }
-
-    // Read all available data from the SSL socket
-
-    if (!ssl->ssl_closed && ssl->in_count < ssl->in_size) {
-      int read = BIO_read( ssl->bio_ssl, &ssl->inbuf[ssl->in_count], ssl->in_size - ssl->in_count );
-      if (read > 0) {
-        ssl_log( transport, "Read %d bytes from SSL socket for app", read );
-        ssl_log_clear_data(transport, &ssl->inbuf[ssl->in_count], read );
-        ssl->in_count += read;
-        work_pending = true;
-      } else {
-        if (!BIO_should_retry(ssl->bio_ssl)) {
-          int reason = SSL_get_error( ssl->ssl, read );
-          switch (reason) {
-          case SSL_ERROR_ZERO_RETURN:
-            // SSL closed cleanly
-            ssl_log(transport, "SSL connection has closed");
-            start_ssl_shutdown(transport);  // KAG: not sure - this may not be necessary
-            ssl->ssl_closed = true;
-            break;
-          default:
-            // unexpected error
-            return (ssize_t)ssl_failed(transport);
-          }
-        } else {
-          if (BIO_should_write( ssl->bio_ssl )) {
-            ssl->write_blocked = true;
-            ssl_log(transport, "Detected write-blocked");
-          }
-          if (BIO_should_read( ssl->bio_ssl )) {
-            ssl->read_blocked = true;
-            ssl_log(transport, "Detected read-blocked");
-          }
-        }
-      }
-    }
-
-    // write incoming data to app layer
-
-    if (!ssl->app_input_closed) {
-      if (ssl->in_count > 0 || ssl->ssl_closed) {  /* if ssl_closed, send 0 count */
-        ssize_t consumed = transport->io_layers[layer+1]->process_input(transport, layer+1, ssl->inbuf, ssl->in_count);
-        if (consumed > 0) {
-          ssl->in_count -= consumed;
-          if (ssl->in_count)
-            memmove( ssl->inbuf, ssl->inbuf + consumed, ssl->in_count );
-          work_pending = true;
-          ssl_log( transport, "Application consumed %d bytes from peer", (int) consumed );
-        } else if (consumed < 0) {
-          ssl_log(transport, "Application layer closed its input, error=%d (discarding %d bytes)",
-               (int) consumed, (int)ssl->in_count);
-          ssl->in_count = 0;    // discard any pending input
-          ssl->app_input_closed = consumed;
-          if (ssl->app_output_closed && ssl->out_count == 0) {
-            // both sides of app closed, and no more app output pending:
-            start_ssl_shutdown(transport);
-          }
-        } else {
-          // app did not consume any bytes, must be waiting for a full frame
-          if (ssl->in_count == ssl->in_size) {
-            // but the buffer is full, not enough room for a full frame.
-            // can we grow the buffer?
-            uint32_t max_frame = pn_transport_get_max_frame(transport);
-            if (!max_frame) max_frame = ssl->in_size * 2;  // no limit
-            if (ssl->in_size < max_frame) {
-              // no max frame limit - grow it.
-              size_t newsize = pn_min(max_frame, ssl->in_size * 2);
-              char *newbuf = (char *)realloc( ssl->inbuf, newsize );
-              if (newbuf) {
-                ssl->in_size = newsize;
-                ssl->inbuf = newbuf;
-                work_pending = true;  // can we get more input?
-              }
-            } else {
-              // can't gather any more input, but app needs more?
-              // This is a bug - since SSL can buffer up to max-frame,
-              // the application _must_ have enough data to process.  If
-              // this is an oversized frame, the app _must_ handle it
-              // by returning an error code to SSL.
-              pn_transport_log(transport, "Error: application unable to consume input.");
-            }
-          }
-        }
-      }
-    }
-
-  } while (work_pending);
-
-  //_log(ssl, "ssl_closed=%d in_count=%d app_input_closed=%d app_output_closed=%d",
-  //     ssl->ssl_closed, ssl->in_count, ssl->app_input_closed, ssl->app_output_closed );
-
-  // PROTON-82: Instead, close the input side as soon as we've completed enough of the SSL
-  // shutdown handshake to send the close_notify.  We're not requiring the response, as
-  // some implementations never reply.
-  // ---
-  // tell transport our input side is closed if the SSL socket cannot be read from any
-  // longer, AND any pending input has been written up to the application (or the
-  // application is closed)
-  //if (ssl->ssl_closed && ssl->app_input_closed) {
-  //  consumed = ssl->app_input_closed;
-  //}
-  if (ssl->app_input_closed && (SSL_get_shutdown(ssl->ssl) & SSL_SENT_SHUTDOWN) ) {
-    consumed = ssl->app_input_closed;
-    if (transport->io_layers[layer]==&ssl_output_closed_layer) {
-      transport->io_layers[layer] = &ssl_closed_layer;
-    } else {
-      transport->io_layers[layer] = &ssl_input_closed_layer;
-    }
-  }
-  ssl_log(transport, "process_input_ssl() returning %d", (int) consumed);
-  return consumed;
-}
-
-static void handle_error_ssl(pn_transport_t *transport, unsigned int layer)
-{
-  transport->io_layers[layer] = &ssl_closed_layer;
-}
-
-static ssize_t process_output_ssl( pn_transport_t *transport, unsigned int layer, char *buffer, size_t max_len)
-{
-  pni_ssl_t *ssl = transport->ssl;
-  if (!ssl) return PN_EOS;
-  if (ssl->ssl == NULL && init_ssl_socket(transport, ssl)) return PN_EOS;
-
-  ssize_t written = 0;
-  bool work_pending;
-
-  do {
-    work_pending = false;
-    // first, get any pending application output, if possible
-
-    if (!ssl->app_output_closed && ssl->out_count < ssl->out_size) {
-      ssize_t app_bytes = transport->io_layers[layer+1]->process_output(transport, layer+1, &ssl->outbuf[ssl->out_count], ssl->out_size - ssl->out_count);
-      if (app_bytes > 0) {
-        ssl->out_count += app_bytes;
-        work_pending = true;
-        ssl_log(transport, "Gathered %d bytes from app to send to peer", app_bytes );
-      } else {
-        if (app_bytes < 0) {
-          ssl_log(transport, "Application layer closed its output, error=%d (%d bytes pending send)",
-               (int) app_bytes, (int) ssl->out_count);
-          ssl->app_output_closed = app_bytes;
-        }
-      }
-    }
-
-    // now push any pending app data into the socket
-
-    if (!ssl->ssl_closed) {
-      char *data = ssl->outbuf;
-      if (ssl->out_count > 0) {
-        int wrote = BIO_write( ssl->bio_ssl, data, ssl->out_count );
-        if (wrote > 0) {
-          data += wrote;
-          ssl->out_count -= wrote;
-          work_pending = true;
-          ssl_log( transport, "Wrote %d bytes from app to socket", wrote );
-        } else {
-          if (!BIO_should_retry(ssl->bio_ssl)) {
-            int reason = SSL_get_error( ssl->ssl, wrote );
-            switch (reason) {
-            case SSL_ERROR_ZERO_RETURN:
-              // SSL closed cleanly
-              ssl_log(transport, "SSL connection has closed");
-              start_ssl_shutdown(transport); // KAG: not sure - this may not be necessary
-              ssl->out_count = 0;      // can no longer write to socket, so erase app output data
-              ssl->ssl_closed = true;
-              break;
-            default:
-              // unexpected error
-              return (ssize_t)ssl_failed(transport);
-            }
-          } else {
-            if (BIO_should_read( ssl->bio_ssl )) {
-              ssl->read_blocked = true;
-              ssl_log(transport, "Detected read-blocked");
-            }
-            if (BIO_should_write( ssl->bio_ssl )) {
-              ssl->write_blocked = true;
-              ssl_log(transport, "Detected write-blocked");
-            }
-          }
-        }
-      }
-
-      if (ssl->out_count == 0) {
-        if (ssl->app_input_closed && ssl->app_output_closed) {
-          // application is done sending/receiving data, and all buffered output data has
-          // been written to the SSL socket
-          start_ssl_shutdown(transport);
-        }
-      } else if (data != ssl->outbuf) {
-        memmove( ssl->outbuf, data, ssl->out_count );
-      }
-    }
-
-    // read from the network bio as much as possible, filling the buffer
-    if (max_len) {
-      int available = BIO_read( ssl->bio_net_io, buffer, max_len );
-      if (available > 0) {
-        max_len -= available;
-        buffer += available;
-        written += available;
-        ssl->write_blocked = false;
-        work_pending = work_pending || max_len > 0;
-        ssl_log(transport, "Read %d bytes from BIO Layer", available );
-      }
-    }
-
-  } while (work_pending);
-
-  //_log(ssl, "written=%d ssl_closed=%d in_count=%d app_input_closed=%d app_output_closed=%d bio_pend=%d",
-  //     written, ssl->ssl_closed, ssl->in_count, ssl->app_input_closed, ssl->app_output_closed, BIO_pending(ssl->bio_net_io) );
-
-  // PROTON-82: close the output side as soon as we've sent the SSL close_notify.
-  // We're not requiring the response, as some implementations never reply.
-  // ----
-  // Once no more data is available "below" the SSL socket, tell the transport we are
-  // done.
-  //if (written == 0 && ssl->ssl_closed && BIO_pending(ssl->bio_net_io) == 0) {
-  //  written = ssl->app_output_closed ? ssl->app_output_closed : PN_EOS;
-  //}
-  if (written == 0 && (SSL_get_shutdown(ssl->ssl) & SSL_SENT_SHUTDOWN) && BIO_pending(ssl->bio_net_io) == 0) {
-    written = ssl->app_output_closed ? ssl->app_output_closed : PN_EOS;
-    if (transport->io_layers[layer]==&ssl_input_closed_layer) {
-      transport->io_layers[layer] = &ssl_closed_layer;
-    } else {
-      transport->io_layers[layer] = &ssl_output_closed_layer;
-    }
-  }
-  ssl_log(transport, "process_output_ssl() returning %d", (int) written);
-  return written;
-}
-
-static int init_ssl_socket(pn_transport_t* transport, pni_ssl_t *ssl)
-{
-  if (ssl->ssl) return 0;
-  if (!ssl->domain) return -1;
-
-  ssl->ssl = SSL_new(ssl->domain->ctx);
-  if (!ssl->ssl) {
-    pn_transport_logf(transport, "SSL socket setup failure." );
-    return -1;
-  }
-
-  // store backpointer to pn_transport_t in SSL object:
-  SSL_set_ex_data(ssl->ssl, ssl_ex_data_index, transport);
-
-#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
-  if (ssl->peer_hostname && ssl->domain->mode == PN_SSL_MODE_CLIENT) {
-    SSL_set_tlsext_host_name(ssl->ssl, ssl->peer_hostname);
-  }
-#endif
-
-  // restore session, if available
-  if (ssl->session_id) {
-    SSL_SESSION *ssn = ssn_cache_find( ssl->domain, ssl->session_id );
-    if (ssn) {
-      ssl_log( transport, "Restoring previous session id=%s", ssl->session_id );
-      int rc = SSL_set_session( ssl->ssl, ssn );
-      if (rc != 1) {
-        ssl_log( transport, "Session restore failed, id=%s", ssl->session_id );
-      }
-    }
-  }
-
-  // now layer a BIO over the SSL socket
-  ssl->bio_ssl = BIO_new(BIO_f_ssl());
-  if (!ssl->bio_ssl) {
-    pn_transport_log(transport, "BIO setup failure." );
-    return -1;
-  }
-  (void)BIO_set_ssl(ssl->bio_ssl, ssl->ssl, BIO_NOCLOSE);
-
-  // create the "lower" BIO "pipe", and attach it below the SSL layer
-  if (!BIO_new_bio_pair(&ssl->bio_ssl_io, 0, &ssl->bio_net_io, 0)) {
-    pn_transport_log(transport, "BIO setup failure." );
-    return -1;
-  }
-  SSL_set_bio(ssl->ssl, ssl->bio_ssl_io, ssl->bio_ssl_io);
-
-  if (ssl->domain->mode == PN_SSL_MODE_SERVER) {
-    SSL_set_accept_state(ssl->ssl);
-    BIO_set_ssl_mode(ssl->bio_ssl, 0);  // server mode
-    ssl_log( transport, "Server SSL socket created." );
-  } else {      // client mode
-    SSL_set_connect_state(ssl->ssl);
-    BIO_set_ssl_mode(ssl->bio_ssl, 1);  // client mode
-    ssl_log( transport, "Client SSL socket created." );
-  }
-  ssl->subject = NULL;
-  ssl->peer_certificate = NULL;
-  return 0;
-}
-
-static void release_ssl_socket(pni_ssl_t *ssl)
-{
-  if (ssl->bio_ssl) BIO_free(ssl->bio_ssl);
-  if (ssl->ssl) {
-      SSL_free(ssl->ssl);       // will free bio_ssl_io
-  } else {
-    if (ssl->bio_ssl_io) BIO_free(ssl->bio_ssl_io);
-  }
-  if (ssl->bio_net_io) BIO_free(ssl->bio_net_io);
-  ssl->bio_ssl = NULL;
-  ssl->bio_ssl_io = NULL;
-  ssl->bio_net_io = NULL;
-  ssl->ssl = NULL;
-}
-
-
-
-pn_ssl_resume_status_t pn_ssl_resume_status(pn_ssl_t *ssl0)
-{
-  pni_ssl_t *ssl = get_ssl_internal(ssl0);
-  if (!ssl || !ssl->ssl) return PN_SSL_RESUME_UNKNOWN;
-  switch (SSL_session_reused( ssl->ssl )) {
-  case 0: return PN_SSL_RESUME_NEW;
-  case 1: return PN_SSL_RESUME_REUSED;
-  default: break;
-  }
-  return PN_SSL_RESUME_UNKNOWN;
-}
-
-
-int pn_ssl_set_peer_hostname(pn_ssl_t *ssl0, const char *hostname)
-{
-  pni_ssl_t *ssl = get_ssl_internal(ssl0);
-  if (!ssl) return -1;
-
-  if (ssl->peer_hostname) free((void *)ssl->peer_hostname);
-  ssl->peer_hostname = NULL;
-  if (hostname) {
-    ssl->peer_hostname = pn_strdup(hostname);
-    if (!ssl->peer_hostname) return -2;
-#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
-    if (ssl->ssl && ssl->domain && ssl->domain->mode == PN_SSL_MODE_CLIENT) {
-      SSL_set_tlsext_host_name(ssl->ssl, ssl->peer_hostname);
-    }
-#endif
-  }
-  return 0;
-}
-
-int pn_ssl_get_peer_hostname(pn_ssl_t *ssl0, char *hostname, size_t *bufsize)
-{
-  pni_ssl_t *ssl = get_ssl_internal(ssl0);
-  if (!ssl) return -1;
-  if (!ssl->peer_hostname) {
-    *bufsize = 0;
-    if (hostname) *hostname = '\0';
-    return 0;
-  }
-  unsigned len = strlen(ssl->peer_hostname);
-  if (hostname) {
-    if (len >= *bufsize) return -1;
-    strcpy( hostname, ssl->peer_hostname );
-  }
-  *bufsize = len;
-  return 0;
-}
-
-static X509 *get_peer_certificate(pni_ssl_t *ssl)
-{
-  // Cache for multiple use and final X509_free
-  if (!ssl->peer_certificate && ssl->ssl) {
-    ssl->peer_certificate = SSL_get_peer_certificate(ssl->ssl);
-    // May still be NULL depending on timing or type of SSL connection
-  }
-  return ssl->peer_certificate;
-}
-
-const char* pn_ssl_get_remote_subject(pn_ssl_t *ssl0)
-{
-  pni_ssl_t *ssl = get_ssl_internal(ssl0);
-  if (!ssl || !ssl->ssl) return NULL;
-  if (!ssl->subject) {
-    X509 *cert = get_peer_certificate(ssl);
-    if (!cert) return NULL;
-    X509_NAME *subject = X509_get_subject_name(cert);
-    if (!subject) return NULL;
-
-    BIO *out = BIO_new(BIO_s_mem());
-    X509_NAME_print_ex(out, subject, 0, XN_FLAG_RFC2253);
-    int len = BIO_number_written(out);
-    ssl->subject = (char*) malloc(len+1);
-    ssl->subject[len] = 0;
-    BIO_read(out, ssl->subject, len);
-    BIO_free(out);
-  }
-  return ssl->subject;
-}
-
-int pn_ssl_get_cert_fingerprint(pn_ssl_t *ssl0, char *fingerprint, size_t fingerprint_length, pn_ssl_hash_alg hash_alg)
-{
-    const char *digest_name = NULL;
-    size_t min_required_length;
-
-    // old versions of python expect fingerprint to contain a valid string on
-    // return from this function
-    fingerprint[0] = 0;
-
-    // Assign the correct digest_name value based on the enum values.
-    switch (hash_alg) {
-        case PN_SSL_SHA1 :
-            min_required_length = 41; // 40 hex characters + 1 '\0' character
-            digest_name = "sha1";
-            break;
-        case PN_SSL_SHA256 :
-            min_required_length = 65; // 64 hex characters + 1 '\0' character
-            digest_name = "sha256";
-            break;
-        case PN_SSL_SHA512 :
-            min_required_length = 129; // 128 hex characters + 1 '\0' character
-            digest_name = "sha512";
-            break;
-        case PN_SSL_MD5 :
-            min_required_length = 33; // 32 hex characters + 1 '\0' character
-            digest_name = "md5";
-            break;
-        default:
-            ssl_log_error("Unknown or unhandled hash algorithm %i \n", hash_alg);
-            return PN_ERR;
-
-    }
-
-    if(fingerprint_length < min_required_length) {
-        ssl_log_error("Insufficient fingerprint_length %i. fingerprint_length must be %i or above for %s digest\n",
-            fingerprint_length, min_required_length, digest_name);
-        return PN_ERR;
-    }
-
-    const EVP_MD  *digest = EVP_get_digestbyname(digest_name);
-
-    pni_ssl_t *ssl = get_ssl_internal(ssl0);
-
-    X509 *cert = get_peer_certificate(ssl);
-
-    if(cert) {
-        unsigned int len;
-
-        unsigned char bytes[64]; // sha512 uses 64 octets, we will use that as the maximum.
-
-        if (X509_digest(cert, digest, bytes, &len) != 1) {
-            ssl_log_error("Failed to extract X509 digest\n");
-            return PN_ERR;
-       }
-
-        char *cursor = fingerprint;
-
-        for (size_t i=0; i<len ; i++) {
-            cursor +=  pni_snprintf((char *)cursor, fingerprint_length, "%02x", bytes[i]);
-            fingerprint_length = fingerprint_length - 2;
-        }
-
-        return PN_OK;
-    }
-    else {
-        ssl_log_error("No certificate is available yet \n");
-        return PN_ERR;
-    }
-
-    return 0;
-}
-
-
-const char* pn_ssl_get_remote_subject_subfield(pn_ssl_t *ssl0, pn_ssl_cert_subject_subfield field)
-{
-    int openssl_field = 0;
-
-    // Assign openssl internal representations of field values to openssl_field
-    switch (field) {
-        case PN_SSL_CERT_SUBJECT_COUNTRY_NAME :
-            openssl_field = NID_countryName;
-            break;
-        case PN_SSL_CERT_SUBJECT_STATE_OR_PROVINCE :
-            openssl_field = NID_stateOrProvinceName;
-            break;
-        case PN_SSL_CERT_SUBJECT_CITY_OR_LOCALITY :
-            openssl_field = NID_localityName;
-            break;
-        case PN_SSL_CERT_SUBJECT_ORGANIZATION_NAME :
-            openssl_field = NID_organizationName;
-            break;
-        case PN_SSL_CERT_SUBJECT_ORGANIZATION_UNIT :
-            openssl_field = NID_organizationalUnitName;
-            break;
-        case PN_SSL_CERT_SUBJECT_COMMON_NAME :
-            openssl_field = NID_commonName;
-            break;
-        default:
-            ssl_log_error("Unknown or unhandled certificate subject subfield %i \n", field);
-            return NULL;
-    }
-
-    pni_ssl_t *ssl = get_ssl_internal(ssl0);
-    X509 *cert = get_peer_certificate(ssl);
-
-    X509_NAME *subject_name = X509_get_subject_name(cert);
-
-    // TODO (gmurthy) - A server side cert subject field can have more than one common name like this - Subject: CN=www.domain1.com, CN=www.domain2.com, see https://bugzilla.mozilla.org/show_bug.cgi?id=380656
-    // For now, we will only return the first common name if there is more than one common name in the cert
-    int index = X509_NAME_get_index_by_NID(subject_name, openssl_field, -1);
-
-    if (index > -1) {
-        X509_NAME_ENTRY *ne = X509_NAME_get_entry(subject_name, index);
-        if(ne) {
-            ASN1_STRING *name_asn1 = X509_NAME_ENTRY_get_data(ne);
-            return (char *) name_asn1->data;
-        }
-    }
-
-    return NULL;
-}
-
-static ssize_t process_input_done(pn_transport_t *transport, unsigned int layer, const char *input_data, size_t len)
-{
-  return PN_EOS;
-}
-static ssize_t process_output_done(pn_transport_t *transport, unsigned int layer, char *input_data, size_t len)
-{
-  return PN_EOS;
-}
-
-// return # output bytes sitting in this layer
-static size_t buffered_output(pn_transport_t *transport)
-{
-  size_t count = 0;
-  pni_ssl_t *ssl = transport->ssl;
-  if (ssl) {
-    count += ssl->out_count;
-    if (ssl->bio_net_io) { // pick up any bytes waiting for network io
-      count += BIO_ctrl_pending(ssl->bio_net_io);
-    }
-  }
-  return count;
-}
diff --git a/proton-c/src/ssl/schannel.c b/proton-c/src/ssl/schannel.c
deleted file mode 100644
index 420e7c5..0000000
--- a/proton-c/src/ssl/schannel.c
+++ /dev/null
@@ -1,2239 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*
- * SChannel is designed to encrypt and decrypt data in place.  So a
- * given buffer is expected to sometimes contain encrypted data,
- * sometimes decrypted data, and occasionally both.  Outgoing buffers
- * need to reserve space for the TLS header and trailer.  Read
- * operations need to ignore the same headers and trailers from
- * incoming buffers.  Outgoing is simple because we choose record
- * boundaries.  Incoming is complicated by handling incomplete TLS
- * records, and buffering contiguous data for the app layer that may
- * span many records.  A lazy double buffering system is used for
- * the latter.
- */
-
-#include <proton/ssl.h>
-#include <proton/engine.h>
-#include "core/engine-internal.h"
-#include "platform/platform.h"
-#include "core/util.h"
-#include "core/autodetect.h"
-
-#include <assert.h>
-
-// security.h needs to see this to distinguish from kernel use.
-#include <windows.h>
-#define SECURITY_WIN32
-#include <security.h>
-#include <Schnlsp.h>
-#include <WinInet.h>
-#undef SECURITY_WIN32
-
-
-/** @file
- * SSL/TLS support API.
- *
- * This file contains an SChannel-based implemention of the SSL/TLS API for Windows platforms.
- */
-
-static void ssl_log_error(const char *fmt, ...);
-static void ssl_log(pn_transport_t *transport, const char *fmt, ...);
-static void ssl_log_error_status(HRESULT status, const char *fmt, ...);
-static HCERTSTORE open_cert_db(const char *store_name, const char *passwd, int *error);
-
-/*
- * win_credential_t: SChannel context that must accompany TLS connections.
- *
- * SChannel attempts session resumption for shared CredHandle objects.
- * To mimic openssl behavior, server CredHandle handles must be shared
- * by derived connections, client CredHandle handles must be unique
- * when app's session_id is null and tracked for reuse otherwise
- * (TODO).
- *
- * Ref counted by parent ssl_domain_t and each derived connection.
- */
-struct win_credential_t {
-  pn_ssl_mode_t mode;
-  PCCERT_CONTEXT cert_context;  // Particulars of the certificate (if any)
-  CredHandle cred_handle;       // Bound session parameters, certificate, CAs, verification_mode
-  HCERTSTORE trust_store;       // Store of root CAs for validating
-  HCERTSTORE server_CA_certs;   // CAs advertised by server (may be a duplicate of the trust_store)
-  char *trust_store_name;
-};
-
-#define win_credential_compare NULL
-#define win_credential_inspect NULL
-#define win_credential_hashcode NULL
-
-static void win_credential_initialize(void *object)
-{
-  win_credential_t *c = (win_credential_t *) object;
-  SecInvalidateHandle(&c->cred_handle);
-  c->cert_context = 0;
-  c->trust_store = 0;
-  c->server_CA_certs = 0;
-  c->trust_store_name = 0;
-}
-
-static void win_credential_finalize(void *object)
-{
-  win_credential_t *c = (win_credential_t *) object;
-  if (SecIsValidHandle(&c->cred_handle))
-    FreeCredentialsHandle(&c->cred_handle);
-  if (c->cert_context)
-    CertFreeCertificateContext(c->cert_context);
-  if (c->trust_store)
-    CertCloseStore(c->trust_store, 0);
-  if (c->server_CA_certs)
-    CertCloseStore(c->server_CA_certs, 0);
-  free(c->trust_store_name);
-}
-
-static win_credential_t *win_credential(pn_ssl_mode_t m)
-{
-  static const pn_cid_t CID_win_credential = CID_pn_void;
-  static const pn_class_t clazz = PN_CLASS(win_credential);
-  win_credential_t *c = (win_credential_t *) pn_class_new(&clazz, sizeof(win_credential_t));
-  c->mode = m;
-  return c;
-}
-
-static int win_credential_load_cert(win_credential_t *cred, const char *store_name, const char *cert_name, const char *passwd)
-{
-  if (!store_name)
-    return -2;
-
-  int ec = 0;
-  HCERTSTORE cert_store = open_cert_db(store_name, passwd, &ec);
-  if (!cert_store)
-    return ec;
-
-  // find friendly name that matches cert_name, or sole certificate
-  PCCERT_CONTEXT tmpctx = NULL;
-  PCCERT_CONTEXT found_ctx = NULL;
-  int cert_count = 0;
-  int name_len = cert_name ? strlen(cert_name) : 0;
-  char *fn = name_len ? (char *) malloc(name_len + 1) : 0;
-  while (tmpctx = CertEnumCertificatesInStore(cert_store, tmpctx)) {
-    cert_count++;
-    if (cert_name) {
-      DWORD len = CertGetNameString(tmpctx, CERT_NAME_FRIENDLY_DISPLAY_TYPE,
-                                    0, NULL, NULL, 0);
-      if (len != name_len + 1)
-        continue;
-      CertGetNameString(tmpctx, CERT_NAME_FRIENDLY_DISPLAY_TYPE,
-                        0, NULL, fn, len);
-      if (!strcmp(cert_name, fn)) {
-        found_ctx = tmpctx;
-        tmpctx= NULL;
-        break;
-      }
-    } else {
-      // Test for single certificate
-      if (cert_count == 1) {
-        found_ctx = CertDuplicateCertificateContext(tmpctx);
-      } else {
-        ssl_log_error("Multiple certificates to choose from certificate store %s\n", store_name);
-        found_ctx = NULL;
-        break;
-      }
-    }
-  }
-
-  if (tmpctx) {
-    CertFreeCertificateContext(tmpctx);
-    tmpctx = false;
-  }
-  if (!found_ctx && cert_name && cert_count == 1)
-    ssl_log_error("Could not find certificate %s in store %s\n", cert_name, store_name);
-  cred->cert_context = found_ctx;
-
-  free(fn);
-  CertCloseStore(cert_store, 0);
-  return found_ctx ? 0 : -8;
-}
-
-
-static CredHandle win_credential_cred_handle(win_credential_t *cred, pn_ssl_verify_mode_t verify_mode,
-                                             const char *session_id, SECURITY_STATUS *status)
-{
-  if (cred->mode == PN_SSL_MODE_SERVER && SecIsValidHandle(&cred->cred_handle)) {
-    *status = SEC_E_OK;
-    return cred->cred_handle;  // Server always reuses cached value
-  }
-  // TODO: if (is_client && session_id != NULL) create or use cached value based on
-  // session_id+server_host_name (per domain? reclaimed after X hours?)
-
-  CredHandle tmp_handle;
-  SecInvalidateHandle(&tmp_handle);
-  TimeStamp expiry;  // Not used
-  SCHANNEL_CRED descriptor;
-  memset(&descriptor, 0, sizeof(descriptor));
-
-  descriptor.dwVersion = SCHANNEL_CRED_VERSION;
-  descriptor.dwFlags = SCH_CRED_NO_DEFAULT_CREDS | SCH_CRED_MANUAL_CRED_VALIDATION;
-  if (cred->cert_context != NULL) {
-    // assign the certificate into the credentials
-    descriptor.paCred = &cred->cert_context;
-    descriptor.cCreds = 1;
-  }
-
-  if (cred->mode == PN_SSL_MODE_SERVER) {
-    descriptor.dwFlags |= SCH_CRED_NO_SYSTEM_MAPPER;
-    if (cred->server_CA_certs) {
-      descriptor.hRootStore = cred->server_CA_certs;
-    }
-  }
-
-  ULONG direction = (cred->mode == PN_SSL_MODE_SERVER) ? SECPKG_CRED_INBOUND : SECPKG_CRED_OUTBOUND;
-  *status = AcquireCredentialsHandle(NULL, UNISP_NAME, direction, NULL,
-                                               &descriptor, NULL, NULL, &tmp_handle, &expiry);
-  if (cred->mode == PN_SSL_MODE_SERVER && *status == SEC_E_OK)
-    cred->cred_handle = tmp_handle;
-
-  return tmp_handle;
-}
-
-static bool win_credential_has_certificate(win_credential_t *cred)
-{
-  if (!cred) return false;
-  return (cred->cert_context != NULL);
-}
-
-#define SSL_DATA_SIZE 16384
-#define SSL_BUF_SIZE (SSL_DATA_SIZE + 5 + 2048 + 32)
-
-typedef enum { UNKNOWN_CONNECTION, SSL_CONNECTION, CLEAR_CONNECTION } connection_mode_t;
-typedef struct pn_ssl_session_t pn_ssl_session_t;
-
-struct pn_ssl_domain_t {
-  int ref_count;
-  pn_ssl_mode_t mode;
-  bool has_ca_db;       // true when CA database configured
-  pn_ssl_verify_mode_t verify_mode;
-  bool allow_unsecured;
-  win_credential_t *cred;
-};
-
-typedef enum { CREATED, CLIENT_HELLO, NEGOTIATING,
-               RUNNING, SHUTTING_DOWN, SSL_CLOSED } ssl_state_t;
-
-struct pni_ssl_t {
-  pn_ssl_domain_t  *domain;
-  const char    *session_id;
-  const char *peer_hostname;
-  ssl_state_t state;
-
-  bool protocol_detected;
-  bool queued_shutdown;
-  bool ssl_closed;            // shutdown complete, or SSL error
-  ssize_t app_input_closed;   // error code returned by upper layer process input
-  ssize_t app_output_closed;  // error code returned by upper layer process output
-
-  // OpenSSL hides the protocol envelope bytes, SChannel has them in-line.
-  char *sc_outbuf;     // SChannel output buffer
-  size_t sc_out_size;
-  size_t sc_out_count;
-  char *network_outp;   // network ready bytes within sc_outbuf
-  size_t network_out_pending;
-
-  char *sc_inbuf;      // SChannel input buffer
-  size_t sc_in_size;
-  size_t sc_in_count;
-  bool sc_in_incomplete;
-
-  char *inbuf_extra;    // Still encrypted data from following Record(s)
-  size_t extra_count;
-
-  char *in_data;          // Just the plaintext data part of sc_inbuf, decrypted in place
-  size_t in_data_size;
-  size_t in_data_count;
-  bool decrypting;
-  size_t max_data_size;  // computed in the handshake
-
-  pn_bytes_t app_inbytes; // Virtual decrypted datastream, presented to app layer
-
-  pn_buffer_t *inbuf2;    // Second input buf if longer contiguous bytes needed
-  bool double_buffered;
-
-  bool sc_input_shutdown;
-
-  CredHandle cred_handle;
-  CtxtHandle ctxt_handle;
-  SecPkgContext_StreamSizes sc_sizes;
-  pn_ssl_verify_mode_t verify_mode;
-  win_credential_t *cred;
-  char *subject;
-};
-
-static inline pn_transport_t *get_transport_internal(pn_ssl_t *ssl)
-{
-  // The external pn_sasl_t is really a pointer to the internal pni_transport_t
-  return ((pn_transport_t *)ssl);
-}
-
-static inline pni_ssl_t *get_ssl_internal(pn_ssl_t *ssl)
-{
-  // The external pn_sasl_t is really a pointer to the internal pni_transport_t
-  return ssl ? ((pn_transport_t *)ssl)->ssl : NULL;
-}
-
-struct pn_ssl_session_t {
-  const char       *id;
-// TODO
-  pn_ssl_session_t *ssn_cache_next;
-  pn_ssl_session_t *ssn_cache_prev;
-};
-
-
-static ssize_t process_input_ssl( pn_transport_t *transport, unsigned int layer, const char *input_data, size_t len);
-static ssize_t process_output_ssl( pn_transport_t *transport, unsigned int layer, char *input_data, size_t len);
-static ssize_t process_input_done(pn_transport_t *transport, unsigned int layer, const char *input_data, size_t len);
-static ssize_t process_output_done(pn_transport_t *transport, unsigned int layer, char *input_data, size_t len);
-static pn_ssl_session_t *ssn_cache_find( pn_ssl_domain_t *, const char * );
-static void ssl_session_free( pn_ssl_session_t *);
-static size_t buffered_output( pn_transport_t *transport );
-static void start_ssl_shutdown(pn_transport_t *transport);
-static void rewind_sc_inbuf(pni_ssl_t *ssl);
-static bool grow_inbuf2(pn_transport_t *ssl, size_t minimum_size);
-static HRESULT verify_peer(pni_ssl_t *ssl, HCERTSTORE root_store, const char *server_name, bool tracing);
-
-// @todo: used to avoid littering the code with calls to printf...
-static void ssl_log_error(const char *fmt, ...)
-{
-  va_list ap;
-  va_start(ap, fmt);
-  vfprintf(stderr, fmt, ap);
-  va_end(ap);
-  fflush(stderr);
-}
-
-// @todo: used to avoid littering the code with calls to printf...
-static void ssl_log(pn_transport_t *transport, const char *fmt, ...)
-{
-  if (PN_TRACE_DRV & transport->trace) {
-    va_list ap;
-    va_start(ap, fmt);
-    vfprintf(stderr, fmt, ap);
-    va_end(ap);
-    fflush(stderr);
-  }
-}
-
-static void ssl_log_error_status(HRESULT status, const char *fmt, ...)
-{
-  char buf[512];
-  va_list ap;
-
-  if (fmt) {
-    va_start(ap, fmt);
-    vfprintf(stderr, fmt, ap);
-    va_end(ap);
-  }
-
-  if (FormatMessage(FORMAT_MESSAGE_MAX_WIDTH_MASK | FORMAT_MESSAGE_FROM_SYSTEM,
-                    0, status, 0, buf, sizeof(buf), 0))
-    ssl_log_error(" : %s\n", buf);
-  else
-    fprintf(stderr, "pn internal Windows error: %x for %x\n", GetLastError(), status);
-
-  fflush(stderr);
-}
-
-static void ssl_log_clear_data(pn_transport_t *transport, const char *data, size_t len)
-{
-  if (PN_TRACE_RAW & transport->trace) {
-    fprintf(stderr, "SSL decrypted data: \"");
-    pn_fprint_data( stderr, data, len );
-    fprintf(stderr, "\"\n");
-  }
-}
-
-static size_t _pni_min(size_t a, size_t b)
-{
-  return (a < b) ? a : b;
-}
-
-// unrecoverable SSL failure occured, notify transport and generate error code.
-static int ssl_failed(pn_transport_t *transport, const char *reason)
-{
-  char buf[512] = "Unknown error.";
-  if (!reason) {
-    HRESULT status = GetLastError();
-
-    FormatMessage(FORMAT_MESSAGE_MAX_WIDTH_MASK | FORMAT_MESSAGE_FROM_SYSTEM,
-                  0, status, 0, buf, sizeof(buf), 0);
-    reason = buf;
-  }
-  pni_ssl_t *ssl = transport->ssl;
-  ssl->ssl_closed = true;
-  ssl->app_input_closed = ssl->app_output_closed = PN_EOS;
-  ssl->state = SSL_CLOSED;
-  pn_do_error(transport, "amqp:connection:framing-error", "SSL Failure: %s", reason);
-  return PN_EOS;
-}
-
-static pn_ssl_session_t *ssn_cache_find( pn_ssl_domain_t *domain, const char *id )
-{
-// TODO:
-  return NULL;
-}
-
-static void ssl_session_free( pn_ssl_session_t *ssn)
-{
-  if (ssn) {
-    if (ssn->id) free( (void *)ssn->id );
-    free( ssn );
-  }
-}
-
-
-/** Public API - visible to application code */
-
-bool pn_ssl_present(void)
-{
-  return true;
-}
-
-pn_ssl_domain_t *pn_ssl_domain( pn_ssl_mode_t mode )
-{
-  pn_ssl_domain_t *domain = (pn_ssl_domain_t *) calloc(1, sizeof(pn_ssl_domain_t));
-  if (!domain) return NULL;
-
-  domain->ref_count = 1;
-  domain->mode = mode;
-  switch(mode) {
-  case PN_SSL_MODE_CLIENT:
-  case PN_SSL_MODE_SERVER:
-    break;
-
-  default:
-    ssl_log_error("Invalid mode for pn_ssl_mode_t: %d\n", mode);
-    free(domain);
-    return NULL;
-  }
-  domain->cred = win_credential(mode);
-  return domain;
-}
-
-void pn_ssl_domain_free( pn_ssl_domain_t *domain )
-{
-  if (!domain) return;
-
-  if (--domain->ref_count == 0) {
-    pn_decref(domain->cred);
-    free(domain);
-  }
-}
-
-
-int pn_ssl_domain_set_credentials( pn_ssl_domain_t *domain,
-                               const char *certificate_file,
-                               const char *private_key_file,
-                               const char *password)
-{
-  if (!domain) return -1;
-
-  if (win_credential_has_certificate(domain->cred)) {
-    // Need a new win_credential_t to hold new certificate
-    pn_decref(domain->cred);
-    domain->cred = win_credential(domain->mode);
-    if (!domain->cred)
-      return -1;
-  }
-  return win_credential_load_cert(domain->cred, certificate_file, private_key_file, password);
-}
-
-
-int pn_ssl_domain_set_trusted_ca_db(pn_ssl_domain_t *domain,
-                                    const char *certificate_db)
-{
-  if (!domain || !certificate_db) return -1;
-
-  int ec = 0;
-  HCERTSTORE store = open_cert_db(certificate_db, NULL, &ec);
-  if (!store)
-    return ec;
-
-  if (domain->has_ca_db) {
-    win_credential_t *new_cred = win_credential(domain->mode);
-    if (!new_cred)
-      return -1;
-    new_cred->cert_context = CertDuplicateCertificateContext(domain->cred->cert_context);
-    pn_decref(domain->cred);
-    domain->cred = new_cred;
-  }
-
-  domain->cred->trust_store = store;
-  domain->cred->trust_store_name = pn_strdup(certificate_db);
-  domain->has_ca_db = true;
-  return 0;
-}
-
-
-int pn_ssl_domain_set_peer_authentication(pn_ssl_domain_t *domain,
-                                          const pn_ssl_verify_mode_t mode,
-                                          const char *trusted_CAs)
-{
-  if (!domain) return -1;
-  if (!domain->has_ca_db && (mode == PN_SSL_VERIFY_PEER || mode == PN_SSL_VERIFY_PEER_NAME)) {
-    ssl_log_error("Error: cannot verify peer without a trusted CA configured.\n"
-                  "       Use pn_ssl_domain_set_trusted_ca_db()\n");
-    return -1;
-  }
-
-  HCERTSTORE store = 0;
-  bool changed = domain->verify_mode && mode != domain->verify_mode;
-
-  switch (mode) {
-  case PN_SSL_VERIFY_PEER:
-  case PN_SSL_VERIFY_PEER_NAME:
-    if (domain->mode == PN_SSL_MODE_SERVER) {
-      if (!trusted_CAs) {
-        ssl_log_error("Error: a list of trusted CAs must be provided.");
-        return -1;
-      }
-      if (!win_credential_has_certificate(domain->cred)) {
-        ssl_log_error("Error: Server cannot verify peer without configuring a certificate.\n"
-                   "       Use pn_ssl_domain_set_credentials()");
-        return -1;
-      }
-      int ec = 0;
-      if (!strcmp(trusted_CAs, domain->cred->trust_store_name)) {
-        store = open_cert_db(trusted_CAs, NULL, &ec);
-        if (!store)
-          return ec;
-      } else {
-        store = CertDuplicateStore(domain->cred->trust_store);
-      }
-
-      if (domain->cred->server_CA_certs) {
-        // Already have one
-        changed = true;
-        win_credential_t *new_cred = win_credential(domain->mode);
-        if (!new_cred) {
-          CertCloseStore(store, 0);
-          return -1;
-        }
-        new_cred->cert_context = CertDuplicateCertificateContext(domain->cred->cert_context);
-        new_cred->trust_store = CertDuplicateStore(domain->cred->trust_store);
-        new_cred->trust_store_name = pn_strdup(domain->cred->trust_store_name);
-        pn_decref(domain->cred);
-        domain->cred = new_cred;
-      }
-
-      domain->cred->server_CA_certs = store;
-    }
-    break;
-
-  case PN_SSL_ANONYMOUS_PEER:   // hippie free love mode... :)
-    break;
-
-  default:
-    ssl_log_error("Invalid peer authentication mode given.\n");
-    return -1;
-  }
-
-  if (changed) {
-    win_credential_t *new_cred = win_credential(domain->mode);
-    if (!new_cred) {
-      CertCloseStore(store, 0);
-      return -1;
-    }
-    new_cred->cert_context = CertDuplicateCertificateContext(domain->cred->cert_context);
-    new_cred->trust_store = CertDuplicateStore(domain->cred->trust_store);
-    new_cred->trust_store_name = pn_strdup(domain->cred->trust_store_name);
-    pn_decref(domain->cred);
-    domain->cred = new_cred;
-  }
-
-  domain->verify_mode = mode;
-  domain->cred->server_CA_certs = store;
-
-  return 0;
-}
-
-const pn_io_layer_t ssl_layer = {
-    process_input_ssl,
-    process_output_ssl,
-    NULL,
-    NULL,
-    buffered_output
-};
-
-const pn_io_layer_t ssl_input_closed_layer = {
-    process_input_done,
-    process_output_ssl,
-    NULL,
-    NULL,
-    buffered_output
-};
-
-const pn_io_layer_t ssl_output_closed_layer = {
-    process_input_ssl,
-    process_output_done,
-    NULL,
-    NULL,
-    buffered_output
-};
-
-const pn_io_layer_t ssl_closed_layer = {
-    process_input_done,
-    process_output_done,
-    NULL,
-    NULL,
-    buffered_output
-};
-
-int pn_ssl_init(pn_ssl_t *ssl0, pn_ssl_domain_t *domain, const char *session_id)
-{
-  pn_transport_t *transport = get_transport_internal(ssl0);
-  pni_ssl_t *ssl = transport->ssl;
-  if (!ssl || !domain || ssl->domain) return -1;
-  if (ssl->state != CREATED) return -1;
-
-  ssl->domain = domain;
-  domain->ref_count++;
-  if (session_id && domain->mode == PN_SSL_MODE_CLIENT)
-    ssl->session_id = pn_strdup(session_id);
-
-  // If SSL doesn't specifically allow skipping encryption, require SSL
-  // TODO: This is a probably a stop-gap until allow_unsecured is removed
-  if (!domain->allow_unsecured) transport->encryption_required = true;
-
-  ssl->cred = domain->cred;
-  pn_incref(domain->cred);
-
-  SECURITY_STATUS status = SEC_E_OK;
-  ssl->cred_handle = win_credential_cred_handle(ssl->cred, ssl->verify_mode,
-                                                ssl->session_id, &status);
-  if (status != SEC_E_OK) {
-    ssl_log_error_status(status, "Credentials handle failure");
-    return -1;
-  }
-
-  ssl->state = (domain->mode == PN_SSL_MODE_CLIENT) ? CLIENT_HELLO : NEGOTIATING;
-  ssl->verify_mode = domain->verify_mode;
-  return 0;
-}
-
-
-int pn_ssl_domain_allow_unsecured_client(pn_ssl_domain_t *domain)
-{
-  if (!domain) return -1;
-  if (domain->mode != PN_SSL_MODE_SERVER) {
-    ssl_log_error("Cannot permit unsecured clients - not a server.\n");
-    return -1;
-  }
-  domain->allow_unsecured = true;
-  return 0;
-}
-
-
-// TODO: This is just an untested guess
-int pn_ssl_get_ssf(pn_ssl_t *ssl0)
-{
-  SecPkgContext_ConnectionInfo info;
-
-  pni_ssl_t *ssl = get_ssl_internal(ssl0);
-  if (ssl &&
-      ssl->state == RUNNING &&
-      SecIsValidHandle(&ssl->ctxt_handle) &&
-      QueryContextAttributes(&ssl->ctxt_handle, SECPKG_ATTR_CONNECTION_INFO, &info) == SEC_E_OK) {
-    return info.dwCipherStrength;
-  }
-  return 0;
-}
-
-bool pn_ssl_get_cipher_name(pn_ssl_t *ssl0, char *buffer, size_t size )
-{
-  pni_ssl_t *ssl = get_ssl_internal(ssl0);
-  if (ssl->state != RUNNING || !SecIsValidHandle(&ssl->ctxt_handle))
-    return false;
-  *buffer = '\0';
-  SecPkgContext_ConnectionInfo info;
-  if (QueryContextAttributes(&ssl->ctxt_handle, SECPKG_ATTR_CONNECTION_INFO, &info) == SEC_E_OK) {
-    // TODO: come up with string for all permutations?
-    pni_snprintf( buffer, size, "%x_%x:%x_%x:%x_%x",
-              info.aiExch, info.dwExchStrength,
-              info.aiCipher, info.dwCipherStrength,
-              info.aiHash, info.dwHashStrength);
-    return true;
-  }
-  return false;
-}
-
-bool pn_ssl_get_protocol_name(pn_ssl_t *ssl0, char *buffer, size_t size )
-{
-  pni_ssl_t *ssl = get_ssl_internal(ssl0);
-  if (ssl->state != RUNNING || !SecIsValidHandle(&ssl->ctxt_handle))
-    return false;
-  *buffer = '\0';
-  SecPkgContext_ConnectionInfo info;
-  if (QueryContextAttributes(&ssl->ctxt_handle, SECPKG_ATTR_CONNECTION_INFO, &info) == SEC_E_OK) {
-    if (info.dwProtocol & (SP_PROT_TLS1_CLIENT | SP_PROT_TLS1_SERVER))
-      pni_snprintf(buffer, size, "%s", "TLSv1");
-    // TLSV1.1 and TLSV1.2 are supported as of XP-SP3, but not defined until VS2010
-    else if ((info.dwProtocol & 0x300))
-      pni_snprintf(buffer, size, "%s", "TLSv1.1");
-    else if ((info.dwProtocol & 0xC00))
-      pni_snprintf(buffer, size, "%s", "TLSv1.2");
-    else {
-      ssl_log_error("unexpected protocol %x\n", info.dwProtocol);
-      return false;
-    }
-    return true;
-  }
-  return false;
-}
-
-
-void pn_ssl_free( pn_transport_t *transport)
-{
-  pni_ssl_t *ssl = transport->ssl;
-  if (!ssl) return;
-  ssl_log( transport, "SSL socket freed.\n" );
-  // clean up Windows per TLS session data before releasing the domain count
-  if (SecIsValidHandle(&ssl->ctxt_handle))
-    DeleteSecurityContext(&ssl->ctxt_handle);
-  if (ssl->cred) {
-    if (ssl->domain->mode == PN_SSL_MODE_CLIENT && ssl->session_id == NULL) {
-      // Responsible for unshared handle
-      if (SecIsValidHandle(&ssl->cred_handle))
-        FreeCredentialsHandle(&ssl->cred_handle);
-    }
-    pn_decref(ssl->cred);
-  }
-
-  if (ssl->domain) pn_ssl_domain_free(ssl->domain);
-  if (ssl->session_id) free((void *)ssl->session_id);
-  if (ssl->peer_hostname) free((void *)ssl->peer_hostname);
-  if (ssl->sc_inbuf) free((void *)ssl->sc_inbuf);
-  if (ssl->sc_outbuf) free((void *)ssl->sc_outbuf);
-  if (ssl->inbuf2) pn_buffer_free(ssl->inbuf2);
-  if (ssl->subject) free(ssl->subject);
-
-  free(ssl);
-}
-
-pn_ssl_t *pn_ssl(pn_transport_t *transport)
-{
-  if (!transport) return NULL;
-  if (transport->ssl) return (pn_ssl_t *)transport;
-
-  pni_ssl_t *ssl = (pni_ssl_t *) calloc(1, sizeof(pni_ssl_t));
-  if (!ssl) return NULL;
-  ssl->sc_out_size = ssl->sc_in_size = SSL_BUF_SIZE;
-
-  ssl->sc_outbuf = (char *)malloc(ssl->sc_out_size);
-  if (!ssl->sc_outbuf) {
-    free(ssl);
-    return NULL;
-  }
-  ssl->sc_inbuf = (char *)malloc(ssl->sc_in_size);
-  if (!ssl->sc_inbuf) {
-    free(ssl->sc_outbuf);
-    free(ssl);
-    return NULL;
-  }
-
-  ssl->inbuf2 = pn_buffer(0);
-  if (!ssl->inbuf2) {
-    free(ssl->sc_inbuf);
-    free(ssl->sc_outbuf);
-    free(ssl);
-    return NULL;
-  }
-
-  transport->ssl = ssl;
-
-  // Set up hostname from any bound connection
-  if (transport->connection) {
-    if (pn_string_size(transport->connection->hostname)) {
-      pn_ssl_set_peer_hostname((pn_ssl_t *) transport, pn_string_get(transport->connection->hostname));
-    }
-  }
-
-  SecInvalidateHandle(&ssl->cred_handle);
-  SecInvalidateHandle(&ssl->ctxt_handle);
-  ssl->state = CREATED;
-  ssl->decrypting = true;
-
-  return (pn_ssl_t *)transport;
-}
-
-
-pn_ssl_resume_status_t pn_ssl_resume_status( pn_ssl_t *ssl )
-{
-  // TODO
-  return PN_SSL_RESUME_UNKNOWN;
-}
-
-
-int pn_ssl_set_peer_hostname( pn_ssl_t *ssl0, const char *hostname )
-{
-  pni_ssl_t *ssl = get_ssl_internal(ssl0);
-  if (!ssl) return -1;
-
-  if (ssl->peer_hostname) free((void *)ssl->peer_hostname);
-  ssl->peer_hostname = NULL;
-  if (hostname) {
-    ssl->peer_hostname = pn_strdup(hostname);
-    if (!ssl->peer_hostname) return -2;
-  }
-  return 0;
-}
-
-int pn_ssl_get_peer_hostname( pn_ssl_t *ssl0, char *hostname, size_t *bufsize )
-{
-  pni_ssl_t *ssl = get_ssl_internal(ssl0);
-  if (!ssl) return -1;
-  if (!ssl->peer_hostname) {
-    *bufsize = 0;
-    if (hostname) *hostname = '\0';
-    return 0;
-  }
-  unsigned len = strlen(ssl->peer_hostname);
-  if (hostname) {
-    if (len >= *bufsize) return -1;
-    strcpy( hostname, ssl->peer_hostname );
-  }
-  *bufsize = len;
-  return 0;
-}
-
-const char* pn_ssl_get_remote_subject(pn_ssl_t *ssl0)
-{
-  // RFC 2253 compliant, but differs from openssl's subject string with space separators and
-  // ordering of multicomponent RDNs.  Made to work as similarly as possible with choice of flags.
-  pni_ssl_t *ssl = get_ssl_internal(ssl0);
-  if (!ssl || !SecIsValidHandle(&ssl->ctxt_handle))
-    return NULL;
-  if (!ssl->subject) {
-    SECURITY_STATUS status;
-    PCCERT_CONTEXT peer_cc = 0;
-    status = QueryContextAttributes(&ssl->ctxt_handle, SECPKG_ATTR_REMOTE_CERT_CONTEXT, &peer_cc);
-    if (status != SEC_E_OK) {
-      ssl_log_error_status(status, "can't obtain remote certificate subject");
-      return NULL;
-    }
-    DWORD flags = CERT_X500_NAME_STR | CERT_NAME_STR_REVERSE_FLAG;
-    DWORD strlen = CertNameToStr(peer_cc->dwCertEncodingType, &peer_cc->pCertInfo->Subject,
-                                 flags, NULL, 0);
-    if (strlen > 0) {
-      ssl->subject = (char*) malloc(strlen);
-      if (ssl->subject) {
-        DWORD len = CertNameToStr(peer_cc->dwCertEncodingType, &peer_cc->pCertInfo->Subject,
-                                  flags, ssl->subject, strlen);
-        if (len != strlen) {
-          free(ssl->subject);
-          ssl->subject = NULL;
-          ssl_log_error("pn_ssl_get_remote_subject failure in CertNameToStr");
-        }
-      }
-    }
-    CertFreeCertificateContext(peer_cc);
-  }
-  return ssl->subject;
-}
-
-
-/** SChannel specific: */
-
-const char *tls_version_check(pni_ssl_t *ssl)
-{
-  SecPkgContext_ConnectionInfo info;
-  QueryContextAttributes(&ssl->ctxt_handle, SECPKG_ATTR_CONNECTION_INFO, &info);
-  // Ascending bit patterns denote newer SSL/TLS protocol versions.
-  // SP_PROT_TLS1_0_SERVER is not defined until VS2010.
-  return (info.dwProtocol < SP_PROT_TLS1_SERVER) ?
-    "peer does not support TLS 1.0 security" : NULL;
-}
-
-static void ssl_encrypt(pn_transport_t *transport, char *app_data, size_t count)
-{
-  pni_ssl_t *ssl = transport->ssl;
-
-  // Get SChannel to encrypt exactly one Record.
-  SecBuffer buffs[4];
-  buffs[0].cbBuffer = ssl->sc_sizes.cbHeader;
-  buffs[0].BufferType = SECBUFFER_STREAM_HEADER;
-  buffs[0].pvBuffer = ssl->sc_outbuf;
-  buffs[1].cbBuffer = count;
-  buffs[1].BufferType = SECBUFFER_DATA;
-  buffs[1].pvBuffer = app_data;
-  buffs[2].cbBuffer = ssl->sc_sizes.cbTrailer;
-  buffs[2].BufferType = SECBUFFER_STREAM_TRAILER;
-  buffs[2].pvBuffer = &app_data[count];
-  buffs[3].cbBuffer = 0;
-  buffs[3].BufferType = SECBUFFER_EMPTY;
-  buffs[3].pvBuffer = 0;
-  SecBufferDesc buff_desc;
-  buff_desc.ulVersion = SECBUFFER_VERSION;
-  buff_desc.cBuffers = 4;
-  buff_desc.pBuffers = buffs;
-  SECURITY_STATUS status = EncryptMessage(&ssl->ctxt_handle, 0, &buff_desc, 0);
-  assert(status == SEC_E_OK);
-
-  // EncryptMessage encrypts the data in place. The header and trailer
-  // areas were reserved previously and must now be included in the updated
-  // count of bytes to write to the peer.
-  ssl->sc_out_count = buffs[0].cbBuffer + buffs[1].cbBuffer + buffs[2].cbBuffer;
-  ssl->network_outp = ssl->sc_outbuf;
-  ssl->network_out_pending = ssl->sc_out_count;
-  ssl_log(transport, "ssl_encrypt %d network bytes\n", ssl->network_out_pending);
-}
-
-// Returns true if decryption succeeded (even for empty content)
-static bool ssl_decrypt(pn_transport_t *transport)
-{
-  pni_ssl_t *ssl = transport->ssl;
-  // Get SChannel to decrypt input.  May have an incomplete Record,
-  // exactly one, or more than one.  Check also for session ending,
-  // session renegotiation.
-
-  SecBuffer recv_buffs[4];
-  recv_buffs[0].cbBuffer = ssl->sc_in_count;
-  recv_buffs[0].BufferType = SECBUFFER_DATA;
-  recv_buffs[0].pvBuffer = ssl->sc_inbuf;
-  recv_buffs[1].BufferType = SECBUFFER_EMPTY;
-  recv_buffs[2].BufferType = SECBUFFER_EMPTY;
-  recv_buffs[3].BufferType = SECBUFFER_EMPTY;
-  SecBufferDesc buff_desc;
-  buff_desc.ulVersion = SECBUFFER_VERSION;
-  buff_desc.cBuffers = 4;
-  buff_desc.pBuffers = recv_buffs;
-  SECURITY_STATUS status = DecryptMessage(&ssl->ctxt_handle, &buff_desc, 0, NULL);
-
-  if (status == SEC_E_INCOMPLETE_MESSAGE) {
-    // Less than a full Record, come back later with more network data
-    ssl->sc_in_incomplete = true;
-    return false;
-  }
-
-  ssl->decrypting = false;
-
-  if (status != SEC_E_OK) {
-    rewind_sc_inbuf(ssl);
-    switch (status) {
-    case SEC_I_CONTEXT_EXPIRED:
-      // TLS shutdown alert record.  Ignore all subsequent input.
-      ssl->state = SHUTTING_DOWN;
-      ssl->sc_input_shutdown = true;
-      return false;
-
-    case SEC_I_RENEGOTIATE:
-      ssl_log_error("unexpected TLS renegotiation\n");
-      // TODO.  Fall through for now.
-    default:
-      ssl_failed(transport, 0);
-      return false;
-    }
-  }
-
-  ssl->decrypting = false;
-  // have a decrypted Record and possible (still-encrypted) data of
-  // one (or more) later Recordss.  Adjust pointers accordingly.
-  for (int i = 0; i < 4; i++) {
-    switch (recv_buffs[i].BufferType) {
-    case SECBUFFER_DATA:
-      ssl->in_data = (char *) recv_buffs[i].pvBuffer;
-      ssl->in_data_size = ssl->in_data_count = recv_buffs[i].cbBuffer;
-      break;
-    case SECBUFFER_EXTRA:
-      ssl->inbuf_extra = (char *)recv_buffs[i].pvBuffer;
-      ssl->extra_count = recv_buffs[i].cbBuffer;
-      break;
-    default:
-      // SECBUFFER_STREAM_HEADER:
-      // SECBUFFER_STREAM_TRAILER:
-      break;
-    }
-  }
-  return true;
-}
-
-static void client_handshake_init(pn_transport_t *transport)
-{
-  pni_ssl_t *ssl = transport->ssl;
-  // Tell SChannel to create the first handshake token (ClientHello)
-  // and place it in sc_outbuf
-  SEC_CHAR *host = const_cast<SEC_CHAR *>(ssl->peer_hostname);
-  ULONG ctxt_requested = ISC_REQ_STREAM | ISC_REQ_USE_SUPPLIED_CREDS | ISC_REQ_EXTENDED_ERROR;
-  ULONG ctxt_attrs;
-
-  SecBuffer send_buffs[2];
-  send_buffs[0].cbBuffer = ssl->sc_out_size;
-  send_buffs[0].BufferType = SECBUFFER_TOKEN;
-  send_buffs[0].pvBuffer = ssl->sc_outbuf;
-  send_buffs[1].cbBuffer = 0;
-  send_buffs[1].BufferType = SECBUFFER_EMPTY;
-  send_buffs[1].pvBuffer = 0;
-  SecBufferDesc send_buff_desc;
-  send_buff_desc.ulVersion = SECBUFFER_VERSION;
-  send_buff_desc.cBuffers = 2;
-  send_buff_desc.pBuffers = send_buffs;
-  SECURITY_STATUS status = InitializeSecurityContext(&ssl->cred_handle,
-                               NULL, host, ctxt_requested, 0, 0, NULL, 0,
-                               &ssl->ctxt_handle, &send_buff_desc,
-                               &ctxt_attrs, NULL);
-
-  if (status == SEC_I_CONTINUE_NEEDED) {
-    ssl->sc_out_count = send_buffs[0].cbBuffer;
-    ssl->network_out_pending = ssl->sc_out_count;
-    // the token is the whole quantity to send
-    ssl->network_outp = ssl->sc_outbuf;
-    ssl_log(transport, "Sending client hello %d bytes\n", ssl->network_out_pending);
-  } else {
-    ssl_log_error_status(status, "InitializeSecurityContext failed");
-    ssl_failed(transport, 0);
-  }
-}
-
-static void client_handshake( pn_transport_t* transport) {
-  pni_ssl_t *ssl = transport->ssl;
-  // Feed SChannel ongoing responses from the server until the handshake is complete.
-  SEC_CHAR *host = const_cast<SEC_CHAR *>(ssl->peer_hostname);
-  ULONG ctxt_requested = ISC_REQ_STREAM | ISC_REQ_USE_SUPPLIED_CREDS;
-  ULONG ctxt_attrs;
-  size_t max = 0;
-
-  // token_buffs describe the buffer that's coming in. It should have
-  // a token from the SSL server, or empty if sending final shutdown alert.
-  bool shutdown = ssl->state == SHUTTING_DOWN;
-  SecBuffer token_buffs[2];
-  token_buffs[0].cbBuffer = shutdown ? 0 : ssl->sc_in_count;
-  token_buffs[0].BufferType = SECBUFFER_TOKEN;
-  token_buffs[0].pvBuffer = shutdown ? 0 : ssl->sc_inbuf;
-  token_buffs[1].cbBuffer = 0;
-  token_buffs[1].BufferType = SECBUFFER_EMPTY;
-  token_buffs[1].pvBuffer = 0;
-  SecBufferDesc token_buff_desc;
-  token_buff_desc.ulVersion = SECBUFFER_VERSION;
-  token_buff_desc.cBuffers = 2;
-  token_buff_desc.pBuffers = token_buffs;
-
-  // send_buffs will hold information to forward to the peer.
-  SecBuffer send_buffs[2];
-  send_buffs[0].cbBuffer = ssl->sc_out_size;
-  send_buffs[0].BufferType = SECBUFFER_TOKEN;
-  send_buffs[0].pvBuffer = ssl->sc_outbuf;
-  send_buffs[1].cbBuffer = 0;
-  send_buffs[1].BufferType = SECBUFFER_EMPTY;
-  send_buffs[1].pvBuffer = 0;
-  SecBufferDesc send_buff_desc;
-  send_buff_desc.ulVersion = SECBUFFER_VERSION;
-  send_buff_desc.cBuffers = 2;
-  send_buff_desc.pBuffers = send_buffs;
-
-  SECURITY_STATUS status = InitializeSecurityContext(&ssl->cred_handle,
-                               &ssl->ctxt_handle, host, ctxt_requested, 0, 0,
-                               &token_buff_desc, 0, NULL, &send_buff_desc,
-                               &ctxt_attrs, NULL);
-  switch (status) {
-  case SEC_E_INCOMPLETE_MESSAGE:
-    // Not enough - get more data from the server then try again.
-    // Leave input buffers untouched.
-    ssl_log(transport, "client handshake: incomplete record\n");
-    ssl->sc_in_incomplete = true;
-    return;
-
-  case SEC_I_CONTINUE_NEEDED:
-    // Successful handshake step, requiring data to be sent to peer.
-    ssl->sc_out_count = send_buffs[0].cbBuffer;
-    // the token is the whole quantity to send
-    ssl->network_out_pending = ssl->sc_out_count;
-    ssl->network_outp = ssl->sc_outbuf;
-    ssl_log(transport, "client handshake token %d bytes\n", ssl->network_out_pending);
-    break;
-
-  case SEC_E_OK:
-    // Handshake complete.
-    if (shutdown) {
-      if (send_buffs[0].cbBuffer > 0) {
-        ssl->sc_out_count = send_buffs[0].cbBuffer;
-        // the token is the whole quantity to send
-        ssl->network_out_pending = ssl->sc_out_count;
-        ssl->network_outp = ssl->sc_outbuf;
-        ssl_log(transport, "client shutdown token %d bytes\n", ssl->network_out_pending);
-      } else {
-        ssl->state = SSL_CLOSED;
-      }
-      // we didn't touch sc_inbuf, no need to reset
-      return;
-    }
-    if (send_buffs[0].cbBuffer != 0) {
-      ssl_failed(transport, "unexpected final server token");
-      break;
-    }
-    if (const char *err = tls_version_check(ssl)) {
-      ssl_failed(transport, err);
-      break;
-    }
-    if (ssl->verify_mode == PN_SSL_VERIFY_PEER || ssl->verify_mode == PN_SSL_VERIFY_PEER_NAME) {
-      bool tracing = PN_TRACE_DRV & transport->trace;
-      HRESULT ec = verify_peer(ssl, ssl->cred->trust_store, ssl->peer_hostname, tracing);
-      if (ec) {
-        if (ssl->peer_hostname)
-          ssl_log_error_status(ec, "certificate verification failed for host %s\n", ssl->peer_hostname);
-        else
-          ssl_log_error_status(ec, "certificate verification failed\n");
-        ssl_failed(transport, "TLS certificate verification error");
-        break;
-      }
-    }
-
-    if (token_buffs[1].BufferType == SECBUFFER_EXTRA && token_buffs[1].cbBuffer > 0) {
-      // This seems to work but not documented, plus logic differs from decrypt message
-      // since the pvBuffer value is not set.  Grrr.
-      ssl->extra_count = token_buffs[1].cbBuffer;
-      ssl->inbuf_extra = ssl->sc_inbuf + (ssl->sc_in_count - ssl->extra_count);
-    }
-
-    QueryContextAttributes(&ssl->ctxt_handle,
-                             SECPKG_ATTR_STREAM_SIZES, &ssl->sc_sizes);
-    max = ssl->sc_sizes.cbMaximumMessage + ssl->sc_sizes.cbHeader + ssl->sc_sizes.cbTrailer;
-    if (max > ssl->sc_out_size) {
-      ssl_log_error("Buffer size mismatch have %d, need %d\n", (int) ssl->sc_out_size, (int) max);
-      ssl->state = SHUTTING_DOWN;
-      ssl->app_input_closed = ssl->app_output_closed = PN_ERR;
-      start_ssl_shutdown(transport);
-      pn_do_error(transport, "amqp:connection:framing-error", "SSL Failure: buffer size");
-      break;
-    }
-
-    ssl->state = RUNNING;
-    ssl->max_data_size = max - ssl->sc_sizes.cbHeader - ssl->sc_sizes.cbTrailer;
-    ssl_log(transport, "client handshake successful %d max record size\n", max);
-    break;
-
-  case SEC_I_CONTEXT_EXPIRED:
-    // ended before we got going
-  default:
-    ssl_log(transport, "client handshake failed %d\n", (int) status);
-    ssl_failed(transport, 0);
-    break;
-  }
-
-  if (token_buffs[1].BufferType == SECBUFFER_EXTRA && token_buffs[1].cbBuffer > 0 &&
-      !ssl->ssl_closed) {
-    // remaining data after the consumed TLS record(s)
-    ssl->extra_count = token_buffs[1].cbBuffer;
-    ssl->inbuf_extra = ssl->sc_inbuf + (ssl->sc_in_count - ssl->extra_count);
-  }
-
-  ssl->decrypting = false;
-  rewind_sc_inbuf(ssl);
-}
-
-
-static void server_handshake(pn_transport_t* transport)
-{
-  pni_ssl_t *ssl = transport->ssl;
-  if (!ssl->protocol_detected) {
-    // SChannel fails less aggressively than openssl on client hello, causing hangs
-    // waiting for more bytes.  Help out here.
-    pni_protocol_type_t type = pni_sniff_header(ssl->sc_inbuf, ssl->sc_in_count);
-    if (type == PNI_PROTOCOL_INSUFFICIENT) {
-      ssl_log(transport, "server handshake: incomplete record\n");
-      ssl->sc_in_incomplete = true;
-      return;
-    } else {
-      ssl->protocol_detected = true;
-      if (type != PNI_PROTOCOL_SSL) {
-        ssl_failed(transport, "bad client hello");
-        ssl->decrypting = false;
-        rewind_sc_inbuf(ssl);
-        return;
-      }
-    }
-  }
-
-  // Feed SChannel ongoing handshake records from the client until the handshake is complete.
-  ULONG ctxt_requested = ASC_REQ_STREAM | ASC_REQ_EXTENDED_ERROR;
-  if (ssl->verify_mode == PN_SSL_VERIFY_PEER || ssl->verify_mode == PN_SSL_VERIFY_PEER_NAME)
-    ctxt_requested |= ASC_REQ_MUTUAL_AUTH;
-  ULONG ctxt_attrs;
-  size_t max = 0;
-
-  // token_buffs describe the buffer that's coming in. It should have
-  // a token from the SSL client except if shutting down or renegotiating.
-  bool shutdown = ssl->state == SHUTTING_DOWN;
-  SecBuffer token_buffs[2];
-  token_buffs[0].cbBuffer = shutdown ? 0 : ssl->sc_in_count;
-  token_buffs[0].BufferType = SECBUFFER_TOKEN;
-  token_buffs[0].pvBuffer = shutdown ? 0 : ssl->sc_inbuf;
-  token_buffs[1].cbBuffer = 0;
-  token_buffs[1].BufferType = SECBUFFER_EMPTY;
-  token_buffs[1].pvBuffer = 0;
-  SecBufferDesc token_buff_desc;
-  token_buff_desc.ulVersion = SECBUFFER_VERSION;
-  token_buff_desc.cBuffers = 2;
-  token_buff_desc.pBuffers = token_buffs;
-
-  // send_buffs will hold information to forward to the peer.
-  SecBuffer send_buffs[2];
-  send_buffs[0].cbBuffer = ssl->sc_out_size;
-  send_buffs[0].BufferType = SECBUFFER_TOKEN;
-  send_buffs[0].pvBuffer = ssl->sc_outbuf;
-  send_buffs[1].cbBuffer = 0;
-  send_buffs[1].BufferType = SECBUFFER_EMPTY;
-  send_buffs[1].pvBuffer = 0;
-  SecBufferDesc send_buff_desc;
-  send_buff_desc.ulVersion = SECBUFFER_VERSION;
-  send_buff_desc.cBuffers = 2;
-  send_buff_desc.pBuffers = send_buffs;
-  PCtxtHandle ctxt_handle_ptr = (SecIsValidHandle(&ssl->ctxt_handle)) ? &ssl->ctxt_handle : 0;
-
-  SECURITY_STATUS status = AcceptSecurityContext(&ssl->cred_handle, ctxt_handle_ptr,
-                               &token_buff_desc, ctxt_requested, 0, &ssl->ctxt_handle,
-                               &send_buff_desc, &ctxt_attrs, NULL);
-
-  bool outbound_token = false;
-  switch(status) {
-  case SEC_E_INCOMPLETE_MESSAGE:
-    // Not enough - get more data from the client then try again.
-    // Leave input buffers untouched.
-    ssl_log(transport, "server handshake: incomplete record\n");
-    ssl->sc_in_incomplete = true;
-    return;
-
-  case SEC_I_CONTINUE_NEEDED:
-    outbound_token = true;
-    break;
-
-  case SEC_E_OK:
-    // Handshake complete.
-    if (shutdown) {
-      if (send_buffs[0].cbBuffer > 0) {
-        ssl->sc_out_count = send_buffs[0].cbBuffer;
-        // the token is the whole quantity to send
-        ssl->network_out_pending = ssl->sc_out_count;
-        ssl->network_outp = ssl->sc_outbuf;
-        ssl_log(transport, "server shutdown token %d bytes\n", ssl->network_out_pending);
-      } else {
-        ssl->state = SSL_CLOSED;
-      }
-      // we didn't touch sc_inbuf, no need to reset
-      return;
-    }
-    if (const char *err = tls_version_check(ssl)) {
-      ssl_failed(transport, err);
-      break;
-    }
-    // Handshake complete.
-
-    if (ssl->verify_mode == PN_SSL_VERIFY_PEER || ssl->verify_mode == PN_SSL_VERIFY_PEER_NAME) {
-      bool tracing = PN_TRACE_DRV & transport->trace;
-      HRESULT ec = verify_peer(ssl, ssl->cred->trust_store, NULL, tracing);
-      if (ec) {
-        ssl_log_error_status(ec, "certificate verification failed\n");
-        ssl_failed(transport, "certificate verification error");
-        break;
-      }
-    }
-
-    QueryContextAttributes(&ssl->ctxt_handle,
-                             SECPKG_ATTR_STREAM_SIZES, &ssl->sc_sizes);
-    max = ssl->sc_sizes.cbMaximumMessage + ssl->sc_sizes.cbHeader + ssl->sc_sizes.cbTrailer;
-    if (max > ssl->sc_out_size) {
-      ssl_log_error("Buffer size mismatch have %d, need %d\n", (int) ssl->sc_out_size, (int) max);
-      ssl->state = SHUTTING_DOWN;
-      ssl->app_input_closed = ssl->app_output_closed = PN_ERR;
-      start_ssl_shutdown(transport);
-      pn_do_error(transport, "amqp:connection:framing-error", "SSL Failure: buffer size");
-      break;
-    }
-
-    if (send_buffs[0].cbBuffer != 0)
-      outbound_token = true;
-
-    ssl->state = RUNNING;
-    ssl->max_data_size = max - ssl->sc_sizes.cbHeader - ssl->sc_sizes.cbTrailer;
-    ssl_log(transport, "server handshake successful %d max record size\n", max);
-    break;
-
-  case SEC_I_CONTEXT_EXPIRED:
-    // ended before we got going
-  default:
-    ssl_log(transport, "server handshake failed %d\n", (int) status);
-    ssl_failed(transport, 0);
-    break;
-  }
-
-  if (outbound_token) {
-    // Successful handshake step, requiring data to be sent to peer.
-    assert(ssl->network_out_pending == 0);
-    ssl->sc_out_count = send_buffs[0].cbBuffer;
-    // the token is the whole quantity to send
-    ssl->network_out_pending = ssl->sc_out_count;
-    ssl->network_outp = ssl->sc_outbuf;
-    ssl_log(transport, "server handshake token %d bytes\n", ssl->network_out_pending);
-  }
-
-  if (token_buffs[1].BufferType == SECBUFFER_EXTRA && token_buffs[1].cbBuffer > 0 &&
-      !ssl->ssl_closed) {
-    // remaining data after the consumed TLS record(s)
-    ssl->extra_count = token_buffs[1].cbBuffer;
-    ssl->inbuf_extra = ssl->sc_inbuf + (ssl->sc_in_count - ssl->extra_count);
-  }
-
-  ssl->decrypting = false;
-  rewind_sc_inbuf(ssl);
-}
-
-static void ssl_handshake(pn_transport_t* transport) {
-  if (transport->ssl->domain->mode == PN_SSL_MODE_CLIENT)
-    client_handshake(transport);
-  else {
-    server_handshake(transport);
-  }
-}
-
-static bool grow_inbuf2(pn_transport_t *transport, size_t minimum_size) {
-  pni_ssl_t *ssl = transport->ssl;
-  size_t old_capacity = pn_buffer_capacity(ssl->inbuf2);
-  size_t new_capacity = old_capacity ? old_capacity * 2 : 1024;
-
-  while (new_capacity < minimum_size)
-    new_capacity *= 2;
-
-  uint32_t max_frame = pn_transport_get_max_frame(transport);
-  if (max_frame != 0) {
-    if (old_capacity >= max_frame) {
-      //  already big enough
-      ssl_log(transport, "Application expecting %d bytes (> negotiated maximum frame)\n", new_capacity);
-      ssl_failed(transport, "TLS: transport maximimum frame size error");
-      return false;
-    }
-  }
-
-  size_t extra_bytes = new_capacity - pn_buffer_size(ssl->inbuf2);
-  int err = pn_buffer_ensure(ssl->inbuf2, extra_bytes);
-  if (err) {
-    ssl_log(transport, "TLS memory allocation failed for %d bytes\n", max_frame);
-    ssl_failed(transport, "TLS memory allocation failed");
-    return false;
-  }
-  return true;
-}
-
-
-// Peer initiated a session end by sending us a shutdown alert (and we should politely
-// reciprocate), or else we are initiating the session end (and will not bother to wait
-// for the peer shutdown alert). Stop processing input immediately, and stop processing
-// output once this is sent.
-
-static void start_ssl_shutdown(pn_transport_t *transport)
-{
-  pni_ssl_t *ssl = transport->ssl;
-  assert(ssl->network_out_pending == 0);
-  if (ssl->queued_shutdown)
-    return;
-  ssl->queued_shutdown = true;
-  ssl_log(transport, "Shutting down SSL connection...\n");
-
-  DWORD shutdown = SCHANNEL_SHUTDOWN;
-  SecBuffer shutBuff;
-  shutBuff.cbBuffer = sizeof(DWORD);
-  shutBuff.BufferType = SECBUFFER_TOKEN;
-  shutBuff.pvBuffer = &shutdown;
-  SecBufferDesc desc;
-  desc.ulVersion = SECBUFFER_VERSION;
-  desc.cBuffers = 1;
-  desc.pBuffers = &shutBuff;
-  ApplyControlToken(&ssl->ctxt_handle, &desc);
-
-  // Next handshake will generate the shudown alert token
-  ssl_handshake(transport);
-}
-
-static void rewind_sc_inbuf(pni_ssl_t *ssl)
-{
-  // Decrypted bytes have been drained or double buffered.  Prepare for the next SSL Record.
-  assert(ssl->in_data_count == 0);
-  if (ssl->decrypting)
-    return;
-  ssl->decrypting = true;
-  if (ssl->inbuf_extra) {
-    // A previous read picked up more than one Record.  Move it to the beginning.
-    memmove(ssl->sc_inbuf, ssl->inbuf_extra, ssl->extra_count);
-    ssl->sc_in_count = ssl->extra_count;
-    ssl->inbuf_extra = 0;
-    ssl->extra_count = 0;
-  } else {
-    ssl->sc_in_count = 0;
-  }
-}
-
-static void app_inbytes_add(pn_transport_t *transport)
-{
-  pni_ssl_t *ssl = transport->ssl;
-  if (!ssl->app_inbytes.start) {
-    ssl->app_inbytes.start = ssl->in_data;
-    ssl->app_inbytes.size = ssl->in_data_count;
-    return;
-  }
-
-  if (ssl->double_buffered) {
-    if (pn_buffer_available(ssl->inbuf2) == 0) {
-      if (!grow_inbuf2(transport, 1024))
-        // could not add room
-        return;
-    }
-    size_t count = _pni_min(ssl->in_data_count, pn_buffer_available(ssl->inbuf2));
-    pn_buffer_append(ssl->inbuf2, ssl->in_data, count);
-    ssl->in_data += count;
-    ssl->in_data_count -= count;
-    ssl->app_inbytes = pn_buffer_bytes(ssl->inbuf2);
-  } else {
-    assert(ssl->app_inbytes.size == 0);
-    ssl->app_inbytes.start = ssl->in_data;
-    ssl->app_inbytes.size = ssl->in_data_count;
-  }
-}
-
-
-static void app_inbytes_progress(pn_transport_t *transport, size_t minimum)
-{
-  pni_ssl_t *ssl = transport->ssl;
-  // Make more decrypted data available, if possible.  Otherwise, move
-  // unread bytes to front of inbuf2 to make room for next bulk decryption.
-  // SSL may have chopped up data that app layer expects to be
-  // contiguous.  Start, continue or stop double buffering here.
-  if (ssl->double_buffered) {
-    if (ssl->app_inbytes.size == 0) {
-      // no straggler bytes, optimistically stop for now
-      ssl->double_buffered = false;
-      pn_buffer_clear(ssl->inbuf2);
-      ssl->app_inbytes.start = ssl->in_data;
-      ssl->app_inbytes.size = ssl->in_data_count;
-    } else {
-      pn_bytes_t ib2 = pn_buffer_bytes(ssl->inbuf2);
-      assert(ssl->app_inbytes.size <= ib2.size);
-      size_t consumed = ib2.size - ssl->app_inbytes.size;
-      if (consumed > 0) {
-        memmove((void *)ib2.start, ib2.start + consumed, ssl->app_inbytes.size);
-        pn_buffer_trim(ssl->inbuf2, 0, consumed);
-      }
-      if (!pn_buffer_available(ssl->inbuf2)) {
-        if (!grow_inbuf2(transport, minimum))
-          // could not add room
-          return;
-      }
-      size_t count = _pni_min(ssl->in_data_count, pn_buffer_available(ssl->inbuf2));
-      pn_buffer_append(ssl->inbuf2, ssl->in_data, count);
-      ssl->in_data += count;
-      ssl->in_data_count -= count;
-      ssl->app_inbytes = pn_buffer_bytes(ssl->inbuf2);
-    }
-  } else {
-    if (ssl->app_inbytes.size) {
-      // start double buffering the left over bytes
-      ssl->double_buffered = true;
-      pn_buffer_clear(ssl->inbuf2);
-      if (!pn_buffer_available(ssl->inbuf2)) {
-        if (!grow_inbuf2(transport, minimum))
-          // could not add room
-          return;
-      }
-      size_t count = _pni_min(ssl->in_data_count, pn_buffer_available(ssl->inbuf2));
-      pn_buffer_append(ssl->inbuf2, ssl->in_data, count);
-      ssl->in_data += count;
-      ssl->in_data_count -= count;
-      ssl->app_inbytes = pn_buffer_bytes(ssl->inbuf2);
-    } else {
-      // already pointing at all available bytes until next decrypt
-    }
-  }
-  if (ssl->in_data_count == 0)
-    rewind_sc_inbuf(ssl);
-}
-
-
-static void app_inbytes_advance(pn_transport_t *transport, size_t consumed)
-{
-  pni_ssl_t *ssl = transport->ssl;
-  if (consumed == 0) {
-    // more contiguous bytes required
-    app_inbytes_progress(transport, ssl->app_inbytes.size + 1);
-    return;
-  }
-  assert(consumed <= ssl->app_inbytes.size);
-  ssl->app_inbytes.start += consumed;
-  ssl->app_inbytes.size -= consumed;
-  if (!ssl->double_buffered) {
-    ssl->in_data += consumed;
-    ssl->in_data_count -= consumed;
-  }
-  if (ssl->app_inbytes.size == 0)
-    app_inbytes_progress(transport, 0);
-}
-
-static void read_closed(pn_transport_t *transport, unsigned int layer, ssize_t error)
-{
-  pni_ssl_t *ssl = transport->ssl;
-  if (ssl->app_input_closed)
-    return;
-  if (ssl->state == RUNNING && !error) {
-    // Signal end of stream
-    ssl->app_input_closed = transport->io_layers[layer+1]->process_input(transport, layer+1, ssl->app_inbytes.start, 0);
-  }
-  if (!ssl->app_input_closed)
-    ssl->app_input_closed = error ? error : PN_ERR;
-
-  if (ssl->app_output_closed) {
-    // both sides of app closed, and no more app output pending:
-    ssl->state = SHUTTING_DOWN;
-    if (ssl->network_out_pending == 0 && !ssl->queued_shutdown) {
-      start_ssl_shutdown(transport);
-    }
-  }
-}
-
-
-// Read up to "available" bytes from the network, decrypt it and pass plaintext to application.
-
-static ssize_t process_input_ssl(pn_transport_t *transport, unsigned int layer, const char *input_data, size_t available)
-{
-  pni_ssl_t *ssl = transport->ssl;
-  ssl_log( transport, "process_input_ssl( data size=%d )\n",available );
-  ssize_t consumed = 0;
-  ssize_t forwarded = 0;
-  bool new_app_input;
-
-  if (available == 0) {
-    // No more inbound network data
-    read_closed(transport, layer, 0);
-    return 0;
-  }
-
-  do {
-    if (ssl->sc_input_shutdown) {
-      // TLS protocol shutdown detected on input, so we are done.
-      read_closed(transport, layer, 0);
-      return PN_EOS;
-    }
-
-    // sc_inbuf should be ready for new or additional network encrypted bytes.
-    // i.e. no straggling decrypted bytes pending.
-    assert(ssl->in_data_count == 0 && ssl->decrypting);
-    new_app_input = false;
-    size_t count;
-
-    if (ssl->state != RUNNING) {
-      count = _pni_min(ssl->sc_in_size - ssl->sc_in_count, available);
-    } else {
-      // look for TLS record boundaries
-      if (ssl->sc_in_count < 5) {
-        ssl->sc_in_incomplete = true;
-        size_t hc = _pni_min(available, 5 - ssl->sc_in_count);
-        memmove(ssl->sc_inbuf + ssl->sc_in_count, input_data, hc);
-        ssl->sc_in_count += hc;
-        input_data += hc;
-        available -= hc;
-        consumed += hc;
-        if (ssl->sc_in_count < 5 || available == 0)
-          break;
-      }
-
-      // Top up sc_inbuf from network input_data hoping for a complete TLS Record
-      // We try to guess the length as an optimization, but let SChannel
-      // ultimately decide if there is spoofing going on.
-      unsigned char low = (unsigned char) ssl->sc_inbuf[4];
-      unsigned char high = (unsigned char) ssl->sc_inbuf[3];
-      size_t rec_len = high * 256 + low + 5;
-      if (rec_len < 5 || rec_len == ssl->sc_in_count || rec_len > ssl->sc_in_size)
-        rec_len = ssl->sc_in_size;
-
-      count = _pni_min(rec_len - ssl->sc_in_count, available);
-    }
-
-    if (count > 0) {
-      memmove(ssl->sc_inbuf + ssl->sc_in_count, input_data, count);
-      ssl->sc_in_count += count;
-      input_data += count;
-      available -= count;
-      consumed += count;
-      ssl->sc_in_incomplete = false;
-    }
-
-    // Try to decrypt another TLS Record.
-
-    if (ssl->sc_in_count > 0 && ssl->state <= SHUTTING_DOWN) {
-      if (ssl->state == NEGOTIATING) {
-        ssl_handshake(transport);
-      } else {
-        if (ssl_decrypt(transport)) {
-          // Ignore TLS Record with 0 length data (does not mean EOS)
-          if (ssl->in_data_size > 0) {
-            new_app_input = true;
-            app_inbytes_add(transport);
-          } else {
-            assert(ssl->decrypting == false);
-            rewind_sc_inbuf(ssl);
-          }
-        }
-        ssl_log(transport, "Next decryption, %d left over\n", available);
-      }
-    }
-
-    if (ssl->state == SHUTTING_DOWN) {
-      if (ssl->network_out_pending == 0 && !ssl->queued_shutdown) {
-        start_ssl_shutdown(transport);
-      }
-    } else if (ssl->state == SSL_CLOSED) {
-      return PN_EOS;
-    }
-
-    // Consume or discard the decrypted bytes
-    if (new_app_input && (ssl->state == RUNNING || ssl->state == SHUTTING_DOWN)) {
-      // present app_inbytes to io_next only if it has new content
-      while (ssl->app_inbytes.size > 0) {
-        if (!ssl->app_input_closed) {
-          ssize_t count = transport->io_layers[layer+1]->process_input(transport, layer+1, ssl->app_inbytes.start, ssl->app_inbytes.size);
-          if (count > 0) {
-            forwarded += count;
-            // advance() can increase app_inbytes.size if double buffered
-            app_inbytes_advance(transport, count);
-            ssl_log(transport, "Application consumed %d bytes from peer\n", (int) count);
-          } else if (count == 0) {
-            size_t old_size = ssl->app_inbytes.size;
-            app_inbytes_advance(transport, 0);
-            if (ssl->app_inbytes.size == old_size) {
-              break;  // no additional contiguous decrypted data available, get more network data
-            }
-          } else {
-            // count < 0
-            ssl_log(transport, "Application layer closed its input, error=%d (discarding %d bytes)\n",
-                 (int) count, (int)ssl->app_inbytes.size);
-            app_inbytes_advance(transport, ssl->app_inbytes.size);    // discard
-            read_closed(transport, layer, count);
-          }
-        } else {
-          ssl_log(transport, "Input closed discard %d bytes\n",
-               (int)ssl->app_inbytes.size);
-          app_inbytes_advance(transport, ssl->app_inbytes.size);      // discard
-        }
-      }
-    }
-  } while (available || (ssl->sc_in_count && !ssl->sc_in_incomplete));
-
-  if (ssl->state >= SHUTTING_DOWN) {
-    if (ssl->app_input_closed || ssl->sc_input_shutdown) {
-      // Next layer doesn't want more bytes, or it can't process without more data than it has seen so far
-      // but the ssl stream has ended
-      consumed = ssl->app_input_closed ? ssl->app_input_closed : PN_EOS;
-      if (transport->io_layers[layer]==&ssl_output_closed_layer) {
-        transport->io_layers[layer] = &ssl_closed_layer;
-      } else {
-        transport->io_layers[layer] = &ssl_input_closed_layer;
-      }
-    }
-  }
-  ssl_log(transport, "process_input_ssl() returning %d, forwarded %d\n", (int) consumed, (int) forwarded);
-  return consumed;
-}
-
-static ssize_t process_output_ssl( pn_transport_t *transport, unsigned int layer, char *buffer, size_t max_len)
-{
-  pni_ssl_t *ssl = transport->ssl;
-  if (!ssl) return PN_EOS;
-  ssl_log( transport, "process_output_ssl( max_len=%d )\n",max_len );
-
-  ssize_t written = 0;
-  ssize_t total_app_bytes = 0;
-  bool work_pending;
-
-  if (ssl->state == CLIENT_HELLO) {
-    // output buffers eclusively for internal handshake use until negotiation complete
-    client_handshake_init(transport);
-    if (ssl->state == SSL_CLOSED)
-      return PN_EOS;
-    ssl->state = NEGOTIATING;
-  }
-
-  do {
-    work_pending = false;
-
-    if (ssl->network_out_pending > 0) {
-      size_t wcount = _pni_min(ssl->network_out_pending, max_len);
-      memmove(buffer, ssl->network_outp, wcount);
-      ssl->network_outp += wcount;
-      ssl->network_out_pending -= wcount;
-      buffer += wcount;
-      max_len -= wcount;
-      written += wcount;
-    }
-
-    if (ssl->network_out_pending == 0 && ssl->state == RUNNING  && !ssl->app_output_closed) {
-      // refill the buffer with app data and encrypt it
-
-      char *app_data = ssl->sc_outbuf + ssl->sc_sizes.cbHeader;
-      char *app_outp = app_data;
-      size_t remaining = ssl->max_data_size;
-      ssize_t app_bytes;
-      do {
-        app_bytes = transport->io_layers[layer+1]->process_output(transport, layer+1, app_outp, remaining);
-        if (app_bytes > 0) {
-          app_outp += app_bytes;
-          remaining -= app_bytes;
-          ssl_log( transport, "Gathered %d bytes from app to send to peer\n", app_bytes );
-        } else {
-          if (app_bytes < 0) {
-            ssl_log(transport, "Application layer closed its output, error=%d (%d bytes pending send)\n",
-                 (int) app_bytes, (int) ssl->network_out_pending);
-            ssl->app_output_closed = app_bytes;
-            if (ssl->app_input_closed)
-              ssl->state = SHUTTING_DOWN;
-          } else if (total_app_bytes == 0 && ssl->app_input_closed) {
-            // We've drained all the App layer can provide
-            ssl_log(transport, "Application layer blocked on input, closing\n");
-            ssl->state = SHUTTING_DOWN;
-            ssl->app_output_closed = PN_ERR;
-          }
-        }
-      } while (app_bytes > 0);
-      if (app_outp > app_data) {
-        work_pending = (max_len > 0);
-        ssl_encrypt(transport, app_data, app_outp - app_data);
-      }
-    }
-
-    if (ssl->network_out_pending == 0) {
-      if (ssl->state == SHUTTING_DOWN) {
-        if (!ssl->queued_shutdown) {
-          start_ssl_shutdown(transport);
-          work_pending = true;
-        } else {
-          ssl->state = SSL_CLOSED;
-        }
-      }
-      else if (ssl->state == NEGOTIATING && ssl->app_input_closed) {
-        ssl->app_output_closed = PN_EOS;
-        ssl->state = SSL_CLOSED;
-      }
-    }
-  } while (work_pending);
-
-  if (written == 0 && ssl->state == SSL_CLOSED) {
-    written = ssl->app_output_closed ? ssl->app_output_closed : PN_EOS;
-    if (transport->io_layers[layer]==&ssl_input_closed_layer) {
-      transport->io_layers[layer] = &ssl_closed_layer;
-    } else {
-      transport->io_layers[layer] = &ssl_output_closed_layer;
-    }
-  }
-  ssl_log(transport, "process_output_ssl() returning %d\n", (int) written);
-  return written;
-}
-
-
-static ssize_t process_input_done(pn_transport_t *transport, unsigned int layer, const char *input_data, size_t len)
-{
-  return PN_EOS;
-}
-
-static ssize_t process_output_done(pn_transport_t *transport, unsigned int layer, char *input_data, size_t len)
-{
-  return PN_EOS;
-}
-
-// return # output bytes sitting in this layer
-static size_t buffered_output(pn_transport_t *transport)
-{
-  size_t count = 0;
-  pni_ssl_t *ssl = transport->ssl;
-  if (ssl) {
-    count += ssl->network_out_pending;
-    if (count == 0 && ssl->state == SHUTTING_DOWN && ssl->queued_shutdown)
-      count++;
-  }
-  return count;
-}
-
-static HCERTSTORE open_cert_db(const char *store_name, const char *passwd, int *error) {
-  *error = 0;
-  DWORD sys_store_type = 0;
-  HCERTSTORE cert_store = 0;
-
-  if (store_name) {
-    if (strncmp(store_name, "ss:", 3) == 0) {
-      store_name += 3;
-      sys_store_type = CERT_SYSTEM_STORE_CURRENT_USER;
-    }
-    else if (strncmp(store_name, "lmss:", 5) == 0) {
-      store_name += 5;
-      sys_store_type = CERT_SYSTEM_STORE_LOCAL_MACHINE;
-    }
-  }
-
-  if (sys_store_type) {
-    // Opening a system store, names are not case sensitive.
-    // Map confusing GUI name to actual registry store name.
-    if (!pn_strcasecmp(store_name, "personal")) store_name= "my";
-    cert_store = CertOpenStore(CERT_STORE_PROV_SYSTEM_A, 0, NULL,
-                               CERT_STORE_OPEN_EXISTING_FLAG | CERT_STORE_READONLY_FLAG |
-                               sys_store_type, store_name);
-    if (!cert_store) {
-      ssl_log_error_status(GetLastError(), "Failed to open system certificate store %s", store_name);
-      *error = -3;
-      return NULL;
-    }
-  } else {
-    // PKCS#12 file
-    HANDLE cert_file = CreateFile(store_name, GENERIC_READ, 0, NULL, OPEN_EXISTING,
-                                  FILE_ATTRIBUTE_NORMAL, NULL);
-    if (INVALID_HANDLE_VALUE == cert_file) {
-      HRESULT status = GetLastError();
-      ssl_log_error_status(status, "Failed to open the file holding the private key: %s", store_name);
-      *error = -4;
-      return NULL;
-    }
-    DWORD nread = 0L;
-    const DWORD file_size = GetFileSize(cert_file, NULL);
-    char *buf = NULL;
-    if (INVALID_FILE_SIZE != file_size)
-      buf = (char *) malloc(file_size);
-    if (!buf || !ReadFile(cert_file, buf, file_size, &nread, NULL)
-        || file_size != nread) {
-      HRESULT status = GetLastError();
-      CloseHandle(cert_file);
-      free(buf);
-      ssl_log_error_status(status, "Reading the private key from file failed %s", store_name);
-      *error = -5;
-      return NULL;
-    }
-    CloseHandle(cert_file);
-
-    CRYPT_DATA_BLOB blob;
-    blob.cbData = nread;
-    blob.pbData = (BYTE *) buf;
-
-    wchar_t *pwUCS2 = NULL;
-    int pwlen = 0;
-    if (passwd) {
-      // convert passwd to null terminated wchar_t (Windows UCS2)
-      pwlen = strlen(passwd);
-      pwUCS2 = (wchar_t *) calloc(pwlen + 1, sizeof(wchar_t));
-      int nwc = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, passwd, pwlen, &pwUCS2[0], pwlen);
-      if (!nwc) {
-        ssl_log_error_status(GetLastError(), "Error converting password from UTF8");
-        free(buf);
-        free(pwUCS2);
-        *error = -6;
-        return NULL;
-      }
-    }
-
-    cert_store = PFXImportCertStore(&blob, pwUCS2, 0);
-    if (pwUCS2) {
-      SecureZeroMemory(pwUCS2, pwlen * sizeof(wchar_t));
-      free(pwUCS2);
-    }
-    if (cert_store == NULL) {
-      ssl_log_error_status(GetLastError(), "Failed to import the file based certificate store");
-      free(buf);
-      *error = -7;
-      return NULL;
-    }
-
-    free(buf);
-  }
-
-  return cert_store;
-}
-
-static bool store_contains(HCERTSTORE store, PCCERT_CONTEXT cert)
-{
-  DWORD find_type = CERT_FIND_EXISTING; // Require exact match
-  PCCERT_CONTEXT tcert = CertFindCertificateInStore(store, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING,
-                                                    0, find_type, cert, 0);
-  if (tcert) {
-    CertFreeCertificateContext(tcert);
-    return true;
-  }
-  return false;
-}
-
-/* Match the DNS name pattern from the peer certificate against our configured peer
-   hostname */
-static bool match_dns_pattern(const char *hostname, const char *pattern, int plen)
-{
-  int slen = (int) strlen(hostname);
-  if (memchr( pattern, '*', plen ) == NULL)
-    return (plen == slen &&
-            pn_strncasecmp( pattern, hostname, plen ) == 0);
-
-  /* dns wildcarded pattern - RFC2818 */
-  char plabel[64];   /* max label length < 63 - RFC1034 */
-  char slabel[64];
-
-  while (plen > 0 && slen > 0) {
-    const char *cptr;
-    int len;
-
-    cptr = (const char *) memchr( pattern, '.', plen );
-    len = (cptr) ? cptr - pattern : plen;
-    if (len > (int) sizeof(plabel) - 1) return false;
-    memcpy( plabel, pattern, len );
-    plabel[len] = 0;
-    if (cptr) ++len;    // skip matching '.'
-    pattern += len;
-    plen -= len;
-
-    cptr = (const char *) memchr( hostname, '.', slen );
-    len = (cptr) ? cptr - hostname : slen;
-    if (len > (int) sizeof(slabel) - 1) return false;
-    memcpy( slabel, hostname, len );
-    slabel[len] = 0;
-    if (cptr) ++len;    // skip matching '.'
-    hostname += len;
-    slen -= len;
-
-    char *star = strchr( plabel, '*' );
-    if (!star) {
-      if (pn_strcasecmp( plabel, slabel )) return false;
-    } else {
-      *star = '\0';
-      char *prefix = plabel;
-      int prefix_len = strlen(prefix);
-      char *suffix = star + 1;
-      int suffix_len = strlen(suffix);
-      if (prefix_len && pn_strncasecmp( prefix, slabel, prefix_len )) return false;
-      if (suffix_len && pn_strncasecmp( suffix,
-                                     slabel + (strlen(slabel) - suffix_len),
-                                     suffix_len )) return false;
-    }
-  }
-
-  return plen == slen;
-}
-
-// Caller must free the returned buffer
-static char* wide_to_utf8(LPWSTR wstring)
-{
-  int len = WideCharToMultiByte(CP_UTF8, 0, wstring, -1, 0, 0, 0, 0);
-  if (!len) {
-    ssl_log_error_status(GetLastError(), "converting UCS2 to UTF8");
-    return NULL;
-  }
-  char *p = (char *) malloc(len);
-  if (!p) return NULL;
-  if (WideCharToMultiByte(CP_UTF8, 0, wstring, -1, p, len, 0, 0))
-    return p;
-  ssl_log_error_status(GetLastError(), "converting UCS2 to UTF8");
-  free (p);
-  return NULL;
-}
-
-static bool server_name_matches(const char *server_name, CERT_EXTENSION *alt_name_ext, PCCERT_CONTEXT cert)
-{
-  // As for openssl.c: alt names first, then CN
-  bool matched = false;
-
-  if (alt_name_ext) {
-    CERT_ALT_NAME_INFO* alt_name_info = NULL;
-    DWORD size = 0;
-    if(!CryptDecodeObjectEx(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, szOID_SUBJECT_ALT_NAME2,
-                            alt_name_ext->Value.pbData, alt_name_ext->Value.cbData,
-                            CRYPT_DECODE_ALLOC_FLAG | CRYPT_DECODE_NOCOPY_FLAG,
-                            0, &alt_name_info, &size)) {
-      ssl_log_error_status(GetLastError(), "Alternative name match internal error");
-      return false;
-    }
-
-    int name_ct = alt_name_info->cAltEntry;
-    for (int i = 0; !matched && i < name_ct; ++i) {
-      if (alt_name_info->rgAltEntry[i].dwAltNameChoice == CERT_ALT_NAME_DNS_NAME) {
-        char *alt_name = wide_to_utf8(alt_name_info->rgAltEntry[i].pwszDNSName);
-        if (alt_name) {
-          matched = match_dns_pattern(server_name, (const char *) alt_name, strlen(alt_name));
-          free(alt_name);
-        }
-      }
-    }
-    LocalFree(&alt_name_info);
-  }
-
-  if (!matched) {
-    PCERT_INFO info = cert->pCertInfo;
-    DWORD len = CertGetNameString(cert, CERT_NAME_ATTR_TYPE, 0, szOID_COMMON_NAME, 0, 0);
-    char *name = (char *) malloc(len);
-    if (name) {
-      int count = CertGetNameString(cert, CERT_NAME_ATTR_TYPE, 0, szOID_COMMON_NAME, name, len);
-      if (count)
-        matched = match_dns_pattern(server_name, (const char *) name, strlen(name));
-      free(name);
-    }
-  }
-  return matched;
-}
-
-const char* pn_ssl_get_remote_subject_subfield(pn_ssl_t *ssl0, pn_ssl_cert_subject_subfield field)
-{
-    return NULL;
-}
-
-int pn_ssl_get_cert_fingerprint(pn_ssl_t *ssl0,
-                                          char *fingerprint,
-                                          size_t fingerprint_length,
-                                          pn_ssl_hash_alg hash_alg)
-{
-    return -1;
-}
-
-static HRESULT verify_peer(pni_ssl_t *ssl, HCERTSTORE root_store, const char *server_name, bool tracing)
-{
-  // Free/release the following before return:
-  PCCERT_CONTEXT peer_cc = 0;
-  PCCERT_CONTEXT trust_anchor = 0;
-  PCCERT_CHAIN_CONTEXT chain_context = 0;
-  wchar_t *nameUCS2 = 0;
-
-  if (server_name && strlen(server_name) > 255) {
-    ssl_log_error("invalid server name: %s\n", server_name);
-    return WSAENAMETOOLONG;
-  }
-
-  // Get peer's certificate.
-  SECURITY_STATUS status;
-  status = QueryContextAttributes(&ssl->ctxt_handle, SECPKG_ATTR_REMOTE_CERT_CONTEXT, &peer_cc);
-  if (status != SEC_E_OK) {
-    ssl_log_error_status(status, "can't obtain remote peer certificate information");
-    return status;
-  }
-
-  // Build the peer's certificate chain.  Multiple chains may be built but we
-  // care about rgpChain[0], which is the best.  Custom root stores are not
-  // allowed until W8/server 2012: see CERT_CHAIN_ENGINE_CONFIG.  For now, we
-  // manually override to taste.
-
-  // Chain verification functions give false reports for CRL if the trust anchor
-  // is not in the official root store.  We ignore CRL completely if it doesn't
-  // apply to any untrusted certs in the chain, and defer to SChannel's veto
-  // otherwise.  To rely on CRL, the CA must be in both the official system
-  // trusted root store and the Proton cred->trust_store.  To defeat CRL, the
-  // most distal cert with CRL must be placed in the Proton cred->trust_store.
-  // Similarly, certificate usage checking is overly strict at times.
-
-  CERT_CHAIN_PARA desc;
-  memset(&desc, 0, sizeof(desc));
-  desc.cbSize = sizeof(desc);
-
-  LPSTR usages[] = { szOID_PKIX_KP_SERVER_AUTH };
-  DWORD n_usages = sizeof(usages) / sizeof(LPSTR);
-  desc.RequestedUsage.dwType = USAGE_MATCH_TYPE_OR;
-  desc.RequestedUsage.Usage.cUsageIdentifier = n_usages;
-  desc.RequestedUsage.Usage.rgpszUsageIdentifier = usages;
-
-  if(!CertGetCertificateChain(0, peer_cc, 0, peer_cc->hCertStore, &desc,
-                             CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT |
-                             CERT_CHAIN_CACHE_END_CERT,
-                             0, &chain_context)){
-    HRESULT st = GetLastError();
-    ssl_log_error_status(st, "Basic certificate chain check failed");
-    CertFreeCertificateContext(peer_cc);
-    return st;
-  }
-  if (chain_context->cChain < 1 || chain_context->rgpChain[0]->cElement < 1) {
-    ssl_log_error("empty chain with status %x %x\n", chain_context->TrustStatus.dwErrorStatus,
-                 chain_context->TrustStatus.dwInfoStatus);
-    return SEC_E_CERT_UNKNOWN;
-  }
-
-  int chain_len = chain_context->rgpChain[0]->cElement;
-  PCCERT_CONTEXT leaf_cert = chain_context->rgpChain[0]->rgpElement[0]->pCertContext;
-  PCCERT_CONTEXT trunk_cert = chain_context->rgpChain[0]->rgpElement[chain_len - 1]->pCertContext;
-  if (tracing)
-    // See doc for CERT_CHAIN_POLICY_STATUS for bit field error and info status values
-    ssl_log_error("status for complete chain: error bits %x info bits %x\n",
-                  chain_context->TrustStatus.dwErrorStatus, chain_context->TrustStatus.dwInfoStatus);
-
-  // Supplement with checks against Proton's trusted_ca_db, custom revocation and usage.
-  HRESULT error = 0;
-  do {
-    // Do not return from this do loop.  Set error = SEC_E_XXX and break.
-    bool revocable = false;  // unless we see any untrusted certs that could be
-    for (int i = 0; i < chain_len; i++) {
-      CERT_CHAIN_ELEMENT *ce = chain_context->rgpChain[0]->rgpElement[i];
-      PCCERT_CONTEXT cc = ce->pCertContext;
-      if (cc->pCertInfo->dwVersion != CERT_V3) {
-        if (tracing)
-          ssl_log_error("certificate chain element %d is not version 3\n", i);
-        error = SEC_E_CERT_WRONG_USAGE; // A fossil
-        break;
-      }
-
-      if (!trust_anchor && store_contains(root_store, cc))
-        trust_anchor = CertDuplicateCertificateContext(cc);
-
-      int n_ext = cc->pCertInfo->cExtension;
-      for (int ii = 0; ii < n_ext && !revocable && !trust_anchor; ii++) {
-        CERT_EXTENSION *p = &cc->pCertInfo->rgExtension[ii];
-        // rfc 5280 extensions for revocation
-        if (!strcmp(p->pszObjId, szOID_AUTHORITY_INFO_ACCESS) ||
-            !strcmp(p->pszObjId, szOID_CRL_DIST_POINTS) ||
-            !strcmp(p->pszObjId, szOID_FRESHEST_CRL)) {
-          revocable = true;
-        }
-      }
-
-      if (tracing) {
-        char name[512];
-        const char *is_anchor = (cc == trust_anchor) ? " trust anchor" : "";
-        if (!CertNameToStr(cc->dwCertEncodingType, &cc->pCertInfo->Subject,
-                           CERT_X500_NAME_STR | CERT_NAME_STR_NO_PLUS_FLAG, name, sizeof(name)))
-          strcpy(name, "[too long]");
-        ssl_log_error("element %d (name: %s)%s error bits %x info bits %x\n", i, name, is_anchor,
-                      ce->TrustStatus.dwErrorStatus, ce->TrustStatus.dwInfoStatus);
-      }
-    }
-    if (error)
-      break;
-
-    if (!trust_anchor) {
-      // We don't trust any of the certs in the chain, see if the last cert
-      // is issued by a Proton trusted CA.
-      DWORD flags = CERT_STORE_NO_ISSUER_FLAG || CERT_STORE_SIGNATURE_FLAG ||
-        CERT_STORE_TIME_VALIDITY_FLAG;
-      trust_anchor = CertGetIssuerCertificateFromStore(root_store, trunk_cert, 0, &flags);
-      if (trust_anchor) {
-        if (tracing) {
-          if (flags & CERT_STORE_SIGNATURE_FLAG)
-            ssl_log_error("root certificate signature failure\n");
-          if (flags & CERT_STORE_TIME_VALIDITY_FLAG)
-            ssl_log_error("root certificate time validity failure\n");
-        }
-        if (flags) {
-          CertFreeCertificateContext(trust_anchor);
-          trust_anchor = 0;
-        }
-      }
-    }
-    if (!trust_anchor) {
-      error = SEC_E_UNTRUSTED_ROOT;
-      break;
-    }
-
-    bool strict_usage = false;
-    CERT_EXTENSION *leaf_alt_names = 0;
-    if (leaf_cert != trust_anchor) {
-      int n_ext = leaf_cert->pCertInfo->cExtension;
-      for (int ii = 0; ii < n_ext; ii++) {
-        CERT_EXTENSION *p = &leaf_cert->pCertInfo->rgExtension[ii];
-        if (!strcmp(p->pszObjId, szOID_ENHANCED_KEY_USAGE))
-          strict_usage = true;
-        if (!strcmp(p->pszObjId, szOID_SUBJECT_ALT_NAME2))
-          if (p->Value.pbData)
-            leaf_alt_names = p;
-      }
-    }
-
-    if (server_name) {
-      int len = strlen(server_name);
-      nameUCS2 = (wchar_t *) calloc(len + 1, sizeof(wchar_t));
-      int nwc = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, server_name, len, &nameUCS2[0], len);
-      if (!nwc) {
-        error = GetLastError();
-        ssl_log_error_status(error, "Error converting server name from UTF8");
-        break;
-      }
-    }
-
-    // SSL-specific parameters (ExtraPolicy below)
-    SSL_EXTRA_CERT_CHAIN_POLICY_PARA ssl_desc;
-    memset(&ssl_desc, 0, sizeof(ssl_desc));
-    ssl_desc.cbSize = sizeof(ssl_desc);
-    ssl_desc.pwszServerName = nameUCS2;
-    ssl_desc.dwAuthType = nameUCS2 ? AUTHTYPE_SERVER : AUTHTYPE_CLIENT;
-    ssl_desc.fdwChecks = SECURITY_FLAG_IGNORE_UNKNOWN_CA;
-    if (server_name)
-      ssl_desc.fdwChecks |= SECURITY_FLAG_IGNORE_CERT_CN_INVALID;
-    if (!revocable)
-      ssl_desc.fdwChecks |= SECURITY_FLAG_IGNORE_REVOCATION;
-    if (!strict_usage)
-      ssl_desc.fdwChecks |= SECURITY_FLAG_IGNORE_WRONG_USAGE;
-
-    // General certificate chain parameters
-    CERT_CHAIN_POLICY_PARA chain_desc;
-    memset(&chain_desc, 0, sizeof(chain_desc));
-    chain_desc.cbSize = sizeof(chain_desc);
-    chain_desc.dwFlags = CERT_CHAIN_POLICY_ALLOW_UNKNOWN_CA_FLAG;
-    if (!revocable)
-      chain_desc.dwFlags |= CERT_CHAIN_POLICY_IGNORE_ALL_REV_UNKNOWN_FLAGS;
-    if (!strict_usage)
-      chain_desc.dwFlags |= CERT_CHAIN_POLICY_IGNORE_WRONG_USAGE_FLAG;
-    chain_desc.pvExtraPolicyPara = &ssl_desc;
-
-    CERT_CHAIN_POLICY_STATUS chain_status;
-    memset(&chain_status, 0, sizeof(chain_status));
-    chain_status.cbSize = sizeof(chain_status);
-
-    if (!CertVerifyCertificateChainPolicy(CERT_CHAIN_POLICY_SSL, chain_context,
-                                          &chain_desc, &chain_status)) {
-      error = GetLastError();
-      // Failure to complete the check, does not (in)validate the cert.
-      ssl_log_error_status(error, "Supplemental certificate chain check failed");
-      break;
-    }
-
-    if (chain_status.dwError) {
-      error = chain_status.dwError;
-      if (tracing) {
-        ssl_log_error_status(chain_status.dwError, "Certificate chain verification error");
-        if (chain_status.lChainIndex == 0 && chain_status.lElementIndex != -1) {
-          int idx = chain_status.lElementIndex;
-          CERT_CHAIN_ELEMENT *ce = chain_context->rgpChain[0]->rgpElement[idx];
-          ssl_log_error("  chain failure at %d error/info: %x %x\n", idx,
-                        ce->TrustStatus.dwErrorStatus, ce->TrustStatus.dwInfoStatus);
-        }
-      }
-      break;
-    }
-
-    if (server_name && ssl->verify_mode == PN_SSL_VERIFY_PEER_NAME &&
-        !server_name_matches(server_name, leaf_alt_names, leaf_cert)) {
-      error = SEC_E_WRONG_PRINCIPAL;
-      break;
-    }
-    else if (ssl->verify_mode == PN_SSL_VERIFY_PEER_NAME && !server_name) {
-      ssl_log_error("Error: configuration error: PN_SSL_VERIFY_PEER_NAME configured, but no peer hostname set!");
-      error = SEC_E_WRONG_PRINCIPAL;
-      break;
-    }
-  } while (0);
-
-  if (tracing && !error)
-    ssl_log_error("peer certificate authenticated\n");
-
-  // Lots to clean up.
-  if (peer_cc)
-    CertFreeCertificateContext(peer_cc);
-  if (trust_anchor)
-    CertFreeCertificateContext(trust_anchor);
-  if (chain_context)
-    CertFreeCertificateChain(chain_context);
-  free(nameUCS2);
-  return error;
-}
diff --git a/proton-c/src/ssl/ssl-internal.h b/proton-c/src/ssl/ssl-internal.h
deleted file mode 100644
index d3205ea..0000000
--- a/proton-c/src/ssl/ssl-internal.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef PROTON_SSL_INTERNAL_H
-#define PROTON_SSL_INTERNAL_H 1
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "proton/ssl.h"
-
-/** @file
- * Internal API for SSL/TLS support in the Driver Layer.
- *
- * Generic API to abstract the implementation of SSL/TLS from the Driver codebase.
- *
- */
-
-// release the SSL context
-void pn_ssl_free(pn_transport_t *transport);
-
-#endif /* ssl-internal.h */
diff --git a/proton-c/src/ssl/ssl_stub.c b/proton-c/src/ssl/ssl_stub.c
deleted file mode 100644
index db2d983..0000000
--- a/proton-c/src/ssl/ssl_stub.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/ssl.h>
-#include <proton/error.h>
-#include <proton/transport.h>
-#include "core/engine-internal.h"
-
-
-/** @file
- * SSL/TLS support API.
- *
- * This file contains stub implementations of the SSL/TLS API.  This implementation is
- * used if there is no SSL/TLS support in the system's environment.
- */
-
-bool pn_ssl_present(void)
-{
-  return false;
-}
-
-pn_ssl_t *pn_ssl(pn_transport_t *transport)
-{
-  return NULL;
-}
-
-int pn_ssl_init(pn_ssl_t *ssl, pn_ssl_domain_t *domain,
-                const char *session_id)
-{
-  return -1;
-}
-
-void pn_ssl_free( pn_ssl_t *ssl)
-{
-}
-
-void pn_ssl_trace(pn_ssl_t *ssl, pn_trace_t trace)
-{
-}
-
-ssize_t pn_ssl_input(pn_transport_t *transport, unsigned int layer, const char *bytes, size_t available)
-{
-  return PN_EOS;
-}
-
-ssize_t pn_ssl_output(pn_transport_t *transport, unsigned int layer, char *buffer, size_t max_size)
-{
-  return PN_EOS;
-}
-
-const pn_io_layer_t ssl_layer = {
-    pn_ssl_input,
-    pn_ssl_output,
-    NULL,
-    NULL
-};
-
-bool pn_ssl_get_cipher_name(pn_ssl_t *ssl, char *buffer, size_t size)
-{
-  return false;
-}
-
-bool pn_ssl_get_protocol_name(pn_ssl_t *ssl, char *buffer, size_t size)
-{
-  return false;
-}
-
-pn_ssl_domain_t *pn_ssl_domain( pn_ssl_mode_t mode)
-{
-  return NULL;
-}
-
-void pn_ssl_domain_free( pn_ssl_domain_t *d )
-{
-}
-
-int pn_ssl_domain_set_credentials( pn_ssl_domain_t *domain,
-                               const char *certificate_file,
-                               const char *private_key_file,
-                               const char *password)
-{
-  return -1;
-}
-
-int pn_ssl_domain_set_trusted_ca_db(pn_ssl_domain_t *domain,
-                                const char *certificate_db)
-{
-  return -1;
-}
-
-int pn_ssl_domain_set_peer_authentication(pn_ssl_domain_t *domain,
-                                   const pn_ssl_verify_mode_t mode,
-                                   const char *trusted_CAs)
-{
-  return -1;
-}
-
-int pn_ssl_domain_allow_unsecured_client(pn_ssl_domain_t *domain)
-{
-  return -1;
-}
-
-bool pn_ssl_allow_unsecured(pn_ssl_t *ssl)
-{
-  return true;
-}
-
-pn_ssl_resume_status_t pn_ssl_resume_status( pn_ssl_t *s )
-{
-  return PN_SSL_RESUME_UNKNOWN;
-}
-
-int pn_ssl_set_peer_hostname( pn_ssl_t *ssl, const char *hostname)
-{
-  return -1;
-}
-
-int pn_ssl_get_peer_hostname( pn_ssl_t *ssl, char *hostname, size_t *bufsize )
-{
-  return -1;
-}
-
-const char* pn_ssl_get_remote_subject(pn_ssl_t *ssl)
-{
-  return NULL;
-}
-
-int pn_ssl_get_ssf(pn_ssl_t *ssl)
-{
-  return 0;
-}
-
-int pn_ssl_get_cert_fingerprint(pn_ssl_t *ssl0, char *fingerprint, size_t fingerprint_length, pn_ssl_hash_alg hash_alg)
-{
-    return -1;
-}
-
-const char* pn_ssl_get_remote_subject_subfield(pn_ssl_t *ssl0, pn_ssl_cert_subject_subfield field)
-{
-    return NULL;
-}
diff --git a/proton-c/src/tests/CMakeLists.txt b/proton-c/src/tests/CMakeLists.txt
deleted file mode 100644
index 59c7665..0000000
--- a/proton-c/src/tests/CMakeLists.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-add_definitions(${COMPILE_WARNING_FLAGS} ${COMPILE_PLATFORM_FLAGS})
-
-if (ENABLE_VALGRIND AND VALGRIND_EXE)
-  set(memcheck-cmd ${VALGRIND_EXE} --error-exitcode=1 --quiet
-                   --leak-check=full --trace-children=yes)
-endif ()
-
-macro (pn_add_c_test test file)
-  add_executable (${test} ${file})
-  target_link_libraries (${test} qpid-proton)
-  if (BUILD_WITH_CXX)
-    set_source_files_properties (${file} PROPERTIES LANGUAGE CXX)
-  endif (BUILD_WITH_CXX)
-  if (CMAKE_SYSTEM_NAME STREQUAL Windows)
-    add_test (NAME ${test}
-              COMMAND ${env_py}
-                "PATH=$<TARGET_FILE_DIR:qpid-proton>"
-                $<TARGET_FILE:${test}>)
-  else ()
-    add_test (${test} ${memcheck-cmd} ${CMAKE_CURRENT_BINARY_DIR}/${test})
-  endif ()
-endmacro(pn_add_c_test)
-
-pn_add_c_test (c-object-tests object.c)
-pn_add_c_test (c-message-tests message.c)
-pn_add_c_test (c-engine-tests engine.c)
-pn_add_c_test (c-parse-url-tests parse-url.c)
-pn_add_c_test (c-refcount-tests refcount.c)
-pn_add_c_test (c-reactor-tests reactor.c)
-pn_add_c_test (c-event-tests event.c)
-pn_add_c_test (c-data-tests data.c)
-pn_add_c_test (c-condition-tests condition.c)
diff --git a/proton-c/src/tests/condition.c b/proton-c/src/tests/condition.c
deleted file mode 100644
index 5ecc263..0000000
--- a/proton-c/src/tests/condition.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <proton/condition.h>
-#include <proton/connection.h>
-#include <stdio.h>
-#include <string.h>
-
-static int fail = 0;
-
-#define TEST_ASSERT(B)                                  \
-    if(!(B)) {                                          \
-        ++fail;                                         \
-        printf("%s:%d %s\n", __FILE__, __LINE__ , #B); \
-    }
-
-int main(int argc, char **argv) {
-    pn_connection_t *c = pn_connection();
-    pn_condition_t *cond = pn_connection_condition(c);
-
-    // Verify empty
-    TEST_ASSERT(!pn_condition_is_set(cond));
-    TEST_ASSERT(!pn_condition_get_name(cond));
-    TEST_ASSERT(!pn_condition_get_description(cond));
-
-    // Format a condition
-    pn_condition_format(cond, "foo", "hello %d", 42);
-    TEST_ASSERT(pn_condition_is_set(cond));
-    TEST_ASSERT(strcmp("foo", pn_condition_get_name(cond)) == 0);
-    TEST_ASSERT(strcmp("hello 42", pn_condition_get_description(cond)) == 0);
-
-    // Clear and verify empty
-    pn_condition_clear(cond);
-    TEST_ASSERT(!pn_condition_is_set(cond));
-    TEST_ASSERT(!pn_condition_get_name(cond));
-    TEST_ASSERT(!pn_condition_get_description(cond));
-
-    pn_connection_free(c);
-    return fail;
-}
diff --git a/proton-c/src/tests/data.c b/proton-c/src/tests/data.c
deleted file mode 100644
index 10e7039..0000000
--- a/proton-c/src/tests/data.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#undef NDEBUG                   /* Make sure that assert() is enabled even in a release build. */
-
-#include <proton/codec.h>
-#include "core/data.h"
-#include <assert.h>
-#include <stdio.h>
-
-// Make sure we can grow the capacity of a pn_data_t all the way to the max and we stop there.
-static void test_grow(void)
-{
-  pn_data_t* data = pn_data(0);
-  while (pn_data_size(data) < PNI_NID_MAX) {
-    int code = pn_data_put_int(data, 1);
-    if (code) fprintf(stderr, "%d: %s", code, pn_error_text(pn_data_error(data)));
-    assert(code == 0);
-  }
-  assert(pn_data_size(data) == PNI_NID_MAX);
-  int code = pn_data_put_int(data, 1);
-  if (code != PN_OUT_OF_MEMORY)
-    fprintf(stderr, "expected PN_OUT_OF_MEMORY, got  %s\n", pn_code(code));
-  assert(code == PN_OUT_OF_MEMORY);
-  assert(pn_data_size(data) == PNI_NID_MAX);
-  pn_data_free(data);
-}
-
-int main(int argc, char **argv) {
-  test_grow();
-}
diff --git a/proton-c/src/tests/engine.c b/proton-c/src/tests/engine.c
deleted file mode 100644
index 87d8d95..0000000
--- a/proton-c/src/tests/engine.c
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <proton/engine.h>
-
-// never remove 'assert()'
-#undef NDEBUG
-#include <assert.h>
-
-// push data from one transport to another
-static int xfer(pn_transport_t *src, pn_transport_t *dest)
-{
-    ssize_t out = pn_transport_pending(src);
-    if (out > 0) {
-        ssize_t in = pn_transport_capacity(dest);
-        if (in > 0) {
-            size_t count = (size_t)((out < in) ? out : in);
-            pn_transport_push(dest,
-                              pn_transport_head(src),
-                              count);
-            pn_transport_pop(src, count);
-            return (int)count;
-        }
-    }
-    return 0;
-}
-
-// transfer all available data between two transports
-static int pump(pn_transport_t *t1, pn_transport_t *t2)
-{
-    int total = 0;
-    int work;
-    do {
-        work = xfer(t1, t2) + xfer(t2, t1);
-        total += work;
-    } while (work);
-    return total;
-}
-
-// handle state changes of the endpoints
-static void process_endpoints(pn_connection_t *conn)
-{
-    pn_session_t *ssn = pn_session_head(conn, PN_LOCAL_UNINIT);
-    while (ssn) {
-        //fprintf(stderr, "Opening session %p\n", (void*)ssn);
-        pn_session_open(ssn);
-        ssn = pn_session_next(ssn, PN_LOCAL_UNINIT);
-    }
-
-    pn_link_t *link = pn_link_head(conn, PN_LOCAL_UNINIT);
-    while (link) {
-        //fprintf(stderr, "Opening link %p\n", (void*)link);
-        pn_link_open(link);
-        link = pn_link_next(link, PN_LOCAL_UNINIT);
-    }
-
-    link = pn_link_head(conn, PN_LOCAL_ACTIVE | PN_REMOTE_CLOSED);
-    while (link) {
-        //fprintf(stderr, "Closing link %p\n", (void*)link);
-        pn_link_close(link);
-        link = pn_link_next(link, PN_LOCAL_ACTIVE | PN_REMOTE_CLOSED);
-    }
-
-    ssn = pn_session_head(conn, PN_LOCAL_ACTIVE | PN_REMOTE_CLOSED);
-    while (ssn) {
-        //fprintf(stderr, "Closing session %p\n", (void*)ssn);
-        pn_session_close(ssn);
-        ssn = pn_session_next(ssn, PN_LOCAL_ACTIVE | PN_REMOTE_CLOSED);
-    }
-}
-
-// bring up a session and a link between the two connections
-static void test_setup(pn_connection_t *c1, pn_transport_t *t1,
-                       pn_connection_t *c2, pn_transport_t *t2)
-{
-    pn_connection_open(c1);
-    pn_connection_open(c2);
-
-    pn_session_t *s1 = pn_session(c1);
-    pn_session_open(s1);
-
-    pn_link_t *tx = pn_sender(s1, "sender");
-    pn_link_open(tx);
-
-    while (pump(t1, t2)) {
-        process_endpoints(c1);
-        process_endpoints(c2);
-    }
-
-    // session and link should be up, c2 should have a receiver link:
-
-    assert(pn_session_state( s1 ) == (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE));
-    assert(pn_link_state( tx ) == (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE));
-
-    pn_link_t *rx = pn_link_head(c2, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE));
-    assert(rx && pn_link_is_receiver(rx));
-}
-
-// test that free'ing the connection should free all contained
-// resources (session, links, deliveries)
-int test_free_connection(int argc, char **argv)
-{
-    fprintf(stdout, "test_free_connection\n");
-    pn_connection_t *c1 = pn_connection();
-    pn_transport_t  *t1 = pn_transport();
-    pn_transport_bind(t1, c1);
-
-    pn_connection_t *c2 = pn_connection();
-    pn_transport_t  *t2 = pn_transport();
-    pn_transport_set_server(t2);
-    pn_transport_bind(t2, c2);
-
-    //pn_transport_trace(t1, PN_TRACE_FRM);
-    test_setup(c1, t1,
-               c2, t2);
-
-    pn_link_t *tx = pn_link_head(c1, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE));
-    assert(tx);
-    pn_link_t *rx = pn_link_head(c2, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE));
-    assert(rx);
-
-    // transfer some data across the link:
-    pn_link_flow(rx, 10);
-    pn_delivery_t *d1 = pn_delivery(tx, pn_dtag("tag-1", 6));
-    while (pump(t1, t2)) {
-        process_endpoints(c1);
-        process_endpoints(c2);
-    }
-    assert(pn_delivery_writable(d1));
-    pn_link_send(tx, "ABC", 4);
-    pn_link_advance(tx);
-
-    // now free the connection, but keep processing the transport
-    process_endpoints(c1);
-    pn_connection_free(c1);
-    while (pump(t1, t2)) {
-        process_endpoints(c2);
-    }
-
-    // delivery should have transfered:
-    assert(pn_link_current(rx) &&
-           pn_delivery_readable(pn_link_current(rx)));
-
-    pn_transport_unbind(t1);
-    pn_transport_free(t1);
-
-    pn_connection_free(c2);
-    pn_transport_unbind(t2);
-    pn_transport_free(t2);
-
-    return 0;
-}
-
-int test_free_session(int argc, char **argv)
-{
-    fprintf(stdout, "test_free_session\n");
-    pn_connection_t *c1 = pn_connection();
-    pn_transport_t  *t1 = pn_transport();
-    pn_transport_bind(t1, c1);
-
-    pn_connection_t *c2 = pn_connection();
-    pn_transport_t  *t2 = pn_transport();
-    pn_transport_set_server(t2);
-    pn_transport_bind(t2, c2);
-
-    //pn_transport_trace(t1, PN_TRACE_FRM);
-    test_setup(c1, t1,
-               c2, t2);
-
-    pn_session_t *ssn = pn_session_head(c1, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE));
-    assert(ssn);
-    pn_link_t *tx = pn_link_head(c1, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE));
-    assert(tx);
-    pn_link_t *rx = pn_link_head(c2, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE));
-    assert(rx);
-
-    // prepare for transfer: request some credit
-    pn_link_flow(rx, 10);
-    pn_delivery_t *d1 = pn_delivery(tx, pn_dtag("tag-1", 6));
-    while (pump(t1, t2)) {
-        process_endpoints(c1);
-        process_endpoints(c2);
-    }
-    assert(pn_delivery_writable(d1));
-
-    // send some data, but also close the session:
-    pn_link_send(tx, "ABC", 4);
-    pn_link_advance(tx);
-
-    pn_session_close(ssn);
-    pn_session_free(ssn);
-
-    while (pump(t1, t2)) {
-        process_endpoints(c1);
-        process_endpoints(c2);
-    }
-
-    // delivery should have transfered:
-    assert(pn_link_current(rx));
-    assert(pn_delivery_readable(pn_link_current(rx)));
-
-    // c2's session should see the close:
-    pn_session_t *ssn2 = pn_session_head(c2, 0);
-    assert(ssn2 && pn_session_state(ssn2) == (PN_LOCAL_CLOSED | PN_REMOTE_CLOSED));
-
-    pn_transport_unbind(t1);
-    pn_transport_free(t1);
-    pn_connection_free(c1);
-
-    pn_transport_unbind(t2);
-    pn_transport_free(t2);
-    pn_connection_free(c2);
-
-    return 0;
-}
-
-int test_free_link(int argc, char **argv)
-{
-    fprintf(stdout, "test_free_link\n");
-    pn_connection_t *c1 = pn_connection();
-    pn_transport_t  *t1 = pn_transport();
-    pn_transport_bind(t1, c1);
-
-    pn_connection_t *c2 = pn_connection();
-    pn_transport_t  *t2 = pn_transport();
-    pn_transport_set_server(t2);
-    pn_transport_bind(t2, c2);
-
-    //pn_transport_trace(t1, PN_TRACE_FRM);
-    test_setup(c1, t1,
-               c2, t2);
-
-    pn_link_t *tx = pn_link_head(c1, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE));
-    assert(tx);
-    pn_link_t *rx = pn_link_head(c2, (PN_LOCAL_ACTIVE | PN_REMOTE_ACTIVE));
-    assert(rx);
-
-    // prepare for transfer: request some credit
-    pn_link_flow(rx, 10);
-    pn_delivery_t *d1 = pn_delivery(tx, pn_dtag("tag-1", 6));
-    while (pump(t1, t2)) {
-        process_endpoints(c1);
-        process_endpoints(c2);
-    }
-    assert(pn_delivery_writable(d1));
-
-    // send some data, then close and destroy the link:
-    pn_link_send(tx, "ABC", 4);
-    pn_link_advance(tx);
-
-    pn_link_close(tx);
-    pn_link_free(tx);
-
-    while (pump(t1, t2)) {
-        process_endpoints(c1);
-        process_endpoints(c2);
-    }
-
-    // the data transfer will complete and the link close
-    // should have been sent to the peer
-    assert(pn_link_current(rx));
-    assert(pn_link_state(rx) == (PN_LOCAL_CLOSED | PN_REMOTE_CLOSED));
-
-    pn_transport_unbind(t1);
-    pn_transport_free(t1);
-    pn_connection_free(c1);
-
-    pn_transport_unbind(t2);
-    pn_transport_free(t2);
-    pn_connection_free(c2);
-
-    return 0;
-}
-
-
-typedef int (*test_ptr_t)(int argc, char **argv);
-
-test_ptr_t tests[] = {test_free_connection,
-                      test_free_session,
-                      test_free_link,
-                      NULL};
-
-int main(int argc, char **argv)
-{
-    test_ptr_t *test = tests;
-    while (*test) {
-        int rc = (*test++)(argc, argv);
-        if (rc)
-            return rc;
-    }
-    return 0;
-}
diff --git a/proton-c/src/tests/event.c b/proton-c/src/tests/event.c
deleted file mode 100644
index 6746c3b..0000000
--- a/proton-c/src/tests/event.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/object.h>
-#include <proton/event.h>
-#include <stdlib.h>
-
-#define assert(E) ((E) ? 0 : (abort(), 0))
-
-static void test_collector(void) {
-  pn_collector_t *collector = pn_collector();
-  assert(collector);
-  pn_free(collector);
-}
-
-#define SETUP_COLLECTOR \
-  void *obj = pn_class_new(PN_OBJECT, 0); \
-  pn_collector_t *collector = pn_collector(); \
-  assert(collector); \
-  pn_event_t *event = pn_collector_put(collector, PN_OBJECT, obj, (pn_event_type_t) 0); \
-  pn_decref(obj); \
-
-static void test_collector_put(void) {
-  SETUP_COLLECTOR;
-  assert(event);
-  assert(pn_event_context(event) == obj);
-  pn_free(collector);
-}
-
-static void test_collector_peek(void) {
-  SETUP_COLLECTOR;
-  pn_event_t *head = pn_collector_peek(collector);
-  assert(head == event);
-  pn_free(collector);
-}
-
-static void test_collector_pop(void) {
-  SETUP_COLLECTOR;
-  pn_event_t *head = pn_collector_peek(collector);
-  assert(head == event);
-  pn_collector_pop(collector);
-  head = pn_collector_peek(collector);
-  assert(!head);
-  pn_free(collector);
-}
-
-static void test_collector_pool(void) {
-  SETUP_COLLECTOR;
-  pn_event_t *head = pn_collector_peek(collector);
-  assert(head == event);
-  pn_collector_pop(collector);
-  head = pn_collector_peek(collector);
-  assert(!head);
-  void *obj2 = pn_class_new(PN_OBJECT, 0);
-  pn_event_t *event2 = pn_collector_put(collector, PN_OBJECT, obj2, (pn_event_type_t) 0);
-  pn_decref(obj2);
-  assert(event == event2);
-  pn_free(collector);
-}
-
-static void test_event_incref(bool eventfirst) {
-  SETUP_COLLECTOR;
-  pn_event_t *head = pn_collector_peek(collector);
-  assert(head == event);
-  pn_incref(head);
-  pn_collector_pop(collector);
-  assert(!pn_collector_peek(collector));
-  void *obj2 = pn_class_new(PN_OBJECT, 0);
-  pn_event_t *event2 = pn_collector_put(collector, PN_OBJECT, obj2, (pn_event_type_t) 0);
-  pn_decref(obj2);
-  assert(head != event2);
-  if (eventfirst) {
-    pn_decref(head);
-    pn_free(collector);
-  } else {
-    pn_free(collector);
-    pn_decref(head);
-  }
-}
-
-int main(int argc, char **argv)
-{
-  test_collector();
-  test_collector_put();
-  test_collector_peek();
-  test_collector_pop();
-  test_collector_pool();
-  test_event_incref(true);
-  test_event_incref(false);
-  return 0;
-}
diff --git a/proton-c/src/tests/message.c b/proton-c/src/tests/message.c
deleted file mode 100644
index 272e25f..0000000
--- a/proton-c/src/tests/message.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <proton/error.h>
-#include <proton/message.h>
-
-#define assert(E) ((E) ? 0 : (abort(), 0))
-
-static void test_overflow_error(void)
-{
-  pn_message_t *message = pn_message();
-  char buf[8];
-  size_t size = 8;
-
-  int err = pn_message_encode(message, buf, &size);
-  assert(err == PN_OVERFLOW);
-  assert(pn_message_errno(message) == 0);
-  pn_message_free(message);
-}
-
-int main(int argc, char **argv)
-{
-  test_overflow_error();
-  return 0;
-}
diff --git a/proton-c/src/tests/object.c b/proton-c/src/tests/object.c
deleted file mode 100644
index 8a1d00e..0000000
--- a/proton-c/src/tests/object.c
+++ /dev/null
@@ -1,1115 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <proton/object.h>
-
-#define assert(E) ((E) ? 0 : (abort(), 0))
-
-static char mem;
-static void *END = &mem;
-
-static pn_list_t *build_list(size_t capacity, ...)
-{
-  pn_list_t *result = pn_list(PN_OBJECT, capacity);
-  va_list ap;
-
-  va_start(ap, capacity);
-  while (true) {
-    void *arg = va_arg(ap, void *);
-    if (arg == END) {
-      break;
-    }
-
-    pn_list_add(result, arg);
-    pn_class_decref(PN_OBJECT, arg);
-  }
-  va_end(ap);
-
-  return result;
-}
-
-static pn_map_t *build_map(float load_factor, size_t capacity, ...)
-{
-  pn_map_t *result = pn_map(PN_OBJECT, PN_OBJECT, capacity, load_factor);
-  va_list ap;
-
-  void *prev = NULL;
-
-  va_start(ap, capacity);
-  int count = 0;
-  while (true) {
-    void *arg = va_arg(ap, void *);
-    bool last = arg == END;
-    if (arg == END) {
-      arg = NULL;
-    }
-
-    if (count % 2) {
-      pn_map_put(result, prev, arg);
-      pn_class_decref(PN_OBJECT, prev);
-      pn_class_decref(PN_OBJECT, arg);
-    } else {
-      prev = arg;
-    }
-
-    if (last) {
-      break;
-    }
-
-    count++;
-  }
-  va_end(ap);
-
-  return result;
-}
-
-static void noop(void *o) {}
-static uintptr_t zero(void *o) { return 0; }
-static intptr_t delta(void *a, void *b) { return (uintptr_t) b - (uintptr_t) a; }
-
-#define CID_noop CID_pn_object
-#define noop_initialize noop
-#define noop_finalize noop
-#define noop_hashcode zero
-#define noop_compare delta
-#define noop_inspect NULL
-
-static const pn_class_t noop_class = PN_CLASS(noop);
-
-static void test_class(const pn_class_t *clazz, size_t size)
-{
-  void *a = pn_class_new(clazz, size);
-  void *b = pn_class_new(clazz, size);
-
-  assert(!pn_class_equals(clazz, a, b));
-  assert(pn_class_equals(clazz, a, a));
-  assert(pn_class_equals(clazz, b, b));
-  assert(!pn_class_equals(clazz, a, NULL));
-  assert(!pn_class_equals(clazz, NULL, a));
-
-  int rca = pn_class_refcount(clazz, a);
-  int rcb = pn_class_refcount(clazz, b);
-
-  assert(rca == -1 || rca == 1);
-  assert(rcb == -1 || rcb == 1);
-
-  pn_class_incref(clazz, a);
-
-  rca = pn_class_refcount(clazz, a);
-  assert(rca == -1 || rca == 2);
-
-  pn_class_decref(clazz, a);
-
-  rca = pn_class_refcount(clazz, a);
-  assert(rca == -1 || rca == 1);
-
-  pn_class_free(clazz, a);
-  pn_class_free(clazz, b);
-}
-
-static void test_new(size_t size, const pn_class_t *clazz)
-{
-  void *obj = pn_class_new(clazz, size);
-  assert(obj);
-  assert(pn_class_refcount(PN_OBJECT, obj) == 1);
-  assert(pn_class(obj) == clazz);
-  char *bytes = (char *) obj;
-  for (size_t i = 0; i < size; i++) {
-    // touch everything for valgrind
-    bytes[i] = i;
-  }
-  pn_free(obj);
-}
-
-static void finalizer(void *object)
-{
-  int **called = (int **) object;
-  (**called)++;
-}
-
-#define CID_finalizer CID_pn_object
-#define finalizer_initialize NULL
-#define finalizer_finalize finalizer
-#define finalizer_hashcode NULL
-#define finalizer_compare NULL
-#define finalizer_inspect NULL
-
-static void test_finalize(void)
-{
-  static pn_class_t clazz = PN_CLASS(finalizer);
-
-  int **obj = (int **) pn_class_new(&clazz, sizeof(int *));
-  assert(obj);
-
-  int called = 0;
-  *obj = &called;
-  pn_free(obj);
-
-  assert(called == 1);
-}
-
-static void test_free(void)
-{
-  // just to make sure it doesn't seg fault or anything
-  pn_free(NULL);
-}
-
-static uintptr_t hashcode(void *obj) { return (uintptr_t) obj; }
-
-#define CID_hashcode CID_pn_object
-#define hashcode_initialize NULL
-#define hashcode_finalize NULL
-#define hashcode_compare NULL
-#define hashcode_hashcode hashcode
-#define hashcode_inspect NULL
-
-static void test_hashcode(void)
-{
-  static pn_class_t clazz = PN_CLASS(hashcode);
-  void *obj = pn_class_new(&clazz, 0);
-  assert(obj);
-  assert(pn_hashcode(obj) == (uintptr_t) obj);
-  assert(pn_hashcode(NULL) == 0);
-  pn_free(obj);
-}
-
-#define CID_compare CID_pn_object
-#define compare_initialize NULL
-#define compare_finalize NULL
-#define compare_compare delta
-#define compare_hashcode NULL
-#define compare_inspect NULL
-
-static void test_compare(void)
-{
-  static pn_class_t clazz = PN_CLASS(compare);
-
-  void *a = pn_class_new(&clazz, 0);
-  assert(a);
-  void *b = pn_class_new(&clazz, 0);
-  assert(b);
-
-  assert(pn_compare(a, b));
-  assert(!pn_equals(a, b));
-  assert(!pn_compare(a, a));
-  assert(pn_equals(a, a));
-  assert(!pn_compare(b, b));
-  assert(pn_equals(b, b));
-  assert(pn_compare(a, b) == (intptr_t) ((uintptr_t) b - (uintptr_t) a));
-
-  assert(pn_compare(NULL, b));
-  assert(!pn_equals(NULL, b));
-
-  assert(pn_compare(a, NULL));
-  assert(!pn_equals(a, NULL));
-
-  assert(!pn_compare(NULL, NULL));
-  assert(pn_equals(NULL, NULL));
-
-  pn_free(a);
-  pn_free(b);
-}
-
-static void test_refcounting(int refs)
-{
-  void *obj = pn_class_new(PN_OBJECT, 0);
-
-  assert(pn_refcount(obj) == 1);
-
-  for (int i = 0; i < refs; i++) {
-    pn_incref(obj);
-    assert(pn_refcount(obj) == i + 2);
-  }
-
-  assert(pn_refcount(obj) == refs + 1);
-
-  for (int i = 0; i < refs; i++) {
-    pn_decref(obj);
-    assert(pn_refcount(obj) == refs - i);
-  }
-
-  assert(pn_refcount(obj) == 1);
-
-  pn_free(obj);
-}
-
-static void test_list(size_t capacity)
-{
-  pn_list_t *list = pn_list(PN_WEAKREF, 0);
-  assert(pn_list_size(list) == 0);
-  assert(!pn_list_add(list, (void *) 0));
-  assert(!pn_list_add(list, (void *) 1));
-  assert(!pn_list_add(list, (void *) 2));
-  assert(!pn_list_add(list, (void *) 3));
-  assert(pn_list_get(list, 0) == (void *) 0);
-  assert(pn_list_get(list, 1) == (void *) 1);
-  assert(pn_list_get(list, 2) == (void *) 2);
-  assert(pn_list_get(list, 3) == (void *) 3);
-  assert(pn_list_size(list) == 4);
-  pn_list_del(list, 1, 2);
-  assert(pn_list_size(list) == 2);
-  assert(pn_list_get(list, 0) == (void *) 0);
-  assert(pn_list_get(list, 1) == (void *) 3);
-  pn_decref(list);
-}
-
-static void test_list_refcount(size_t capacity)
-{
-  void *one = pn_class_new(PN_OBJECT, 0);
-  void *two = pn_class_new(PN_OBJECT, 0);
-  void *three = pn_class_new(PN_OBJECT, 0);
-  void *four = pn_class_new(PN_OBJECT, 0);
-
-  pn_list_t *list = pn_list(PN_OBJECT, 0);
-  assert(!pn_list_add(list, one));
-  assert(!pn_list_add(list, two));
-  assert(!pn_list_add(list, three));
-  assert(!pn_list_add(list, four));
-  assert(pn_list_get(list, 0) == one);
-  assert(pn_list_get(list, 1) == two);
-  assert(pn_list_get(list, 2) == three);
-  assert(pn_list_get(list, 3) == four);
-  assert(pn_list_size(list) == 4);
-
-  assert(pn_refcount(one) == 2);
-  assert(pn_refcount(two) == 2);
-  assert(pn_refcount(three) == 2);
-  assert(pn_refcount(four) == 2);
-
-  pn_list_del(list, 1, 2);
-  assert(pn_list_size(list) == 2);
-
-  assert(pn_refcount(one) == 2);
-  assert(pn_refcount(two) == 1);
-  assert(pn_refcount(three) == 1);
-  assert(pn_refcount(four) == 2);
-
-  assert(pn_list_get(list, 0) == one);
-  assert(pn_list_get(list, 1) == four);
-
-  assert(!pn_list_add(list, one));
-
-  assert(pn_list_size(list) == 3);
-  assert(pn_refcount(one) == 3);
-
-  pn_decref(list);
-
-  assert(pn_refcount(one) == 1);
-  assert(pn_refcount(two) == 1);
-  assert(pn_refcount(three) == 1);
-  assert(pn_refcount(four) == 1);
-
-  pn_decref(one);
-  pn_decref(two);
-  pn_decref(three);
-  pn_decref(four);
-}
-
-static void check_list_index(pn_list_t *list, void *value, ssize_t idx)
-{
-  assert(pn_list_index(list, value) == idx);
-}
-
-static void test_list_index(void)
-{
-  pn_list_t *l = pn_list(PN_WEAKREF, 0);
-  void *one = pn_string("one");
-  void *two = pn_string("two");
-  void *three = pn_string("three");
-  void *dup1 = pn_string("dup");
-  void *dup2 = pn_string("dup");
-  void *last = pn_string("last");
-
-  pn_list_add(l, one);
-  pn_list_add(l, two);
-  pn_list_add(l, three);
-  pn_list_add(l, dup1);
-  pn_list_add(l, dup2);
-  pn_list_add(l, last);
-
-  check_list_index(l, one, 0);
-  check_list_index(l, two, 1);
-  check_list_index(l, three, 2);
-  check_list_index(l, dup1, 3);
-  check_list_index(l, dup2, 3);
-  check_list_index(l, last, 5);
-
-  void *nonexistent = pn_string("nonexistent");
-
-  check_list_index(l, nonexistent, -1);
-
-  pn_free(l);
-  pn_free(one);
-  pn_free(two);
-  pn_free(three);
-  pn_free(dup1);
-  pn_free(dup2);
-  pn_free(last);
-  pn_free(nonexistent);
-}
-
-static bool pn_strequals(const char *a, const char *b)
-{
-  return !strcmp(a, b);
-}
-
-static void test_build_list(void)
-{
-  pn_list_t *l = build_list(0,
-                            pn_string("one"),
-                            pn_string("two"),
-                            pn_string("three"),
-                            END);
-
-  assert(pn_list_size(l) == 3);
-
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_list_get(l, 0)),
-                      "one"));
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_list_get(l, 1)),
-                      "two"));
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_list_get(l, 2)),
-                      "three"));
-
-  pn_free(l);
-}
-
-static void test_build_map(void)
-{
-  pn_map_t *m = build_map(0.75, 0,
-                          pn_string("key"),
-                          pn_string("value"),
-                          pn_string("key2"),
-                          pn_string("value2"),
-                          END);
-
-  assert(pn_map_size(m) == 2);
-
-  pn_string_t *key = pn_string(NULL);
-
-  pn_string_set(key, "key");
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_map_get(m, key)),
-                      "value"));
-  pn_string_set(key, "key2");
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_map_get(m, key)),
-                      "value2"));
-
-  pn_free(m);
-  pn_free(key);
-}
-
-static void test_build_map_odd(void)
-{
-  pn_map_t *m = build_map(0.75, 0,
-                          pn_string("key"),
-                          pn_string("value"),
-                          pn_string("key2"),
-                          pn_string("value2"),
-                          pn_string("key3"),
-                          END);
-
-  assert(pn_map_size(m) == 3);
-
-  pn_string_t *key = pn_string(NULL);
-
-  pn_string_set(key, "key");
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_map_get(m, key)),
-                      "value"));
-  pn_string_set(key, "key2");
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_map_get(m, key)),
-                      "value2"));
-  pn_string_set(key, "key3");
-  assert(pn_map_get(m, key) == NULL);
-
-  pn_free(m);
-  pn_free(key);
-}
-
-static void test_map(void)
-{
-  void *one = pn_class_new(PN_OBJECT, 0);
-  void *two = pn_class_new(PN_OBJECT, 0);
-  void *three = pn_class_new(PN_OBJECT, 0);
-
-  pn_map_t *map = pn_map(PN_OBJECT, PN_OBJECT, 4, 0.75);
-  assert(pn_map_size(map) == 0);
-
-  pn_string_t *key = pn_string("key");
-  pn_string_t *dup = pn_string("key");
-  pn_string_t *key1 = pn_string("key1");
-  pn_string_t *key2 = pn_string("key2");
-
-  assert(!pn_map_put(map, key, one));
-  assert(pn_map_size(map) == 1);
-  assert(!pn_map_put(map, key1, two));
-  assert(pn_map_size(map) == 2);
-  assert(!pn_map_put(map, key2, three));
-  assert(pn_map_size(map) == 3);
-
-  assert(pn_map_get(map, dup) == one);
-
-  assert(!pn_map_put(map, dup, one));
-  assert(pn_map_size(map) == 3);
-
-  assert(!pn_map_put(map, dup, two));
-  assert(pn_map_size(map) == 3);
-  assert(pn_map_get(map, dup) == two);
-
-  assert(pn_refcount(key) == 2);
-  assert(pn_refcount(dup) == 1);
-  assert(pn_refcount(key1) == 2);
-  assert(pn_refcount(key2) == 2);
-
-  assert(pn_refcount(one) == 1);
-  assert(pn_refcount(two) == 3);
-  assert(pn_refcount(three) == 2);
-
-  pn_map_del(map, key1);
-  assert(pn_map_size(map) == 2);
-
-  assert(pn_refcount(key) == 2);
-  assert(pn_refcount(dup) == 1);
-  assert(pn_refcount(key1) == 1);
-  assert(pn_refcount(key2) == 2);
-
-  assert(pn_refcount(one) == 1);
-  assert(pn_refcount(two) == 2);
-  assert(pn_refcount(three) == 2);
-
-  pn_decref(one);
-  pn_decref(two);
-  pn_decref(three);
-
-  pn_decref(key);
-  pn_decref(dup);
-  pn_decref(key1);
-  pn_decref(key2);
-
-  pn_decref(map);
-}
-
-static void test_hash(void)
-{
-  void *one = pn_class_new(PN_OBJECT, 0);
-  void *two = pn_class_new(PN_OBJECT, 0);
-  void *three = pn_class_new(PN_OBJECT, 0);
-
-  pn_hash_t *hash = pn_hash(PN_OBJECT, 4, 0.75);
-  pn_hash_put(hash, 0, NULL);
-  pn_hash_put(hash, 1, one);
-  pn_hash_put(hash, 2, two);
-  pn_hash_put(hash, 3, three);
-  pn_hash_put(hash, 4, one);
-  pn_hash_put(hash, 5, two);
-  pn_hash_put(hash, 6, three);
-  pn_hash_put(hash, 7, one);
-  pn_hash_put(hash, 8, two);
-  pn_hash_put(hash, 9, three);
-  pn_hash_put(hash, 10, one);
-  pn_hash_put(hash, 11, two);
-  pn_hash_put(hash, 12, three);
-  pn_hash_put(hash, 18, one);
-
-  assert(pn_hash_get(hash, 2) == two);
-  assert(pn_hash_get(hash, 5) == two);
-  assert(pn_hash_get(hash, 18) == one);
-  assert(pn_hash_get(hash, 0) == NULL);
-
-  assert(pn_hash_size(hash) == 14);
-
-  pn_hash_del(hash, 5);
-  assert(pn_hash_get(hash, 5) == NULL);
-  assert(pn_hash_size(hash) == 13);
-  pn_hash_del(hash, 18);
-  assert(pn_hash_get(hash, 18) == NULL);
-  assert(pn_hash_size(hash) == 12);
-
-  pn_decref(hash);
-
-  pn_decref(one);
-  pn_decref(two);
-  pn_decref(three);
-}
-
-
-// collider class: all objects have same hash, no two objects compare equal
-static intptr_t collider_compare(void *a, void *b)
-{
-  if (a == b) return 0;
-  return (a > b) ? 1 : -1;
-}
-
-static uintptr_t collider_hashcode(void *obj)
-{
-  return 23;
-}
-
-#define CID_collider CID_pn_object
-#define collider_initialize NULL
-#define collider_finalize NULL
-#define collider_inspect NULL
-
-static void test_map_links(void)
-{
-  const pn_class_t collider_clazz = PN_CLASS(collider);
-  void *keys[3];
-  for (int i = 0; i < 3; i++)
-    keys[i] = pn_class_new(&collider_clazz, 0);
-
-  // test deleting a head, middle link, tail
-
-  for (int delete_idx=0; delete_idx < 3; delete_idx++) {
-    pn_map_t *map = pn_map(PN_WEAKREF, PN_WEAKREF, 0, 0.75);
-    // create a chain of entries that have same head (from identical key hashcode)
-    for (int i = 0; i < 3; i++) {
-      pn_map_put(map, keys[i], keys[i]);
-    }
-    pn_map_del(map, keys[delete_idx]);
-    for (int i = 0; i < 3; i++) {
-      void *value = (i == delete_idx) ? NULL : keys[i];
-      assert (pn_map_get(map, keys[i]) == value);
-    }
-    pn_free(map);
-  }
-  for (int i = 0; i < 3; i++)
-    pn_free(keys[i]);
-}
-
-
-static bool equals(const char *a, const char *b)
-{
-  if (a == NULL && b == NULL) {
-    return true;
-  }
-
-  if (a == NULL || b == NULL) {
-    return false;
-  }
-
-  return !strcmp(a, b);
-}
-
-static void test_string(const char *value)
-{
-  size_t size = value ? strlen(value) : 0;
-
-  pn_string_t *str = pn_string(value);
-  assert(equals(pn_string_get(str), value));
-  assert(pn_string_size(str) == size);
-
-  pn_string_t *strn = pn_stringn(value, size);
-  assert(equals(pn_string_get(strn), value));
-  assert(pn_string_size(strn) == size);
-
-  pn_string_t *strset = pn_string(NULL);
-  pn_string_set(strset, value);
-  assert(equals(pn_string_get(strset), value));
-  assert(pn_string_size(strset) == size);
-
-  pn_string_t *strsetn = pn_string(NULL);
-  pn_string_setn(strsetn, value, size);
-  assert(equals(pn_string_get(strsetn), value));
-  assert(pn_string_size(strsetn) == size);
-
-  assert(pn_hashcode(str) == pn_hashcode(strn));
-  assert(pn_hashcode(str) == pn_hashcode(strset));
-  assert(pn_hashcode(str) == pn_hashcode(strsetn));
-
-  assert(!pn_compare(str, str));
-  assert(!pn_compare(str, strn));
-  assert(!pn_compare(str, strset));
-  assert(!pn_compare(str, strsetn));
-
-  pn_free(str);
-  pn_free(strn);
-  pn_free(strset);
-  pn_free(strsetn);
-}
-
-static void test_stringn(const char *value, size_t size)
-{
-  pn_string_t *strn = pn_stringn(value, size);
-  assert(equals(pn_string_get(strn), value));
-  assert(pn_string_size(strn) == size);
-
-  pn_string_t *strsetn = pn_string(NULL);
-  pn_string_setn(strsetn, value, size);
-  assert(equals(pn_string_get(strsetn), value));
-  assert(pn_string_size(strsetn) == size);
-
-  assert(pn_hashcode(strn) == pn_hashcode(strsetn));
-  assert(!pn_compare(strn, strsetn));
-
-  pn_free(strn);
-  pn_free(strsetn);
-}
-
-static void test_string_format(void)
-{
-  pn_string_t *str = pn_string("");
-  assert(str);
-  int err = pn_string_format(str, "%s", "this is a string that should be long "
-                             "enough to force growth but just in case we'll "
-                             "tack this other really long string on for the "
-                             "heck of it");
-  assert(err == 0);
-  pn_free(str);
-}
-
-static void test_string_addf(void)
-{
-  pn_string_t *str = pn_string("hello ");
-  assert(str);
-  int err = pn_string_addf(str, "%s", "this is a string that should be long "
-                           "enough to force growth but just in case we'll "
-                           "tack this other really long string on for the "
-                           "heck of it");
-  assert(err == 0);
-  pn_free(str);
-}
-
-static void test_map_iteration(int n)
-{
-  pn_list_t *pairs = pn_list(PN_OBJECT, 2*n);
-  for (int i = 0; i < n; i++) {
-    void *key = pn_class_new(PN_OBJECT, 0);
-    void *value = pn_class_new(PN_OBJECT, 0);
-    pn_list_add(pairs, key);
-    pn_list_add(pairs, value);
-    pn_decref(key);
-    pn_decref(value);
-  }
-
-  pn_map_t *map = pn_map(PN_OBJECT, PN_OBJECT, 0, 0.75);
-
-  assert(pn_map_head(map) == 0);
-
-  for (int i = 0; i < n; i++) {
-    pn_map_put(map, pn_list_get(pairs, 2*i), pn_list_get(pairs, 2*i + 1));
-  }
-
-  for (pn_handle_t entry = pn_map_head(map); entry; entry = pn_map_next(map, entry))
-  {
-    void *key = pn_map_key(map, entry);
-    void *value = pn_map_value(map, entry);
-    ssize_t idx = pn_list_index(pairs, key);
-    assert(idx >= 0);
-
-    assert(pn_list_get(pairs, idx) == key);
-    assert(pn_list_get(pairs, idx + 1) == value);
-
-    pn_list_del(pairs, idx, 2);
-  }
-
-  assert(pn_list_size(pairs) == 0);
-
-  pn_decref(map);
-  pn_decref(pairs);
-}
-
-void test_inspect(void *o, const char *expected)
-{
-  pn_string_t *dst = pn_string(NULL);
-  pn_inspect(o, dst);
-  assert(pn_strequals(pn_string_get(dst), expected));
-  pn_free(dst);
-}
-
-void test_list_inspect(void)
-{
-  pn_list_t *l = build_list(0, END);
-  test_inspect(l, "[]");
-  pn_free(l);
-
-  l = build_list(0, pn_string("one"), END);
-  test_inspect(l, "[\"one\"]");
-  pn_free(l);
-
-  l = build_list(0,
-                 pn_string("one"),
-                 pn_string("two"),
-                 END);
-  test_inspect(l, "[\"one\", \"two\"]");
-  pn_free(l);
-
-  l = build_list(0,
-                 pn_string("one"),
-                 pn_string("two"),
-                 pn_string("three"),
-                 END);
-  test_inspect(l, "[\"one\", \"two\", \"three\"]");
-  pn_free(l);
-}
-
-void test_map_inspect(void)
-{
-  // note that when there is more than one entry in a map, the order
-  // of the entries is dependent on the hashes involved, it will be
-  // deterministic though
-  pn_map_t *m = build_map(0.75, 0, END);
-  test_inspect(m, "{}");
-  pn_free(m);
-
-  m = build_map(0.75, 0,
-                pn_string("key"), pn_string("value"),
-                END);
-  test_inspect(m, "{\"key\": \"value\"}");
-  pn_free(m);
-
-  m = build_map(0.75, 0,
-                pn_string("k1"), pn_string("v1"),
-                pn_string("k2"), pn_string("v2"),
-                END);
-  test_inspect(m, "{\"k1\": \"v1\", \"k2\": \"v2\"}");
-  pn_free(m);
-
-  m = build_map(0.75, 0,
-                pn_string("k1"), pn_string("v1"),
-                pn_string("k2"), pn_string("v2"),
-                pn_string("k3"), pn_string("v3"),
-                END);
-  test_inspect(m, "{\"k3\": \"v3\", \"k1\": \"v1\", \"k2\": \"v2\"}");
-  pn_free(m);
-}
-
-void test_map_coalesced_chain(void)
-{
-  pn_hash_t *map = pn_hash(PN_OBJECT, 16, 0.75);
-  pn_string_t *values[9] = {
-      pn_string("a"),
-      pn_string("b"),
-      pn_string("c"),
-      pn_string("d"),
-      pn_string("e"),
-      pn_string("f"),
-      pn_string("g"),
-      pn_string("h"),
-      pn_string("i")
-  };
-  //add some items:
-  pn_hash_put(map, 1, values[0]);
-  pn_hash_put(map, 2, values[1]);
-  pn_hash_put(map, 3, values[2]);
-
-  //use up all non-addressable elements:
-  pn_hash_put(map, 14, values[3]);
-  pn_hash_put(map, 15, values[4]);
-  pn_hash_put(map, 16, values[5]);
-
-  //use an addressable element for a key that doesn't map to it:
-  pn_hash_put(map, 4, values[6]);
-  pn_hash_put(map, 17, values[7]);
-  assert(pn_hash_size(map) == 8);
-
-  //free up one non-addressable entry:
-  pn_hash_del(map, 16);
-  assert(pn_hash_get(map, 16) == NULL);
-  assert(pn_hash_size(map) == 7);
-
-  //add a key whose addressable slot is already taken (by 17),
-  //generating a coalesced chain:
-  pn_hash_put(map, 12, values[8]);
-
-  //remove an entry from the coalesced chain:
-  pn_hash_del(map, 4);
-  assert(pn_hash_get(map, 4) == NULL);
-
-  //test lookup of all entries:
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 1)), "a"));
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 2)), "b"));
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 3)), "c"));
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 14)), "d"));
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 15)), "e"));
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 17)), "h"));
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 12)), "i"));
-  assert(pn_hash_size(map) == 7);
-
-  //cleanup:
-  for (pn_handle_t i = pn_hash_head(map); i; i = pn_hash_head(map)) {
-    pn_hash_del(map, pn_hash_key(map, i));
-  }
-  assert(pn_hash_size(map) == 0);
-
-  for (size_t i = 0; i < 9; ++i) {
-      pn_free(values[i]);
-  }
-  pn_free(map);
-}
-
-void test_map_coalesced_chain2(void)
-{
-  pn_hash_t *map = pn_hash(PN_OBJECT, 16, 0.75);
-  pn_string_t *values[10] = {
-      pn_string("a"),
-      pn_string("b"),
-      pn_string("c"),
-      pn_string("d"),
-      pn_string("e"),
-      pn_string("f"),
-      pn_string("g"),
-      pn_string("h"),
-      pn_string("i"),
-      pn_string("j")
-  };
-  //add some items:
-  pn_hash_put(map, 1, values[0]);//a
-  pn_hash_put(map, 2, values[1]);//b
-  pn_hash_put(map, 3, values[2]);//c
-
-  //use up all non-addressable elements:
-  pn_hash_put(map, 14, values[3]);//d
-  pn_hash_put(map, 15, values[4]);//e
-  pn_hash_put(map, 16, values[5]);//f
-  //take slot from addressable region
-  pn_hash_put(map, 29, values[6]);//g, goes into slot 12
-
-  //free up one non-addressable entry:
-  pn_hash_del(map, 14);
-  assert(pn_hash_get(map, 14) == NULL);
-
-  //add a key whose addressable slot is already taken (by 29),
-  //generating a coalesced chain:
-  pn_hash_put(map, 12, values[7]);//h
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 12)), "h"));
-  //delete from tail of coalesced chain:
-  pn_hash_del(map, 12);
-  assert(pn_hash_get(map, 12) == NULL);
-
-  //extend chain into cellar again, then coalesce again extending back
-  //into addressable region
-  pn_hash_put(map, 42, values[8]);//i
-  pn_hash_put(map, 25, values[9]);//j
-  //delete entry from coalesced chain, where next element in chain is
-  //in cellar:
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 29)), "g"));
-  pn_hash_del(map, 29);
-
-  //test lookup of all entries:
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 1)), "a"));
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 2)), "b"));
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 3)), "c"));
-  //d was deleted
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 15)), "e"));
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 16)), "f"));
-  //g was deleted, h was deleted
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 42)), "i"));
-  assert(pn_strequals(pn_string_get((pn_string_t *) pn_hash_get(map, 25)), "j"));
-  assert(pn_hash_size(map) == 7);
-
-  //cleanup:
-  for (pn_handle_t i = pn_hash_head(map); i; i = pn_hash_head(map)) {
-    pn_hash_del(map, pn_hash_key(map, i));
-  }
-  assert(pn_hash_size(map) == 0);
-
-  for (size_t i = 0; i < 10; ++i) {
-      pn_free(values[i]);
-  }
-  pn_free(map);
-}
-
-void test_list_compare(void)
-{
-  pn_list_t *a = pn_list(PN_OBJECT, 0);
-  pn_list_t *b = pn_list(PN_OBJECT, 0);
-
-  assert(pn_equals(a, b));
-
-  void *one = pn_class_new(PN_OBJECT, 0);
-  void *two = pn_class_new(PN_OBJECT, 0);
-  void *three = pn_class_new(PN_OBJECT, 0);
-
-  pn_list_add(a, one);
-  assert(!pn_equals(a, b));
-  pn_list_add(b, one);
-  assert(pn_equals(a, b));
-
-  pn_list_add(b, two);
-  assert(!pn_equals(a, b));
-  pn_list_add(a, two);
-  assert(pn_equals(a, b));
-
-  pn_list_add(a, three);
-  assert(!pn_equals(a, b));
-  pn_list_add(b, three);
-  assert(pn_equals(a, b));
-
-  pn_free(a); pn_free(b);
-  pn_free(one); pn_free(two); pn_free(three);
-}
-
-typedef struct {
-  pn_list_t *list;
-  size_t index;
-} pn_it_state_t;
-
-static void *pn_it_next(void *state) {
-  pn_it_state_t *it = (pn_it_state_t *) state;
-  if (it->index < pn_list_size(it->list)) {
-    return pn_list_get(it->list, it->index++);
-  } else {
-    return NULL;
-  }
-}
-
-void test_iterator(void)
-{
-  pn_list_t *list = build_list(0,
-                               pn_string("one"),
-                               pn_string("two"),
-                               pn_string("three"),
-                               pn_string("four"),
-                               END);
-  pn_iterator_t *it = pn_iterator();
-  pn_it_state_t *state = (pn_it_state_t *) pn_iterator_start
-    (it, pn_it_next, sizeof(pn_it_state_t));
-  state->list = list;
-  state->index = 0;
-
-  void *obj;
-  int index = 0;
-  while ((obj = pn_iterator_next(it))) {
-    assert(obj == pn_list_get(list, index));
-    ++index;
-  }
-  assert(index == 4);
-
-  pn_free(list);
-  pn_free(it);
-}
-
-void test_heap(int seed, int size)
-{
-  srand(seed);
-  pn_list_t *list = pn_list(PN_VOID, 0);
-
-  intptr_t min = 0;
-  intptr_t max = 0;
-
-  for (int i = 0; i < size; i++) {
-    intptr_t r = rand();
-
-    if (i == 0) {
-      min = r;
-      max = r;
-    } else {
-      if (r < min) {
-        min = r;
-      }
-      if (r > max) {
-        max = r;
-      }
-    }
-
-    pn_list_minpush(list, (void *) r);
-  }
-
-  intptr_t prev = (intptr_t) pn_list_minpop(list);
-  assert(prev == min);
-  assert(pn_list_size(list) == (size_t)(size - 1));
-  int count = 0;
-  while (pn_list_size(list)) {
-    intptr_t r = (intptr_t) pn_list_minpop(list);
-    assert(r >= prev);
-    prev = r;
-    count++;
-  }
-  assert(count == size - 1);
-  assert(prev == max);
-
-  pn_free(list);
-}
-
-int main(int argc, char **argv)
-{
-  for (size_t i = 0; i < 128; i++) {
-    test_class(PN_OBJECT, i);
-    test_class(PN_VOID, i);
-    test_class(&noop_class, i);
-  }
-
-  for (size_t i = 0; i < 128; i++) {
-    test_new(i, PN_OBJECT);
-    test_new(i, &noop_class);
-  }
-
-  test_finalize();
-  test_free();
-  test_hashcode();
-  test_compare();
-
-  for (int i = 0; i < 1024; i++) {
-    test_refcounting(i);
-  }
-
-  for (size_t i = 0; i < 4; i++) {
-    test_list(i);
-  }
-
-  for (size_t i = 0; i < 4; i++) {
-    test_list_refcount(i);
-  }
-
-  test_list_index();
-
-  test_map();
-  test_map_links();
-
-  test_hash();
-
-  test_string(NULL);
-  test_string("");
-  test_string("this is a test");
-  test_string("012345678910111213151617181920212223242526272829303132333435363"
-              "738394041424344454647484950515253545556575859606162636465666768");
-  test_string("this has an embedded \000 in it");
-  test_stringn("this has an embedded \000 in it", 28);
-
-  test_string_format();
-  test_string_addf();
-
-  test_build_list();
-  test_build_map();
-  test_build_map_odd();
-
-  for (int i = 0; i < 64; i++)
-  {
-    test_map_iteration(i);
-  }
-
-  test_list_inspect();
-  test_map_inspect();
-  test_list_compare();
-  test_iterator();
-  for (int seed = 0; seed < 64; seed++) {
-    for (int size = 1; size <= 64; size++) {
-      test_heap(seed, size);
-    }
-  }
-
-  test_map_coalesced_chain();
-  test_map_coalesced_chain2();
-
-  return 0;
-}
diff --git a/proton-c/src/tests/parse-url.c b/proton-c/src/tests/parse-url.c
deleted file mode 100644
index c17ff1f..0000000
--- a/proton-c/src/tests/parse-url.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "proton/type_compat.h"
-#include "proton/error.h"
-#include "proton/url.h"
-
-static bool verify(const char* what, const char* want, const char* got) {
-  bool eq = (want == got || (want && got && strcmp(want, got) == 0));
-  if (!eq) printf("  %s: '%s' != '%s'\n", what, want, got);
-  return eq;
-}
-
-static bool test(const char* url, const char* scheme, const char* user, const char* pass, const char* host, const char* port, const char*path)
-{
-  pn_url_t *purl = pn_url_parse(url);
-  bool ok =
-    verify("scheme", scheme, pn_url_get_scheme(purl)) &&
-    verify("user", user, pn_url_get_username(purl)) &&
-    verify("pass", pass, pn_url_get_password(purl)) &&
-    verify("host", host, pn_url_get_host(purl)) &&
-    verify("port", port, pn_url_get_port(purl)) &&
-    verify("path", path, pn_url_get_path(purl));
-  pn_url_free(purl);
-  return ok;
-}
-
-// Run test and additionally verify the round trip of parse and stringify
-// matches original string.
-static bool testrt(const char* url, const char* scheme, const char* user, const char* pass, const char* host, const char* port, const char*path)
-{
-  bool ok = test(url, scheme, user, pass, host, port, path);
-  pn_url_t *purl = pn_url_parse(url);
-  ok = ok && verify("url", url, pn_url_str(purl));
-  pn_url_free(purl);
-  return ok;
-}
-
-#define TEST(EXPR) \
-  do { if (!(EXPR)) { printf("%s:%d: %s\n\n", __FILE__, __LINE__, #EXPR); failed++; } } while(0)
-
-int main(int argc, char **argv)
-{
-  int failed = 0;
-  TEST(testrt("/Foo.bar:90087@somewhere", 0, 0, 0, 0, 0, "Foo.bar:90087@somewhere"));
-  TEST(testrt("host", 0, 0, 0, "host", 0, 0));
-  TEST(testrt("host:423", 0, 0, 0, "host", "423", 0));
-  TEST(testrt("user@host", 0, "user", 0, "host", 0, 0));
-
-  // Can't round-trip passwords with ':', not strictly legal but the parser allows it.
-  TEST(test("user:1243^&^:pw@host:423", 0, "user", "1243^&^:pw", "host", "423", 0));
-  TEST(test("user:1243^&^:pw@host:423/Foo.bar:90087", 0, "user", "1243^&^:pw", "host", "423", "Foo.bar:90087"));
-  TEST(test("user:1243^&^:pw@host:423/Foo.bar:90087@somewhere", 0, "user", "1243^&^:pw", "host", "423", "Foo.bar:90087@somewhere"));
-
-  TEST(testrt("[::1]", 0, 0, 0, "::1", 0, 0));
-  TEST(testrt("[::1]:amqp", 0, 0, 0, "::1", "amqp", 0));
-  TEST(testrt("user@[::1]", 0, "user", 0, "::1", 0, 0));
-  TEST(testrt("user@[::1]:amqp", 0, "user", 0, "::1", "amqp", 0));
-
-  // Can't round-trip passwords with ':', not strictly legal but the parser allows it.
-  TEST(test("user:1243^&^:pw@[::1]:amqp", 0, "user", "1243^&^:pw", "::1", "amqp", 0));
-  TEST(test("user:1243^&^:pw@[::1]:amqp/Foo.bar:90087", 0, "user", "1243^&^:pw", "::1", "amqp", "Foo.bar:90087"));
-  TEST(test("user:1243^&^:pw@[::1:amqp/Foo.bar:90087", 0, "user", "1243^&^:pw", "[", ":1:amqp", "Foo.bar:90087"));
-  TEST(test("user:1243^&^:pw@::1]:amqp/Foo.bar:90087", 0, "user", "1243^&^:pw", 0, ":1]:amqp", "Foo.bar:90087"));
-
-  TEST(testrt("amqp://user@[::1]", "amqp", "user", 0, "::1", 0, 0));
-  TEST(testrt("amqp://user@[::1]:amqp", "amqp", "user", 0, "::1", "amqp", 0));
-  TEST(testrt("amqp://user@[1234:52:0:1260:f2de:f1ff:fe59:8f87]:amqp", "amqp", "user", 0, "1234:52:0:1260:f2de:f1ff:fe59:8f87", "amqp", 0));
-
-  // Can't round-trip passwords with ':', not strictly legal but the parser allows it.
-  TEST(test("amqp://user:1243^&^:pw@[::1]:amqp", "amqp", "user", "1243^&^:pw", "::1", "amqp", 0));
-  TEST(test("amqp://user:1243^&^:pw@[::1]:amqp/Foo.bar:90087", "amqp", "user", "1243^&^:pw", "::1", "amqp", "Foo.bar:90087"));
-
-  TEST(testrt("amqp://host", "amqp", 0, 0, "host", 0, 0));
-  TEST(testrt("amqp://user@host", "amqp", "user", 0, "host", 0, 0));
-  TEST(testrt("amqp://user@host/path:%", "amqp", "user", 0, "host", 0, "path:%"));
-  TEST(testrt("amqp://user@host:5674/path:%", "amqp", "user", 0, "host", "5674", "path:%"));
-  TEST(testrt("amqp://user@host/path:%", "amqp", "user", 0, "host", 0, "path:%"));
-  TEST(testrt("amqp://bigbird@host/queue@host", "amqp", "bigbird", 0, "host", 0, "queue@host"));
-  TEST(testrt("amqp://host/queue@host", "amqp", 0, 0, "host", 0, "queue@host"));
-  TEST(testrt("amqp://host:9765/queue@host", "amqp", 0, 0, "host", "9765", "queue@host"));
-  TEST(test("user:pass%2fword@host", 0, "user", "pass/word", "host", 0, 0));
-  TEST(testrt("user:pass%2Fword@host", 0, "user", "pass/word", "host", 0, 0));
-  // Can't round-trip passwords with lowercase hex encoding
-  TEST(test("us%2fer:password@host", 0, "us/er", "password", "host", 0, 0));
-  TEST(testrt("us%2Fer:password@host", 0, "us/er", "password", "host", 0, 0));
-  // Can't round-trip passwords with lowercase hex encoding
-  TEST(test("user:pass%2fword%@host", 0, "user", "pass/word%", "host", 0, 0));
-  TEST(testrt("localhost/temp-queue://ID:ganymede-36663-1408448359876-2:123:0", 0, 0, 0, "localhost", 0, "temp-queue://ID:ganymede-36663-1408448359876-2:123:0"));
-  TEST(testrt("/temp-queue://ID:ganymede-36663-1408448359876-2:123:0", 0, 0, 0, 0, 0, "temp-queue://ID:ganymede-36663-1408448359876-2:123:0"));
-  TEST(testrt("amqp://localhost/temp-queue://ID:ganymede-36663-1408448359876-2:123:0", "amqp", 0, 0, "localhost", 0, "temp-queue://ID:ganymede-36663-1408448359876-2:123:0"));
-  // PROTON-995
-  TEST(testrt("amqps://%40user%2F%3A:%40pass%2F%3A@example.net/some_topic",
-              "amqps", "@user/:", "@pass/:", "example.net", 0, "some_topic"));
-  TEST(testrt("amqps://user%2F%3A=:pass%2F%3A=@example.net/some_topic",
-              "amqps", "user/:=", "pass/:=", "example.net", 0, "some_topic"));
-  // Really perverse url
-  TEST(testrt("://:@://:", "", "", "", 0, "", "/:"));
-  return failed;
-}
diff --git a/proton-c/src/tests/reactor.c b/proton-c/src/tests/reactor.c
deleted file mode 100644
index 900d6a3..0000000
--- a/proton-c/src/tests/reactor.c
+++ /dev/null
@@ -1,578 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/reactor.h>
-#include <proton/handlers.h>
-#include <proton/event.h>
-#include <proton/connection.h>
-#include <proton/session.h>
-#include <proton/link.h>
-#include <proton/delivery.h>
-#include <proton/url.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define assert(E) ((E) ? 0 : (abort(), 0))
-
-
-static void test_reactor(void) {
-  pn_reactor_t *reactor = pn_reactor();
-  assert(reactor);
-  pn_free(reactor);
-}
-
-static void test_reactor_free(void) {
-  pn_reactor_t *reactor = pn_reactor();
-  assert(reactor);
-  pn_reactor_free(reactor);
-}
-
-static void test_reactor_run(void) {
-  pn_reactor_t *reactor = pn_reactor();
-  assert(reactor);
-  // run should exit if there is nothing left to do
-  pn_reactor_run(reactor);
-  pn_free(reactor);
-}
-
-static void test_reactor_run_free(void) {
-  pn_reactor_t *reactor = pn_reactor();
-  assert(reactor);
-  // run should exit if there is nothing left to do
-  pn_reactor_run(reactor);
-  pn_reactor_free(reactor);
-}
-
-typedef struct {
-  pn_reactor_t *reactor;
-  pn_list_t *events;
-} pni_test_handler_t;
-
-pni_test_handler_t *thmem(pn_handler_t *handler) {
-  return (pni_test_handler_t *) pn_handler_mem(handler);
-}
-
-void test_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) {
-  pni_test_handler_t *th = thmem(handler);
-  pn_reactor_t *reactor = pn_event_reactor(event);
-  assert(reactor == th->reactor);
-  pn_list_add(th->events, (void *) type);
-}
-
-pn_handler_t *test_handler(pn_reactor_t *reactor, pn_list_t *events) {
-  pn_handler_t *handler = pn_handler_new(test_dispatch, sizeof(pni_test_handler_t), NULL);
-  thmem(handler)->reactor = reactor;
-  thmem(handler)->events = events;
-  return handler;
-}
-
-
-void root_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) {
-  pni_test_handler_t *th = thmem(handler);
-  pn_reactor_t *reactor = pn_event_reactor(event);
-  assert(reactor == th->reactor);
-  pn_list_add(th->events, pn_event_root(event));
-}
-
-pn_handler_t *test_root(pn_reactor_t *reactor, pn_list_t *events) {
-  pn_handler_t *handler = pn_handler_new(root_dispatch, sizeof(pni_test_handler_t), NULL);
-  thmem(handler)->reactor = reactor;
-  thmem(handler)->events = events;
-  return handler;
-}
-
-#define END PN_EVENT_NONE
-
-void expect(pn_list_t *events, ...) {
-  va_list ap;
-
-  va_start(ap, events);
-  size_t idx = 0;
-  while (true) {
-    pn_event_type_t expected = (pn_event_type_t) va_arg(ap, int);
-    if (expected == END) {
-      assert(idx == pn_list_size(events));
-      break;
-    }
-    assert(idx < pn_list_size(events));
-    pn_event_type_t actual = (pn_event_type_t)(size_t) pn_list_get(events, idx++);
-    assert(expected == actual);
-  }
-  va_end(ap);
-}
-
-static void test_reactor_handler(void) {
-  pn_reactor_t *reactor = pn_reactor();
-  assert(reactor);
-  pn_handler_t *handler = pn_reactor_get_handler(reactor);
-  assert(handler);
-  pn_list_t *events = pn_list(PN_VOID, 0);
-  pn_handler_t *th = test_handler(reactor, events);
-  pn_handler_add(handler, th);
-  pn_decref(th);
-  pn_free(reactor);
-  expect(events, END);
-  pn_free(events);
-}
-
-static void test_reactor_handler_free(void) {
-  pn_reactor_t *reactor = pn_reactor();
-  assert(reactor);
-  pn_handler_t *handler = pn_reactor_get_handler(reactor);
-  assert(handler);
-  pn_list_t *events = pn_list(PN_VOID, 0);
-  pn_handler_add(handler, test_handler(reactor, events));
-  pn_reactor_free(reactor);
-  expect(events, END);
-  pn_free(events);
-}
-
-static void test_reactor_handler_run(void) {
-  pn_reactor_t *reactor = pn_reactor();
-  assert(reactor);
-  pn_handler_t *handler = pn_reactor_get_handler(reactor);
-  assert(handler);
-  pn_list_t *events = pn_list(PN_VOID, 0);
-  pn_handler_t *th = test_handler(reactor, events);
-  pn_handler_add(handler, th);
-  pn_reactor_run(reactor);
-  expect(events, PN_REACTOR_INIT, PN_SELECTABLE_INIT, PN_SELECTABLE_UPDATED, PN_SELECTABLE_FINAL, PN_REACTOR_FINAL, END);
-  pn_free(reactor);
-  pn_free(th);
-  pn_free(events);
-}
-
-static void test_reactor_handler_run_free(void) {
-  pn_reactor_t *reactor = pn_reactor();
-  assert(reactor);
-  pn_handler_t *handler = pn_reactor_get_handler(reactor);
-  assert(handler);
-  pn_list_t *events = pn_list(PN_VOID, 0);
-  pn_handler_add(handler, test_handler(reactor, events));
-  pn_reactor_run(reactor);
-  expect(events, PN_REACTOR_INIT, PN_SELECTABLE_INIT, PN_SELECTABLE_UPDATED, PN_SELECTABLE_FINAL, PN_REACTOR_FINAL, END);
-  pn_reactor_free(reactor);
-  pn_free(events);
-}
-
-static void test_reactor_event_root(void) {
-  pn_reactor_t *reactor = pn_reactor();
-  assert(reactor);
-  pn_handler_t *handler = pn_reactor_get_handler(reactor);
-  assert(handler);
-  pn_list_t *roots = pn_list(PN_VOID, 0);
-  pn_handler_t *th = test_root(reactor, roots);
-  pn_handler_add(handler, th);
-  pn_reactor_run(reactor);
-  expect(roots, handler, handler, handler, handler, handler, END);
-  pn_free(reactor);
-  pn_free(th);
-  pn_free(roots);
-}
-
-static void test_reactor_connection(void) {
-  pn_reactor_t *reactor = pn_reactor();
-  assert(reactor);
-  pn_list_t *cevents = pn_list(PN_VOID, 0);
-  pn_handler_t *tch = test_handler(reactor, cevents);
-  pn_connection_t *connection = pn_reactor_connection(reactor, tch);
-  assert(connection);
-  pn_reactor_set_connection_host(reactor, connection, "127.0.0.1", "5672");
-  pn_url_t *url = pn_url_parse(pn_reactor_get_connection_address(reactor, connection));
-  assert(strcmp(pn_url_get_host(url), "127.0.0.1") == 0);
-  assert(strcmp(pn_url_get_port(url), "5672") == 0);
-  pn_decref(url);
-  pn_handler_t *root = pn_reactor_get_handler(reactor);
-  pn_list_t *revents = pn_list(PN_VOID, 0);
-  pn_handler_add(root, test_handler(reactor, revents));
-  pn_reactor_run(reactor);
-  expect(revents, PN_REACTOR_INIT, PN_SELECTABLE_INIT, PN_SELECTABLE_UPDATED, PN_SELECTABLE_FINAL, PN_REACTOR_FINAL,
-         END);
-  expect(cevents, PN_CONNECTION_INIT, END);
-  pn_reactor_free(reactor);
-  pn_handler_free(tch);
-  pn_free(cevents);
-  pn_free(revents);
-}
-
-static void test_reactor_connection_factory(void)
-{
-  pn_reactor_t *reactor = pn_reactor();
-  pn_connection_t *conn;
-  const char *addr;
-  // use host as connection hostname default
-  conn = pn_reactor_connection_to_host(reactor, "a.test.com", "5678", NULL);
-  pn_connection_set_hostname(conn, "virt.host");
-  addr = pn_reactor_get_connection_address(reactor, conn);
-  assert(addr && strcmp(addr, "a.test.com:5678") == 0);
-  assert(strcmp(pn_connection_get_hostname(conn), "virt.host") == 0);
-  // verify the host address can be changed:
-  pn_reactor_set_connection_host(reactor, conn, "a.different.com", "9999");
-  addr = pn_reactor_get_connection_address(reactor, conn);
-  assert(addr && strcmp(addr, "a.different.com:9999") == 0);
-  assert(strcmp(pn_connection_get_hostname(conn), "virt.host") == 0);
-  pn_reactor_free(reactor);
-}
-
-static void test_reactor_acceptor(void) {
-  pn_reactor_t *reactor = pn_reactor();
-  assert(reactor);
-  pn_acceptor_t *acceptor = pn_reactor_acceptor(reactor, "0.0.0.0", "5678", NULL);
-  assert(acceptor);
-  pn_reactor_free(reactor);
-}
-
-pn_acceptor_t **tram(pn_handler_t *h) {
-  return (pn_acceptor_t **) pn_handler_mem(h);
-}
-
-static void tra_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) {
-  switch (type) {
-  case PN_REACTOR_INIT:
-    {
-      pn_acceptor_t *acceptor = *tram(handler);
-      pn_acceptor_close(acceptor);
-    }
-    break;
-  default:
-    break;
-  }
-}
-
-static pn_handler_t *tra_handler(pn_acceptor_t *acceptor) {
-  pn_handler_t *handler = pn_handler_new(tra_dispatch, sizeof(pn_acceptor_t *), NULL);
-  *tram(handler) = acceptor;
-  return handler;
-}
-
-static void test_reactor_acceptor_run(void) {
-  pn_reactor_t *reactor = pn_reactor();
-  assert(reactor);
-  pn_handler_t *root = pn_reactor_get_handler(reactor);
-  assert(root);
-  pn_acceptor_t *acceptor = pn_reactor_acceptor(reactor, "0.0.0.0", "5678", NULL);
-  assert(acceptor);
-  pn_handler_add(root, tra_handler(acceptor));
-  pn_reactor_run(reactor);
-  pn_reactor_free(reactor);
-}
-
-typedef struct {
-  pn_reactor_t *reactor;
-  pn_acceptor_t *acceptor;
-  pn_list_t *events;
-} server_t;
-
-static server_t *smem(pn_handler_t *handler) {
-  return (server_t *) pn_handler_mem(handler);
-}
-
-static void server_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) {
-  server_t *srv = smem(handler);
-  pn_list_add(srv->events, (void *) pn_event_type(event));
-  switch (type) {
-  case PN_CONNECTION_REMOTE_OPEN:
-    pn_connection_open(pn_event_connection(event));
-    break;
-  case PN_CONNECTION_REMOTE_CLOSE:
-    pn_acceptor_close(srv->acceptor);
-    pn_connection_close(pn_event_connection(event));
-    pn_connection_release(pn_event_connection(event));
-    break;
-  default:
-    break;
-  }
-}
-
-typedef struct {
-  pn_list_t *events;
-} client_t;
-
-static client_t *cmem(pn_handler_t *handler) {
-  return (client_t *) pn_handler_mem(handler);
-}
-
-static void client_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) {
-  client_t *cli = cmem(handler);
-  pn_list_add(cli->events, (void *) type);
-  pn_connection_t *conn = pn_event_connection(event);
-  switch (pn_event_type(event)) {
-  case PN_CONNECTION_INIT:
-    pn_connection_set_hostname(conn, "some.org");
-    pn_connection_open(conn);
-    break;
-  case PN_CONNECTION_REMOTE_OPEN:
-    pn_connection_close(conn);
-    break;
-  case PN_CONNECTION_REMOTE_CLOSE:
-    pn_connection_release(conn);
-    break;
-  default:
-    break;
-  }
-}
-
-static void test_reactor_connect(void) {
-  pn_reactor_t *reactor = pn_reactor();
-  pn_handler_t *sh = pn_handler_new(server_dispatch, sizeof(server_t), NULL);
-  server_t *srv = smem(sh);
-  pn_acceptor_t *acceptor = pn_reactor_acceptor(reactor, "0.0.0.0", "5678", sh);
-  srv->reactor = reactor;
-  srv->acceptor = acceptor;
-  srv->events = pn_list(PN_VOID, 0);
-  pn_handler_t *ch = pn_handler_new(client_dispatch, sizeof(client_t), NULL);
-  client_t *cli = cmem(ch);
-  cli->events = pn_list(PN_VOID, 0);
-  pn_connection_t *conn = pn_reactor_connection_to_host(reactor,
-                                                        "127.0.0.1",
-                                                        "5678",
-                                                        ch);
-  assert(conn);
-  pn_url_t *url = pn_url_parse(pn_reactor_get_connection_address(reactor, conn));
-  assert(strcmp(pn_url_get_host(url), "127.0.0.1") == 0);
-  assert(strcmp(pn_url_get_port(url), "5678") == 0);
-  pn_decref(url);
-  pn_reactor_run(reactor);
-  expect(srv->events, PN_CONNECTION_INIT, PN_CONNECTION_BOUND,
-         PN_CONNECTION_REMOTE_OPEN,
-         PN_CONNECTION_LOCAL_OPEN, PN_TRANSPORT,
-         PN_CONNECTION_REMOTE_CLOSE, PN_TRANSPORT_TAIL_CLOSED,
-         PN_CONNECTION_LOCAL_CLOSE, PN_TRANSPORT,
-         PN_TRANSPORT_HEAD_CLOSED, PN_TRANSPORT_CLOSED,
-         PN_CONNECTION_UNBOUND, PN_CONNECTION_FINAL, END);
-  pn_free(srv->events);
-  pn_decref(sh);
-  expect(cli->events, PN_CONNECTION_INIT, PN_CONNECTION_LOCAL_OPEN,
-         PN_CONNECTION_BOUND,
-         PN_CONNECTION_REMOTE_OPEN, PN_CONNECTION_LOCAL_CLOSE,
-         PN_TRANSPORT, PN_TRANSPORT_HEAD_CLOSED,
-         PN_CONNECTION_REMOTE_CLOSE, PN_TRANSPORT_TAIL_CLOSED,
-         PN_TRANSPORT_CLOSED, PN_CONNECTION_UNBOUND,
-         PN_CONNECTION_FINAL, END);
-  pn_free(cli->events);
-  pn_decref(ch);
-  pn_reactor_free(reactor);
-}
-
-static void test_reactor_bad_domain(void) {
-  pn_reactor_t *reactor = pn_reactor();
-  assert(reactor);
-  pn_handler_t *ch = pn_handler_new(client_dispatch, sizeof(client_t), NULL);
-  client_t *cli = cmem(ch);
-  cli->events = pn_list(PN_VOID, 0);
-  pn_connection_t *connection = pn_reactor_connection_to_host(reactor, "somebogusdomain", "5672", ch);
-  assert(connection);
-  pn_reactor_run(reactor);
-
-  expect(cli->events, PN_CONNECTION_INIT, PN_CONNECTION_LOCAL_OPEN,
-         PN_CONNECTION_BOUND, PN_TRANSPORT_TAIL_CLOSED,
-         PN_TRANSPORT_ERROR, PN_TRANSPORT_HEAD_CLOSED,
-         PN_TRANSPORT_CLOSED, PN_CONNECTION_UNBOUND,
-         END);
-
-  pn_free(cli->events);
-  pn_decref(ch);
-  pn_reactor_free(reactor);
-}
-
-typedef struct {
-  int received;
-} sink_t;
-
-static sink_t *sink(pn_handler_t *handler) {
-  return (sink_t *) pn_handler_mem(handler);
-}
-
-void sink_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) {
-  sink_t *snk = sink(handler);
-  pn_delivery_t *dlv = pn_event_delivery(event);
-  switch (type) {
-  case PN_DELIVERY:
-    if (!pn_delivery_partial(dlv)) {
-      pn_delivery_settle(dlv);
-      snk->received++;
-    }
-    break;
-  default:
-    break;
-  }
-}
-
-typedef struct {
-  int remaining;
-} source_t;
-
-static source_t *source(pn_handler_t *handler) {
-  return (source_t *) pn_handler_mem(handler);
-}
-
-
-void source_dispatch(pn_handler_t *handler, pn_event_t *event, pn_event_type_t type) {
-  source_t *src = source(handler);
-  pn_connection_t *conn = pn_event_connection(event);
-  switch (type) {
-  case PN_CONNECTION_INIT:
-    {
-      pn_session_t *ssn = pn_session(conn);
-      pn_link_t *snd = pn_sender(ssn, "sender");
-      pn_connection_open(conn);
-      pn_session_open(ssn);
-      pn_link_open(snd);
-    }
-    break;
-  case PN_LINK_FLOW:
-    {
-      pn_link_t *link = pn_event_link(event);
-      while (pn_link_credit(link) > 0 && src->remaining > 0) {
-        pn_delivery_t *dlv = pn_delivery(link, pn_dtag("", 0));
-        assert(dlv);
-        pn_delivery_settle(dlv);
-        src->remaining--;
-      }
-
-      if (!src->remaining) {
-        pn_connection_close(conn);
-      }
-    }
-    break;
-  case PN_CONNECTION_REMOTE_CLOSE:
-    pn_connection_release(conn);
-    break;
-  default:
-    break;
-  }
-}
-
-static void test_reactor_transfer(int count, int window) {
-  pn_reactor_t *reactor = pn_reactor();
-
-  pn_handler_t *sh = pn_handler_new(server_dispatch, sizeof(server_t), NULL);
-  server_t *srv = smem(sh);
-  pn_acceptor_t *acceptor = pn_reactor_acceptor(reactor, "0.0.0.0", "5678", sh);
-  srv->reactor = reactor;
-  srv->acceptor = acceptor;
-  srv->events = pn_list(PN_VOID, 0);
-  pn_handler_add(sh, pn_handshaker());
-  // XXX: a window of 1 doesn't work unless the flowcontroller is
-  // added after the thing that settles the delivery
-  pn_handler_add(sh, pn_flowcontroller(window));
-  pn_handler_t *snk = pn_handler_new(sink_dispatch, sizeof(sink_t), NULL);
-  sink(snk)->received = 0;
-  pn_handler_add(sh, snk);
-
-  pn_handler_t *ch = pn_handler_new(source_dispatch, sizeof(source_t), NULL);
-  source_t *src = source(ch);
-  src->remaining = count;
-  pn_connection_t *conn = NULL;
-  // Using the connection's hostname to set the connection address is
-  // deprecated. Once support is dropped the conditional code can be removed:
-  #if 0
-  conn = pn_reactor_connection(reactor, ch);
-  assert(conn);
-  pn_reactor_connection_set_address(reactor, conn, "127.0.0.1", "5678");
-  #else
-  // This is deprecated:
-  conn = pn_reactor_connection(reactor, ch);
-  pn_connection_set_hostname(conn, "127.0.0.1:5678");
-  #endif
-
-  pn_reactor_run(reactor);
-
-  assert(sink(snk)->received == count);
-
-  pn_free(srv->events);
-  pn_reactor_free(reactor);
-  pn_handler_free(sh);
-  pn_handler_free(ch);
-}
-
-static void test_reactor_schedule(void) {
-  pn_reactor_t *reactor = pn_reactor();
-  pn_handler_t *root = pn_reactor_get_handler(reactor);
-  pn_list_t *events = pn_list(PN_VOID, 0);
-  pn_handler_add(root, test_handler(reactor, events));
-  pn_reactor_schedule(reactor, 0, NULL);
-  pn_reactor_run(reactor);
-  pn_reactor_free(reactor);
-  expect(events, PN_REACTOR_INIT, PN_SELECTABLE_INIT, PN_SELECTABLE_UPDATED, PN_REACTOR_QUIESCED,
-         PN_TIMER_TASK, PN_SELECTABLE_UPDATED, PN_SELECTABLE_FINAL, PN_REACTOR_FINAL, END);
-  pn_free(events);
-}
-
-static void test_reactor_schedule_handler(void) {
-  pn_reactor_t *reactor = pn_reactor();
-  pn_handler_t *root = pn_reactor_get_handler(reactor);
-  pn_list_t *events = pn_list(PN_VOID, 0);
-  pn_list_t *tevents = pn_list(PN_VOID, 0);
-  pn_handler_add(root, test_handler(reactor, events));
-  pn_handler_t *th = test_handler(reactor, tevents);
-  pn_reactor_schedule(reactor, 0, th);
-  pn_reactor_run(reactor);
-  pn_reactor_free(reactor);
-  pn_handler_free(th);
-  expect(events, PN_REACTOR_INIT, PN_SELECTABLE_INIT, PN_SELECTABLE_UPDATED, PN_REACTOR_QUIESCED, PN_SELECTABLE_UPDATED,
-         PN_SELECTABLE_FINAL, PN_REACTOR_FINAL, END);
-  expect(tevents, PN_TIMER_TASK, END);
-  pn_free(events);
-  pn_free(tevents);
-}
-
-static void test_reactor_schedule_cancel(void) {
-  pn_reactor_t *reactor = pn_reactor();
-  pn_handler_t *root = pn_reactor_get_handler(reactor);
-  pn_list_t *events = pn_list(PN_VOID, 0);
-  pn_handler_add(root, test_handler(reactor, events));
-  pn_task_t *task = pn_reactor_schedule(reactor, 0, NULL);
-  pn_task_cancel(task);
-  pn_reactor_run(reactor);
-  pn_reactor_free(reactor);
-  expect(events, PN_REACTOR_INIT, PN_SELECTABLE_INIT, PN_SELECTABLE_UPDATED,
-         PN_SELECTABLE_FINAL, PN_REACTOR_FINAL, END);
-  pn_free(events);
-}
-
-int main(int argc, char **argv)
-{
-  test_reactor_event_root();
-  test_reactor();
-  test_reactor_free();
-  test_reactor_run();
-  test_reactor_run_free();
-  test_reactor_handler();
-  test_reactor_handler_free();
-  test_reactor_handler_run();
-  test_reactor_handler_run_free();
-  test_reactor_connection();
-  test_reactor_connection_factory();
-  test_reactor_bad_domain();
-  test_reactor_acceptor();
-  test_reactor_acceptor_run();
-  test_reactor_connect();
-  for (int i = 0; i < 64; i++) {
-    test_reactor_transfer(i, 2);
-  }
-  test_reactor_transfer(1024, 64);
-  test_reactor_transfer(4*1024, 1024);
-  test_reactor_schedule();
-  test_reactor_schedule_handler();
-  test_reactor_schedule_cancel();
-  return 0;
-}
diff --git a/proton-c/src/tests/refcount.c b/proton-c/src/tests/refcount.c
deleted file mode 100644
index 267c861..0000000
--- a/proton-c/src/tests/refcount.c
+++ /dev/null
@@ -1,393 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/connection.h>
-#include <proton/event.h>
-#include <proton/session.h>
-#include <proton/link.h>
-#include <proton/delivery.h>
-#include <proton/transport.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#define assert(E) ((E) ? 0 : (abort(), 0))
-
-/**
- * The decref order tests validate that whenever the last pointer to a
- * child object, e.g. a session or a link, is about to go away, the
- * parent object takes ownership of that reference if the child object
- * has not been freed, this avoids reference cycles but allows
- * navigation from parents to children.
- **/
-
-#define SETUP_CSL                               \
-  pn_connection_t *conn = pn_connection();      \
-  pn_session_t *ssn = pn_session(conn);         \
-  pn_incref(ssn);                               \
-  pn_link_t *lnk = pn_sender(ssn, "sender");    \
-  pn_incref(lnk);                               \
-                                                \
-  assert(pn_refcount(conn) == 2);               \
-  assert(pn_refcount(ssn) == 2);                \
-  assert(pn_refcount(lnk) == 1);
-
-static void test_decref_order_csl(void) {
-  SETUP_CSL;
-
-  pn_decref(conn);
-  assert(pn_refcount(conn) == 1); // session keeps alive
-  pn_decref(ssn);
-  assert(pn_refcount(ssn) == 1); // link keeps alive
-  pn_decref(lnk);
-  // all gone now (requires valgrind to validate)
-}
-
-static void test_decref_order_cls(void) {
-  SETUP_CSL;
-
-  pn_decref(conn);
-  assert(pn_refcount(conn) == 1); // session keeps alive
-  pn_decref(lnk);
-  assert(pn_refcount(lnk) == 1); // session takes over ownership
-  pn_decref(ssn);
-  // all gone now (requires valgrind to validate)
-}
-
-static void test_decref_order_lcs(void) {
-  SETUP_CSL;
-
-  pn_decref(lnk);
-  assert(pn_refcount(lnk) == 1); // session takes over ownership
-  pn_decref(conn);
-  assert(pn_refcount(conn) == 1); // session keeps alive
-  pn_decref(ssn);
-  // all gone now (requires valgrind to validate)
-}
-
-static void test_decref_order_scl(void) {
-  SETUP_CSL;
-
-  pn_decref(ssn);
-  assert(pn_refcount(ssn) == 1); // link keeps alive
-  pn_decref(conn);
-  assert(pn_refcount(conn) == 1); // session keeps alive
-  pn_decref(lnk);
-  // all gone now (requires valgrind to validate)
-}
-
-static void test_decref_order_slc(void) {
-  SETUP_CSL;
-
-  pn_decref(ssn);
-  assert(pn_refcount(ssn) == 1); // link keeps alive
-  pn_decref(lnk);
-  assert(pn_refcount(ssn) == 1); // connection takes over ownership
-  assert(pn_refcount(lnk) == 1); // session takes over ownership
-  pn_decref(conn);
-  // all gone now (requires valgrind to validate)
-}
-
-static void test_decref_order_lsc(void) {
-  SETUP_CSL;
-
-  pn_decref(lnk);
-  assert(pn_refcount(lnk) == 1); // session takes over ownership
-  assert(pn_refcount(ssn) == 1);
-  pn_decref(ssn);
-  assert(pn_refcount(lnk) == 1);
-  assert(pn_refcount(ssn) == 1); // connection takes over ownership
-  pn_decref(conn);
-  // all gone now (requires valgrind to validate)
-}
-
-/**
- * The incref order tests verify that once ownership of the last
- * pointer to a child is taken over by a parent, it is reassigned when
- * the child is increfed.
- **/
-
-#define SETUP_INCREF_ORDER                      \
-  SETUP_CSL;                                    \
-  pn_decref(lnk);                               \
-  pn_decref(ssn);                               \
-  assert(pn_refcount(lnk) == 1);                \
-  assert(pn_refcount(ssn) == 1);                \
-  assert(pn_refcount(conn) == 1);
-
-static void test_incref_order_sl(void) {
-  SETUP_INCREF_ORDER;
-
-  pn_incref(ssn);
-  assert(pn_refcount(conn) == 2);
-  assert(pn_refcount(ssn) == 1);
-  assert(pn_refcount(lnk) == 1);
-  pn_incref(lnk);
-  assert(pn_refcount(conn) == 2);
-  assert(pn_refcount(ssn) == 2);
-  assert(pn_refcount(lnk) == 1);
-
-  pn_decref(conn);
-  pn_decref(ssn);
-  pn_decref(lnk);
-}
-
-static void test_incref_order_ls(void) {
-  SETUP_INCREF_ORDER;
-
-  pn_incref(lnk);
-  assert(pn_refcount(conn) == 2);
-  assert(pn_refcount(ssn) == 1);
-  assert(pn_refcount(lnk) == 1);
-  pn_incref(ssn);
-  assert(pn_refcount(conn) == 2);
-  assert(pn_refcount(ssn) == 2);
-  assert(pn_refcount(lnk) == 1);
-
-  pn_decref(conn);
-  pn_decref(ssn);
-  pn_decref(lnk);
-}
-
-static void swap(int array[], int i, int j) {
-  int a = array[i];
-  int b = array[j];
-  array[j] = a;
-  array[i] = b;
-}
-
-static void setup(void **objects) {
-  pn_connection_t *conn = pn_connection();
-  pn_session_t *ssn = pn_session(conn);
-  pn_incref(ssn);
-  pn_link_t *lnk = pn_sender(ssn, "sender");
-  pn_incref(lnk);
-  pn_delivery_t *dlv = pn_delivery(lnk, pn_dtag("dtag", 4));
-  pn_incref(dlv);
-
-  assert(pn_refcount(conn) == 2);
-  assert(pn_refcount(ssn) == 2);
-  assert(pn_refcount(lnk) == 2);
-  assert(pn_refcount(dlv) == 1);
-
-  objects[0] = conn;
-  objects[1] = ssn;
-  objects[2] = lnk;
-  objects[3] = dlv;
-}
-
-static bool decreffed(int *indexes, void **objects, int step, void *object) {
-  for (int i = 0; i <= step; i++) {
-    if (object == objects[indexes[i]]) {
-      return true;
-    }
-  }
-  return false;
-}
-
-static bool live_descendent(int *indexes, void **objects, int step, int objidx) {
-  for (int i = objidx + 1; i < 4; i++) {
-    if (!decreffed(indexes, objects, step, objects[i])) {
-      return true;
-    }
-  }
-
-  return false;
-}
-
-static void assert_refcount(void *object, int expected) {
-  int rc = pn_refcount(object);
-  //printf("pn_refcount(%s) = %d\n", pn_object_reify(object)->name, rc);
-  assert(rc == expected);
-}
-
-static void test_decref_order(int *indexes, void **objects) {
-  setup(objects);
-
-  //printf("-----------\n");
-  for (int i = 0; i < 3; i++) {
-    int idx = indexes[i];
-    void *obj = objects[idx];
-    //printf("decreffing %s\n", pn_object_reify(obj)->name);
-    pn_decref(obj);
-    for (int j = 0; j <= i; j++) {
-      // everything we've decreffed already should have a refcount of
-      // 1 because it has been preserved by its parent
-      assert_refcount(objects[indexes[j]], 1);
-    }
-    for (int j = i+1; j < 4; j++) {
-      // everything we haven't decreffed yet should have a refcount of
-      // 2 unless it has a descendent that has not been decrefed (or
-      // it has no child) in which case it should have a refcount of 1
-      int idx = indexes[j];
-      void *obj = objects[idx];
-      assert(!decreffed(indexes, objects, i, obj));
-      if (live_descendent(indexes, objects, i, idx)) {
-        assert_refcount(obj, 2);
-      } else {
-        assert_refcount(obj, 1);
-      }
-    }
-  }
-
-  void *last = objects[indexes[3]];
-  //printf("decreffing %s\n", pn_object_reify(last)->name);
-  pn_decref(last);
-  // all should be gone now, need to run with valgrind to check
-}
-
-static void permute(int n, int *indexes, void **objects) {
-  int j;
-  if (n == 1) {
-    test_decref_order(indexes, objects);
-  } else {
-    for (int i = 1; i <= n; i++) {
-      permute(n-1, indexes, objects);
-      if ((n % 2) == 1) {
-        j = 1;
-      } else {
-        j = i;
-      }
-      swap(indexes, j-1, n-1);
-    }
-  }
-}
-
-static void test_decref_permutations(void) {
-  void *objects[4];
-  int indexes[4] = {0, 1, 2, 3};
-  permute(4, indexes, objects);
-}
-
-static void test_transport(void) {
-  pn_transport_t *transport = pn_transport();
-  assert(pn_refcount(transport) == 1);
-  pn_incref(transport);
-  assert(pn_refcount(transport) == 2);
-  pn_decref(transport);
-  assert(pn_refcount(transport) == 1);
-  pn_free(transport);
-}
-
-static void test_connection_transport(void) {
-  pn_connection_t *connection = pn_connection();
-  assert(pn_refcount(connection) == 1);
-  pn_transport_t *transport = pn_transport();
-  assert(pn_refcount(transport) == 1);
-  pn_transport_bind(transport, connection);
-  assert(pn_refcount(connection) == 2);
-  pn_decref(transport);
-  assert(pn_refcount(transport) == 1); // preserved by the bind
-  assert(pn_refcount(connection) == 1);
-  pn_free(connection);
-}
-
-static void test_transport_connection(void) {
-  pn_transport_t *transport = pn_transport();
-  assert(pn_refcount(transport) == 1);
-  pn_connection_t *connection = pn_connection();
-  assert(pn_refcount(connection) == 1);
-  pn_transport_bind(transport, connection);
-  assert(pn_refcount(connection) == 2);
-  pn_decref(connection);
-  assert(pn_refcount(connection) == 1);
-  assert(pn_refcount(transport) == 1);
-  pn_free(transport);
-}
-
-static void drain(pn_collector_t *collector) {
-  while (pn_collector_next(collector))
-    ;
-}
-
-static void test_collector_connection_transport(void) {
-  pn_collector_t *collector = pn_collector();
-  assert(pn_refcount(collector) == 1);
-  pn_connection_t *connection = pn_connection();
-  assert(pn_refcount(connection) == 1);
-  pn_connection_collect(connection, collector);
-  assert(pn_refcount(collector) == 2);
-  assert(pn_refcount(connection) == 2);
-  drain(collector);
-  assert(pn_refcount(connection) == 1);
-  pn_transport_t *transport = pn_transport();
-  assert(pn_refcount(transport) == 1);
-  pn_transport_bind(transport, connection);
-  assert(pn_refcount(transport) == 1);
-  assert(pn_refcount(connection) == 3);
-  drain(collector);
-  assert(pn_refcount(connection) == 2);
-  pn_decref(transport);
-  assert(pn_refcount(transport) == 1); // preserved by the bind
-  assert(pn_refcount(connection) == 1);
-  pn_free(connection);
-  assert(pn_refcount(transport) == 1); // events
-  assert(pn_refcount(connection) == 1); // events
-  pn_collector_free(collector);
-}
-
-static void test_collector_transport_connection(void) {
-  pn_collector_t *collector = pn_collector();
-  assert(pn_refcount(collector) == 1);
-  pn_transport_t *transport = pn_transport();
-  assert(pn_refcount(transport) == 1);
-  pn_connection_t *connection = pn_connection();
-  assert(pn_refcount(connection) == 1);
-  pn_connection_collect(connection, collector);
-  assert(pn_refcount(collector) == 2);
-  assert(pn_refcount(connection) == 2);
-  drain(collector);
-  assert(pn_refcount(connection) == 1);
-  pn_transport_bind(transport, connection);
-  assert(pn_refcount(connection) == 3);
-  assert(pn_refcount(transport) == 1);
-  drain(collector);
-  assert(pn_refcount(connection) == 2);
-  assert(pn_refcount(transport) == 1);
-  pn_decref(connection);
-  assert(pn_refcount(connection) == 1);
-  assert(pn_refcount(transport) == 1);
-  pn_free(transport);
-  assert(pn_refcount(connection) == 1);
-  assert(pn_refcount(transport) == 1);
-  pn_collector_free(collector);
-}
-
-int main(int argc, char **argv)
-{
-  test_decref_order_csl();
-  test_decref_order_cls();
-  test_decref_order_lcs();
-  test_decref_order_scl();
-  test_decref_order_slc();
-  test_decref_order_lsc();
-
-  test_incref_order_sl();
-  test_incref_order_ls();
-
-  test_decref_permutations();
-
-  test_transport();
-  test_connection_transport();
-  test_transport_connection();
-  test_collector_connection_transport();
-  test_collector_transport_connection();
-  return 0;
-}
diff --git a/proton-c/src/transactions.xml b/proton-c/src/transactions.xml
deleted file mode 100644
index 663eb7b..0000000
--- a/proton-c/src/transactions.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-Copyright Bank of America, N.A., Barclays Bank PLC, Cisco Systems, Credit
-Suisse, Deutsche Boerse, Envoy Technologies Inc., Goldman Sachs, HCL
-Technologies Ltd, IIT Software GmbH, iMatix Corporation, INETCO Systems Limited,
-Informatica Corporation, JPMorgan Chase & Co., Kaazing Corporation, N.A,
-Microsoft Corporation, my-Channels, Novell, Progress Software, Red Hat Inc.,
-Software AG, Solace Systems Inc., StormMQ Ltd., Tervela Inc., TWIST Process
-Innovations Ltd, VMware, Inc., and WS02 Inc. 2006-2011. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-3. The name of the author may not be used to endorse or promote products
-derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--->
-
-<amqp name="transactions" xmlns="http://www.amqp.org/schema/amqp.xsd">
-  <section name="coordination">
-    <type name="coordinator" class="composite" source="list" provides="target">
-      <descriptor name="amqp:coordinator:list" code="0x00000000:0x00000030"/>
-      <field name="capabilities" type="symbol" requires="txn-capability" multiple="true"/>
-    </type>
-    <type name="declare" class="composite" source="list">
-      <descriptor name="amqp:declare:list" code="0x00000000:0x00000031"/>
-      <field name="global-id" type="*" requires="global-tx-id"/>
-    </type>
-    <type name="discharge" class="composite" source="list">
-      <descriptor name="amqp:discharge:list" code="0x00000000:0x00000032"/>
-      <field name="txn-id" type="*" mandatory="true" requires="txn-id"/>
-      <field name="fail" type="boolean"/>
-    </type>
-    <type name="transaction-id" class="restricted" source="binary" provides="txn-id"/>
-    <type name="declared" class="composite" source="list" provides="delivery-state, outcome">
-      <descriptor name="amqp:declared:list" code="0x00000000:0x00000033"/>
-      <field name="txn-id" type="*" mandatory="true" requires="txn-id"/>
-    </type>
-    <type name="transactional-state" class="composite" source="list" provides="delivery-state">
-      <descriptor name="amqp:transactional-state:list" code="0x00000000:0x00000034"/>
-      <field name="txn-id" type="*" mandatory="true" requires="txn-id"/>
-      <field name="outcome" type="*" requires="outcome"/>
-    </type>
-    <type name="txn-capability" class="restricted" source="symbol" provides="txn-capability">
-      <choice name="local-transactions" value="amqp:local-transactions"/>
-      <choice name="distributed-transactions" value="amqp:distributed-transactions"/>
-      <choice name="promotable-transactions" value="amqp:promotable-transactions"/>
-      <choice name="multi-txns-per-ssn" value="amqp:multi-txns-per-ssn"/>
-      <choice name="multi-ssns-per-txn" value="amqp:multi-ssns-per-txn"/>
-    </type>
-    <type name="transaction-error" class="restricted" source="symbol" provides="error-condition">
-      <choice name="unknown-id" value="amqp:transaction:unknown-id"/>
-      <choice name="transaction-rollback" value="amqp:transaction:rollback"/>
-      <choice name="transaction-timeout" value="amqp:transaction:timeout"/>
-    </type>
-  </section>
-</amqp>
diff --git a/proton-c/src/transport.xml b/proton-c/src/transport.xml
deleted file mode 100644
index 7ff2fd4..0000000
--- a/proton-c/src/transport.xml
+++ /dev/null
@@ -1,200 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-Copyright Bank of America, N.A., Barclays Bank PLC, Cisco Systems, Credit
-Suisse, Deutsche Boerse, Envoy Technologies Inc., Goldman Sachs, HCL
-Technologies Ltd, IIT Software GmbH, iMatix Corporation, INETCO Systems Limited,
-Informatica Corporation, JPMorgan Chase & Co., Kaazing Corporation, N.A,
-Microsoft Corporation, my-Channels, Novell, Progress Software, Red Hat Inc.,
-Software AG, Solace Systems Inc., StormMQ Ltd., Tervela Inc., TWIST Process
-Innovations Ltd, VMware, Inc., and WS02 Inc. 2006-2011. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-3. The name of the author may not be used to endorse or promote products
-derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--->
-
-<amqp name="transport" xmlns="http://www.amqp.org/schema/amqp.xsd">
-  <section name="performatives">
-    <type name="open" class="composite" source="list" provides="frame">
-      <descriptor name="amqp:open:list" code="0x00000000:0x00000010"/>
-      <field name="container-id" type="string" mandatory="true"/>
-      <field name="hostname" type="string"/>
-      <field name="max-frame-size" type="uint" default="4294967295"/>
-      <field name="channel-max" type="ushort" default="65535"/>
-      <field name="idle-time-out" type="milliseconds"/>
-      <field name="outgoing-locales" type="ietf-language-tag" multiple="true"/>
-      <field name="incoming-locales" type="ietf-language-tag" multiple="true"/>
-      <field name="offered-capabilities" type="symbol" multiple="true"/>
-      <field name="desired-capabilities" type="symbol" multiple="true"/>
-      <field name="properties" type="fields"/>
-    </type>
-    <type name="begin" class="composite" source="list" provides="frame">
-      <descriptor name="amqp:begin:list" code="0x00000000:0x00000011"/>
-      <field name="remote-channel" type="ushort"/>
-      <field name="next-outgoing-id" type="transfer-number" mandatory="true"/>
-      <field name="incoming-window" type="uint" mandatory="true"/>
-      <field name="outgoing-window" type="uint" mandatory="true"/>
-      <field name="handle-max" type="handle" default="4294967295"/>
-      <field name="offered-capabilities" type="symbol" multiple="true"/>
-      <field name="desired-capabilities" type="symbol" multiple="true"/>
-      <field name="properties" type="fields"/>
-    </type>
-    <type name="attach" class="composite" source="list" provides="frame">
-      <descriptor name="amqp:attach:list" code="0x00000000:0x00000012"/>
-      <field name="name" type="string" mandatory="true"/>
-      <field name="handle" type="handle" mandatory="true"/>
-      <field name="role" type="role" mandatory="true"/>
-      <field name="snd-settle-mode" type="sender-settle-mode" default="mixed"/>
-      <field name="rcv-settle-mode" type="receiver-settle-mode" default="first"/>
-      <field name="source" type="*" requires="source"/>
-      <field name="target" type="*" requires="target"/>
-      <field name="unsettled" type="map"/>
-      <field name="incomplete-unsettled" type="boolean" default="false"/>
-      <field name="initial-delivery-count" type="sequence-no"/>
-      <field name="max-message-size" type="ulong"/>
-      <field name="offered-capabilities" type="symbol" multiple="true"/>
-      <field name="desired-capabilities" type="symbol" multiple="true"/>
-      <field name="properties" type="fields"/>
-    </type>
-    <type name="flow" class="composite" source="list" provides="frame">
-      <descriptor name="amqp:flow:list" code="0x00000000:0x00000013"/>
-      <field name="next-incoming-id" type="transfer-number"/>
-      <field name="incoming-window" type="uint" mandatory="true"/>
-      <field name="next-outgoing-id" type="transfer-number" mandatory="true"/>
-      <field name="outgoing-window" type="uint" mandatory="true"/>
-      <field name="handle" type="handle"/>
-      <field name="delivery-count" type="sequence-no"/>
-      <field name="link-credit" type="uint"/>
-      <field name="available" type="uint"/>
-      <field name="drain" type="boolean" default="false"/>
-      <field name="echo" type="boolean" default="false"/>
-      <field name="properties" type="fields"/>
-    </type>
-    <type name="transfer" class="composite" source="list" provides="frame">
-      <descriptor name="amqp:transfer:list" code="0x00000000:0x00000014"/>
-      <field name="handle" type="handle" mandatory="true"/>
-      <field name="delivery-id" type="delivery-number"/>
-      <field name="delivery-tag" type="delivery-tag"/>
-      <field name="message-format" type="message-format"/>
-      <field name="settled" type="boolean"/>
-      <field name="more" type="boolean" default="false"/>
-      <field name="rcv-settle-mode" type="receiver-settle-mode"/>
-      <field name="state" type="*" requires="delivery-state"/>
-      <field name="resume" type="boolean" default="false"/>
-      <field name="aborted" type="boolean" default="false"/>
-      <field name="batchable" type="boolean" default="false"/>
-    </type>
-    <type name="disposition" class="composite" source="list" provides="frame">
-      <descriptor name="amqp:disposition:list" code="0x00000000:0x00000015"/>
-      <field name="role" type="role" mandatory="true"/>
-      <field name="first" type="delivery-number" mandatory="true"/>
-      <field name="last" type="delivery-number"/>
-      <field name="settled" type="boolean" default="false"/>
-      <field name="state" type="*" requires="delivery-state"/>
-      <field name="batchable" type="boolean" default="false"/>
-    </type>
-    <type name="detach" class="composite" source="list" provides="frame">
-      <descriptor name="amqp:detach:list" code="0x00000000:0x00000016"/>
-      <field name="handle" type="handle" mandatory="true"/>
-      <field name="closed" type="boolean" default="false"/>
-      <field name="error" type="error"/>
-    </type>
-    <type name="end" class="composite" source="list" provides="frame">
-      <descriptor name="amqp:end:list" code="0x00000000:0x00000017"/>
-      <field name="error" type="error"/>
-    </type>
-    <type name="close" class="composite" source="list" provides="frame">
-      <descriptor name="amqp:close:list" code="0x00000000:0x00000018"/>
-      <field name="error" type="error"/>
-    </type>
-  </section>
-  <section name="definitions">
-    <type name="role" class="restricted" source="boolean">
-      <choice name="sender" value="false"/>
-      <choice name="receiver" value="true"/>
-    </type>
-    <type name="sender-settle-mode" class="restricted" source="ubyte">
-      <choice name="unsettled" value="0"/>
-      <choice name="settled" value="1"/>
-      <choice name="mixed" value="2"/>
-    </type>
-    <type name="receiver-settle-mode" class="restricted" source="ubyte">
-      <choice name="first" value="0"/>
-      <choice name="second" value="1"/>
-    </type>
-    <type name="handle" class="restricted" source="uint"/>
-    <type name="seconds" class="restricted" source="uint"/>
-    <type name="milliseconds" class="restricted" source="uint"/>
-    <type name="delivery-tag" class="restricted" source="binary"/>
-    <type name="delivery-number" class="restricted" source="sequence-no"/>
-    <type name="transfer-number" class="restricted" source="sequence-no"/>
-    <type name="sequence-no" class="restricted" source="uint"/>
-    <type name="message-format" class="restricted" source="uint"/>
-    <type name="ietf-language-tag" class="restricted" source="symbol"/>
-    <type name="fields" class="restricted" source="map"/>
-    <type name="error" class="composite" source="list">
-      <descriptor name="amqp:error:list" code="0x00000000:0x0000001d"/>
-      <field name="condition" type="symbol" mandatory="true" requires="error-condition"/>
-      <field name="description" type="string"/>
-      <field name="info" type="fields"/>
-    </type>
-    <type name="amqp-error" class="restricted" source="symbol" provides="error-condition">
-      <choice name="internal-error" value="amqp:internal-error"/>
-      <choice name="not-found" value="amqp:not-found"/>
-      <choice name="unauthorized-access" value="amqp:unauthorized-access"/>
-      <choice name="decode-error" value="amqp:decode-error"/>
-      <choice name="resource-limit-exceeded" value="amqp:resource-limit-exceeded"/>
-      <choice name="not-allowed" value="amqp:not-allowed"/>
-      <choice name="invalid-field" value="amqp:invalid-field"/>
-      <choice name="not-implemented" value="amqp:not-implemented"/>
-      <choice name="resource-locked" value="amqp:resource-locked"/>
-      <choice name="precondition-failed" value="amqp:precondition-failed"/>
-      <choice name="resource-deleted" value="amqp:resource-deleted"/>
-      <choice name="illegal-state" value="amqp:illegal-state"/>
-      <choice name="frame-size-too-small" value="amqp:frame-size-too-small"/>
-    </type>
-    <type name="connection-error" class="restricted" source="symbol" provides="error-condition">
-      <choice name="connection-forced" value="amqp:connection:forced"/>
-      <choice name="framing-error" value="amqp:connection:framing-error"/>
-      <choice name="redirect" value="amqp:connection:redirect"/>
-    </type>
-    <type name="session-error" class="restricted" source="symbol" provides="error-condition">
-      <choice name="window-violation" value="amqp:session:window-violation"/>
-      <choice name="errant-link" value="amqp:session:errant-link"/>
-      <choice name="handle-in-use" value="amqp:session:handle-in-use"/>
-      <choice name="unattached-handle" value="amqp:session:unattached-handle"/>
-    </type>
-    <type name="link-error" class="restricted" source="symbol" provides="error-condition">
-      <choice name="detach-forced" value="amqp:link:detach-forced"/>
-      <choice name="transfer-limit-exceeded" value="amqp:link:transfer-limit-exceeded"/>
-      <choice name="message-size-exceeded" value="amqp:link:message-size-exceeded"/>
-      <choice name="redirect" value="amqp:link:redirect"/>
-      <choice name="stolen" value="amqp:link:stolen"/>
-    </type>
-    <definition name="PORT" value="5672"/>
-    <definition name="SECURE-PORT" value="5671"/>
-    <definition name="MAJOR" value="1"/>
-    <definition name="MINOR" value="0"/>
-    <definition name="REVISION" value="0"/>
-    <definition name="MIN-MAX-FRAME-SIZE" value="512"/>
-  </section>
-</amqp>
diff --git a/proton-c/src/types.xml b/proton-c/src/types.xml
deleted file mode 100644
index 4aa9c0f..0000000
--- a/proton-c/src/types.xml
+++ /dev/null
@@ -1,125 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-Copyright Bank of America, N.A., Barclays Bank PLC, Cisco Systems, Credit
-Suisse, Deutsche Boerse, Envoy Technologies Inc., Goldman Sachs, HCL
-Technologies Ltd, IIT Software GmbH, iMatix Corporation, INETCO Systems Limited,
-Informatica Corporation, JPMorgan Chase & Co., Kaazing Corporation, N.A,
-Microsoft Corporation, my-Channels, Novell, Progress Software, Red Hat Inc.,
-Software AG, Solace Systems Inc., StormMQ Ltd., Tervela Inc., TWIST Process
-Innovations Ltd, VMware, Inc., and WS02 Inc. 2006-2011. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-3. The name of the author may not be used to endorse or promote products
-derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--->
-
-<amqp name="types" xmlns="http://www.amqp.org/schema/amqp.xsd">
-  <section name="encodings">
-    <type name="null" class="primitive">
-      <encoding code="0x40" category="fixed" width="0"/>
-    </type>
-    <type name="boolean" class="primitive">
-      <encoding code="0x56" category="fixed" width="1"/>
-      <encoding name="true" code="0x41" category="fixed" width="0"/>
-      <encoding name="false" code="0x42" category="fixed" width="0"/>
-    </type>
-    <type name="ubyte" class="primitive">
-      <encoding code="0x50" category="fixed" width="1"/>
-    </type>
-    <type name="ushort" class="primitive">
-      <encoding code="0x60" category="fixed" width="2"/>
-    </type>
-    <type name="uint" class="primitive">
-      <encoding code="0x70" category="fixed" width="4"/>
-      <encoding name="smalluint" code="0x52" category="fixed" width="1"/>
-      <encoding name="uint0" code="0x43" category="fixed" width="0"/>
-    </type>
-    <type name="ulong" class="primitive">
-      <encoding code="0x80" category="fixed" width="8"/>
-      <encoding name="smallulong" code="0x53" category="fixed" width="1"/>
-      <encoding name="ulong0" code="0x44" category="fixed" width="0"/>
-    </type>
-    <type name="byte" class="primitive">
-      <encoding code="0x51" category="fixed" width="1"/>
-    </type>
-    <type name="short" class="primitive">
-      <encoding code="0x61" category="fixed" width="2"/>
-    </type>
-    <type name="int" class="primitive">
-      <encoding code="0x71" category="fixed" width="4"/>
-      <encoding name="smallint" code="0x54" category="fixed" width="1"/>
-    </type>
-    <type name="long" class="primitive">
-      <encoding code="0x81" category="fixed" width="8"/>
-      <encoding name="smalllong" code="0x55" category="fixed" width="1"/>
-    </type>
-    <type name="float" class="primitive">
-      <encoding name="ieee-754" code="0x72" category="fixed" width="4"/>
-    </type>
-    <type name="double" class="primitive">
-      <encoding name="ieee-754" code="0x82" category="fixed" width="8"/>
-    </type>
-    <type name="decimal32" class="primitive">
-      <encoding name="ieee-754" code="0x74" category="fixed" width="4"/>
-    </type>
-    <type name="decimal64" class="primitive">
-      <encoding name="ieee-754" code="0x84" category="fixed" width="8"/>
-    </type>
-    <type name="decimal128" class="primitive">
-      <encoding name="ieee-754" code="0x94" category="fixed" width="16"/>
-    </type>
-    <type name="char" class="primitive">
-      <encoding name="utf32" code="0x73" category="fixed" width="4"/>
-    </type>
-    <type name="timestamp" class="primitive">
-      <encoding name="ms64" code="0x83" category="fixed" width="8"/>
-    </type>
-    <type name="uuid" class="primitive">
-      <encoding code="0x98" category="fixed" width="16"/>
-    </type>
-    <type name="binary" class="primitive">
-      <encoding name="vbin8" code="0xa0" category="variable" width="1"/>
-      <encoding name="vbin32" code="0xb0" category="variable" width="4"/>
-    </type>
-    <type name="string" class="primitive">
-      <encoding name="str8-utf8" code="0xa1" category="variable" width="1"/>
-      <encoding name="str32-utf8" code="0xb1" category="variable" width="4"/>
-    </type>
-    <type name="symbol" class="primitive">
-      <encoding name="sym8" code="0xa3" category="variable" width="1"/>
-      <encoding name="sym32" code="0xb3" category="variable" width="4"/>
-    </type>
-    <type name="list" class="primitive">
-      <encoding name="list0" code="0x45" category="fixed" width="0"/>
-      <encoding name="list8" code="0xc0" category="compound" width="1"/>
-      <encoding name="list32" code="0xd0" category="compound" width="4"/>
-    </type>
-    <type name="map" class="primitive">
-      <encoding name="map8" code="0xc1" category="compound" width="1"/>
-      <encoding name="map32" code="0xd1" category="compound" width="4"/>
-    </type>
-    <type name="array" class="primitive">
-      <encoding name="array8" code="0xe0" category="array" width="1"/>
-      <encoding name="array32" code="0xf0" category="array" width="4"/>
-    </type>
-  </section>
-</amqp>
diff --git a/proton-c/tox.ini.in b/proton-c/tox.ini.in
deleted file mode 100644
index 2a6b09d..0000000
--- a/proton-c/tox.ini.in
+++ /dev/null
@@ -1,27 +0,0 @@
-[tox]
-envlist = py26,py27,py33,py34,py35
-minversion = 1.4
-skipdist = True
-setupdir = @py_bin@/dist
-
-[testenv]
-usedevelop = False
-setenv =
-    VIRTUAL_ENV={envdir}
-    DEBUG=True
-passenv =
-    PKG_CONFIG_PATH
-    CFLAGS
-    SASLPASSWD
-    VALGRIND
-    CLASSPATH
-commands =
-    @CMAKE_SOURCE_DIR@/tests/python/proton-test {posargs}
-deps =
-    unittest2
-
-[testenv:pep8]
-commands = flake8
-
-[testenv:docs]
-commands = python setup.py build_sphinx
diff --git a/proton-c/xproton.py b/proton-c/xproton.py
deleted file mode 100644
index 8d78660..0000000
--- a/proton-c/xproton.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from cproton import *
diff --git a/qpid-proton-cpp.syms b/qpid-proton-cpp.syms
deleted file mode 100644
index c24e898..0000000
--- a/qpid-proton-cpp.syms
+++ /dev/null
@@ -1,627 +0,0 @@
-# XXX acceptor symbols, but not connector?
-proton::acceptor::close()
-proton::acceptor::connection_options()
-
-proton::condition::description() const
-proton::condition::empty() const
-proton::condition::info() const
-proton::condition::name() const
-proton::condition::operator!() const
-proton::condition::what() const
-
-proton::connection::close()
-proton::connection::container() const
-proton::connection::container_id() const
-proton::connection::default_session()
-proton::connection::host(std::string const&)
-proton::connection::host() const
-proton::connection::links() const
-proton::connection::local_condition() const
-proton::connection::open()
-proton::connection::open_receiver(std::string const&, proton::link_options const&)
-proton::connection::open_sender(std::string const&, proton::link_options const&)
-proton::connection::open_session()
-proton::connection::password(std::string const&)
-proton::connection::release()
-proton::connection::remote_condition() const
-proton::connection::sessions() const
-proton::connection::state() const
-proton::connection::transport() const
-proton::connection::user(std::string const&)
-proton::connection::~connection()
-
-proton::connection_driver::can_read() const
-proton::connection_driver::can_write() const
-proton::connection_driver::closed() const
-proton::connection_driver::connection() const
-proton::connection_driver::connection_driver(proton::handler&, proton::connection_options const&)
-proton::connection_driver::container::container(std::string const&)
-proton::connection_driver::container::id() const
-proton::connection_driver::container::make_options()
-proton::connection_driver::container::options(proton::connection_options const&)
-proton::connection_driver::container::~container()
-proton::connection_driver::dispatch()
-proton::connection_driver::io_error::io_error(std::string const&)
-proton::connection_driver::io_error::~io_error()
-proton::connection_driver::no_opts
-proton::connection_driver::process(int)
-proton::connection_driver::try_read()
-proton::connection_driver::try_write()
-proton::connection_driver::~connection_driver()
-
-proton::connection_options::connection_options()
-proton::connection_options::connection_options(proton::connection_options const&)
-proton::connection_options::container_id(std::string const&)
-proton::connection_options::handler(proton::handler*)
-proton::connection_options::heartbeat(proton::duration)
-proton::connection_options::idle_timeout(proton::duration)
-proton::connection_options::link_prefix(std::string const&)
-proton::connection_options::max_channels(unsigned short)
-proton::connection_options::max_frame_size(unsigned int)
-proton::connection_options::operator=(proton::connection_options const&)
-proton::connection_options::override(proton::connection_options const&)
-proton::connection_options::reconnect(proton::reconnect_timer const&)
-proton::connection_options::sasl_allow_insecure_mechs(bool)
-proton::connection_options::sasl_allowed_mechs(std::string const&)
-proton::connection_options::sasl_config_name(std::string const&)
-proton::connection_options::sasl_config_path(std::string const&)
-proton::connection_options::sasl_enabled(bool)
-proton::connection_options::ssl_client_options(proton::ssl_client_options const&)
-proton::connection_options::ssl_server_options(proton::ssl_server_options const&)
-proton::connection_options::~connection_options()
-
-proton::container::client_connection_options(proton::connection_options const&)
-proton::container::connect(proton::url const&, proton::connection_options const&)
-proton::container::container(proton::handler&, std::string const&)
-proton::container::container(std::string const&)
-proton::container::id() const
-proton::container::listen(proton::url const&, proton::connection_options const&)
-proton::container::open_receiver(proton::url const&, proton::link_options const&, proton::connection_options const&)
-proton::container::open_sender(proton::url const&, proton::link_options const&, proton::connection_options const&)
-proton::container::run()
-proton::container::schedule(int, proton::handler*)
-proton::container::server_connection_options(proton::connection_options const&)
-proton::container::~container()
-
-proton::conversion_error::conversion_error(std::string const&)
-proton::conversion_error::~conversion_error()
-
-proton::delivery::clear()
-proton::delivery::link() const
-proton::delivery::partial() const
-proton::delivery::pending() const
-proton::delivery::readable() const
-proton::delivery::remote_state() const
-proton::delivery::settle()
-proton::delivery::settle(proton::delivery::state)
-proton::delivery::settled() const
-proton::delivery::update(proton::delivery::state)
-proton::delivery::updated() const
-proton::delivery::writable() const
-
-proton::duration::FOREVER
-proton::duration::IMMEDIATE
-proton::duration::MINUTE
-proton::duration::SECOND
-
-proton::endpoint::LOCAL_ACTIVE
-proton::endpoint::LOCAL_CLOSED
-proton::endpoint::LOCAL_MASK
-proton::endpoint::LOCAL_UNINIT
-proton::endpoint::REMOTE_ACTIVE
-proton::endpoint::REMOTE_CLOSED
-proton::endpoint::REMOTE_MASK
-proton::endpoint::REMOTE_UNINIT
-proton::endpoint::~endpoint()
-
-proton::error::error(std::string const&)
-proton::error::~error()
-
-proton::handler::handler(int, bool, bool, bool)
-
-# XXX Do these default implementations actually need to be exported?
-# The API user never uses them directly he only overrides virtuals
-proton::handler::on_connection_close(proton::event&)
-proton::handler::on_connection_error(proton::event&)
-proton::handler::on_connection_open(proton::event&)
-proton::handler::on_delivery_accept(proton::event&)
-proton::handler::on_delivery_reject(proton::event&)
-proton::handler::on_delivery_release(proton::event&)
-proton::handler::on_delivery_settle(proton::event&)
-proton::handler::on_link_close(proton::event&)
-proton::handler::on_link_error(proton::event&)
-proton::handler::on_link_open(proton::event&)
-proton::handler::on_message(proton::event&)
-proton::handler::on_sendable(proton::event&)
-proton::handler::on_session_close(proton::event&)
-proton::handler::on_session_error(proton::event&)
-proton::handler::on_session_open(proton::event&)
-proton::handler::on_start(proton::event&)
-proton::handler::on_timer(proton::event&)
-proton::handler::on_transport_close(proton::event&)
-proton::handler::on_transport_error(proton::event&)
-proton::handler::on_unhandled(proton::event&)
-proton::handler::on_unhandled_error(proton::event&, proton::condition const&)
-proton::handler::~handler()
-
-# XXX I wonder how much of these internal symbols can just not be exported
-proton::internal::assert_map_scope(proton::internal::scope const&)
-proton::internal::data::append(proton::internal::data)
-proton::internal::data::appendn(proton::internal::data, int)
-proton::internal::data::clear()
-proton::internal::data::copy(proton::internal::data const&)
-proton::internal::data::create()
-proton::internal::data::decoder()
-proton::internal::data::empty() const
-proton::internal::data::encoder()
-proton::internal::data::equal(proton::internal::data const&) const
-proton::internal::data::less(proton::internal::data const&) const
-proton::internal::data::narrow()
-proton::internal::data::next() const
-proton::internal::data::point() const
-proton::internal::data::restore(unsigned long)
-proton::internal::data::type() const
-proton::internal::data::widen()
-proton::internal::decoder::backup()
-proton::internal::decoder::check_type(proton::type_id)
-proton::internal::decoder::decode(char const*, unsigned long)
-proton::internal::decoder::decode(std::string const&)
-proton::internal::decoder::more() const
-proton::internal::decoder::operator>>(bool&)
-proton::internal::decoder::operator>>(double&)
-proton::internal::decoder::operator>>(float&)
-proton::internal::decoder::operator>>(int&)
-proton::internal::decoder::operator>>(long&)
-proton::internal::decoder::operator>>(proton::annotation_key&)
-proton::internal::decoder::operator>>(proton::decimal128&)
-proton::internal::decoder::operator>>(proton::decimal32&)
-proton::internal::decoder::operator>>(proton::decimal64&)
-proton::internal::decoder::operator>>(proton::internal::assert_type)
-proton::internal::decoder::operator>>(proton::internal::finish)
-proton::internal::decoder::operator>>(proton::internal::rewind)
-proton::internal::decoder::operator>>(proton::internal::skip)
-proton::internal::decoder::operator>>(proton::internal::start&)
-proton::internal::decoder::operator>>(proton::message_id&)
-proton::internal::decoder::operator>>(proton::scalar&)
-proton::internal::decoder::operator>>(proton::timestamp&)
-proton::internal::decoder::operator>>(proton::uuid&)
-proton::internal::decoder::operator>>(proton::value&)
-proton::internal::decoder::operator>>(short&)
-proton::internal::decoder::operator>>(signed char&)
-proton::internal::decoder::operator>>(std::string&)
-proton::internal::decoder::operator>>(unsigned char&)
-proton::internal::decoder::operator>>(unsigned int&)
-proton::internal::decoder::operator>>(unsigned long&)
-proton::internal::decoder::operator>>(unsigned short&)
-proton::internal::decoder::operator>>(wchar_t&)
-proton::internal::decoder::rewind()
-proton::internal::decoder::skip()
-proton::internal::decoder::type() const
-proton::internal::encoder::encode(char*, unsigned long&)
-proton::internal::encoder::encode(std::string&)
-proton::internal::encoder::encode()
-proton::internal::encoder::insert(proton::value const&)
-proton::internal::encoder::operator<<(bool)
-proton::internal::encoder::operator<<(double)
-proton::internal::encoder::operator<<(float)
-proton::internal::encoder::operator<<(int)
-proton::internal::encoder::operator<<(long)
-proton::internal::encoder::operator<<(proton::binary const&)
-proton::internal::encoder::operator<<(proton::decimal128)
-proton::internal::encoder::operator<<(proton::decimal32)
-proton::internal::encoder::operator<<(proton::decimal64)
-proton::internal::encoder::operator<<(proton::internal::finish const&)
-proton::internal::encoder::operator<<(proton::internal::start const&)
-proton::internal::encoder::operator<<(proton::scalar const&)
-proton::internal::encoder::operator<<(proton::symbol const&)
-proton::internal::encoder::operator<<(proton::timestamp)
-proton::internal::encoder::operator<<(proton::uuid const&)
-proton::internal::encoder::operator<<(short)
-proton::internal::encoder::operator<<(signed char)
-proton::internal::encoder::operator<<(std::string const&)
-proton::internal::encoder::operator<<(unsigned char)
-proton::internal::encoder::operator<<(unsigned int)
-proton::internal::encoder::operator<<(unsigned long)
-proton::internal::encoder::operator<<(unsigned short)
-proton::internal::encoder::operator<<(wchar_t)
-proton::internal::operator<<(std::ostream&, proton::internal::data const&)
-proton::internal::operator<<(std::ostream&, proton::internal::encoder const&)
-proton::internal::pn_ptr_base::decref(void*)
-proton::internal::pn_ptr_base::incref(void*)
-proton::internal::ssl_domain::operator=(proton::internal::ssl_domain const&)
-proton::internal::ssl_domain::ssl_domain(proton::internal::ssl_domain const&)
-proton::internal::ssl_domain::~ssl_domain()
-proton::internal::start::array(proton::type_id, bool)
-proton::internal::start::described()
-proton::internal::start::list()
-proton::internal::start::map()
-proton::internal::start::start(proton::type_id, proton::type_id, bool, unsigned long)
-
-# XXX Not sure how much of this should be exposed
-proton::io::INVALID_DESCRIPTOR
-proton::io::connect(proton::url const&)
-proton::io::error_str()
-proton::io::finalize()
-proton::io::initialize()
-
-proton::io::listener::accept(std::string&, std::string&)
-proton::io::listener::listener(std::string const&, std::string const&)
-proton::io::listener::~listener()
-
-proton::io::socket_engine::io_close()
-proton::io::socket_engine::io_read(char*, unsigned long)
-proton::io::socket_engine::io_write(char const*, unsigned long)
-proton::io::socket_engine::run()
-proton::io::socket_engine::socket_engine(long, proton::handler&, proton::connection_options const&)
-proton::io::socket_engine::socket_engine(proton::url const&, proton::handler&, proton::connection_options const&)
-proton::io::socket_engine::~socket_engine()
-
-proton::link::advance()
-proton::link::close()
-proton::link::connection() const
-proton::link::credit() const
-proton::link::detach()
-proton::link::detach_handler()
-proton::link::drained()
-proton::link::handler(proton::proton_handler&)
-proton::link::local_condition() const
-proton::link::local_source() const
-proton::link::local_target() const
-proton::link::name() const
-proton::link::open(proton::link_options const&)
-proton::link::queued()
-proton::link::receiver()
-proton::link::receiver() const
-proton::link::receiver_settle_mode()
-proton::link::receiver_settle_mode(proton::link_options::receiver_settle_mode)
-proton::link::recv(char*, unsigned long)
-proton::link::remote_condition() const
-proton::link::remote_receiver_settle_mode()
-proton::link::remote_sender_settle_mode()
-proton::link::remote_source() const
-proton::link::remote_target() const
-proton::link::sender()
-proton::link::sender() const
-proton::link::sender_settle_mode()
-proton::link::sender_settle_mode(proton::link_options::sender_settle_mode)
-proton::link::session() const
-proton::link::state() const
-proton::link::unsettled()
-proton::link::~link()
-
-proton::link_iterator::operator++()
-
-proton::link_options::browsing(bool)
-proton::link_options::delivery_mode(proton::link_options::delivery_mode)
-proton::link_options::distribution_mode(proton::terminus::distribution_mode)
-proton::link_options::durable_subscription(bool)
-proton::link_options::dynamic_address(bool)
-proton::link_options::handler(proton::handler*)
-proton::link_options::lifetime_policy(proton::link_options::lifetime_policy)
-proton::link_options::link_options()
-proton::link_options::link_options(proton::link_options const&)
-proton::link_options::local_address(std::string const&)
-proton::link_options::operator=(proton::link_options const&)
-proton::link_options::override(proton::link_options const&)
-proton::link_options::selector(std::string const&)
-proton::link_options::~link_options()
-
-proton::message::address(std::string const&)
-proton::message::address() const
-proton::message::application_properties()
-proton::message::application_properties() const
-proton::message::body()
-proton::message::body() const
-proton::message::clear()
-proton::message::content_encoding(std::string const&)
-proton::message::content_encoding() const
-proton::message::content_type(std::string const&)
-proton::message::content_type() const
-proton::message::correlation_id() const
-proton::message::correlation_id(proton::message_id const&)
-proton::message::creation_time() const
-proton::message::creation_time(proton::timestamp)
-proton::message::decode(std::vector<char, std::allocator<char> > const&)
-proton::message::delivery_annotations()
-proton::message::delivery_annotations() const
-proton::message::delivery_count() const
-proton::message::delivery_count(unsigned int)
-proton::message::durable() const
-proton::message::durable(bool)
-proton::message::encode() const
-proton::message::encode(std::vector<char, std::allocator<char> >&) const
-proton::message::expiry_time() const
-proton::message::expiry_time(proton::timestamp)
-proton::message::first_acquirer() const
-proton::message::first_acquirer(bool)
-proton::message::group_id(std::string const&)
-proton::message::group_id() const
-proton::message::group_sequence() const
-proton::message::group_sequence(int)
-proton::message::id() const
-proton::message::id(proton::message_id const&)
-proton::message::inferred() const
-proton::message::inferred(bool)
-proton::message::message()
-proton::message::message(proton::message const&)
-proton::message::message_annotations()
-proton::message::message_annotations() const
-proton::message::operator=(proton::message const&)
-proton::message::priority() const
-proton::message::priority(unsigned char)
-proton::message::reply_to(std::string const&)
-proton::message::reply_to() const
-proton::message::reply_to_group_id(std::string const&)
-proton::message::reply_to_group_id() const
-proton::message::subject(std::string const&)
-proton::message::subject() const
-proton::message::ttl() const
-proton::message::ttl(proton::duration)
-proton::message::user_id(std::string const&)
-proton::message::user_id() const
-proton::message::~message()
-
-proton::operator<(proton::scalar const&, proton::scalar const&)
-proton::operator<(proton::value const&, proton::value const&)
-proton::operator<<(std::ostream&, proton::decimal128 const&)
-proton::operator<<(std::ostream&, proton::decimal32 const&)
-proton::operator<<(std::ostream&, proton::decimal64 const&)
-proton::operator<<(std::ostream&, proton::duration)
-proton::operator<<(std::ostream&, proton::scalar const&)
-proton::operator<<(std::ostream&, proton::timestamp)
-proton::operator<<(std::ostream&, proton::type_id)
-proton::operator<<(std::ostream&, proton::url const&)
-proton::operator<<(std::ostream&, proton::uuid const&)
-proton::operator<<(std::ostream&, proton::value const&)
-proton::operator==(proton::scalar const&, proton::scalar const&)
-proton::operator==(proton::value const&, proton::value const&)
-proton::operator>>(std::istream&, proton::url&)
-
-proton::receiver::flow(int)
-proton::receiver::~receiver()
-proton::reconnect_timer::next_delay(proton::timestamp)
-proton::reconnect_timer::reconnect_timer(unsigned int, int, unsigned int, bool, int, int)
-proton::reconnect_timer::reset()
-
-proton::sasl::allow_insecure_mechs()
-proton::sasl::allow_insecure_mechs(bool)
-proton::sasl::allowed_mechs(std::string const&)
-proton::sasl::config_name(std::string const&)
-proton::sasl::config_path(std::string const&)
-proton::sasl::done(proton::sasl::outcome)
-proton::sasl::extended()
-proton::sasl::mech() const
-proton::sasl::outcome() const
-proton::sasl::user() const
-
-proton::scalar::as_double() const
-proton::scalar::as_int() const
-proton::scalar::as_string() const
-proton::scalar::as_uint() const
-proton::scalar::empty() const
-proton::scalar::get(bool&) const
-proton::scalar::get(double&) const
-proton::scalar::get(float&) const
-proton::scalar::get(int&) const
-proton::scalar::get(long&) const
-proton::scalar::get(proton::binary&) const
-proton::scalar::get(proton::decimal128&) const
-proton::scalar::get(proton::decimal32&) const
-proton::scalar::get(proton::decimal64&) const
-proton::scalar::get(proton::symbol&) const
-proton::scalar::get(proton::timestamp&) const
-proton::scalar::get(proton::uuid&) const
-proton::scalar::get(short&) const
-proton::scalar::get(signed char&) const
-proton::scalar::get(std::string&) const
-proton::scalar::get(unsigned char&) const
-proton::scalar::get(unsigned int&) const
-proton::scalar::get(unsigned long&) const
-proton::scalar::get(unsigned short&) const
-proton::scalar::get(wchar_t&) const
-proton::scalar::operator=(bool)
-proton::scalar::operator=(char const*)
-proton::scalar::operator=(double)
-proton::scalar::operator=(float)
-proton::scalar::operator=(int)
-proton::scalar::operator=(long)
-proton::scalar::operator=(proton::binary const&)
-proton::scalar::operator=(proton::decimal128 const&)
-proton::scalar::operator=(proton::decimal32 const&)
-proton::scalar::operator=(proton::decimal64 const&)
-proton::scalar::operator=(proton::scalar const&)
-proton::scalar::operator=(proton::symbol const&)
-proton::scalar::operator=(proton::timestamp)
-proton::scalar::operator=(proton::uuid const&)
-proton::scalar::operator=(short)
-proton::scalar::operator=(signed char)
-proton::scalar::operator=(std::string const&)
-proton::scalar::operator=(unsigned char)
-proton::scalar::operator=(unsigned int)
-proton::scalar::operator=(unsigned long)
-proton::scalar::operator=(unsigned short)
-proton::scalar::operator=(wchar_t)
-proton::scalar::scalar()
-proton::scalar::scalar(proton::scalar const&)
-proton::scalar::type() const
-
-proton::sender::available()
-proton::sender::offered(int)
-proton::sender::send(proton::message const&)
-proton::sender::~sender()
-
-proton::session::connection() const
-proton::session::create_receiver(std::string const&)
-proton::session::create_sender(std::string const&)
-proton::session::links() const
-proton::session::local_condition() const
-proton::session::open()
-proton::session::open_receiver(std::string const&, proton::link_options const&)
-proton::session::open_sender(std::string const&, proton::link_options const&)
-proton::session::remote_condition() const
-proton::session::state() const
-proton::session::~session()
-proton::session_iterator::operator++()
-
-proton::ssl::cipher() const
-proton::ssl::peer_hostname(std::string const&)
-proton::ssl::peer_hostname() const
-proton::ssl::protocol() const
-proton::ssl::remote_subject() const
-proton::ssl::resume_status() const
-proton::ssl::ssf() const
-
-proton::ssl_certificate::ssl_certificate(std::string const&, std::string const&)
-proton::ssl_certificate::ssl_certificate(std::string const&, std::string const&, std::string const&)
-
-proton::ssl_client_options::ssl_client_options()
-proton::ssl_client_options::ssl_client_options(proton::ssl_certificate&, std::string const&, proton::ssl::verify_mode)
-proton::ssl_client_options::ssl_client_options(std::string const&, proton::ssl::verify_mode)
-
-proton::ssl_server_options::ssl_server_options()
-proton::ssl_server_options::ssl_server_options(proton::ssl_certificate&)
-proton::ssl_server_options::ssl_server_options(proton::ssl_certificate&, std::string const&, std::string const&, proton::ssl::verify_mode)
-
-proton::swap(proton::message&, proton::message&)
-proton::swap(proton::value&, proton::value&)
-
-proton::task::cancel()
-
-proton::terminus::address(std::string const&)
-proton::terminus::address() const
-proton::terminus::distribution_mode() const
-proton::terminus::distribution_mode(proton::terminus::distribution_mode)
-proton::terminus::durability()
-proton::terminus::durability(proton::terminus::durability)
-proton::terminus::dynamic() const
-proton::terminus::dynamic(bool)
-proton::terminus::expiry_policy() const
-proton::terminus::expiry_policy(proton::terminus::expiry_policy)
-proton::terminus::filter()
-proton::terminus::filter() const
-proton::terminus::node_properties()
-proton::terminus::node_properties() const
-proton::terminus::timeout() const
-proton::terminus::timeout(unsigned int)
-proton::terminus::type() const
-proton::terminus::type(proton::terminus::type)
-
-proton::timeout_error::timeout_error(std::string const&)
-proton::timeout_error::~timeout_error()
-
-proton::timestamp::now()
-
-proton::transport::bind(proton::connection&)
-proton::transport::condition() const
-proton::transport::connection() const
-proton::transport::idle_timeout() const
-proton::transport::max_channels() const
-proton::transport::max_frame_size() const
-proton::transport::remote_idle_timeout() const
-proton::transport::remote_max_channels() const
-proton::transport::remote_max_frame_size() const
-proton::transport::sasl() const
-proton::transport::ssl() const
-proton::transport::unbind()
-
-proton::type_id_is_container(proton::type_id)
-proton::type_id_is_decimal(proton::type_id)
-proton::type_id_is_floating_point(proton::type_id)
-proton::type_id_is_integral(proton::type_id)
-proton::type_id_is_scalar(proton::type_id)
-proton::type_id_is_signed(proton::type_id)
-proton::type_id_is_signed_int(proton::type_id)
-proton::type_id_is_string_like(proton::type_id)
-proton::type_id_is_unsigned_int(proton::type_id)
-
-# XXX Why is this a free function not a member function?
-proton::type_name(proton::type_id)
-
-proton::url::defaults()
-proton::url::empty() const
-proton::url::host(std::string const&)
-proton::url::host() const
-proton::url::host_port() const
-proton::url::operator=(proton::url const&)
-proton::url::parse(char const*)
-proton::url::parse(std::string const&)
-proton::url::password(std::string const&)
-proton::url::password() const
-proton::url::path(std::string const&)
-proton::url::path() const
-proton::url::port(std::string const&)
-proton::url::port() const
-proton::url::port_int() const
-proton::url::scheme(std::string const&)
-proton::url::scheme() const
-proton::url::str() const
-proton::url::url()
-proton::url::url(char const*, bool)
-proton::url::url(proton::url const&)
-proton::url::url(std::string const&, bool)
-proton::url::username(std::string const&)
-proton::url::username() const
-proton::url::~url()
-
-proton::url_error::url_error(std::string const&)
-proton::url_error::~url_error()
-
-proton::uuid::make(char const*)
-proton::uuid::random()
-proton::uuid::str() const
-
-proton::value::as_double() const
-proton::value::as_int() const
-proton::value::as_string() const
-proton::value::as_uint() const
-proton::value::clear()
-proton::value::decode() const
-proton::value::empty() const
-proton::value::encode()
-proton::value::operator=(proton::value const&)
-proton::value::type() const
-proton::value::value()
-proton::value::value(pn_data_t*)
-proton::value::value(proton::value const&)
-
-# Only types with the following info can be thrown across shared abject boundary
-# Or correctly dynamically cast by user
-typeinfo for proton::connection
-typeinfo for proton::connection_driver
-typeinfo for proton::connection_driver::io_error
-typeinfo for proton::conversion_error
-typeinfo for proton::endpoint
-typeinfo for proton::error
-typeinfo for proton::handler
-typeinfo for proton::link
-typeinfo for proton::receiver
-typeinfo for proton::sender
-typeinfo for proton::session
-typeinfo for proton::timeout_error
-typeinfo for proton::url_error
-typeinfo name for proton::connection
-typeinfo name for proton::connection_driver
-typeinfo name for proton::connection_driver::io_error
-typeinfo name for proton::conversion_error
-typeinfo name for proton::endpoint
-typeinfo name for proton::error
-typeinfo name for proton::handler
-typeinfo name for proton::link
-typeinfo name for proton::receiver
-typeinfo name for proton::sender
-typeinfo name for proton::session
-typeinfo name for proton::timeout_error
-typeinfo name for proton::url_error
-vtable for proton::connection
-vtable for proton::connection_driver
-vtable for proton::connection_driver::io_error
-vtable for proton::conversion_error
-vtable for proton::endpoint
-vtable for proton::error
-vtable for proton::handler
-vtable for proton::link
-vtable for proton::receiver
-vtable for proton::sender
-vtable for proton::session
-vtable for proton::timeout_error
-vtable for proton::url_error
diff --git a/tests/java/org/apache/qpid/proton/ProtonJInterop.java b/tests/java/org/apache/qpid/proton/ProtonJInterop.java
deleted file mode 100644
index 58a9c31..0000000
--- a/tests/java/org/apache/qpid/proton/ProtonJInterop.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.qpid.proton;
-
-import java.io.IOException;
-import java.nio.BufferOverflowException;
-
-import org.apache.qpid.proton.amqp.messaging.AmqpValue;
-import org.apache.qpid.proton.amqp.transport.ErrorCondition;
-import org.apache.qpid.proton.engine.BaseHandler;
-import org.apache.qpid.proton.engine.Connection;
-import org.apache.qpid.proton.engine.Delivery;
-import org.apache.qpid.proton.engine.EndpointState;
-import org.apache.qpid.proton.engine.Event;
-import org.apache.qpid.proton.engine.Receiver;
-import org.apache.qpid.proton.engine.Sender;
-import org.apache.qpid.proton.engine.Session;
-import org.apache.qpid.proton.message.Message;
-import org.apache.qpid.proton.reactor.Acceptor;
-import org.apache.qpid.proton.reactor.FlowController;
-import org.apache.qpid.proton.reactor.Handshaker;
-import org.apache.qpid.proton.reactor.Reactor;
-
-public class ProtonJInterop {
-
-    private static class SendHandler extends BaseHandler {
-
-        private int numMsgs;
-        private int count = 0;
-        private boolean result = false;
-
-        private SendHandler(int numMsgs) {
-            this.numMsgs = numMsgs;
-            add(new Handshaker());
-        }
-
-        @Override
-        public void onConnectionInit(Event event) {
-            Connection conn = event.getConnection();
-            Session ssn = conn.session();
-            Sender snd = ssn.sender("sender");
-            conn.open();
-            ssn.open();
-            snd.open();
-        }
-
-        @Override
-        public void onLinkFlow(Event event) {
-            Sender snd = (Sender)event.getLink();
-            if (snd.getCredit() > 0 && snd.getLocalState() != EndpointState.CLOSED) {
-                Message message = Proton.message();
-                ++count;
-                message.setBody(new AmqpValue("message-"+count));
-                byte[] msgData = new byte[1024];
-                int length;
-                while(true) {
-                    try {
-                        length = message.encode(msgData, 0, msgData.length);
-                        break;
-                    } catch(BufferOverflowException e) {
-                        msgData = new byte[msgData.length * 2];
-                    }
-                }
-                byte[] tag = String.valueOf(count).getBytes();
-                Delivery dlv = snd.delivery(tag);
-                snd.send(msgData, 0, length);
-                dlv.settle();
-                snd.advance();
-                if (count == numMsgs) {
-                    snd.close();
-                    snd.getSession().close();
-                    snd.getSession().getConnection().close();
-                    result = true;
-                }
-            }
-        }
-
-        @Override
-        public void onTransportError(Event event) {
-            result = false;
-            ErrorCondition condition = event.getTransport().getCondition();
-            if (condition != null) {
-                System.err.println("Error: " + condition.getDescription());
-            } else {
-                System.err.println("Error (no description returned).");
-            }
-        }
-    }
-
-    private static class Send extends BaseHandler {
-        private final SendHandler sendHandler;
-        private final String host;
-        private final int port;
-
-        private Send(String host, int port, int numMsgs) {
-            this.host = host;
-            this.port = port;
-            sendHandler = new SendHandler(numMsgs);
-        }
-
-        @Override
-        public void onReactorInit(Event event) {
-            Reactor r = event.getReactor();
-            r.connectionToHost(host, port, sendHandler);
-        }
-
-        public boolean getResult() {
-            return sendHandler.result;
-        }
-    }
-
-    private static class Recv extends BaseHandler {
-        private final int port;
-        private final int numMsgs;
-        private int count = 0;
-        private Acceptor acceptor = null;
-
-        private Recv(int port, int numMsgs) {
-            this.port = port;
-            this.numMsgs = numMsgs;
-            add(new Handshaker());
-            add(new FlowController());
-        }
-
-        @Override
-        public void onReactorInit(Event event) {
-            try {
-                acceptor = event.getReactor().acceptor("localhost", port);
-            } catch(IOException ioException) {
-                throw new RuntimeException(ioException);
-            }
-        }
-
-        @Override
-        public void onDelivery(Event event) {
-            Receiver recv = (Receiver)event.getLink();
-            Delivery delivery = recv.current();
-            if (delivery.isReadable() && !delivery.isPartial()) {
-                int size = delivery.pending();
-                byte[] buffer = new byte[size];
-                int read = recv.recv(buffer, 0, buffer.length);
-                recv.advance();
-
-                Message msg = Proton.message();
-                msg.decode(buffer, 0, read);
-
-                ++count;
-                String msgBody = ((AmqpValue)msg.getBody()).getValue().toString();
-                String expected = "message-" + count;
-                if (!expected.equals(msgBody)) {
-                    throw new RuntimeException("Received message body '" + msgBody + "', expected: '" + expected + "'");
-                }
-
-                if (count == numMsgs) {
-                    recv.close();
-                    recv.getSession().close();
-                    recv.getSession().getConnection().close();
-                    acceptor.close();
-                }
-            }
-        }
-    }
-
-    public static void main(String[] args) throws IOException {
-        try {
-            int port = Integer.valueOf(args[1]);
-            int numMsgs = Integer.valueOf(args[2]);
-            boolean result = false;
-
-            if ("send".equalsIgnoreCase(args[0])) {
-                Send send = new Send("localhost", port, numMsgs);
-                Reactor r = Proton.reactor(send);
-                r.run();
-                result = send.getResult();
-            } else {
-                Reactor r = Proton.reactor(new Recv(port, numMsgs));
-                r.run();
-                result = true;
-            }
-            System.exit(result ? 0 : 1);
-        } catch(Throwable t) {
-            t.printStackTrace();
-            System.exit(1);
-        }
-    }
-}
diff --git a/proton-c/bindings/python/proton/__init__.py b/tests/java/shim/binding/proton/__init__.py
similarity index 100%
rename from proton-c/bindings/python/proton/__init__.py
rename to tests/java/shim/binding/proton/__init__.py
diff --git a/proton-c/bindings/python/proton/_compat.py b/tests/java/shim/binding/proton/_compat.py
similarity index 100%
rename from proton-c/bindings/python/proton/_compat.py
rename to tests/java/shim/binding/proton/_compat.py
diff --git a/proton-c/bindings/python/proton/handlers.py b/tests/java/shim/binding/proton/handlers.py
similarity index 100%
rename from proton-c/bindings/python/proton/handlers.py
rename to tests/java/shim/binding/proton/handlers.py
diff --git a/proton-c/bindings/python/proton/reactor.py b/tests/java/shim/binding/proton/reactor.py
similarity index 100%
rename from proton-c/bindings/python/proton/reactor.py
rename to tests/java/shim/binding/proton/reactor.py
diff --git a/proton-c/bindings/python/proton/utils.py b/tests/java/shim/binding/proton/utils.py
similarity index 100%
rename from proton-c/bindings/python/proton/utils.py
rename to tests/java/shim/binding/proton/utils.py
diff --git a/proton-c/bindings/python/proton/wrapper.py b/tests/java/shim/binding/proton/wrapper.py
similarity index 100%
rename from proton-c/bindings/python/proton/wrapper.py
rename to tests/java/shim/binding/proton/wrapper.py
diff --git a/tests/javascript/codec.js b/tests/javascript/codec.js
deleted file mode 100755
index 193c878..0000000
--- a/tests/javascript/codec.js
+++ /dev/null
@@ -1,569 +0,0 @@
-#!/usr/bin/env node
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/**
- * This is a fairly literal JavaScript port of codec.py used to unit test the
- * proton.Data wrapper class. This suite of tests is actually testing the low
- * level implementation methods used to access the AMQP type system and in
- * practice most normal users wouldn't need to call these directly, rather users
- * should simply use the putObject() and getObject() methods.
- */
-
-// Check if the environment is Node.js and if not log an error and exit.
-if (typeof process === 'object' && typeof require === 'function') {
-    var unittest = require("./unittest.js");
-    var assert = require("assert");
-
-    // Increase the virtual heap available to the emscripten compiled C runtime.
-    // This allows us to test a really big string.
-    PROTON_TOTAL_MEMORY = 140000000;
-    PROTON_TOTAL_STACK = 25000000; // Needs to be bigger than the biggest string.
-    var proton = require("qpid-proton-messenger");
-
-    // Extend TestCase by creating a prototype instance and adding test methods as properties.
-    var DataTest = new unittest.TestCase();
-
-    DataTest.setUp = function() {
-        this.data = new proton.Data();
-    };
-
-    DataTest.tearDown = function() {
-        this.data.free();
-        this.data = null;
-    };
-    
-    DataTest.testTopLevelNext = function() {
-        console.log("testTopLevelNext");
-        assert(this.data.next() === null);
-        this.data.putNULL();
-        this.data.putBOOL(false);
-        this.data.putINT(0);
-        assert(this.data.next() === null);
-        this.data.rewind();
-        assert(this.data.next() === proton.Data.NULL);
-        assert(this.data.next() === proton.Data.BOOL);
-        assert(this.data.next() === proton.Data.INT);
-        assert(this.data.next() === null);
-        console.log("OK\n");
-    };
-    
-    DataTest.testNestedNext = function() {
-        console.log("testNestedNext");
-        assert(this.data.next() === null);
-        this.data.putNULL();
-        assert(this.data.next() === null);
-        this.data.putLISTNODE();
-        assert(this.data.next() === null);
-        this.data.putBOOL(false);
-        assert(this.data.next() === null);
-        this.data.rewind();
-        assert(this.data.next() === proton.Data.NULL);
-        assert(this.data.next() === proton.Data.LIST);
-        this.data.enter();
-        assert(this.data.next() === null);
-        this.data.putUBYTE(0);
-        assert(this.data.next() === null);
-        this.data.putUINT(0);
-        assert(this.data.next() === null);
-        this.data.putINT(0);
-        assert(this.data.next() === null);
-        this.data.exit();
-        assert(this.data.next() === proton.Data.BOOL);
-        assert(this.data.next() === null);
-    
-        this.data.rewind();
-        assert(this.data.next() === proton.Data.NULL);
-        assert(this.data.next() === proton.Data.LIST);
-        assert(this.data.enter());
-        assert(this.data.next() === proton.Data.UBYTE);
-        assert(this.data.next() === proton.Data.UINT);
-        assert(this.data.next() === proton.Data.INT);
-        assert(this.data.next() === null);
-        assert(this.data.exit());
-        assert(this.data.next() === proton.Data.BOOL);
-        assert(this.data.next() === null);
-        console.log("OK\n");
-    };
-    
-    DataTest.testEnterExit = function() {
-        console.log("testEnterExit");
-        assert(this.data.next() === null);
-        assert(!this.data.enter());
-        this.data.putLISTNODE();
-        assert(this.data.enter());
-        assert(this.data.next() === null);
-        this.data.putLISTNODE();
-        assert(this.data.enter());
-        this.data.putLISTNODE();
-        assert(this.data.enter());
-        assert(this.data.exit());
-        assert(this.data.getLISTNODE() === 0);
-        assert(this.data.exit());
-        assert(this.data.getLISTNODE() === 1);
-        assert(this.data.exit());
-        assert(this.data.getLISTNODE() === 1);
-        assert(!this.data.exit());
-        assert(this.data.getLISTNODE() === 1);
-        assert(this.data.next() === null);
-    
-        this.data.rewind();
-        assert(this.data.next() === proton.Data.LIST);
-        assert(this.data.getLISTNODE() === 1);
-        assert(this.data.enter());
-        assert(this.data.next() === proton.Data.LIST);
-        assert(this.data.getLISTNODE() === 1);
-        assert(this.data.enter());
-        assert(this.data.next() === proton.Data.LIST);
-        assert(this.data.getLISTNODE() === 0);
-        assert(this.data.enter());
-        assert(this.data.next() === null);
-        assert(this.data.exit());
-        assert(this.data.getLISTNODE() === 0);
-        assert(this.data.exit());
-        assert(this.data.getLISTNODE() === 1);
-        assert(this.data.exit());
-        assert(this.data.getLISTNODE() === 1);
-        assert(!this.data.exit());
-        console.log("OK\n");
-    };
-    
-    /**
-     * This tests the "low level" putARRAYNODE/getARRAYNODE methods.
-     * In general though applications would create a proton.Data.Array and use the
-     * higher level putARRAY/getARRAY
-     */
-    DataTest._testArray = function(dtype, descriptor, atype, values) {
-        var values = Array.prototype.slice.apply(arguments, [3]);
-        dtype = (dtype == null) ? null : dtype.toUpperCase();
-        atype = atype.toUpperCase();
-    
-        // Create an array node, enter it and put the descriptor (if present) and values.
-        this.data.putARRAYNODE(dtype != null, proton.Data[atype]);
-        this.data.enter();
-        if (dtype != null) {
-            var putter = 'put' + dtype;
-            this.data[putter](descriptor);
-        }
-        var putter = 'put' + atype;
-        for (var i = 0; i < values.length; i++) {
-            this.data[putter](values[i]);
-        }
-        this.data.exit();
-    
-        // Check that we did indeed add an Array node
-        this.data.rewind();
-        assert(this.data.next() === proton.Data.ARRAY);
-    
-        // Get the count, described and type metadata from the array node and compare
-        // with the values we passed to putARRAYNODE.
-        var metadata = this.data.getARRAYNODE();
-        var count = metadata.count;
-        var described = metadata.described;
-        var type = metadata.type;
-    
-        assert(count === values.length);
-        if (dtype == null) {
-            assert(described === false);
-        } else {
-            assert(described === true);
-        }
-        assert(type === proton.Data[atype]);
-    
-        // Enter the array node and compare the descriptor and values with those that
-        // we put into the array.
-        assert(this.data.enter());
-        if (described) {
-            assert(this.data.next() === proton.Data[dtype]);
-            var getter = 'get' + dtype;
-            var gotten = this.data[getter]();
-            assert(gotten.toString() === descriptor.toString());
-        }
-        var getter = 'get' + atype;
-        for (var i = 0; i < values.length; i++) {
-            assert(this.data.next() === proton.Data[atype]);
-            var gotten = this.data[getter]();
-            assert(gotten.toString() === values[i].toString());
-        }
-        assert(this.data.next() === null);
-        assert(this.data.exit());
-    };
-    
-    DataTest.testStringArray = function() {
-        console.log("testStringArray");
-        this._testArray(null, null, "string", "one", "two", "three");
-    
-        // Now try using the proton.Data.Array class.
-        this.data.clear();
-        var put = new proton.Data.Array("STRING", ["four", "five", "six"]);
-        this.data.putARRAY(put);
-        var get = this.data.getARRAY();
-        assert(get.equals(put));
-        console.log("OK\n");
-    };
-    
-    DataTest.testDescribedStringArray = function() {
-        console.log("testDescribedStringArray");
-        this._testArray("symbol", "url", "string", "one", "two", "three");
-    
-        // Now try using the proton.Data.Array class.
-        this.data.clear();
-        var put = new proton.Data.Array("STRING", ["four", "five", "six"], new proton.Data.Symbol("url"));
-        this.data.putARRAY(put);
-        var get = this.data.getARRAY();
-        assert(get.equals(put));
-        console.log("OK\n");
-    };
-    
-    DataTest.testIntArray = function() {
-        console.log("testIntArray");
-        this._testArray(null, null, "int", 1, 2, 3);
-    
-        // Now try using the proton.Data.Array class.
-        this.data.clear();
-        var put = new proton.Data.Array("INT", [4, 5, 6]);
-        this.data.putARRAY(put);
-        var get = this.data.getARRAY();
-        assert(get.equals(put));
-        console.log("OK\n");
-    };
-    
-    DataTest.testUUIDArray = function() {
-        console.log("testUUIDArray");
-        this._testArray(null, null, "uuid", new proton.Data.Uuid(), new proton.Data.Uuid(), new proton.Data.Uuid());
-    
-        // Now try using the proton.Data.Array class.
-        this.data.clear();
-        var put = new proton.Data.Array("UUID", [new proton.Data.Uuid(), new proton.Data.Uuid(), new proton.Data.Uuid()]);
-        this.data.putARRAY(put);
-        var get = this.data.getARRAY();
-        assert(get.equals(put));
-        console.log("OK\n");
-    };
-
-    DataTest.testEmptyArray = function() {
-        console.log("testEmptyArray");
-        this._testArray(null, null, "null");
-
-        // Now try using the proton.Data.Array class.
-        this.data.clear();
-        var put = new proton.Data.Array();
-        this.data.putARRAY(put);
-        var get = this.data.getARRAY();
-        assert(get.equals(put));
-        console.log("OK\n");
-    };
-
-    DataTest.testDescribedEmptyArray = function() {
-        console.log("testDescribedEmptyArray");
-        this._testArray("long", 0, "null");
-    
-        // Now try using the proton.Data.Array class.
-        this.data.clear();
-        var put = new proton.Data.Array((0).long());
-        this.data.putARRAY(put);
-        var get = this.data.getARRAY();
-        assert(get.equals(put));
-        console.log("OK\n");
-    };  
-
-    DataTest._test = function(dtype, values) {
-        var values = Array.prototype.slice.apply(arguments, [1]);
-        var lastValue = values[values.length - 1];
-
-        // Default equality function. Note that we use valueOf because some of the
-        // types we are trying to compare (Symbol, Timestamp, Uuid etc.) are object
-        // types and we want to compare their value not whether they are the same object.
-        var eq = function(x, y) {return x.valueOf() === y.valueOf();};
-    
-        if (typeof lastValue === 'function') {
-            eq = values.pop();
-        }
-    
-        dtype = dtype.toUpperCase();
-        var ntype = proton.Data[dtype];
-        var putter = 'put' + dtype;
-        var getter = 'get' + dtype;
-    
-        for (var i = 0; i < values.length; i++) {
-            var v = values[i];
-            /*
-             * Replace the array element with its value. We do this to make testing
-             * simpler for Binary elements. In the case of Binary putBINARY "consumes"
-             * the data, in other words ownership of the underlying raw data transfers
-             * to the Data object so the v object becomes "empty" after calling the
-             * putter. Calling its valueOf() happens to call its toString() which
-             * provides a stringified version of the Binary whilst also working for
-             * the other data types we want to test too.
-             */
-            values[i] = v.valueOf();
-            this.data[putter](v);
-            var gotten = this.data[getter]();
-            assert(eq(gotten, values[i]));
-        }
-    
-        this.data.rewind();
-    
-        for (var i = 0; i < values.length; i++) {
-            var v = values[i];
-            var vtype = this.data.next();
-            assert(vtype === ntype);
-            var gotten = this.data[getter]();
-            assert(eq(gotten, v));
-        }
-    
-        // Test encode and decode methods.
-        var encoded = this.data.encode();
-        var copy = new proton.Data();
-        while (encoded) {
-            encoded = copy.decode(encoded);
-        }
-        copy.rewind();
-    
-        for (var i = 0; i < values.length; i++) {
-            var v = values[i];
-            var vtype = copy.next();
-            assert(vtype === ntype);
-            var gotten = copy[getter]();
-            assert(eq(gotten, v));
-        }
-        copy.free();
-    };  
-    
-    DataTest.testInt = function() {
-        console.log("testInt");
-        this._test("int", 1, 2, 3, -1, -2, -3);
-        console.log("OK\n");
-    
-    };  
-
-    DataTest.testString = function() {
-        console.log("testString");
-        this._test("string", "one", "two", "three", "this is a test", "");
-        console.log("OK\n");
-    };  
-
-    DataTest.testBigString = function() {
-        // Try a 2MB string, this is about as big as we can cope with using the default
-        // emscripten heap size.
-        console.log("testBigString");
-        var data = "";
-        for (var i = 0; i < 2000000; i++) {
-            data += "*";
-        }
-        var string = "start\n" + data + "\nfinish\n";
-        this._test("string", string);
-        console.log("OK\n");
-    };  
-
-/* TODO - currently emscripten isn't respecting Module['TOTAL_STACK'] so setting PROTON_TOTAL_STACK doesn't actually increase the stack size.
-    DataTest.testReallyBigString = function() {
-        // Try a 20MB string, this needs a bigger emscripten heap size and more stack
-        // as the default stack is 5MB and strings are allocated on the stack.
-        console.log("testReallyBigString");
-        var data = "";
-        for (var i = 0; i < 20000000; i++) {
-            data += "*";
-        }
-        var string = "start\n" + data + "\nfinish\n";
-        this._test("string", string);
-        console.log("OK\n");
-    };
-*/
-
-    DataTest.testFloat = function() {
-        console.log("testFloat");
-        // We have to use a special comparison here because JavaScript internally
-        // only uses doubles and converting between floats and doubles is imprecise.
-        this._test("float", 0, 1, 2, 3, 0.1, 0.2, 0.3, -1, -2, -3, -0.1, -0.2, -0.3,
-                   function(x, y) {return (x - y < 0.000001);});
-        console.log("OK\n");
-    };  
-
-    DataTest.testDouble = function() {
-        console.log("testDouble");
-        this._test("double", 0, 1, 2, 3, 0.1, 0.2, 0.3, -1, -2, -3, -0.1, -0.2, -0.3);
-        console.log("OK\n");
-    };  
-
-    DataTest.testBinary = function() {
-        console.log("testBinary");
-        this._test("binary", new proton.Data.Binary(["t".char(), "h".char(), "i".char(), "s".char()]),
-                   new proton.Data.Binary("is"), new proton.Data.Binary("a"), new proton.Data.Binary("test"),
-                   new proton.Data.Binary("of"), new proton.Data.Binary("двоичные данные"));
-        console.log("OK\n");
-    };  
-
-    DataTest.testSymbol = function() {
-        console.log("testSymbol");
-        this._test("symbol", new proton.Data.Symbol("this is a symbol test"),
-                             new proton.Data.Symbol("bleh"), new proton.Data.Symbol("blah"));
-        console.log("OK\n");
-    };
-
-    DataTest.testTimestamp = function() {
-        console.log("testTimestamp");
-        this._test("timestamp", new Date(0), new Date(12345), new Date(1000000));
-        console.log("OK\n");
-    };  
-
-    DataTest.testChar = function() {
-        console.log("testChar");
-        this._test("char", 'a', 'b', 'c', '\u1234');
-        console.log("OK\n");
-    };  
-
-    DataTest.testUUID = function() {
-        console.log("testUUID");
-        this._test("uuid", new proton.Data.Uuid(), new proton.Data.Uuid(), new proton.Data.Uuid());
-        console.log("OK\n");
-    };
-
-    /* TODO
-    DataTest.testDecimal32 = function() {
-        console.log("testDecimal32");
-        //this._test("decimal32", 0, 1, 2, 3, 4, Math.pow(2, 30));
-    };
-
-    DataTest.testDecimal64 = function() {
-        console.log("testDecimal64");
-        //this._test("decimal64", 0, 1, 2, 3, 4, Math.pow(2, 60));
-    };  
-
-    DataTest.testDecimal128 = function() {
-        console.log("testDecimal128");
-        // TODO
-    };
-    */
-
-    DataTest.testCopy = function() {
-        console.log("testCopy");
-        this.data.putDESCRIBEDNODE();
-        this.data.enter();
-        this.data.putULONG(123);
-        this.data.putMAPNODE();
-        this.data.enter();
-        this.data.putSTRING("pi");
-        this.data.putDOUBLE(3.14159265359);
-        this.data.exit();
-        this.data.exit();
-    
-        var dst = this.data.copy();
-        var copy = dst.format();
-        var orig = this.data.format();
-        assert(copy === orig);
-        dst.free();
-        console.log("OK\n");
-    };  
-
-    DataTest.testCopyNested = function() {
-        console.log("testCopyNested");
-        var nested = [1, 2, 3, [4, 5, 6], 7, 8, 9];
-        this.data.putObject(nested);
-        var dst = this.data.copy();
-        assert(dst.format() === this.data.format());
-        dst.free();
-        console.log("OK\n");
-    };  
-
-    DataTest.testCopyNestedArray = function() {
-        console.log("testCopyNestedArray");
-        var nested = [new proton.Data.Array("LIST", [
-                        ["first",  [new proton.Data.Array("INT", [1, 2, 3]), "this"]],
-                        ["second", [new proton.Data.Array("INT", [1, 2, 3]), "is"]],
-                        ["third",  [new proton.Data.Array("INT", [1, 2, 3]), "fun"]]
-                        ]),
-                    "end"];
-        this.data.putObject(nested);
-        var dst = this.data.copy();
-        assert(dst.format() === this.data.format());
-        dst.free();
-        console.log("OK\n");
-    };
-
-    DataTest.testRoundTrip = function() {
-        console.log("testRoundTrip");
-        var obj = {key: new Date(1234),
-                   123: "blah",
-                   c: "bleh",
-                   desc: new proton.Data.Described("http://example.org", new proton.Data.Symbol("url")),
-                   array: new proton.Data.Array("INT", [1, 2, 3]),
-                   list: [1, 2, 3, null, 4],
-                   boolean: true};
-        // Serialise obj into this.data.
-        this.data.putObject(obj);
-    
-        // Encode this.data into a Binary representation.
-        var enc = this.data.encode();
-    
-        // Create a new Data instance and decode from the Binary representation
-        // consuming the Binary contents in the process.
-        var data = new proton.Data();
-        data.decode(enc);
-    
-        assert(data.format() === this.data.format());
-    
-        // Deserialise from the copied Data instance into a new JavaScript Object.
-        data.rewind();
-        assert(data.next());
-        var copy = data.getObject();
-    
-        // Create yet another Data instance and serialise the new Object into that.
-        var data1 = new proton.Data();
-        data1.putObject(copy);
-    
-        // Compare the round tripped Data with the original one.
-        assert(data1.format() === this.data.format());
-    
-        data.free();
-        data1.free();
-        console.log("OK\n");
-    };
-
-    DataTest.testLookup = function() {
-        console.log("testLookup");
-        var obj = {key: "value",
-                   pi: 3.14159,
-                   list: [1, 2, 3, 4]};
-        // Serialise obj into this.data.
-        this.data.putObject(obj);
-        this.data.rewind();
-        this.data.next();
-        this.data.enter();
-        this.data.narrow();
-        assert(this.data.lookup("pi"));
-        assert(this.data.getObject() === 3.14159);
-        this.data.rewind();
-        assert(this.data.lookup("key"));
-        assert(this.data.getObject() === "value");
-        this.data.rewind();
-        assert(this.data.lookup("list"));
-        assert(this.data.getObject().toString() === "1,2,3,4");
-        this.data.widen();
-        this.data.rewind();
-        assert(!this.data.lookup("pi"));
-        console.log("OK\n");
-    };  
-
-    DataTest.run();
-} else {
-    console.error("codec.js should be run in Node.js");
-}
-
diff --git a/tests/javascript/message.js b/tests/javascript/message.js
deleted file mode 100755
index e714922..0000000
--- a/tests/javascript/message.js
+++ /dev/null
@@ -1,359 +0,0 @@
-#!/usr/bin/env node
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/**
- * This is a fairly literal JavaScript port of message.py used to unit test the
- * proton.Message wrapper class.
- */
-
-// Check if the environment is Node.js and if not log an error and exit.
-if (typeof process === 'object' && typeof require === 'function') {
-    var unittest = require("./unittest.js");
-    var assert = require("assert");
-    var proton = require("qpid-proton-messenger");
-
-    /**
-     * JavaScript Implementation of Python's range() function taken from:
-     * http://stackoverflow.com/questions/8273047/javascript-function-similar-to-python-range
-     */
-    var range = function(start, stop, step) {
-        if (typeof stop == 'undefined') {
-            // one param defined
-            stop = start;
-            start = 0;
-        };
-        if (typeof step == 'undefined') {
-            step = 1;
-        };
-        if ((step > 0 && start >= stop) || (step < 0 && start <= stop)) {
-            return [];
-        };
-        var result = [];
-        for (var i = start; step > 0 ? i < stop : i > stop; i += step) {
-            result.push(i);
-        };
-        return result;
-    };
-
-
-    // Extend TestCase by creating a new Test class as we're using it in a few places.
-    var Test = function() { // Test constructor.
-        /**
-         * The following call is the equivalent of "super" in Java. It's not necessary
-         * here as the unittest.TestCase constructor doesn't set any state, but it
-         * is the correct thing to do when implementing classical inheritance in
-         * JavaScript so I've kept it here as a useful reminder of the "pattern".
-         */
-        //unittest.TestCase.prototype.constructor.call(this);
-    };  
-
-    Test.prototype = new unittest.TestCase(); // Here's where the inheritance occurs.
-    Test.prototype.constructor = Test; // Otherwise instances of Test would have a constructor of unittest.TestCase.
-
-    Test.prototype.setUp = function() {
-        this.msg = new proton.Message();
-    };
-
-    Test.prototype.tearDown = function() {
-        this.msg.free();
-        this.msg = null;
-    };
-
-
-    // Extend Test more simply by creating a prototype instance and adding test methods as properties.
-
-    var AccessorsTest = new Test();
-
-    AccessorsTest._test = function(name, defaultValue, values) {
-        /**
-         * For the case of Binary values under test we retrieve their toString().
-         * This is because the methods under test "consume" the data, in other
-         * words ownership of the underlying raw data transfers to the Message
-         * object so the sent Binary object becomes "empty" after calling the setter.
-         * In addition Binary values merely contain a "pointer" to the raw data
-         * so even a "deepEqual" comparison won't accurately compare two Binaries.
-         * For these tests we "cheat" and store an array of characters in the
-         * Binary so that we can use their String forms for comparison tests.
-         *
-         * We also get the String value of Uuid for the case of setUserID because
-         * that method transparently creates Binary values from the String form
-         * of non-Binary data passed to it. It's a convenience method, but makes
-         * testing somewhat more fiddly.
-         */
-
-        // First get the values passed to the method.
-        var values = Array.prototype.slice.apply(arguments, [2]);
-        // If the first element of values is actually an Array then use the Array.
-        // This scenario is what happens in the tests that use the range() function.
-        values = (Object.prototype.toString.call(values[0]) === '[object Array]') ? values[0] : values;
-    
-        // Work out the accessor/mutator names noting that boolean accessors use "is" not "get".
-        var setter = 'set' + name;
-        var getter = (typeof defaultValue === 'boolean') ? 'is' + name : 'get' + name;
-    
-        // Get the message's default value first.
-        var d = this.msg[getter]();
-        d = (d instanceof proton.Data.Binary) ? d.toString() : d;
-    
-        // Compare the message's default with the expected default value passed in the test case.
-        assert.deepEqual(d, defaultValue);
-    
-        for (var i = 0; i < values.length; i++) {
-            var v = values[i];
-    
-            var value = (v instanceof proton.Data.Binary ||
-                         (name === 'UserID' && v instanceof proton.Data.Uuid)) ? v.toString() : v;
-            value = (v instanceof Date) ? v.valueOf() : v;
-    
-            this.msg[setter](v); // This call will "consume" Binary data.
-    
-            var gotten = this.msg[getter]();
-            gotten = (gotten instanceof proton.Data.Binary) ? gotten.toString() : gotten;
-            gotten = (gotten instanceof Date) ? gotten.valueOf() : v;
-    
-            assert.deepEqual(value, gotten);
-        }
-    };
-
-    AccessorsTest._testString = function(name) {
-        this._test(name, "", "asdf", "fdsa", "");
-    };  
-
-    AccessorsTest._testTime = function(name) {
-        // The ExpiryTime and CreationTime methods can take either a number or a Date Object.
-        this._test(name, new Date(0), new Date(0), 123456789, new Date(987654321));
-    };
-
-    AccessorsTest.testID = function() {
-        console.log("testID");
-        this._test("ID", null, "bytes", null, 123, "string", new proton.Data.Uuid(), new proton.Data.Binary("ВИНАРЫ"));
-        console.log("OK\n");
-    };  
-
-    AccessorsTest.testCorrelationID = function() {
-        console.log("testCorrelationID");
-        this._test("CorrelationID", null, "bytes", null, 123, "string", new proton.Data.Uuid(), new proton.Data.Binary("ВИНАРЫ"));
-        console.log("OK\n");
-    };
-
-    AccessorsTest.testDurable = function() {
-        console.log("testDurable");
-        this._test("Durable", false, true, false);
-        console.log("OK\n");
-    };
-
-    AccessorsTest.testPriority = function() {
-        console.log("testPriority");
-        this._test("Priority", proton.Message.DEFAULT_PRIORITY, range(0, 256));
-        console.log("OK\n");
-    };
-
-    AccessorsTest.testTTL = function() {
-        console.log("testTTL");
-        this._test("TTL", 0, range(12345, 54321));
-        console.log("OK\n");
-    };
-
-    AccessorsTest.testFirstAcquirer = function() {
-        console.log("testFirstAcquirer");
-        this._test("FirstAcquirer", false, true, false);
-        console.log("OK\n");
-    };
-
-    AccessorsTest.testDeliveryCount = function() {
-        console.log("testDeliveryCount");
-        this._test("DeliveryCount", 0, range(0, 1024));
-        console.log("OK\n");
-    };
-
-    AccessorsTest.testUserID = function() {
-        console.log("testUserID");
-        this._test("UserID", "", "asdf", "fdsa", 123, new proton.Data.Binary("ВИНАРЫ"), new proton.Data.Uuid(), "");
-        console.log("OK\n");
-    };
-
-    AccessorsTest.testAddress = function() {
-        console.log("testAddress");
-        this._testString("Address");
-        console.log("OK\n");
-    };
-
-    AccessorsTest.testSubject = function() {
-        console.log("testSubject");
-        this._testString("Subject");
-        console.log("OK\n");
-    };
-
-    AccessorsTest.testReplyTo = function() {
-        console.log("testReplyTo");
-        this._testString("ReplyTo");
-        console.log("OK\n");
-    };
-
-    AccessorsTest.testContentType = function() {
-        console.log("testContentType");
-        this._testString("ContentType");
-        console.log("OK\n");
-    };
-
-    AccessorsTest.testContentEncoding = function() {
-        console.log("testContentEncoding");
-        this._testString("ContentEncoding");
-        console.log("OK\n");
-    };
-
-    AccessorsTest.testExpiryTime = function() {
-        console.log("testExpiryTime");
-        this._testTime("ExpiryTime");
-        console.log("OK\n");
-    };
-
-    AccessorsTest.testCreationTime = function() {
-        console.log("testCreationTime");
-        this._testTime("CreationTime");
-        console.log("OK\n");
-    };
-
-    AccessorsTest.testGroupID = function() {
-        console.log("testGroupID");
-        this._testString("GroupID");
-        console.log("OK\n");
-    };
-
-    AccessorsTest.testGroupSequence = function() {
-        console.log("testGroupSequence");
-        this._test("GroupSequence", 0, 0, -10, 10, 20, -20);
-        console.log("OK\n");
-    };
-
-    AccessorsTest.testReplyToGroupID = function() {
-        console.log("testReplyToGroupID");
-        this._testString("ReplyToGroupID");
-        console.log("OK\n");
-    };
-
-
-    var CodecTest = new Test();
-
-    CodecTest.testRoundTrip = function() {
-        console.log("testRoundTrip");
-        this.msg.setID("asdf");
-        this.msg.setCorrelationID(new proton.Data.Uuid());
-        this.msg.setTTL(3);
-        this.msg.setPriority(100);
-        this.msg.setAddress("address");
-        this.msg.setSubject("subject");
-        this.msg.body = "Hello World!";
-    
-        var data = this.msg.encode();
-        var msg2 = new proton.Message();
-        msg2.decode(data);
-    
-        assert(this.msg.getID() === msg2.getID());
-        assert(this.msg.getCorrelationID().toString() === msg2.getCorrelationID().toString());
-        assert(this.msg.getTTL() === msg2.getTTL());
-        assert(this.msg.getPriority() === msg2.getPriority());
-        assert(this.msg.getAddress() === msg2.getAddress());
-        assert(this.msg.getSubject() === msg2.getSubject());
-        assert(this.msg.body === msg2.body);
-
-        msg2.free();
-        console.log("OK\n");
-    };
-
-    /**
-     * This test tests the transparent serialisation and deserialisation of JavaScript
-     * Objects using the AMQP type system (this is the default behaviour).
-     */
-    CodecTest.testRoundTripBodyObject = function() {
-        console.log("testRoundTripBodyObject");
-        this.msg.setAddress("address");
-        this.msg.body = {array: [1, 2, 3, 4], object: {name: "John Smith", age: 65}};
-
-        var data = this.msg.encode();
-        var msg2 = new proton.Message();
-        msg2.decode(data);
-    
-        assert(this.msg.getAddress() === msg2.getAddress());
-        assert(this.msg.getContentType() === msg2.getContentType());
-        assert.deepEqual(this.msg.body, msg2.body);
-
-        msg2.free();
-        console.log("OK\n");
-    };
-
-    /**
-     * This test tests the transparent serialisation and deserialisation of JavaScript
-     * Objects as JSON. In this case the "on-the-wire" representation is an AMQP binary
-     * stored in the AMQP data section.
-     */
-    CodecTest.testRoundTripBodyObjectAsJSON = function() {
-        console.log("testRoundTripBodyObjectAsJSON");
-        this.msg.setAddress("address");
-        this.msg.setContentType("application/json");
-        this.msg.body = {array: [1, 2, 3, 4], object: {name: "John Smith", age: 65}};
-    
-        var data = this.msg.encode();
-        var msg2 = new proton.Message();
-        msg2.decode(data);
-    
-        assert(this.msg.getAddress() === msg2.getAddress());
-        assert(this.msg.getContentType() === msg2.getContentType());
-        assert.deepEqual(this.msg.body, msg2.body);
-    
-        msg2.free();
-        console.log("OK\n");
-    };
-
-    /**
-     * By default the API will encode using the AMQP type system, but is the content-type
-     * is set it will encode as an opaque Binary in an AMQP data section. For certain
-     * types however this isn't the most useful thing. For application/json (see
-     * previous test) we convert to and from JavaScript Objects and for text/* MIME
-     * types the API will automatically convert the received Binary into a String.
-     */
-    CodecTest.testRoundTripMIMETextObject = function() {
-        console.log("testRoundTripMIMETextObject");
-        this.msg.setAddress("address");
-        this.msg.setContentType("text/plain");
-        this.msg.body = "some text";
-    
-        var data = this.msg.encode();
-        var msg2 = new proton.Message();
-        msg2.decode(data);
-
-        assert(this.msg.getAddress() === msg2.getAddress());
-        assert(this.msg.getContentType() === msg2.getContentType());
-        assert.deepEqual(this.msg.body, msg2.body);
-
-        msg2.free();
-        console.log("OK\n");
-    };
-
-
-    // load and save are deprecated so not implemented in the JavaScript binding.
-
-    AccessorsTest.run();
-    CodecTest.run();
-} else {
-    console.error("message.js should be run in Node.js");
-}
-
diff --git a/tests/javascript/msgr-recv.js b/tests/javascript/msgr-recv.js
deleted file mode 100755
index 24bdcae..0000000
--- a/tests/javascript/msgr-recv.js
+++ /dev/null
@@ -1,265 +0,0 @@
-#!/usr/bin/env node
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-var Statistics = function() {
-    this.startTime = 0;
-    this.latencySamples = 0;
-    this.latencyTotal = 0;
-    this.latencyMin = 0;
-    this.latencyMax = 0;
-};
-
-Statistics.prototype.start = function() {
-    this.startTime = +new Date();
-};
-
-Statistics.prototype.messageReceived = function(msg) {
-    var ts = +msg.getCreationTime(); // The + gets the value of the returned Data Object.
-    if (ts) {
-        var l = +new Date() - ts;
-        if (l) {
-            this.latencyTotal += l;
-            this.latencySamples += 1;
-            if (this.latencySamples === 1) {
-                this.latencyMin = this.latencyMax = l;
-            } else {
-                if (this.latencyMin > l) {
-                    this.latencyMin = l;
-                }
-                if (this.latencyMax < l) {
-                    this.latencyMax = l;
-                }
-            }
-        }
-    }
-};
-
-Statistics.prototype.report = function(sent, received) {
-    var seconds = (+new Date() - this.startTime)/1000;
-    console.log("Messages sent: " + sent + " received: " + received);
-    console.log("Total time: " + seconds + " seconds");
-    if (seconds) {
-        console.log("Throughput: " + (sent/seconds) + " msgs/sec sent");
-        console.log("Throughput: " + (received/seconds) + " msgs/sec received");
-    }
-
-    if (this.latencySamples) {
-        console.log("Latency (ms): " + this.latencyMin + " min " + 
-                                       this.latencyMax + " max " + 
-                                       (this.latencyTotal/this.latencySamples) + " avg");
-    }
-};
-
-
-var MessengerReceive = function(opts, callback) {
-    //if (opts.verbose) {
-        console.log("subscriptions = " + opts.subscriptions);
-        console.log("messageCount = " + opts.messageCount);
-        console.log("recvCount = " + opts.recvCount);
-        console.log("incomingWindow = " + opts.incomingWindow);
-        console.log("reportInterval = " + opts.reportInterval);
-        console.log("reply = " + opts.reply);
-        console.log("forwardingTargets = " + opts.forwardingTargets);
-        console.log("name = " + opts.name);
-        console.log("readyText = " + opts.readyText);
-        console.log("verbose = " + opts.verbose);
-        console.log();
-    //}
-
-    var stats = new Statistics();
-    var running = true; // Used to avoid calling stop multiple times.
-    var sent = 0;
-    var received = 0;
-    var forwardingIndex = 0;
-
-    var message = new proton.Message();
-    var messenger = new proton.Messenger(opts.name);
-
-    var pumpData = function() {
-        if (opts.verbose) {
-            console.log("Calling messenger.recv(" + opts.recvCount + ")");
-        }
-        messenger.recv(opts.recvCount);
-
-        if (opts.verbose) {
-            console.log("Messages on incoming queue: " + messenger.incoming());
-        }
-        while (messenger.incoming()) {
-            // start the timer only after receiving the first msg
-            if (received === 0) {
-                stats.start();
-            }
-
-            messenger.get(message);
-            received += 1;
-            //console.log("Address: " + message.getAddress());
-            //console.log("CorrelationID: " + message.getCorrelationID());
-            //console.log("Content: " + message.body);
-            stats.messageReceived(message);
-
-            if (opts.reply) {
-                var replyTo = message.getReplyTo();
-                if (replyTo) {
-                    if (opts.verbose) {
-                        console.log("Replying to: " + replyTo);
-                    }
-                    message.setAddress(replyTo);
-                    message.setCreationTime(new Date());
-                    messenger.put(message);
-                    sent += 1;
-                }
-            }
-        }
-
-        // Check for exit condition.
-        if (running && !(opts.messageCount === 0 || received < opts.messageCount)) {
-            // Wait for outgoing to be zero before calling stop so pending sends
-            // get flushed properly.
-            if (messenger.outgoing()) {
-                if (opts.verbose) {
-                    console.log("Flushing pending sends");
-                }
-            } else {
-//console.log("******* messenger.stop()");
-                messenger.stop();
-                running = false;
-                stats.report(sent, received);
-                if (callback) {
-                    callback(stats);
-                }
-            }
-        }
-
-        if (messenger.isStopped()) {
-//console.log("-------------------- messenger.isStopped()");
-            message.free();
-            messenger.free();
-        }
-    };
-
-    this.start = function() {
-        messenger.on('error', function(error) {console.log("** error **"); console.log(error);});
-        messenger.on('work', pumpData);
-        messenger.on('subscription', function(subscription) {
-            // Hack to let test scripts know when the receivers are ready (so that the
-            // senders may be started).
-console.log("****** subscription " + subscription.getAddress() + " succeeded")
-            if (opts.readyText) {
-                console.log(opts.readyText);
-            }
-        });
-
-        if (opts.incomingWindow) {
-            messenger.setIncomingWindow(opts.incomingWindow);
-        }
-        messenger.start();
-
-        // Unpack addresses that were specified using comma-separated list
-        var subscriptions = opts.subscriptions.split(',');
-        for (var i = 0; i < subscriptions.length; i++) {
-            var subscription = subscriptions[i];
-            if (opts.verbose) {
-                console.log("Subscribing to " + subscription);
-            }
-            messenger.subscribe(subscription);
-        }
-    };
-};
-
-
-// Check if the environment is Node.js and if not log an error and exit.
-if (typeof process === 'object' && typeof require === 'function') {
-    var usage =
-    'Usage: msgr-recv [OPTIONS]\n' +
-    ' -a <addr>[,<addr>]* \tAddresses to listen on [amqp://~0.0.0.0]\n' +
-    ' -c # \tNumber of messages to receive before exiting [0=forever]\n' +
-    ' -b # \tArgument to Messenger::recv(n) [2048]\n' +
-    ' -w # \tSize for incoming window [0]\n' +
-    ' -e # \t# seconds to report statistics, 0 = end of test [0] *TBD*\n' +
-    ' -R \tSend reply if \'reply-to\' present\n' +
-    ' -F <addr>[,<addr>]* \tAddresses used for forwarding received messages\n' +
-    ' -N <name> \tSet the container name to <name>\n' +
-    ' -X <text> \tPrint \'<text>\\n\' to stdout after all subscriptions are created\n' +
-    ' -V \tEnable debug logging\n';
-
-    // Increase the virtual heap available to the emscripten compiled C runtime.
-    // This allows us to test a really big string.
-    PROTON_TOTAL_MEMORY = 140000000;
-    PROTON_TOTAL_STACK = 25000000; // Needs to be bigger than the biggest string.
-    var proton = require("qpid-proton-messenger");
-
-    var opts = {};
-    opts.subscriptions = 'amqp://~0.0.0.0';
-    opts.messageCount = 0;
-    opts.recvCount = -1;
-    opts.incomingWindow;
-    opts.reportInterval = 0;
-    opts.reply = false;
-    opts.forwardingTargets;
-    opts.name;
-    opts.readyText;
-    opts.verbose = false;
-
-    var args = process.argv.slice(2);
-    if (args.length > 0) {
-        if (args[0] === '-h' || args[0] === '--help') {
-            console.log(usage);
-            process.exit(0);
-        }
-
-        for (var i = 0; i < args.length; i++) {
-            var arg = args[i];
-            if (arg.charAt(0) === '-') {
-                if (arg === '-V') {
-                    opts.verbose = true;
-                } else if (arg === '-R') {
-                    opts.reply = true;
-                } else {
-                    i++;
-                    var val = args[i];
-                    if (arg === '-a') {
-                        opts.subscriptions = val;
-                    } else if (arg === '-c') {
-                        opts.messageCount = val;
-                    } else if (arg === '-b') {
-                        opts.recvCount = val;
-                    } else if (arg === '-w') {
-                        opts.incomingWindow = val;
-                    } else if (arg === '-e') {
-                        opts.reportInterval = val;
-                    } else if (arg === '-F') {
-                        opts.forwardingTargets = val;
-                    } else if (arg === '-N') {
-                        opts.name = val;
-                    } else if (arg === '-X') {
-                        opts.readyText = val;
-                    }
-                }
-            }
-        }
-    }
-
-    var receiver = new MessengerReceive(opts);
-    receiver.start();
-} else {
-    console.error("msgr-recv.js should be run in Node.js");
-}
-
diff --git a/tests/javascript/msgr-send-common.js b/tests/javascript/msgr-send-common.js
deleted file mode 100644
index 4e68097..0000000
--- a/tests/javascript/msgr-send-common.js
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/**
- * This file is essentially a "module" that is common to msgr-send.js and msgr-send.html.
- * It defines the Statistics and MessengerSend classes and if the environment is Node.js
- * it will import qpid-proton-messenger and export MessengerSend for use in msgr-send.js.
- * Because it's really a module/library trying to execute msgr-send-common.js won't
- * itself do anything terribly exciting.
- */
-
-var Statistics = function() {
-    this.startTime = 0;
-    this.latencySamples = 0;
-    this.latencyTotal = 0;
-    this.latencyMin = 0;
-    this.latencyMax = 0;
-};
-
-Statistics.prototype.start = function() {
-    this.startTime = +new Date();
-};
-
-Statistics.prototype.messageReceived = function(msg) {
-    var ts = +msg.getCreationTime(); // The + gets the value of the returned Data Object.
-    if (ts) {
-        var l = +new Date() - ts;
-        if (l) {
-            this.latencyTotal += l;
-            this.latencySamples += 1;
-            if (this.latencySamples === 1) {
-                this.latencyMin = this.latencyMax = l;
-            } else {
-                if (this.latencyMin > l) {
-                    this.latencyMin = l;
-                }
-                if (this.latencyMax < l) {
-                    this.latencyMax = l;
-                }
-            }
-        }
-    }
-};
-
-Statistics.prototype.report = function(sent, received) {
-    var seconds = (+new Date() - this.startTime)/1000;
-    console.log("Messages sent: " + sent + " received: " + received);
-    console.log("Total time: " + seconds + " seconds");
-    if (seconds) {
-        console.log("Throughput: " + (sent/seconds) + " msgs/sec sent");
-        console.log("Throughput: " + (received/seconds) + " msgs/sec received");
-    }
-
-    if (this.latencySamples) {
-        console.log("Latency (ms): " + this.latencyMin + " min " + 
-                                       this.latencyMax + " max " + 
-                                       (this.latencyTotal/this.latencySamples) + " avg");
-    }
-};
-
-
-var MessengerSend = function(opts, callback) {
-    //if (opts.verbose) {
-        console.log("addresses = " + opts.addresses);
-        console.log("messageCount = " + opts.messageCount);
-        console.log("messageSize = " + opts.messageSize);
-        console.log("recvCount = " + opts.recvCount);
-        console.log("sendBatch = " + opts.sendBatch);
-        console.log("outgoingWindow = " + opts.outgoingWindow);
-        console.log("reportInterval = " + opts.reportInterval);
-        console.log("getReplies = " + opts.getReplies);
-        console.log("name = " + opts.name);
-        console.log("verbose = " + opts.verbose);
-        console.log();
-    //}
-
-    var stats = new Statistics();
-    var targets = [];
-    var running = true; // Used to avoid calling stop multiple times.
-    var sent = 0;
-    var received = 0;
-
-    var message = new proton.Message();
-    var replyMessage = new proton.Message();
-    var messenger = new proton.Messenger(opts.name);
-
-    // Retrieve replies and return the number of reply messages received.
-    var processReplies = function() {
-        var received = 0;
-        if (opts.verbose) {
-            console.log("Calling messenger.recv(" + opts.recvCount + ")");
-        }
-        messenger.recv(opts.recvCount);
-
-        if (opts.verbose) {
-            console.log("Messages on incoming queue: " + messenger.incoming());
-        }
-        while (messenger.incoming()) {
-            messenger.get(replyMessage);
-            received += 1;
-            //console.log("Address: " + replyMessage.getAddress());
-            //console.log("Content: " + replyMessage.body);
-            stats.messageReceived(replyMessage);
-        }
-        return received;
-    };
-
-    // Send messages as fast as possible. This is analogous to the while loop in
-    // the Python msgr-send.py but we wrap in a function in JavaScript so that
-    // we can schedule on the JavaScript Event queue via setTimeout. This is needed
-    // otherwise the JavaScript Event loop is blocked and no data gets sent.
-    var sendData = function() {
-        var delay = 0;
-        while (opts.messageCount === 0 || (sent < opts.messageCount)) {
-            // Check the amount of data buffered on the socket, if it's non-zero
-            // exit the loop and call senData again after a short delay. This
-            // will throttle the send rate if necessary.
-            if (messenger.getBufferedAmount()) {
-console.log("messenger.getBufferedAmount() = " + messenger.getBufferedAmount());
-                delay = 100;
-                break; // Exit loop to check for exit condition and schedule to Event queue.
-            }       
-
-            var index = sent % targets.length;
-//console.log("sent = " + sent + ", index = " + index);
-
-            message.setAddress(targets[index]);
-            message.setCorrelationID(sent);
-            message.setCreationTime(new Date());
-            messenger.put(message);
-            sent += 1;
-
-            if (opts.sendBatch && (messenger.outgoing() >= opts.sendBatch)) {
-                if (opts.verbose) {
-                    console.log("Calling messenger.send()")
-                }
-                messenger.send();
-
-                if (opts.getReplies) {
-                    received += processReplies();
-                }
-                break; // Exit loop to check for exit condition and yield to Event loop.
-            }
-        }
-
-        // Check for exit condition.
-        if (running && !(opts.messageCount === 0 || (sent < opts.messageCount))) {
-            if (opts.getReplies && (received < sent)) {
-                received += processReplies();
-                if (opts.verbose) {
-                    console.log("Messages sent = " + sent + ", received = " + received);
-                }
-            } else if (messenger.outgoing()) {
-                if (opts.verbose) {
-                    console.log("Flushing pending sends");
-                }
-                messenger.send();
-            } else {
-//console.log("******* calling stop")
-                messenger.stop();
-                running = false;
-                stats.report(sent, received);
-                if (callback) {
-                    callback(stats);
-                }
-            }
-        }
-
-        if (messenger.isStopped()) {
-//console.log("-------------------- messenger.isStopped()");
-            message.free();
-            messenger.free();
-        } else {
-            // schedule next call on the JavaScript Event queue. If we don't do this
-            // our messages won't get sent because none of the internal JavaScript
-            // network code will get any CPU.
-
-            // If available we call setImmediate rather than setTimeout when the delay
-            // is zero. setImmediate is more efficient, in particular I noticed that
-            // with Node.js v0.10.18 I could get max throughput and max out CPU using
-            // setTimeout, but when I upgraded to v0.10.33 my throughput dropped and
-            // my CPU was hovering around 55% but using setImmediate the performance
-            // improved again. My guess is that v0.10.18 was checking for zero delay
-            // and calling setImmediate internally whereas v0.10.33 wasn't, but I
-            // can't say for sure. TODO it's possible that some browsers might do a
-            // better job with setImmediate too (given what I'm seeing with Node.js),
-            // Chrome might be one such case, but it's not universally supported.
-            // It might be worth adding a proper polyfill to handle this.
-            if (delay === 0 && typeof setImmediate === 'function') {
-                setImmediate(sendData);
-            } else {
-                setTimeout(sendData, delay);
-            }   
-        }
-    };
-
-    this.start = function() {
-        message.body = Array(+opts.messageSize + 1).join('X');
-        message.setReplyTo('~');
-
-        messenger.on('error', function(error) {
-            console.log(error);
-            opts.messageCount = -1; // Force exit condition.
-        });
-
-        if (opts.outgoingWindow) {
-            messenger.setOutgoingWindow(opts.outgoingWindow);
-        }
-        messenger.start();
-
-        // Unpack targets that were specified using comma-separated list
-        var addresses = opts.addresses.split(',');
-        for (var i = 0; i < addresses.length; i++) {
-            var address = addresses[i];
-            targets.push(address);
-        }
-
-        stats.start();
-        sendData();
-    };
-};
-
-// If running in Node.js import the proton library and export MessengerSend.
-if (typeof module === 'object') {
-    var proton = require("qpid-proton-messenger");
-    module.exports.MessengerSend = MessengerSend;
-}
-
diff --git a/tests/javascript/msgr-send.html b/tests/javascript/msgr-send.html
deleted file mode 100644
index 531d886..0000000
--- a/tests/javascript/msgr-send.html
+++ /dev/null
@@ -1,123 +0,0 @@
-<!DOCTYPE html> <!-- HTML5 doctype -->
-
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-  
-    http://www.apache.org/licenses/LICENSE-2.0
-  
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-
-<html>
-
-<head>
-	<title>Proton Messenger Send Benchmark</title>
-	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
-
-<!--
-  Import the Messenger Binding proton.js. Note that this simple example pulls
-  it from the node_modules/qpid-proton/lib, which is created by the build process
-  so that the node.js based examples "just work", in a real Web App you would
-  clearly need to copy the proton.js to your own server.
-
-  In actual fact the CMake build actually builds proton.js into the directory:
-  <build>/proton-c/bindings/javascript
-  where <build> is the build directory created to run cmake from, it is then
-  copied to the node_modules/qpid-proton/lib directory.
-
-  In this example we also set the global variable PROTON_TOTAL_MEMORY in order to
-  increase the virtual heap available to the emscripten compiled C runtime. It
-  is not really necessary to do this for this application as the default value
-  of 16777216 is fine, it is simply done here to illustrate how to do it.
--->
-<script type="text/javascript">PROTON_TOTAL_MEMORY = 140000000;</script>
-<script type="text/javascript">PROTON_TOTAL_STACK = 25000000;</script>
-<script type="text/javascript" src="../../node_modules/qpid-proton-messenger/lib/proton-messenger.js"></script>
-<script type="text/javascript" src="./msgr-send-common.js"></script>
-
-<script type="text/javascript">
-
-var start = function() {
-    var opts = {};
-    opts.addresses = document.getElementById("address").value;
-    opts.messageCount = parseInt(document.getElementById("messageCount").value, 10);
-    opts.messageSize = parseInt(document.getElementById("messageSize").value, 10);
-    opts.sendBatch = parseInt(document.getElementById("sendBatch").value, 10);
-
-    opts.recvCount = -1;
-    opts.outgoingWindow;
-    opts.reportInterval = 0;
-    opts.getReplies = false;
-    opts.name;
-    opts.verbose = false;
-
-    var sender = new MessengerSend(opts);
-    sender.start();
-};
-
-</script>
-
-<style>
-body
-{
-	font: 13px/1.5 Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif;
-    overflow-x: hidden; /* Hide horizontal scrollbar */
-    background: #dddddd;
-}
-
-label
-{
-    display: block;
-	font-size: 17px;
-}
-
-input, textarea
-{
-	font-size: 13px;
-    margin-bottom: 10px;
-}
-</style>
-
-</head>
-
-<body>
-<div>
-    <label for="address">Address:</label>
-    <input type="text" id="address" size="40"
-           placeholder="amqp://user:password@host:port"
-           name="address" value="amqp://guest:guest@0.0.0.0" />
-</div>
-<div>    
-    <label for="messageCount">Message Count:</label>
-    <input type="text" id="messageCount" size="40"
-           name="messageCount" value="0" />
-</div>
-<div>    
-    <label for="messageSize">Message Size:</label>
-    <input type="text" id="messageSize" size="40"
-           name="messageSize" value="1024" />
-</div>
-<div>    
-    <label for="sendBatch">Send Batch Size:</label>
-    <input type="text" id="sendBatch" size="40"
-           name="sendBatch" value="1024" />
-</div>
-
-
-<div>
-    <input type="button" value="start" onclick="start()"/>
-</div>
-</body>
-
-</html>
diff --git a/tests/javascript/msgr-send.js b/tests/javascript/msgr-send.js
deleted file mode 100755
index 124f29e..0000000
--- a/tests/javascript/msgr-send.js
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/env node
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-// Check if the environment is Node.js and if not log an error and exit.
-if (typeof process === 'object' && typeof require === 'function') {
-    var usage =
-    'Usage: msgr-send [OPTIONS]\n' +
-    ' -a <addr>[,<addr>]* \tThe target address [amqp://~0.0.0.0]\n' +
-    ' -c # \tNumber of messages to send before exiting [0=forever]\n' +
-    ' -b # \tSize of message body in bytes [1024]\n' +
-    ' -p # \tSend batches of # messages (wait for replies before sending next batch if -R) [1024]\n' +
-    ' -w # \tSize for outgoing window [0]\n' +
-    ' -e # \t# seconds to report statistics, 0 = end of test [0] *TBD*\n' +
-    ' -R \tWait for a reply to each sent message\n' +
-    ' -B # \tArgument to Messenger::recv(n) [-1]\n' +
-    ' -N <name> \tSet the container name to <name>\n' +
-    ' -V \tEnable debug logging\n';
-
-    // Increase the virtual heap available to the emscripten compiled C runtime.
-    // This allows us to test a really big string.
-    PROTON_TOTAL_MEMORY = 140000000;
-    PROTON_TOTAL_STACK = 25000000; // Needs to be bigger than the biggest string.
-    var proton = require("qpid-proton-messenger");
-    var benchmark = require("./msgr-send-common.js");
-
-    var opts = {};
-    opts.addresses = 'amqp://0.0.0.0';
-    opts.messageCount = 0;
-    opts.messageSize = 1024;
-    opts.recvCount = -1;
-    opts.sendBatch = 1024;
-    opts.outgoingWindow;
-    opts.reportInterval = 0;
-    opts.getReplies = false;
-    opts.name;
-    opts.verbose = false;
-
-    var args = process.argv.slice(2);
-    if (args.length > 0) {
-        if (args[0] === '-h' || args[0] === '--help') {
-            console.log(usage);
-            process.exit(0);
-        }
-
-        for (var i = 0; i < args.length; i++) {
-            var arg = args[i];
-            if (arg.charAt(0) === '-') {
-                if (arg === '-V') {
-                    opts.verbose = true;
-                } else if (arg === '-R') {
-                    opts.getReplies = true;
-                } else {
-                    i++;
-                    var val = args[i];
-                    if (arg === '-a') {
-                        opts.addresses = val;
-                    } else if (arg === '-c') {
-                        opts.messageCount = val;
-                    } else if (arg === '-b') {
-                        opts.messageSize = val;
-                    } else if (arg === '-B') {
-                        opts.recvCount = val;
-                    } else if (arg === '-p') {
-                        opts.sendBatch = val;
-                    } else if (arg === '-w') {
-                        opts.outgoingWindow = val;
-                    } else if (arg === '-e') {
-                        opts.reportInterval = val;
-                    } else if (arg === '-N') {
-                        opts.name = val;
-                    }
-                }
-            }
-        }
-    }
-
-    var sender = new benchmark.MessengerSend(opts);
-    sender.start();
-} else {
-    console.error("msgr-send.js should be run in Node.js");
-}
-
diff --git a/tests/javascript/soak.js b/tests/javascript/soak.js
deleted file mode 100755
index 50bf921..0000000
--- a/tests/javascript/soak.js
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/env node
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-// Check if the environment is Node.js and if not log an error and exit.
-if (typeof process === 'object' && typeof require === 'function') {
-    var proton = require("qpid-proton-messenger");
-
-    var addr = 'guest:guest@localhost:5673';
-    //var addr = 'localhost:5673';
-    var address = 'amqp://' + addr;
-    console.log(address);
-
-    var subscriptionQueue = '';
-    var count = 0;
-    var start = 0; // Start Time.
-
-    var message = new proton.Message();
-    var messenger = new proton.Messenger();
-
-    var pumpData = function() {
-        while (messenger.incoming()) {
-            // The second parameter forces Binary payloads to be decoded as strings
-            // this is useful because the broker QMF Agent encodes strings as AMQP
-            // binary, which is a right pain from an interoperability perspective.
-            var t = messenger.get(message, true);
-            //console.log("Address: " + message.getAddress());
-            //console.log("Content: " + message.body);
-            messenger.accept(t);
-    
-            if (count % 1000 === 0) {
-                var time = +new Date();
-                console.log("count = " + count + ", duration = " + (time - start) + ", rate = " + ((count*1000)/(time - start)));
-            }
-
-            sendMessage();
-        }
-
-        if (messenger.isStopped()) {
-            message.free();
-            messenger.free();
-        }
-    };
-
-    var sendMessage = function() {
-        var msgtext = "Message Number " + count;
-        count++;
-
-        message.setAddress(address + '/' + subscriptionQueue);
-        message.body = msgtext;
-        messenger.put(message);
-        //messenger.settle();
-    };
-
-    messenger.on('error', function(error) {console.log(error);});
-    messenger.on('work', pumpData);
-    messenger.on('subscription', function(subscription) {
-        var subscriptionAddress = subscription.getAddress();
-        var splitAddress = subscriptionAddress.split('/');
-        subscriptionQueue = splitAddress[splitAddress.length - 1];
-
-        console.log("Subscription Queue: " + subscriptionQueue);
-        start = +new Date();
-        sendMessage();
-    });
-
-    //messenger.setOutgoingWindow(1024);
-    messenger.setIncomingWindow(1024); // The Java Broker seems to need this.
-    messenger.recv(); // Receive as many messages as messenger can buffer.
-    messenger.start();
-
-    messenger.subscribe('amqp://' + addr + '/#');
-} else {
-    console.error("soak.js should be run in Node.js");
-}
-
diff --git a/tests/javascript/unittest.js b/tests/javascript/unittest.js
deleted file mode 100644
index bc1567c..0000000
--- a/tests/javascript/unittest.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/**
- * The TestCase class provides a simple dependency-free Unit Test framework to
- * automagically invoke methods that start with "test" on classes that extend it.
- */
-
-// TestCase Constructor
-var TestCase = function() {};
-
-// Enumerate all functions of the class and invoke those beginning with "test".
-TestCase.prototype.run = function() {
-    for (var property in this) {
-        if ((typeof this[property] === 'function') &&
-            property.lastIndexOf('test', 0) === 0) {
-            this.setUp();
-            this[property]();
-            this.tearDown();
-        }
-    }
-};
-
-TestCase.prototype.setUp = function() {};
-TestCase.prototype.tearDown = function() {};
-
-module.exports.TestCase = TestCase;
-
diff --git a/tests/perf/README.txt b/tests/perf/README.txt
deleted file mode 100644
index 3805ad1..0000000
--- a/tests/perf/README.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Simple performance tests.
-
-quick_perf coordinates two processes: a simple fast echo "server" and
-a client that sends and receives simple binary messages over a single
-connection on the loopback interface.  The latter is timed.  This
-provides a crude view of the overhead of the Proton library alone
-(CMake target "quick_perf_c") or with a language binding.  It is most
-useful for verifying a lack of performance degradation on a large
-ckeckin or between releases.  It probably says little about expected
-performance on a physical network or for a particular application.
diff --git a/tests/perf/quick_perf.py b/tests/perf/quick_perf.py
deleted file mode 100644
index 59b47a2..0000000
--- a/tests/perf/quick_perf.py
+++ /dev/null
@@ -1,79 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License
-#
-
-# For use with CMake to run simple performance tests in Proton.
-# Assumes that rector-recv and reactor-send can be found in PATH.
-# CMkake's choice of python executable may be passed via PYTHON_EXE environment var.
-# Add any OS specific monitor helpers in PN_QPERF_MON: i.e.
-#    PN_QPERF_MON="time taskset 0x2" make quick_perf_c
-
-
-import os, sys, socket, time
-from example_test import Proc, pick_addr
-from subprocess import Popen, PIPE, STDOUT
-
-
-NULL = open(os.devnull, 'w')
-
-connaddr = pick_addr()
-linkaddr = connaddr + "/perf_test"
-
-if 'PYTHON_EXE' in os.environ:
-    python_exe = os.environ['PYTHON_EXE']
-else:
-    python_exe = 'python'
-
-if 'PN_QPERF_MON' in os.environ:
-    monitor_cmd = os.environ['PN_QPERF_MON'].split()
-else:
-    monitor_cmd = []
-
-
-
-mcount = 5000000
-if 'PYTHON' in sys.argv:
-    mcount /= 10
-
-perf_targets = {'C' : ['reactor-send', "-a", linkaddr, "-c", str(mcount), "-R"],
-                'CPP' : ['reactor_send_cpp', "-a", linkaddr, "-c", str(mcount), "-R", "1"],
-                'PYTHON' : [python_exe, 'reactor-send.py', "-a", linkaddr, "-c", str(mcount), "-R"] }
-try:
-    perf_target = monitor_cmd + perf_targets[sys.argv[1]]
-except:
-    print "Usage: python quick_perf [C|CPP|PYTHON]"
-    raise
-
-
-# Use Proton-C reactor-recv as a relatively fast loopback "broker" for these tests
-server = Proc(["reactor-recv", "-X", "listening", "-a", linkaddr, "-c", str(mcount), "-R"], ready="listening", 
-              skip_valgrind=True, timeout=300)
-try:
-    start = time.time()
-    client = Proc(perf_target, skip_valgrind=True, timeout=300)
-    print client.wait_exit()
-    server.wait_exit()
-    end = time.time()
-except Exception as e:
-    if server: server.safe_kill()
-    raise Exception("Error running %s: %s", server, e)
-
-
-secs = end - start
-print("%d loopback messages in %.1f secs" % (mcount * 2, secs) )
-print("%.0f msgs/sec" % (mcount * 2 / secs) )
diff --git a/tests/pom.xml b/tests/pom.xml
index c01089f..732f0a1 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -66,7 +66,7 @@
           <systemPropertyVariables>
             <protonJythonIgnoreFile>${basedir}/java/pythonTests.ignore</protonJythonIgnoreFile>
             <protonJythonTestRoot>${basedir}/python</protonJythonTestRoot>
-            <protonJythonBinding>${basedir}/../proton-c/bindings/python</protonJythonBinding>
+            <protonJythonBinding>${basedir}/java/shim/binding</protonJythonBinding>
             <protonJythonShim>${basedir}/java/shim</protonJythonShim>
             <protonJythonTestScript>${basedir}/python/proton-test</protonJythonTestScript>
             <protonJythonTestXmlOutputDirectory>${testReportOutputDirectory}</protonJythonTestXmlOutputDirectory>
diff --git a/tests/python/proton_tests/__init__.py b/tests/python/proton_tests/__init__.py
index 091fa49..66ce650 100644
--- a/tests/python/proton_tests/__init__.py
+++ b/tests/python/proton_tests/__init__.py
@@ -22,7 +22,6 @@
 import proton_tests.message
 import proton_tests.handler
 import proton_tests.reactor
-import proton_tests.reactor_interop
 import proton_tests.messenger
 import proton_tests.sasl
 import proton_tests.transport
diff --git a/tests/python/proton_tests/reactor_interop.py b/tests/python/proton_tests/reactor_interop.py
deleted file mode 100644
index 801a417..0000000
--- a/tests/python/proton_tests/reactor_interop.py
+++ /dev/null
@@ -1,164 +0,0 @@
-#!/usr/bin/python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-from __future__ import absolute_import
-
-from .common import Test, free_tcp_port, Skipped
-from proton import Message
-from proton.handlers import CHandshaker, CFlowController
-from proton.reactor import Reactor
-
-import os
-import subprocess
-from threading import Thread
-import time
-
-class JavaThread(Thread):
-  def __init__(self, operation, port, count):
-    Thread.__init__(self)
-    self.operation = operation
-    self.port = str(port)
-    self.count = str(count)
-    self.result = 1
-
-  def run(self):
-    self.result = subprocess.call(['java',
-        'org.apache.qpid.proton.ProtonJInterop',
-        self.operation, self.port, self.count])
-
-class ReceiveHandler:
-  def __init__(self, count):
-    self.count = count
-    self.handlers = [CHandshaker(), CFlowController()]
-    self.messages = []
-
-  def on_reactor_init(self, event):
-    port = free_tcp_port()
-    self.acceptor = event.reactor.acceptor("127.0.0.1", port)
-    self.java_thread = JavaThread("send", port, self.count)
-    self.java_thread.start()
-
-  def on_delivery(self, event):
-    rcv = event.receiver
-    msg = Message()
-    if rcv and msg.recv(rcv):
-      event.delivery.settle()
-      self.messages += [msg.body]
-      self.count -= 1
-      if (self.count == 0):
-        self.acceptor.close()
-
-class SendHandler:
-  def __init__(self, host, num_msgs):
-    self.host = host
-    self.num_msgs = num_msgs
-    self.count = 0
-    self.handlers = [CHandshaker()]
-
-  def on_connection_init(self, event):
-    conn = event.connection
-    conn.hostname = self.host
-    ssn = conn.session()
-    snd = ssn.sender("sender")
-    conn.open()
-    ssn.open()
-    snd.open()
-
-  def on_link_flow(self, event):
-    snd = event.sender
-    if snd.credit > 0 and self.count < self.num_msgs:
-      self.count += 1
-      msg = Message("message-" + str(self.count))
-      dlv = snd.send(msg)
-      dlv.settle()
-      if (self.count == self.num_msgs):
-        snd.close()
-        snd.session.close()
-        snd.connection.close()
-
-  def on_reactor_init(self, event):
-    event.reactor.connection(self)
-
-class ReactorInteropTest(Test):
-
-  def setUp(self):
-    classpath = ""
-    if ('CLASSPATH' in os.environ):
-      classpath = os.environ['CLASSPATH']
-    entries = classpath.split(os.pathsep)
-    self.proton_j_available = False
-    for entry in entries:
-      self.proton_j_available |= entry != "" and os.path.exists(entry)
-
-  def protonc_to_protonj(self, count):
-    if (not self.proton_j_available):
-      raise Skipped("ProtonJ not found")
-
-    port = free_tcp_port()
-    java_thread = JavaThread("recv", port, count)
-    java_thread.start()
-    # Give the Java thread time to spin up a JVM and start listening
-    # XXX: would be better to parse the stdout output for a message
-    time.sleep(1)
-
-    sh = SendHandler('127.0.0.1:' + str(port), count)
-    r = Reactor(sh)
-    r.run()
-
-    java_thread.join()
-    assert(java_thread.result == 0)
-
-  def protonj_to_protonc(self, count):
-    if (not self.proton_j_available):
-      raise Skipped("ProtonJ not found")
-
-    rh = ReceiveHandler(count)
-    r = Reactor(rh)
-    r.run()
-
-    rh.java_thread.join()
-    assert(rh.java_thread.result == 0)
-
-    for i in range(1, count):
-      assert(rh.messages[i-1] == ("message-" + str(i)))
-
-  def test_protonc_to_protonj_1(self):
-    self.protonc_to_protonj(1)
-
-  def test_protonc_to_protonj_5(self):
-    self.protonc_to_protonj(5)
-
-  def test_protonc_to_protonj_500(self):
-    self.protonc_to_protonj(500)
-
-  def test_protonc_to_protonj_5000(self):
-    self.protonc_to_protonj(5000)
-
-  def test_protonj_to_protonc_1(self):
-    self.protonj_to_protonc(1)
-
-  def test_protonj_to_protonc_5(self):
-    self.protonj_to_protonc(5)
-
-  def test_protonj_to_protonc_500(self):
-    self.protonj_to_protonc(500)
-
-  def test_protonj_to_protonc_5000(self):
-    self.protonj_to_protonc(5000)
-
diff --git a/tests/ruby/proton-test b/tests/ruby/proton-test
deleted file mode 100755
index 04aee1c..0000000
--- a/tests/ruby/proton-test
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env ruby
-
-if RUBY_VERSION < "1.9"
-require 'rubygems'
-end
-
-require 'test/unit'
-require 'proton_tests/interop.rb'
-require 'proton_tests/smoke.rb'
diff --git a/tests/ruby/proton_tests/interop.rb b/tests/ruby/proton_tests/interop.rb
deleted file mode 100755
index 1d50483..0000000
--- a/tests/ruby/proton_tests/interop.rb
+++ /dev/null
@@ -1,141 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'test/unit'
-require 'qpid_proton'
-
-if ((RUBY_VERSION.split(".").map {|x| x.to_i}  <=> [1, 9]) < 0)
-  require 'pathname'
-  class File
-    def self.absolute_path(name)
-      return Pathname.new(name).realpath
-    end
-  end
-end
-
-class InteropTest < Test::Unit::TestCase
-  Data = Qpid::Proton::Codec::Data
-  Message = Qpid::Proton::Message
-
-  def setup
-    @data = Data.new
-    @message = Message.new
-  end
-
-  # Walk up the directory tree to find the tests directory.
-  def get_data(name)
-    path = File.absolute_path(__FILE__)
-    while path and File.basename(path) != "tests" do path = File.dirname(path); end
-    path = File.join(path,"interop")
-    raise "Can't find test/interop directory from #{__FILE__}" unless File.directory?(path)
-    path = File.join(path,"#{name}.amqp")
-    File.open(path, "rb") { |f| f.read }
-  end
-
-  # Decode encoded bytes as a Data object
-  def decode_data(encoded)
-    buffer = encoded
-    while buffer.size > 0
-      n = @data.decode(buffer)
-      buffer = buffer[n..-1]
-    end
-    @data.rewind
-    reencoded = @data.encode
-    # Test the round-trip re-encoding gives the same result.
-    assert_equal(encoded, reencoded)
-  end
-
-  def decode_data_file(name) decode_data(get_data(name)); end
-
-  def decode_message_file(name)
-    message = Message.new()
-    message.decode(self.get_data(name))
-    self.decode_data(message.body)
-  end
-
-  def assert_next(type, value)
-    assert @data.next
-    assert_equal(type, @data.type)
-    assert_equal(value, type.get(@data))
-  end
-
-  def assert_array_next(expected, header)
-    assert_next(Qpid::Proton::Codec::ARRAY, expected)
-    result = @data.type.get(@data)
-    assert_equal(result.proton_array_header, header)
-  end
-
-  def test_message
-    decode_message_file("message")
-    assert_next(Qpid::Proton::Codec::STRING, "hello")
-    assert !@data.next
-  end
-
-  def test_primitives
-    decode_data_file("primitives")
-    assert_next(Qpid::Proton::Codec::BOOL, true)
-    assert_next(Qpid::Proton::Codec::BOOL, false)
-    assert_next(Qpid::Proton::Codec::UBYTE, 42)
-    assert_next(Qpid::Proton::Codec::USHORT, 42)
-    assert_next(Qpid::Proton::Codec::SHORT, -42)
-    assert_next(Qpid::Proton::Codec::UINT, 12345)
-    assert_next(Qpid::Proton::Codec::INT, -12345)
-    assert_next(Qpid::Proton::Codec::ULONG, 12345)
-    assert_next(Qpid::Proton::Codec::LONG, -12345)
-    assert_next(Qpid::Proton::Codec::FLOAT, 0.125)
-    assert_next(Qpid::Proton::Codec::DOUBLE, 0.125)
-    assert !@data.next
-  end
-
-  def test_strings
-    decode_data_file("strings")
-    assert_next(Qpid::Proton::Codec::BINARY, "abc\0defg")
-    assert_next(Qpid::Proton::Codec::STRING, "abcdefg")
-    assert_next(Qpid::Proton::Codec::SYMBOL, "abcdefg")
-    assert_next(Qpid::Proton::Codec::BINARY, "")
-    assert_next(Qpid::Proton::Codec::STRING, "")
-    assert_next(Qpid::Proton::Codec::SYMBOL, "")
-    assert !@data.next
-  end
-
-  def test_described
-    decode_data_file("described")
-    assert_next(Qpid::Proton::Codec::DESCRIBED, Qpid::Proton::Types::Described.new("foo-descriptor", "foo-value"))
-    assert(@data.described?)
-    assert_next(Qpid::Proton::Codec::DESCRIBED, Qpid::Proton::Types::Described.new(12, 13))
-    assert(@data.described?)
-    assert !@data.next
-  end
-
-  def test_described_array
-    decode_data_file("described_array")
-    assert_array_next((0...10).to_a,
-                       Qpid::Proton::Types::ArrayHeader.new(Qpid::Proton::Codec::INT,
-                                                     "int-array"))
-  end
-
-  def test_arrays
-    decode_data_file("arrays")
-    assert_array_next((0...100).to_a,
-                      Qpid::Proton::Types::ArrayHeader.new(Qpid::Proton::Codec::INT))
-    assert_array_next(["a", "b", "c"],
-                      Qpid::Proton::Types::ArrayHeader.new(Qpid::Proton::Codec::STRING))
-    assert_array_next([],
-                      Qpid::Proton::Types::ArrayHeader.new(Qpid::Proton::Codec::INT))
-    assert !@data.next
-  end
-
-  def test_lists
-    decode_data_file("lists")
-    assert_next(Qpid::Proton::Codec::LIST, [32, "foo", true])
-    assert_next(Qpid::Proton::Codec::LIST, [])
-    assert !@data.next
-  end
-
-  def test_maps
-    decode_data_file("maps")
-    assert_next(Qpid::Proton::Codec::MAP, {"one" => 1, "two" => 2, "three" => 3 })
-    assert_next(Qpid::Proton::Codec::MAP, {1 => "one", 2 => "two", 3 => "three"})
-    assert_next(Qpid::Proton::Codec::MAP, {})
-    assert !@data.next
-  end
-end
diff --git a/tests/ruby/proton_tests/smoke.rb b/tests/ruby/proton_tests/smoke.rb
deleted file mode 100755
index 5fc990a..0000000
--- a/tests/ruby/proton_tests/smoke.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'test/unit'
-require 'qpid_proton'
-
-class SmokeTest < Test::Unit::TestCase
-
-  Messenger = Qpid::Proton::Messenger::Messenger
-  Message = Qpid::Proton::Message
-
-  def setup
-    @server = Messenger.new()
-    @client = Messenger.new()
-    @server.blocking = false
-    @client.blocking = false
-    @server.subscribe("~0.0.0.0:12345")
-    @server.start()
-    @client.start()
-    pump()
-  end
-
-  def pump
-    while (@server.work(0) or @client.work(0)) do end
-  end
-
-  def teardown
-    @server.stop()
-    @client.stop()
-
-    pump()
-
-    assert @client.stopped?
-    assert @server.stopped?
-  end
-
-  def testSmoke(count=10)
-    msg = Message.new()
-    msg.address = "0.0.0.0:12345"
-
-    @server.receive()
-
-    count.times {|i|
-      msg.body = "Hello World! #{i}"
-      @client.put(msg)
-    }
-
-    msg2 = Message.new()
-
-    count.times {|i|
-      if (@server.incoming == 0) then
-        pump()
-      end
-      @server.get(msg2)
-      assert msg2.body == "Hello World! #{i}"
-    }
-
-    assert(@client.outgoing == 0,
-           "Expected 0 outgoing messages, found #{@client.outgoing}")
-    assert(@server.incoming == 0,
-           "Expected 0 incoming messages, found #{@server.incoming}")
-  end
-
-end
diff --git a/tests/smoke/recv.php b/tests/smoke/recv.php
deleted file mode 100755
index 96c2ec9..0000000
--- a/tests/smoke/recv.php
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env php
-<?php
-
-include("proton.php");
-
-$messenger = new Messenger();
-$messenger->incoming_window = 10;
-$message = new Message();
-
-$address = $argv[1];
-if (!$address) {
-  $address = "~0.0.0.0";
-}
-$messenger->subscribe($address);
-
-$messenger->start();
-
-while (true) {
-  $messenger->recv();
-  $messenger->get($message);
-  print "Got: $message\n";
-  $messenger->accept();
-}
-
-$messenger->stop();
-
-?>
\ No newline at end of file
diff --git a/tests/smoke/recv.pl b/tests/smoke/recv.pl
deleted file mode 100755
index 796bb7e..0000000
--- a/tests/smoke/recv.pl
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env perl
-require 'qpid_proton.pm';
-
-my $messenger = qpid::proton::Messenger->new();
-$messenger->set_incoming_window(1);
-my $message = qpid::proton::Message->new();
-
-my $address = $ARGV[0];
-$address = "~0.0.0.0" if !defined $address;
-$messenger->subscribe($address);
-
-$messenger->start();
-
-while (true) {
-    my $err = $messenger->receive();
-    # XXX: no exceptions!
-    die $messenger->get_error() if $err < 0;
-    $messenger->get($message);
-    print "Got: $message\n";
-    $messenger->accept();
-}
-
-$messenger->stop();
diff --git a/tests/smoke/recv.py b/tests/smoke/recv.py
deleted file mode 100755
index e6aa2b6..0000000
--- a/tests/smoke/recv.py
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env python
-from __future__ import print_function
-import sys
-from proton import *
-
-messenger = Messenger()
-messenger.incoming_window = 1
-message = Message()
-
-address = "~0.0.0.0"
-if len(sys.argv) > 1:
-  address = sys.argv[1]
-messenger.subscribe(address)
-
-messenger.start()
-
-while True:
-  messenger.recv()
-  messenger.get(message)
-  print("Got: %s" % message)
-  messenger.accept()
-
-messenger.stop()
diff --git a/tests/smoke/recv.rb b/tests/smoke/recv.rb
deleted file mode 100755
index 29df6cf..0000000
--- a/tests/smoke/recv.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'qpid_proton.rb'
-
-messenger = Qpid::Proton::Messenger.new()
-messenger.incoming_window = 1
-message = Qpid::Proton::Message.new()
-
-address = ARGV[0]
-if not address then
-  address = "~0.0.0.0"
-end
-messenger.subscribe(address)
-
-messenger.start()
-
-while (true) do
-  messenger.receive()
-  messenger.get(message)
-  print "Got: #{message}\n"
-  messenger.accept()
-end
-
-messenger.stop()
diff --git a/tests/smoke/send.php b/tests/smoke/send.php
deleted file mode 100755
index e77d89d..0000000
--- a/tests/smoke/send.php
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env php
-<?php
-
-include("proton.php");
-
-$messenger = new Messenger();
-$messenger->outgoing_window = 10;
-$message = new Message();
-
-$address = $argv[1];
-if (!$address) {
-  $address = "0.0.0.0";
-}
-
-$message->address = $address;
-$message->properties = Array("binding" => "php",
-                             "version" => phpversion());
-$message->body = "Hello World!";
-
-$messenger->start();
-$tracker = $messenger->put($message);
-print "Put: $message\n";
-$messenger->send();
-print "Status: " . $messenger->status($tracker) . "\n";
-$messenger->stop();
-
-?>
\ No newline at end of file
diff --git a/tests/smoke/send.pl b/tests/smoke/send.pl
deleted file mode 100755
index 11c5a04..0000000
--- a/tests/smoke/send.pl
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env perl
-require 'qpid_proton.pm';
-my $messenger = qpid::proton::Messenger->new();
-$messenger->set_outgoing_window(10);
-my $message = qpid::proton::Message->new();
-
-my $address = $ARGV[0];
-$address = "0.0.0.0" if !defined $address;
-$message->set_address($address);
-# how do we set properties and body?
-
-$messenger->start();
-my $tracker = $messenger->put($message);
-print "Put: $message\n";
-$messenger->send();
-print "Status: ", $messenger->status($tracker), "\n";
-$messenger->stop();
diff --git a/tests/smoke/send.py b/tests/smoke/send.py
deleted file mode 100755
index 7daee01..0000000
--- a/tests/smoke/send.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-from __future__ import print_function
-import sys
-from proton import *
-
-messenger = Messenger()
-messenger.outgoing_window = 10
-message = Message()
-
-address = "0.0.0.0"
-if len(sys.argv) > 1:
-  address = sys.argv[1]
-
-message.address = address
-message.properties = {u"binding": u"python",
-                      u"version": sys.version}
-message.body = u"Hello World!"
-
-messenger.start()
-tracker = messenger.put(message)
-print("Put: %s" % message)
-messenger.send()
-print("Status: %s" % messenger.status(tracker))
-messenger.stop()
diff --git a/tests/smoke/send.rb b/tests/smoke/send.rb
deleted file mode 100755
index c6865af..0000000
--- a/tests/smoke/send.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'qpid_proton.rb'
-
-messenger = Qpid::Proton::Messenger.new()
-messenger.outgoing_window = 10
-message = Qpid::Proton::Message.new()
-
-address = ARGV[0]
-if not address then
-  address = "0.0.0.0"
-end
-
-message.address = address
-message.properties = {"binding" => "ruby",
-  "version" => "#{RUBY_VERSION} #{RUBY_PLATFORM}"}
-message.body = "Hello World!"
-
-messenger.start()
-tracker = messenger.put(message)
-print "Put: #{message}\n"
-messenger.send()
-print "Status: ", messenger.status(tracker), "\n"
-messenger.stop()
diff --git a/tests/tools/apps/README.txt b/tests/tools/apps/README.txt
deleted file mode 100644
index 7552489..0000000
--- a/tests/tools/apps/README.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-This directory contains applications built using proton.  These
-applications are used by the testbed for soak tests.  See the
-"soak.py" file for the tests that utilize these applications.
-
-These applications can be used standalone to generate or consume
-message traffic.
-
-Contents:
-
-msgr-send - this Messenger-based application generates message
-   traffic, and can be configured to consume responses.
-
-msgr-recv - this Messenger-based application consumes message traffic,
-   and can be configured to forward or reply to received messages.
diff --git a/tests/tools/apps/c/CMakeLists.txt b/tests/tools/apps/c/CMakeLists.txt
deleted file mode 100644
index 2c801c4..0000000
--- a/tests/tools/apps/c/CMakeLists.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-include(CheckIncludeFiles)
-
-include_directories(${CMAKE_SOURCE_DIR}/examples/c/include)
-
-CHECK_INCLUDE_FILES("inttypes.h" INTTYPES_AVAILABLE)
-if (INTTYPES_AVAILABLE)
-  list(APPEND PLATFORM_DEFINITIONS "USE_INTTYPES")
-else (INTTYPES_AVAILABLE)
-  if (CMAKE_COMPILER_IS_GNUCC)
-    # since inttypes.h provides portable printf format macros
-    set (COMPILE_WARNING_FLAGS "${COMPILE_WARNING_FLAGS} -Wno-format")
-  endif (CMAKE_COMPILER_IS_GNUCC)
-endif (INTTYPES_AVAILABLE)
-
-add_executable(msgr-recv msgr-recv.c msgr-common.c)
-add_executable(msgr-send msgr-send.c msgr-common.c)
-add_executable(reactor-recv reactor-recv.c msgr-common.c)
-add_executable(reactor-send reactor-send.c msgr-common.c)
-
-target_link_libraries(msgr-recv qpid-proton)
-target_link_libraries(msgr-send qpid-proton)
-target_link_libraries(reactor-recv qpid-proton)
-target_link_libraries(reactor-send qpid-proton)
-
-set_target_properties (
-  msgr-recv msgr-send reactor-recv reactor-send
-  PROPERTIES
-  COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_LANGUAGE_FLAGS}"
-  COMPILE_DEFINITIONS "${PLATFORM_DEFINITIONS}"
-)
-
-if (BUILD_WITH_CXX)
-  set_source_files_properties (msgr-recv.c msgr-send.c msgr-common.c reactor-recv.c reactor-send.c PROPERTIES LANGUAGE CXX)
-endif (BUILD_WITH_CXX)
diff --git a/tests/tools/apps/c/msgr-common.c b/tests/tools/apps/c/msgr-common.c
deleted file mode 100644
index 7c43a45..0000000
--- a/tests/tools/apps/c/msgr-common.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "msgr-common.h"
-#include <pncompat/misc_funcs.inc>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-void msgr_die(const char *file, int line, const char *message)
-{
-  fprintf(stderr, "%s:%i: %s\n", file, line, message);
-  exit(1);
-}
-
-//sigh - would be nice if proton exported pn_strdup()
-char *msgr_strdup( const char *src )
-{
-  char *r = NULL;
-  if (src) {
-    r = (char *) malloc(sizeof(char) * (strlen(src) + 1));
-    if (r) strcpy(r,src);
-  }
-  return r;
-}
-
-
-pn_timestamp_t msgr_now()
-{
-  // from "pncompat/misc_funcs.inc"
-  return time_now();
-}
-
-void addresses_init( Addresses_t *a )
-{
-  a->size = 10; // whatever
-  a->count = 0;
-  a->addresses = (const char **) calloc( a->size, sizeof(const char *));
-  check(a->addresses, "malloc failure");
-}
-
-void addresses_free( Addresses_t *a )
-{
-  if (a->addresses) {
-    int i;
-    for (i = 0; i < a->count; i++)
-      if (a->addresses[i]) free( (void *)a->addresses[i] );
-    free( a->addresses );
-    a->addresses = NULL;
-  }
-}
-
-void addresses_add( Addresses_t *a, const char *addr )
-{
-  if (a->count == a->size) {
-    a->size += 10;
-    a->addresses = (const char **) realloc( a->addresses,
-                                            a->size * sizeof(const char *) );
-    check( a->addresses, "malloc failure" );
-    int i;
-    for (i = a->count; i < a->size; i++)
-      a->addresses[i] = NULL;
-  }
-  a->addresses[a->count] = msgr_strdup(addr);
-  check( a->addresses[a->count], "malloc failure" );
-  a->count++;
-}
-
-// merge a comma-separated list of addresses
-void addresses_merge( Addresses_t *a, const char *list )
-{
-  char *const l = msgr_strdup(list);
-  check( l, "malloc failure" );
-  char *addr = l;
-  while (addr && *addr) {
-    char *comma = strchr( addr, ',' );
-    if (comma) {
-      *comma++ = '\0';
-    }
-    addresses_add( a, addr );
-    addr = comma;
-  }
-  free(l);
-}
-
-
-void statistics_start( Statistics_t *s )
-{
-  s->latency_samples = 0;
-  s->latency_total = s->latency_min = s->latency_max = 0.0;
-  s->start = msgr_now();
-}
-
-void statistics_msg_received( Statistics_t *s, pn_message_t *message )
-{
-  pn_timestamp_t ts = pn_message_get_creation_time( message );
-  if (ts) {
-    double l = (double)(msgr_now() - ts);
-    if (l > 0) {
-      s->latency_total += l;
-      if (++s->latency_samples == 1) {
-        s->latency_min = s->latency_max = l;
-      } else {
-        if (s->latency_min > l)
-          s->latency_min = l;
-        if (s->latency_max < l)
-          s->latency_max = l;
-      }
-    }
-  }
-}
-
-void statistics_report( Statistics_t *s, uint64_t sent, uint64_t received )
-{
-  pn_timestamp_t end = msgr_now() - s->start;
-  double secs = end/(double)1000.0;
-
-  fprintf(stdout, "Messages sent: %" PRIu64 " recv: %" PRIu64 "\n", sent, received );
-  fprintf(stdout, "Total time: %f sec\n", secs );
-  fprintf(stdout, "Throughput: %f msgs/sec\n",  (secs != 0.0) ? (double)sent/secs : 0);
-  fprintf(stdout, "Latency (sec): %f min %f max %f avg\n",
-          s->latency_min/1000.0, s->latency_max/1000.0,
-          (s->latency_samples) ? (s->latency_total/s->latency_samples)/1000.0 : 0);
-}
-
-void parse_password( const char *input, char **password )
-{
-    if (strncmp( input, "pass:", 5 ) == 0) {
-        // password provided on command line (not secure, shows up in 'ps')
-        *password = msgr_strdup( input + 5 );
-    } else {    // input assumed to be file containing password
-        FILE *f = fopen( input, "r" );
-        check( f, "Cannot open password file\n" );
-        *password = (char *)malloc(256);    // 256 should be enough for anybody!
-        check( *password, "malloc failure" );
-        int rc = fscanf( f, "%255s", *password );
-        check( rc == 1, "Cannot read password from file\n" );
-        fclose(f);
-    }
-}
-
-static int log = 0;
-void enable_logging()
-{
-    log = 1;
-}
-
-void LOG( const char *fmt, ... )
-{
-    if (log) {
-        va_list ap;
-        va_start(ap, fmt);
-        vfprintf( stdout, fmt, ap );
-        va_end(ap);
-    }
-}
diff --git a/tests/tools/apps/c/msgr-common.h b/tests/tools/apps/c/msgr-common.h
deleted file mode 100644
index d3f483a..0000000
--- a/tests/tools/apps/c/msgr-common.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "pncompat/misc_defs.h"
-
-#if defined(USE_INTTYPES)
-#ifdef __cplusplus
-#define __STDC_FORMAT_MACROS
-#endif
-#include <inttypes.h>
-#endif
-
-#ifdef _MSC_VER
-#if !defined(PRIu64)
-#define PRIu64 "I64u"
-#endif
-#if !defined(SCNu64)
-#define SCNu64 "I64u"
-#endif
-#endif
-
-/* If still not defined, best guess */
-#if !defined(SCNu64)
-#define SCNu64 "ul"
-#endif
-#if !defined(PRIu64)
-#define PRIu64 "ul"
-#endif
-
-
-#include "proton/types.h"
-#include "proton/message.h"
-
-void msgr_die(const char *file, int line, const char *message);
-char *msgr_strdup( const char *src );
-pn_timestamp_t msgr_now(void);
-void parse_password( const char *, char ** );
-
-#define check_messenger(m)  \
-  { check(pn_messenger_errno(m) == 0, pn_error_text(pn_messenger_error(m))) }
-
-#define check( expression, message )  \
-  { if (!(expression)) msgr_die(__FILE__,__LINE__, message); }
-
-
-// manage an ordered list of addresses
-
-typedef struct {
-  const char **addresses;
-  int size;     // room in 'addresses'
-  int count;    // # entries
-} Addresses_t;
-
-#define NEXT_ADDRESS(a, i) (((i) + 1) % (a).count)
-void addresses_init( Addresses_t *a );
-void addresses_free( Addresses_t *a );
-void addresses_add( Addresses_t *a, const char *addr );
-void addresses_merge( Addresses_t *a, const char *list );
-
-// Statistics handling
-
-typedef struct {
-  pn_timestamp_t start;
-  uint64_t latency_samples;
-  double latency_total;
-  double latency_min;
-  double latency_max;
-} Statistics_t;
-
-void statistics_start( Statistics_t *s );
-void statistics_msg_received( Statistics_t *s, pn_message_t *message );
-void statistics_report( Statistics_t *s, uint64_t sent, uint64_t received );
-
-void enable_logging(void);
-void LOG( const char *fmt, ... );
-
diff --git a/tests/tools/apps/c/msgr-recv.c b/tests/tools/apps/c/msgr-recv.c
deleted file mode 100644
index eff5820..0000000
--- a/tests/tools/apps/c/msgr-recv.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "msgr-common.h"
-#include "proton/message.h"
-#include "proton/messenger.h"
-#include "proton/error.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-typedef struct {
-    Addresses_t subscriptions;
-    uint64_t msg_count;
-    int recv_count;
-    int incoming_window;
-    int timeout;  // seconds
-    unsigned int report_interval;  // in seconds
-    int   outgoing_window;
-    Addresses_t forwarding_targets;
-    int   reply;
-    const char *name;
-    const char *ready_text;
-    char *certificate;
-    char *privatekey;   // used to sign certificate
-    char *password;     // for private key file
-    char *ca_db;        // trusted CA database
-} Options_t;
-
-
-static void usage(int rc)
-{
-    printf("Usage: msgr-recv [OPTIONS] \n"
-           " -a <addr>[,<addr>]* \tAddresses to listen on [amqp://~0.0.0.0]\n"
-           " -c # \tNumber of messages to receive before exiting [0=forever]\n"
-           " -b # \tArgument to Messenger::recv(n) [2048]\n"
-           " -w # \tSize for incoming window [0]\n"
-           " -t # \tInactivity timeout in seconds, -1 = no timeout [-1]\n"
-           " -e # \t# seconds to report statistics, 0 = end of test [0] *TBD*\n"
-           " -R \tSend reply if 'reply-to' present\n"
-           " -W # \t# outgoing window size [0]\n"
-           " -F <addr>[,<addr>]* \tAddresses used for forwarding received messages\n"
-           " -N <name> \tSet the container name to <name>\n"
-           " -X <text> \tPrint '<text>\\n' to stdout after all subscriptions are created\n"
-           " -V \tEnable debug logging\n"
-           " SSL options:\n"
-           " -T <path> \tDatabase of trusted CA certificates for validating peer\n"
-           " -C <path> \tFile containing self-identifying certificate\n"
-           " -K <path> \tFile containing private key used to sign certificate\n"
-           " -P [pass:<password>|path] \tPassword to unlock private key file.\n"
-           );
-    exit(rc);
-}
-
-static void parse_options( int argc, char **argv, Options_t *opts )
-{
-    int c;
-    opterr = 0;
-
-    memset( opts, 0, sizeof(*opts) );
-    opts->recv_count = -1;
-    opts->timeout = -1;
-    addresses_init(&opts->subscriptions);
-    addresses_init(&opts->forwarding_targets);
-
-    while ((c = getopt(argc, argv,
-                       "a:c:b:w:t:e:RW:F:VN:X:T:C:K:P:")) != -1) {
-        switch (c) {
-        case 'a': addresses_merge( &opts->subscriptions, optarg ); break;
-        case 'c':
-            if (sscanf( optarg, "%" SCNu64, &opts->msg_count ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 'b':
-            if (sscanf( optarg, "%d", &opts->recv_count ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 'w':
-            if (sscanf( optarg, "%d", &opts->incoming_window ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 't':
-            if (sscanf( optarg, "%d", &opts->timeout ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            if (opts->timeout > 0) opts->timeout *= 1000;
-            break;
-        case 'e':
-            if (sscanf( optarg, "%u", &opts->report_interval ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 'R': opts->reply = 1; break;
-        case 'W':
-            if (sscanf( optarg, "%d", &opts->outgoing_window ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 'F': addresses_merge( &opts->forwarding_targets, optarg ); break;
-        case 'V': enable_logging(); break;
-        case 'N': opts->name = optarg; break;
-        case 'X': opts->ready_text = optarg; break;
-        case 'T': opts->ca_db = optarg; break;
-        case 'C': opts->certificate = optarg; break;
-        case 'K': opts->privatekey = optarg; break;
-        case 'P': parse_password( optarg, &opts->password ); break;
-
-        default:
-            usage(1);
-        }
-    }
-
-    // default subscription if none specified
-    if (opts->subscriptions.count == 0) addresses_add( &opts->subscriptions,
-                                                       "amqp://~0.0.0.0" );
-}
-
-
-
-int main(int argc, char** argv)
-{
-    Options_t opts;
-    Statistics_t stats;
-    uint64_t sent = 0;
-    uint64_t received = 0;
-    int forwarding_index = 0;
-    int rc;
-
-    pn_message_t *message;
-    pn_messenger_t *messenger;
-
-    parse_options( argc, argv, &opts );
-
-    const int forward = opts.forwarding_targets.count != 0;
-
-    message = pn_message();
-    messenger = pn_messenger( opts.name );
-
-    /* load the various command line options if they're set */
-    if (opts.certificate) {
-        rc = pn_messenger_set_certificate(messenger, opts.certificate);
-        check_messenger(messenger);
-        check( rc == 0, "Failed to set certificate" );
-    }
-
-    if (opts.privatekey) {
-        rc = pn_messenger_set_private_key(messenger, opts.privatekey);
-        check_messenger(messenger);
-        check( rc == 0, "Failed to set private key" );
-    }
-
-    if (opts.password) {
-        rc = pn_messenger_set_password(messenger, opts.password);
-        check_messenger(messenger);
-        check( rc == 0, "Failed to set password" );
-    }
-
-    if (opts.ca_db) {
-        rc = pn_messenger_set_trusted_certificates(messenger, opts.ca_db);
-        check_messenger(messenger);
-        check( rc == 0, "Failed to set trusted CA database" );
-    }
-
-    if (opts.incoming_window) {
-        // RAFI: seems to cause receiver to hang:
-        pn_messenger_set_incoming_window( messenger, opts.incoming_window );
-    }
-
-    pn_messenger_set_timeout( messenger, opts.timeout );
-
-    pn_messenger_start(messenger);
-    check_messenger(messenger);
-
-    int i;
-    for (i = 0; i < opts.subscriptions.count; i++) {
-        pn_messenger_subscribe(messenger, opts.subscriptions.addresses[i]);
-        check_messenger(messenger);
-        LOG("Subscribing to '%s'\n", opts.subscriptions.addresses[i]);
-    }
-
-    // hack to let test scripts know when the receivers are ready (so
-    // that the senders may be started)
-    if (opts.ready_text) {
-        fprintf(stdout, "%s\n", opts.ready_text);
-        fflush(stdout);
-    }
-
-    while (!opts.msg_count || received < opts.msg_count) {
-
-        LOG("Calling pn_messenger_recv(%d)\n", opts.recv_count);
-        rc = pn_messenger_recv(messenger, opts.recv_count);
-        check_messenger(messenger);
-        check(rc == 0 || (opts.timeout == 0 && rc == PN_TIMEOUT), "pn_messenger_recv() failed");
-
-        // start the timer only after receiving the first msg
-        if (received == 0) statistics_start( &stats );
-
-        LOG("Messages on incoming queue: %d\n", pn_messenger_incoming(messenger));
-        while (pn_messenger_incoming(messenger)) {
-            pn_messenger_get(messenger, message);
-            check_messenger(messenger);
-            received++;
-            // TODO: header decoding?
-            // uint64_t id = pn_message_get_correlation_id( message ).u.as_ulong;
-            statistics_msg_received( &stats, message );
-
-            if (opts.reply) {
-                const char *reply_addr = pn_message_get_reply_to( message );
-                if (reply_addr) {
-                    LOG("Replying to: %s\n", reply_addr );
-                    pn_message_set_address( message, reply_addr );
-                    pn_message_set_creation_time( message, msgr_now() );
-                    pn_messenger_put(messenger, message);
-                    sent++;
-                }
-            }
-
-            if (forward) {
-                const char *forward_addr = opts.forwarding_targets.addresses[forwarding_index];
-                forwarding_index = NEXT_ADDRESS(opts.forwarding_targets, forwarding_index);
-                LOG("Forwarding to: %s\n", forward_addr );
-                pn_message_set_address( message, forward_addr );
-                pn_message_set_reply_to( message, NULL );       // else points to origin sender
-                pn_message_set_creation_time( message, msgr_now() );
-                pn_messenger_put(messenger, message);
-                sent++;
-            }
-
-        }
-        LOG("Messages received=%llu sent=%llu\n", received, sent);
-    }
-
-    // this will flush any pending sends
-    if (pn_messenger_outgoing(messenger) > 0) {
-        LOG("Calling pn_messenger_send()\n");
-        rc = pn_messenger_send(messenger, -1);
-        check_messenger(messenger);
-        check(rc == 0, "pn_messenger_send() failed");
-    }
-
-    rc = pn_messenger_stop(messenger);
-    check(rc == 0, "pn_messenger_stop() failed");
-    check_messenger(messenger);
-
-    statistics_report( &stats, sent, received );
-
-    pn_messenger_free(messenger);
-    pn_message_free(message);
-    addresses_free( &opts.subscriptions );
-    addresses_free( &opts.forwarding_targets );
-
-    return 0;
-}
diff --git a/tests/tools/apps/c/msgr-send.c b/tests/tools/apps/c/msgr-send.c
deleted file mode 100644
index 7d67fcc..0000000
--- a/tests/tools/apps/c/msgr-send.c
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "msgr-common.h"
-#include "proton/message.h"
-#include "proton/messenger.h"
-#include "proton/error.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-
-typedef struct {
-    Addresses_t targets;
-    uint64_t msg_count;
-    uint32_t msg_size;  // of body
-    uint32_t send_batch;
-    int   outgoing_window;
-    unsigned int report_interval;      // in seconds
-    //Addresses_t subscriptions;
-    //Addresses_t reply_tos;
-    int   get_replies;
-    int   timeout;      // in seconds
-    int   incoming_window;
-    int   recv_count;
-    const char *name;
-    char *certificate;
-    char *privatekey;   // used to sign certificate
-    char *password;     // for private key file
-    char *ca_db;        // trusted CA database
-} Options_t;
-
-
-static void usage(int rc)
-{
-    printf("Usage: msgr-send [OPTIONS] \n"
-           " -a <addr>[,<addr>]* \tThe target address [amqp[s]://domain[/name]]\n"
-           " -c # \tNumber of messages to send before exiting [0=forever]\n"
-           " -b # \tSize of message body in bytes [1024]\n"
-           " -p # \tSend batches of # messages (wait for replies before sending next batch if -R) [1024]\n"
-           " -w # \t# outgoing window size [0]\n"
-           " -e # \t# seconds to report statistics, 0 = end of test [0]\n"
-           " -R \tWait for a reply to each sent message\n"
-           " -t # \tInactivity timeout in seconds, -1 = no timeout [-1]\n"
-           " -W # \tIncoming window size [0]\n"
-           " -B # \tArgument to Messenger::recv(n) [-1]\n"
-           " -N <name> \tSet the container name to <name>\n"
-           " -V \tEnable debug logging\n"
-           " SSL options:\n"
-           " -T <path> \tDatabase of trusted CA certificates for validating peer\n"
-           " -C <path> \tFile containing self-identifying certificate\n"
-           " -K <path> \tFile containing private key used to sign certificate\n"
-           " -P [pass:<password>|path] \tPassword to unlock private key file.\n"
-           );
-    //printf("-p     \t*TODO* Add N sample properties to each message [3]\n");
-    exit(rc);
-}
-
-static void parse_options( int argc, char **argv, Options_t *opts )
-{
-    int c;
-    opterr = 0;
-
-    memset( opts, 0, sizeof(*opts) );
-    opts->msg_size  = 1024;
-    opts->send_batch = 1024;
-    opts->timeout = -1;
-    opts->recv_count = -1;
-    addresses_init(&opts->targets);
-
-    while ((c = getopt(argc, argv,
-                       "a:c:b:p:w:e:l:Rt:W:B:VN:T:C:K:P:")) != -1) {
-        switch(c) {
-        case 'a': addresses_merge( &opts->targets, optarg ); break;
-        case 'c':
-            if (sscanf( optarg, "%" SCNu64, &opts->msg_count ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 'b':
-            if (sscanf( optarg, "%u", &opts->msg_size ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 'p':
-            if (sscanf( optarg, "%u", &opts->send_batch ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 'w':
-            if (sscanf( optarg, "%d", &opts->outgoing_window ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 'e':
-            if (sscanf( optarg, "%u", &opts->report_interval ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 'R': opts->get_replies = 1; break;
-        case 't':
-            if (sscanf( optarg, "%d", &opts->timeout ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            if (opts->timeout > 0) opts->timeout *= 1000;
-            break;
-        case 'W':
-            if (sscanf( optarg, "%d", &opts->incoming_window ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 'B':
-            if (sscanf( optarg, "%d", &opts->recv_count ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 'V': enable_logging(); break;
-        case 'N': opts->name = optarg; break;
-        case 'T': opts->ca_db = optarg; break;
-        case 'C': opts->certificate = optarg; break;
-        case 'K': opts->privatekey = optarg; break;
-        case 'P': parse_password( optarg, &opts->password ); break;
-
-        default:
-            usage(1);
-        }
-    }
-
-    // default target if none specified
-    if (opts->targets.count == 0) addresses_add( &opts->targets, "amqp://0.0.0.0" );
-}
-
-
-// return the # of reply messages received
-static int process_replies( pn_messenger_t *messenger,
-                            pn_message_t *message,
-                            Statistics_t *stats,
-                            int max_count)
-{
-    int received = 0;
-    LOG("Calling pn_messenger_recv(%d)\n", max_count);
-    int rc = pn_messenger_recv( messenger, max_count );
-    check((rc == 0 || rc == PN_TIMEOUT), "pn_messenger_recv() failed");
-    LOG("Messages on incoming queue: %d\n", pn_messenger_incoming(messenger));
-    while (pn_messenger_incoming(messenger)) {
-        pn_messenger_get(messenger, message);
-        check_messenger(messenger);
-        received++;
-        // TODO: header decoding?
-        statistics_msg_received( stats, message );
-        // uint64_t id = pn_message_get_correlation_id( message ).u.as_ulong;
-    }
-    return received;
-}
-
-
-
-int main(int argc, char** argv)
-{
-    Options_t opts;
-    Statistics_t stats;
-    uint64_t sent = 0;
-    uint64_t received = 0;
-    int target_index = 0;
-    int rc;
-
-    pn_message_t *message = 0;
-    pn_message_t *reply_message = 0;
-    pn_messenger_t *messenger = 0;
-
-    parse_options( argc, argv, &opts );
-
-    messenger = pn_messenger( opts.name );
-
-    if (opts.certificate) {
-        rc = pn_messenger_set_certificate(messenger, opts.certificate);
-        check( rc == 0, "Failed to set certificate" );
-    }
-
-    if (opts.privatekey) {
-        rc = pn_messenger_set_private_key(messenger, opts.privatekey);
-        check( rc == 0, "Failed to set private key" );
-    }
-
-    if (opts.password) {
-        rc = pn_messenger_set_password(messenger, opts.password);
-        check( rc == 0, "Failed to set password" );
-    }
-
-    if (opts.ca_db) {
-        rc = pn_messenger_set_trusted_certificates(messenger, opts.ca_db);
-        check( rc == 0, "Failed to set trusted CA database" );
-    }
-
-    if (opts.outgoing_window) {
-        pn_messenger_set_outgoing_window( messenger, opts.outgoing_window );
-    }
-    pn_messenger_set_timeout( messenger, opts.timeout );
-    pn_messenger_start(messenger);
-
-    message = pn_message();
-    check(message, "failed to allocate a message");
-    pn_message_set_reply_to(message, "~");
-    pn_data_t *body = pn_message_body(message);
-    char *data = (char *)calloc(1, opts.msg_size);
-    pn_data_put_binary(body, pn_bytes(opts.msg_size, data));
-    free(data);
-    pn_atom_t id;
-    id.type = PN_ULONG;
-
-#if 0
-    // TODO: how do we effectively benchmark header processing overhead???
-    pn_data_t *props = pn_message_properties(message);
-    pn_data_put_map(props);
-    pn_data_enter(props);
-    //
-    //pn_data_put_string(props, pn_bytes(6,  "string"));
-    //pn_data_put_string(props, pn_bytes(10, "this is awkward"));
-    //
-    //pn_data_put_string(props, pn_bytes(4,  "long"));
-    pn_data_put_long(props, 12345);
-    //
-    //pn_data_put_string(props, pn_bytes(9, "timestamp"));
-    pn_data_put_timestamp(props, (pn_timestamp_t) 54321);
-    pn_data_exit(props);
-#endif
-
-    const int get_replies = opts.get_replies;
-
-    if (get_replies) {
-        // disable the timeout so that pn_messenger_recv() won't block
-        reply_message = pn_message();
-        check(reply_message, "failed to allocate a message");
-    }
-
-    statistics_start( &stats );
-    while (!opts.msg_count || (sent < opts.msg_count)) {
-
-        // setup the message to send
-        pn_message_set_address(message, opts.targets.addresses[target_index]);
-        target_index = NEXT_ADDRESS(opts.targets, target_index);
-        id.u.as_ulong = sent;
-        pn_message_set_correlation_id( message, id );
-        pn_message_set_creation_time( message, msgr_now() );
-        pn_messenger_put(messenger, message);
-        sent++;
-        if (opts.send_batch && (pn_messenger_outgoing(messenger) >= (int)opts.send_batch)) {
-            if (get_replies) {
-                while (received < sent) {
-                    // this will also transmit any pending sent messages
-                    received += process_replies( messenger, reply_message,
-                                                 &stats, opts.recv_count );
-                }
-            } else {
-                LOG("Calling pn_messenger_send()\n");
-                rc = pn_messenger_send(messenger, -1);
-                check((rc == 0 || rc == PN_TIMEOUT), "pn_messenger_send() failed");
-            }
-        }
-        check_messenger(messenger);
-    }
-
-    LOG("Messages received=%llu sent=%llu\n", received, sent);
-
-    if (get_replies) {
-        // wait for the last of the replies
-        while (received < sent) {
-            int count = process_replies( messenger, reply_message,
-                                         &stats, opts.recv_count );
-            check( count > 0 || (opts.timeout == 0),
-                   "Error: timed out waiting for reply messages\n");
-            received += count;
-            LOG("Messages received=%llu sent=%llu\n", received, sent);
-        }
-    } else if (pn_messenger_outgoing(messenger) > 0) {
-        LOG("Calling pn_messenger_send()\n");
-        rc = pn_messenger_send(messenger, -1);
-        check(rc == 0, "pn_messenger_send() failed");
-    }
-
-    rc = pn_messenger_stop(messenger);
-    check(rc == 0, "pn_messenger_stop() failed");
-    check_messenger(messenger);
-
-    statistics_report( &stats, sent, received );
-
-    pn_messenger_free(messenger);
-    pn_message_free(message);
-    if (reply_message) pn_message_free( reply_message );
-    addresses_free( &opts.targets );
-
-    return 0;
-}
diff --git a/tests/tools/apps/c/reactor-recv.c b/tests/tools/apps/c/reactor-recv.c
deleted file mode 100644
index bdd1cc2..0000000
--- a/tests/tools/apps/c/reactor-recv.c
+++ /dev/null
@@ -1,451 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*
- * Implements a subset of msgr-recv.c using reactor events.
- */
-
-#include "proton/message.h"
-#include "proton/error.h"
-#include "proton/types.h"
-#include "proton/reactor.h"
-#include "proton/handlers.h"
-#include "proton/engine.h"
-#include "proton/url.h"
-#include "msgr-common.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-// The exact struct from msgr-recv, mostly fallow.
-typedef struct {
-  Addresses_t subscriptions;
-  uint64_t msg_count;
-  int recv_count;
-  int incoming_window;
-  int timeout;  // seconds
-  unsigned int report_interval;  // in seconds
-  int   outgoing_window;
-  int   reply;
-  const char *name;
-  const char *ready_text;
-  char *certificate;
-  char *privatekey;   // used to sign certificate
-  char *password;     // for private key file
-  char *ca_db;        // trusted CA database
-} Options_t;
-
-
-static void usage(int rc)
-{
-    printf("Usage: reactor-recv [OPTIONS] \n"
-           " -c # \tNumber of messages to receive before exiting [0=forever]\n"
-           " -R \tSend reply if 'reply-to' present\n"
-           " -t # \tInactivity timeout in seconds, -1 = no timeout [-1]\n"
-           " -X <text> \tPrint '<text>\\n' to stdout after all subscriptions are created\n"
-           );
-    exit(rc);
-}
-
-
-// Global context for this process
-typedef struct {
-  Options_t *opts;
-  Statistics_t *stats;
-  uint64_t sent;
-  uint64_t received;
-  pn_message_t *message;
-  pn_acceptor_t *acceptor;
-  char *encoded_data;
-  size_t encoded_data_size;
-  int connections;
-  pn_list_t *active_connections;
-  bool shutting_down;
-  pn_handler_t *listener_handler;
-  int quiesce_count;
-} global_context_t;
-
-// Per connection context
-typedef struct {
-  global_context_t *global;
-  int connection_id;
-  pn_link_t *recv_link;
-  pn_link_t *reply_link;
-} connection_context_t;
-
-
-static char *ensure_buffer(char *buf, size_t needed, size_t *actual)
-{
-  char* new_buf;
-  // Make room for the largest message seen so far, plus extra for slight changes in metadata content
-  if (needed + 1024 <= *actual)
-    return buf;
-  needed += 2048;
-  new_buf = (char *) realloc(buf, needed);
-  if (new_buf != NULL) {
-    buf = new_buf;
-    *actual = buf ? needed : 0;
-  }
-  return buf;
-}
-
-void global_shutdown(global_context_t *gc)
-{
-  if (gc->shutting_down) return;
-  gc->shutting_down = true;
-  pn_acceptor_close(gc->acceptor);
-  size_t n = pn_list_size(gc->active_connections);
-  for (size_t i = 0; i < n; i++) {
-    pn_connection_t *conn = (pn_connection_t *) pn_list_get(gc->active_connections, i);
-    if (!(pn_connection_state(conn) & PN_LOCAL_CLOSED)) {
-      pn_connection_close(conn);
-    }
-  }
-}
-
-connection_context_t *connection_context(pn_handler_t *h)
-{
-  connection_context_t *p = (connection_context_t *) pn_handler_mem(h);
-  return p;
-}
-
-void connection_context_init(connection_context_t *cc, global_context_t *gc)
-{
-  cc->global = gc;
-  pn_incref(gc->listener_handler);
-  cc->connection_id = gc->connections++;
-  cc->recv_link = 0;
-  cc->reply_link = 0;
-}
-
-void connection_cleanup(pn_handler_t *h)
-{
-  connection_context_t *cc = connection_context(h);
-  // Undo pn_incref() from connection_context_init()
-  pn_decref(cc->global->listener_handler);
-}
-
-void connection_dispatch(pn_handler_t *h, pn_event_t *event, pn_event_type_t type)
-{
-  connection_context_t *cc = connection_context(h);
-  bool replying = cc->global->opts->reply;
-
-  switch (type) {
-  case PN_LINK_REMOTE_OPEN:
-    {
-      pn_link_t *link = pn_event_link(event);
-      if (pn_link_is_receiver(link)) {
-        check(cc->recv_link == NULL, "Multiple incomming links on one connection");
-        cc->recv_link = link;
-        pn_connection_t *conn = pn_event_connection(event);
-        pn_list_add(cc->global->active_connections, conn);
-        if (cc->global->shutting_down) {
-          pn_connection_close(conn);
-          break;
-        }
-        if (replying) {
-          // Set up a reply link and defer granting credit to the incoming link
-          pn_connection_t *conn = pn_session_connection(pn_link_session(link));
-          pn_session_t *ssn = pn_session(conn);
-          pn_session_open(ssn);
-          char name[100]; // prefer a multiplatform uuid generator
-          sprintf(name, "reply_sender_%d", cc->connection_id);
-          cc->reply_link = pn_sender(ssn, name);
-          pn_link_open(cc->reply_link);
-        }
-        else {
-          pn_flowcontroller_t *fc = pn_flowcontroller(1024);
-          pn_handler_add(h, fc);
-          pn_decref(fc);
-        }
-      }
-    }
-    break;
-  case PN_LINK_FLOW:
-    {
-      if (replying) {
-        pn_link_t *reply_link = pn_event_link(event);
-        // pn_flowcontroller handles the non-reply case
-        check(reply_link == cc->reply_link, "internal error");
-
-        // Grant the sender as much credit as just given to us for replies
-        int delta = pn_link_credit(reply_link) - pn_link_credit(cc->recv_link);
-        if (delta > 0)
-          pn_link_flow(cc->recv_link, delta);
-      }
-    }
-    break;
-  case PN_DELIVERY:
-    {
-      pn_link_t *recv_link = pn_event_link(event);
-      pn_delivery_t *dlv = pn_event_delivery(event);
-      if (pn_link_is_receiver(recv_link) && !pn_delivery_partial(dlv)) {
-        if (cc->global->received == 0) statistics_start(cc->global->stats);
-
-        size_t encoded_size = pn_delivery_pending(dlv);
-        cc->global->encoded_data = ensure_buffer(cc->global->encoded_data, encoded_size,
-                                                 &cc->global->encoded_data_size);
-        check(cc->global->encoded_data, "decoding buffer realloc failure");
-
-        ssize_t n = pn_link_recv(recv_link, cc->global->encoded_data, encoded_size);
-        check(n == (ssize_t) encoded_size, "message data read fail");
-        pn_message_t *msg = cc->global->message;
-        int err = pn_message_decode(msg, cc->global->encoded_data, n);
-        check(err == 0, "message decode error");
-        cc->global->received++;
-        pn_delivery_settle(dlv);
-        statistics_msg_received(cc->global->stats, msg);
-
-        if (replying) {
-          const char *reply_addr = pn_message_get_reply_to(msg);
-          if (reply_addr) {
-            pn_link_t *rl = cc->reply_link;
-            check(pn_link_credit(rl) > 0, "message received without corresponding reply credit");
-            LOG("Replying to: %s\n", reply_addr );
-
-            pn_message_set_address(msg, reply_addr);
-            pn_message_set_creation_time(msg, msgr_now());
-
-            char tag[8];
-            void *ptr = &tag;
-            *((uint64_t *) ptr) = cc->global->sent;
-            pn_delivery_t *dlv = pn_delivery(rl, pn_dtag(tag, 8));
-            size_t size = cc->global->encoded_data_size;
-            int err = pn_message_encode(msg, cc->global->encoded_data, &size);
-            check(err == 0, "message encoding error");
-            pn_link_send(rl, cc->global->encoded_data, size);
-            pn_delivery_settle(dlv);
-
-            cc->global->sent++;
-          }
-        }
-      }
-      if (cc->global->received >= cc->global->opts->msg_count) {
-        global_shutdown(cc->global);
-      }
-    }
-    break;
-  case PN_CONNECTION_UNBOUND:
-    {
-      pn_connection_t *conn = pn_event_connection(event);
-      pn_list_remove(cc->global->active_connections, conn);
-      pn_connection_release(conn);
-    }
-    break;
-  default:
-    break;
-  }
-}
-
-pn_handler_t *connection_handler(global_context_t *gc)
-{
-  pn_handler_t *h = pn_handler_new(connection_dispatch, sizeof(connection_context_t), connection_cleanup);
-  connection_context_t *cc = connection_context(h);
-  connection_context_init(cc, gc);
-  return h;
-}
-
-
-void start_listener(global_context_t *gc, pn_reactor_t *reactor)
-{
-  check(gc->opts->subscriptions.count > 0, "no listening address");
-  pn_url_t *listen_url = pn_url_parse(gc->opts->subscriptions.addresses[0]);
-  const char *host = pn_url_get_host(listen_url);
-  const char *port = pn_url_get_port(listen_url);
-  if (port == 0 || strlen(port) == 0)
-    port = "5672";
-  if (host == 0 || strlen(host) == 0)
-    host = "0.0.0.0";
-  if (*host == '~') host++;
-  gc->acceptor = pn_reactor_acceptor(reactor, host, port, NULL);
-  check(gc->acceptor, "acceptor creation failed");
-  pn_url_free(listen_url);
-}
-
-void global_context_init(global_context_t *gc, Options_t *o, Statistics_t *s)
-{
-  gc->opts = o;
-  gc->stats = s;
-  gc->sent = 0;
-  gc->received = 0;
-  gc->encoded_data_size = 0;
-  gc->encoded_data = 0;
-  gc->message = pn_message();
-  check(gc->message, "failed to allocate a message");
-  gc->connections = 0;
-  gc->active_connections = pn_list(PN_OBJECT, 0);
-  gc->acceptor = 0;
-  gc->shutting_down = false;
-  gc->listener_handler = 0;
-  gc->quiesce_count = 0;
-}
-
-global_context_t *global_context(pn_handler_t *h)
-{
-  return (global_context_t *) pn_handler_mem(h);
-}
-
-void listener_cleanup(pn_handler_t *h)
-{
-  global_context_t *gc = global_context(h);
-  pn_message_free(gc->message);
-  free(gc->encoded_data);
-  pn_free(gc->active_connections);
-}
-
-void listener_dispatch(pn_handler_t *h, pn_event_t *event, pn_event_type_t type)
-{
-  global_context_t *gc = global_context(h);
-  if (type == PN_REACTOR_QUIESCED)
-    gc->quiesce_count++;
-  else
-    gc->quiesce_count = 0;
-
-  switch (type) {
-  case PN_CONNECTION_INIT:
-    {
-      pn_connection_t *connection = pn_event_connection(event);
-
-      // New incoming connection on listener socket.  Give each a separate handler.
-      pn_handler_t *ch = connection_handler(gc);
-      pn_handshaker_t *handshaker = pn_handshaker();
-      pn_handler_add(ch, handshaker);
-      pn_decref(handshaker);
-      pn_record_t *record = pn_connection_attachments(connection);
-      pn_record_set_handler(record, ch);
-      pn_decref(ch);
-    }
-    break;
-  case PN_REACTOR_QUIESCED:
-    {
-      // Two quiesce in a row means we have been idle for a timout period
-      if (gc->opts->timeout != -1 && gc->quiesce_count > 1)
-        global_shutdown(gc);
-    }
-    break;
-  case PN_REACTOR_INIT:
-    {
-      pn_reactor_t *reactor = pn_event_reactor(event);
-      start_listener(gc, reactor);
-
-      // hack to let test scripts know when the receivers are ready (so
-      // that the senders may be started)
-      if (gc->opts->ready_text) {
-        fprintf(stdout, "%s\n", gc->opts->ready_text);
-        fflush(stdout);
-      }
-      if (gc->opts->timeout != -1)
-        pn_reactor_set_timeout(pn_event_reactor(event), gc->opts->timeout);
-    }
-    break;
-  case PN_REACTOR_FINAL:
-    {
-      if (gc->received == 0) statistics_start(gc->stats);
-      statistics_report(gc->stats, gc->sent, gc->received);
-    }
-    break;
-  default:
-    break;
-  }
-}
-
-pn_handler_t *listener_handler(Options_t *opts, Statistics_t *stats)
-{
-  pn_handler_t *h = pn_handler_new(listener_dispatch, sizeof(global_context_t), listener_cleanup);
-  global_context_t *gc = global_context(h);
-  global_context_init(gc, opts, stats);
-  gc->listener_handler = h;
-  return h;
-}
-
-static void parse_options( int argc, char **argv, Options_t *opts )
-{
-    int c;
-    opterr = 0;
-
-    memset( opts, 0, sizeof(*opts) );
-    opts->recv_count = -1;
-    opts->timeout = -1;
-    addresses_init( &opts->subscriptions);
-
-    while ((c = getopt(argc, argv,
-                       "a:c:b:w:t:e:RW:F:VN:X:T:C:K:P:")) != -1) {
-        switch (c) {
-        case 'a':
-          {
-            // TODO: multiple addresses?
-            char *comma = strchr(optarg, ',');
-            check(comma == 0, "multiple addresses not implemented");
-            check(opts->subscriptions.count == 0, "multiple addresses not implemented");
-            addresses_merge( &opts->subscriptions, optarg );
-          }
-          break;
-        case 'c':
-            if (sscanf( optarg, "%" SCNu64, &opts->msg_count ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 't':
-            if (sscanf( optarg, "%d", &opts->timeout ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            if (opts->timeout > 0) opts->timeout *= 1000;
-            break;
-        case 'R': opts->reply = 1; break;
-        case 'V': enable_logging(); break;
-        case 'X': opts->ready_text = optarg; break;
-        default:
-            usage(1);
-        }
-    }
-
-    if (opts->subscriptions.count == 0) addresses_add( &opts->subscriptions,
-                                                       "amqp://~0.0.0.0" );
-}
-
-int main(int argc, char** argv)
-{
-  Options_t opts;
-  Statistics_t stats;
-  parse_options( argc, argv, &opts );
-  pn_reactor_t *reactor = pn_reactor();
-
-  // set up default handlers for our reactor
-  pn_handler_t *root = pn_reactor_get_handler(reactor);
-  pn_handler_t *lh = listener_handler(&opts, &stats);
-  pn_handler_add(root, lh);
-  pn_handshaker_t *handshaker = pn_handshaker();
-  pn_handler_add(root, handshaker);
-
-  // Omit decrefs else segfault.  Not sure why they are necessary
-  // to keep valgrind happy for the connection_handler, but not here.
-  // pn_decref(handshaker);
-  // pn_decref(lh);
-
-  pn_reactor_run(reactor);
-  pn_reactor_free(reactor);
-
-  addresses_free( &opts.subscriptions );
-  return 0;
-}
diff --git a/tests/tools/apps/c/reactor-send.c b/tests/tools/apps/c/reactor-send.c
deleted file mode 100644
index f8d0c50..0000000
--- a/tests/tools/apps/c/reactor-send.c
+++ /dev/null
@@ -1,416 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/*
- * Implements a subset of msgr-send.c using reactor events.
- */
-
-#include "proton/message.h"
-#include "proton/error.h"
-#include "proton/types.h"
-#include "proton/reactor.h"
-#include "proton/handlers.h"
-#include "proton/engine.h"
-#include "proton/url.h"
-#include "msgr-common.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-
-typedef struct {
-    Addresses_t targets;
-    uint64_t msg_count;
-    uint32_t msg_size;  // of body
-    uint32_t send_batch;
-    int   outgoing_window;
-    unsigned int report_interval;      // in seconds
-    //Addresses_t subscriptions;
-    //Addresses_t reply_tos;
-    int   get_replies;
-    int   unique_message;  // 1 -> create and free a pn_message_t for each send/recv
-    int   timeout;      // in seconds
-    int   incoming_window;
-    int   recv_count;
-    const char *name;
-    char *certificate;
-    char *privatekey;   // used to sign certificate
-    char *password;     // for private key file
-    char *ca_db;        // trusted CA database
-} Options_t;
-
-
-static void usage(int rc)
-{
-    printf("Usage: reactor-send [OPTIONS] \n"
-           " -a <addr> \tThe target address [amqp[s]://domain[/name]]\n"
-           " -c # \tNumber of messages to send before exiting [0=forever]\n"
-           " -b # \tSize of message body in bytes [1024]\n"
-           " -R \tWait for a reply to each sent message\n"
-           " -V \tEnable debug logging\n"
-           );
-    exit(rc);
-}
-
-
-typedef struct {
-  Options_t *opts;
-  Statistics_t *stats;
-  uint64_t sent;
-  uint64_t received;
-  pn_message_t *message;
-  pn_message_t *reply_message;
-  pn_atom_t id;
-  char *encoded_data;
-  size_t encoded_data_size;
-  pn_url_t *send_url;
-  pn_string_t *hostname;
-  pn_string_t *container_id;
-  pn_string_t *reply_to;
-} sender_context_t;
-
-void sender_context_init(sender_context_t *sc, Options_t *opts, Statistics_t *stats)
-{
-  sc->opts = opts;
-  sc->stats = stats;
-  sc->sent = 0;
-  sc->received = 0;
-  sc->id.type = PN_ULONG;
-  // 4096 extra bytes should easily cover the message metadata
-  sc->encoded_data_size = sc->opts->msg_size + 4096;
-  sc->encoded_data = (char *)calloc(1, sc->encoded_data_size);
-  check(sc->encoded_data, "failed to allocate encoding buffer");
-  sc->container_id = pn_string("reactor-send"); // prefer uuid-like name
-
-  sc->reply_message = (sc->opts->get_replies) ? pn_message() : 0;
-  sc->message = pn_message();
-  check(sc->message, "failed to allocate a message");
-  sc->reply_to = pn_string("amqp://");
-  pn_string_addf(sc->reply_to, "%s", pn_string_get(sc->container_id));
-  pn_message_set_reply_to(sc->message, pn_string_get(sc->reply_to));
-  pn_data_t *body = pn_message_body(sc->message);
-  // borrow the encoding buffer this one time
-  char *data = sc->encoded_data;
-  pn_data_put_binary(body, pn_bytes(sc->opts->msg_size, data));
-
-  check(sc->opts->targets.count > 0, "no specified address");
-  sc->send_url = pn_url_parse(sc->opts->targets.addresses[0]);
-  const char *host = pn_url_get_host(sc->send_url);
-  const char *port = pn_url_get_port(sc->send_url);
-  sc->hostname = pn_string(host);
-  if (port && strlen(port))
-    pn_string_addf(sc->hostname, ":%s", port);
-}
-
-sender_context_t *sender_context(pn_handler_t *h)
-{
-  return (sender_context_t *) pn_handler_mem(h);
-}
-
-void sender_cleanup(pn_handler_t *h)
-{
-  sender_context_t *sc = sender_context(h);
-  pn_message_free(sc->message);
-  pn_message_free(sc->reply_message);
-  pn_url_free(sc->send_url);
-  pn_free(sc->hostname);
-  pn_free(sc->container_id);
-  pn_free(sc->reply_to);
-  free(sc->encoded_data);
-}
-
-pn_handler_t *replyto_handler(sender_context_t *sc);
-
-pn_message_t* get_message(sender_context_t *sc, bool sending) {
-  if (sc->opts->unique_message) {
-    pn_message_t *m = pn_message();
-    check(m, "failed to allocate a message");
-    if (sending) {
-      pn_message_set_reply_to(m, pn_string_get(sc->reply_to));
-      // copy the data
-      pn_data_t *body = pn_message_body(m);
-      pn_data_t *template_body = pn_message_body(sc->message);
-      pn_data_put_binary(body, pn_data_get_binary(template_body));
-    }
-    return m;
-  }
-  else
-    return sending ? sc->message : sc->reply_message;  // our simplified "message pool"
-}
-
-void return_message(sender_context_t *sc, pn_message_t *m) {
-  if (sc->opts->unique_message)
-    pn_message_free(m);
-}
-
-void sender_dispatch(pn_handler_t *h, pn_event_t *event, pn_event_type_t type)
-{
-  sender_context_t *sc = sender_context(h);
-
-  switch (type) {
-  case PN_CONNECTION_INIT:
-    {
-      pn_connection_t *conn = pn_event_connection(event);
-      pn_connection_set_container(conn, pn_string_get(sc->container_id));
-      pn_connection_set_hostname(conn, pn_string_get(sc->hostname));
-      pn_connection_open(conn);
-      pn_session_t *ssn = pn_session(conn);
-      pn_session_open(ssn);
-      pn_link_t *snd = pn_sender(ssn, "sender");
-      const char *path = pn_url_get_path(sc->send_url);
-      if (path && strlen(path)) {
-        pn_terminus_set_address(pn_link_target(snd), path);
-        pn_terminus_set_address(pn_link_source(snd), path);
-      }
-      pn_link_open(snd);
-    }
-    break;
-  case PN_LINK_FLOW:
-    {
-      pn_link_t *snd = pn_event_link(event);
-      while (pn_link_credit(snd) > 0 && sc->sent < sc->opts->msg_count) {
-        if (sc->sent == 0)
-          statistics_start(sc->stats);
-
-        char tag[8];
-        void *ptr = &tag;
-        *((uint64_t *) ptr) = sc->sent;
-        pn_delivery_t *dlv = pn_delivery(snd, pn_dtag(tag, 8));
-
-        // setup the message to send
-        pn_message_t *msg = get_message(sc, true);;
-        pn_message_set_address(msg, sc->opts->targets.addresses[0]);
-        sc->id.u.as_ulong = sc->sent;
-        pn_message_set_correlation_id(msg, sc->id);
-        pn_message_set_creation_time(msg, msgr_now());
-
-        size_t size = sc->encoded_data_size;
-        int err = pn_message_encode(msg, sc->encoded_data, &size);
-        check(err == 0, "message encoding error");
-        pn_link_send(snd, sc->encoded_data, size);
-        pn_delivery_settle(dlv);
-        sc->sent++;
-        return_message(sc, msg);
-      }
-      if (sc->sent == sc->opts->msg_count && !sc->opts->get_replies) {
-        pn_link_close(snd);
-        pn_connection_t *conn = pn_event_connection(event);
-        pn_connection_close(conn);
-      }
-    }
-    break;
-  case PN_LINK_INIT:
-    {
-      pn_link_t *link = pn_event_link(event);
-      if (pn_link_is_receiver(link)) {
-        // Response messages link.  Could manage credit and deliveries in this handler but
-        // a dedicated handler also works.
-        pn_handler_t *replyto = replyto_handler(sc);
-        pn_flowcontroller_t *fc = pn_flowcontroller(1024);
-        pn_handler_add(replyto, fc);
-        pn_decref(fc);
-        pn_handshaker_t *handshaker = pn_handshaker();
-        pn_handler_add(replyto, handshaker);
-        pn_decref(handshaker);
-        pn_record_t *record = pn_link_attachments(link);
-        pn_record_set_handler(record, replyto);
-        pn_decref(replyto);
-      }
-    }
-    break;
-  case PN_CONNECTION_LOCAL_CLOSE:
-    {
-      statistics_report(sc->stats, sc->sent, sc->received);
-    }
-    break;
-  default:
-    break;
-  }
-}
-
-pn_handler_t *sender_handler(Options_t *opts, Statistics_t *stats)
-{
-  pn_handler_t *h = pn_handler_new(sender_dispatch, sizeof(sender_context_t), sender_cleanup);
-  sender_context_t *sc = sender_context(h);
-  sender_context_init(sc, opts, stats);
-  return h;
-}
-
-sender_context_t *replyto_sender_context(pn_handler_t *h)
-{
-  sender_context_t **p = (sender_context_t **) pn_handler_mem(h);
-  return *p;
-}
-
-void replyto_cleanup(pn_handler_t *h)
-{}
-
-void replyto_dispatch(pn_handler_t *h, pn_event_t *event, pn_event_type_t type) {
-  sender_context_t *sc = replyto_sender_context(h);
-
-  switch (type) {
-  case PN_DELIVERY:
-    {
-      check(sc->opts->get_replies, "Unexpected reply message");
-      pn_link_t *recv_link = pn_event_link(event);
-      pn_delivery_t *dlv = pn_event_delivery(event);
-      if (pn_link_is_receiver(recv_link) && !pn_delivery_partial(dlv)) {
-        size_t encoded_size = pn_delivery_pending(dlv);
-        check(encoded_size <= sc->encoded_data_size, "decoding buffer too small");
-        ssize_t n = pn_link_recv(recv_link, sc->encoded_data, encoded_size);
-        check(n == (ssize_t)encoded_size, "read fail on reply link");
-        pn_message_t *msg = get_message(sc, false);
-        int err = pn_message_decode(msg, sc->encoded_data, n);
-        check(err == 0, "message decode error");
-        statistics_msg_received(sc->stats, msg);
-        sc->received++;
-        pn_delivery_settle(dlv);
-        return_message(sc, msg);
-      }
-      if (sc->received == sc->opts->msg_count) {
-        pn_link_close(recv_link);
-        pn_connection_t *conn = pn_event_connection(event);
-        pn_connection_close(conn);
-      }
-    }
-    break;
-  default:
-    break;
-  }
-}
-
-pn_handler_t *replyto_handler(sender_context_t *sc)
-{
-  pn_handler_t *h = pn_handler_new(replyto_dispatch, sizeof(sender_context_t *), replyto_cleanup);
-  sender_context_t **p = (sender_context_t **) pn_handler_mem(h);
-  *p = sc;
-  return h;
-}
-
-static void parse_options( int argc, char **argv, Options_t *opts )
-{
-    int c;
-    opterr = 0;
-
-    memset( opts, 0, sizeof(*opts) );
-    opts->msg_size  = 1024;
-    opts->send_batch = 1024;
-    opts->timeout = -1;
-    opts->recv_count = -1;
-    opts->unique_message = 0;
-    addresses_init(&opts->targets);
-
-    while ((c = getopt(argc, argv,
-                       "ua:c:b:p:w:e:l:Rt:W:B:VN:T:C:K:P:")) != -1) {
-        switch(c) {
-        case 'a':
-          {
-            // TODO: multiple addresses?  To keep tests happy, accept multiple for now,
-            // but ignore all but the first.
-            addresses_merge( &opts->targets, optarg );
-          }
-          break;
-        case 'c':
-            if (sscanf( optarg, "%" SCNu64, &opts->msg_count ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 'b':
-            if (sscanf( optarg, "%u", &opts->msg_size ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 'p':
-            if (sscanf( optarg, "%u", &opts->send_batch ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 'w':
-            if (sscanf( optarg, "%d", &opts->outgoing_window ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 'e':
-            if (sscanf( optarg, "%u", &opts->report_interval ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 'R': opts->get_replies = 1; break;
-        case 'u': opts->unique_message = 1; break;
-        case 't':
-            if (sscanf( optarg, "%d", &opts->timeout ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            if (opts->timeout > 0) opts->timeout *= 1000;
-            break;
-        case 'W':
-            if (sscanf( optarg, "%d", &opts->incoming_window ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 'B':
-            if (sscanf( optarg, "%d", &opts->recv_count ) != 1) {
-                fprintf(stderr, "Option -%c requires an integer argument.\n", optopt);
-                usage(1);
-            }
-            break;
-        case 'V': enable_logging(); break;
-        case 'N': opts->name = optarg; break;
-        case 'T': opts->ca_db = optarg; break;
-        case 'C': opts->certificate = optarg; break;
-        case 'K': opts->privatekey = optarg; break;
-        case 'P': parse_password( optarg, &opts->password ); break;
-
-        default:
-            usage(1);
-        }
-    }
-
-    // default target if none specified
-    if (opts->targets.count == 0) addresses_add( &opts->targets, "amqp://0.0.0.0" );
-}
-
-
-int main(int argc, char** argv)
-{
-  Options_t opts;
-  Statistics_t stats;
-  parse_options( argc, argv, &opts );
-
-  pn_reactor_t *reactor = pn_reactor();
-  pn_handler_t *sh = sender_handler(&opts, &stats);
-  pn_handler_add(sh, pn_handshaker());
-  pn_reactor_connection(reactor, sh);
-  pn_reactor_run(reactor);
-  pn_reactor_free(reactor);
-
-  pn_handler_free(sh);
-  addresses_free(&opts.targets);
-  return 0;
-}
diff --git a/tests/tools/apps/cpp/CMakeLists.txt b/tests/tools/apps/cpp/CMakeLists.txt
deleted file mode 100644
index 2bc1bc5..0000000
--- a/tests/tools/apps/cpp/CMakeLists.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-include_directories("${CMAKE_SOURCE_DIR}/examples/cpp" "${CMAKE_SOURCE_DIR}/examples/cpp/lib")
-add_executable(reactor_send_cpp reactor_send.cpp)
-
-target_link_libraries(reactor_send_cpp qpid-proton qpid-proton-cpp)
-
-if (CMAKE_SYSTEM_NAME STREQUAL Windows)
-  # No change needed for windows already use correct separator
-  function(to_native_path path result)
-    file (TO_NATIVE_PATH "${path}" path)
-    set (${result} ${path} PARENT_SCOPE)
-  endfunction()
-else (CMAKE_SYSTEM_NAME STREQUAL Windows)
-  # Just change ';'->':'
-  function(to_native_path path result)
-    file (TO_NATIVE_PATH "${path}" path)
-    string (REGEX REPLACE ";" ":" path "${path}")
-    set (${result} ${path} PARENT_SCOPE)
-  endfunction()
-endif (CMAKE_SYSTEM_NAME STREQUAL Windows)
-
-set (py_bld "$<TARGET_FILE_DIR:qpid-proton>" "$<TARGET_FILE_DIR:qpid-proton-cpp>") # For windows
-set (app_path $<TARGET_FILE_DIR:reactor-recv> $<TARGET_FILE_DIR:reactor_send_cpp>)
-set (py_path ${py_bld} ${app_path} $ENV{PATH})
-to_native_path("${py_path}" py_path)
-set (py_pythonpath "${CMAKE_SOURCE_DIR}/examples/cpp" $ENV{PYTHONPATH})
-to_native_path ("${py_pythonpath}" py_pythonpath)
-set (perf_pythonpath "${py_pythonpath}" "${CMAKE_SOURCE_DIR}/examples/cpp")
-to_native_path ("${perf_pythonpath}" perf_pythonpath)
-
-add_custom_target(quick_perf_cpp ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/proton-c/env.py --
-                  "PATH=${py_path}" "PYTHONPATH=${perf_pythonpath}"
-                  ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/tests/perf/quick_perf.py" "CPP")
-
-add_dependencies(quick_perf_cpp reactor_send_cpp reactor-recv qpid-proton-cpp)
diff --git a/tests/tools/apps/cpp/reactor_send.cpp b/tests/tools/apps/cpp/reactor_send.cpp
deleted file mode 100644
index 7841a5e..0000000
--- a/tests/tools/apps/cpp/reactor_send.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include "options.hpp"
-
-#include "proton/binary.hpp"
-#include "proton/codec/decoder.hpp"
-#include "proton/connection.hpp"
-#include "proton/container.hpp"
-#include "proton/default_container.hpp"
-#include "proton/delivery.hpp"
-#include "proton/message.hpp"
-#include "proton/message_id.hpp"
-#include "proton/messaging_handler.hpp"
-#include "proton/receiver_options.hpp"
-#include "proton/sender.hpp"
-#include "proton/thread_safe.hpp"
-#include "proton/tracker.hpp"
-#include "proton/value.hpp"
-
-#include <iostream>
-#include <map>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-class reactor_send : public proton::messaging_handler {
-  private:
-    std::string url_;
-    proton::message message_;
-    std::string reply_to_;
-    int sent_;
-    int confirmed_;
-    int total_;
-    int received_;
-    size_t received_bytes_;
-    proton::binary received_content_;
-    bool replying_;
-    proton::message_id id_value_;
-  public:
-
-    reactor_send(const std::string &url, int c, int size, bool replying)
-        : url_(url), sent_(0), confirmed_(0), total_(c),
-          received_(0), received_bytes_(0), replying_(replying) {
-        if (replying_)
-            message_.reply_to("localhost/test");
-        proton::binary content;
-        content.assign((size_t) size, 'X');
-        message_.body(content);
-    }
-
-    void on_container_start(proton::container &c) PN_CPP_OVERRIDE {
-        c.receiver_options(proton::receiver_options().credit_window(1024));
-        c.open_sender(url_);
-    }
-
-    void on_sendable(proton::sender &sender) PN_CPP_OVERRIDE {
-        while (sender.credit() && sent_ < total_) {
-            id_value_ = sent_ + 1;
-            message_.correlation_id(id_value_);
-            message_.creation_time(proton::timestamp::now());
-            sender.send(message_);
-            sent_++;
-        }
-    }
-
-    void on_tracker_accept(proton::tracker &t) PN_CPP_OVERRIDE {
-        confirmed_++;
-        t.settle();
-        if (confirmed_ == total_) {
-            std::cout << "all messages confirmed" << std::endl;
-            if (!replying_)
-                t.connection().close();
-        }
-    }
-
-    void on_message(proton::delivery &d, proton::message &msg) PN_CPP_OVERRIDE {
-        received_content_ = proton::get<proton::binary>(msg.body());
-        received_bytes_ += received_content_.size();
-        if (received_ < total_) {
-            received_++;
-        }
-        d.settle();
-        if (received_ == total_) {
-            d.receiver().close();
-            d.connection().close();
-        }
-    }
-
-    void on_transport_close(proton::transport &) PN_CPP_OVERRIDE {
-        sent_ = confirmed_;
-    }
-};
-
-int main(int argc, char **argv) {
-    // Command line options
-    std::string address("127.0.0.1:5672/cpp_tests");
-    int message_count = 10;
-    int message_size = 100;
-    bool replying = false;
-    example::options opts(argc, argv);
-    opts.add_value(address, 'a', "address", "connect and send to URL", "URL");
-    opts.add_value(message_count, 'c', "messages", "send COUNT messages", "COUNT");
-    opts.add_value(message_size, 'b', "bytes", "send binary messages BYTES long", "BYTES");
-    opts.add_value(replying, 'R', "replying", "process reply messages", "REPLYING");
-    try {
-        opts.parse();
-        reactor_send send(address, message_count, message_size, replying);
-        proton::default_container(send).run();
-        return 0;
-    } catch (const example::bad_option& e) {
-        std::cout << opts << std::endl << e.what() << std::endl;
-    } catch (const std::exception& e) {
-        std::cerr << e.what() << std::endl;
-    }
-    return 1;
-}
diff --git a/tests/tools/apps/python/msgr-recv.py b/tests/tools/apps/python/msgr-recv.py
deleted file mode 100755
index 757b19c..0000000
--- a/tests/tools/apps/python/msgr-recv.py
+++ /dev/null
@@ -1,206 +0,0 @@
-#!/usr/bin/env python
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-from __future__ import print_function
-import sys, optparse, time
-import logging
-from proton import *
-
-# Hi python3!
-try:
-    long()
-except:
-    long = int
-
-
-usage = """
-Usage: msgr-recv [OPTIONS]
- -a <addr>[,<addr>]* \tAddresses to listen on [amqp://~0.0.0.0]
- -c # \tNumber of messages to receive before exiting [0=forever]
- -b # \tArgument to Messenger::recv(n) [2048]
- -w # \tSize for incoming window [0]
- -t # \tInactivity timeout in seconds, -1 = no timeout [-1]
- -e # \t# seconds to report statistics, 0 = end of test [0] *TBD*
- -R \tSend reply if 'reply-to' present
- -W # \t# outgoing window size [0]
- -F <addr>[,<addr>]* \tAddresses used for forwarding received messages
- -N <name> \tSet the container name to <name>
- -X <text> \tPrint '<text>\\n' to stdout after all subscriptions are created
- -V \tEnable debug logging"""
-
-
-def parse_options( argv ):
-    parser = optparse.OptionParser(usage=usage)
-    parser.add_option("-a", dest="subscriptions", action="append", type="string")
-    parser.add_option("-c", dest="msg_count", type="int", default=0)
-    parser.add_option("-b", dest="recv_count", type="int", default=-1)
-    parser.add_option("-w", dest="incoming_window", type="int")
-    parser.add_option("-t", dest="timeout", type="int", default=-1)
-    parser.add_option("-e", dest="report_interval", type="int", default=0)
-    parser.add_option("-R", dest="reply", action="store_true")
-    parser.add_option("-W", dest="outgoing_window", type="int")
-    parser.add_option("-F", dest="forwarding_targets", action="append", type="string")
-    parser.add_option("-N", dest="name", type="string")
-    parser.add_option("-X", dest="ready_text", type="string")
-    parser.add_option("-V", dest="verbose", action="store_true")
-
-    return parser.parse_args(args=argv)
-
-
-class Statistics(object):
-    def __init__(self):
-        self.start_time = 0.0
-        self.latency_samples = 0
-        self.latency_total = 0.0
-        self.latency_min = None
-        self.latency_max = None
-
-    def start(self):
-        self.start_time = time.time()
-
-    def msg_received(self, msg):
-        ts = msg.creation_time
-        if ts:
-            l = long(time.time() * 1000) - ts
-            if l > 0.0:
-                self.latency_total += l
-                self.latency_samples += 1
-                if self.latency_samples == 1:
-                    self.latency_min = self.latency_max = l
-                else:
-                    if self.latency_min > l:
-                        self.latency_min = l
-                    if self.latency_max < l:
-                        self.latency_max = l
-
-    def report(self, sent, received):
-        secs = time.time() - self.start_time
-        print("Messages sent: %d recv: %d" % (sent, received) )
-        print("Total time: %f sec" % secs )
-        if secs:
-            print("Throughput: %f msgs/sec" % (sent/secs) )
-        if self.latency_samples:
-            print("Latency (sec): %f min %f max %f avg" % (self.latency_min/1000.0,
-                                                           self.latency_max/1000.0,
-                                                           (self.latency_total/self.latency_samples)/1000.0))
-
-
-def main(argv=None):
-    opts = parse_options(argv)[0]
-    if opts.subscriptions is None:
-        opts.subscriptions = ["amqp://~0.0.0.0"]
-    stats = Statistics()
-    sent = 0
-    received = 0
-    forwarding_index = 0
-
-    log = logging.getLogger("msgr-recv")
-    log.addHandler(logging.StreamHandler())
-    if opts.verbose:
-        log.setLevel(logging.DEBUG)
-    else:
-        log.setLevel(logging.INFO)
-
-    message = Message()
-    messenger = Messenger( opts.name )
-
-    if opts.incoming_window is not None:
-        messenger.incoming_window = opts.incoming_window
-    if opts.timeout > 0:
-        opts.timeout *= 1000
-    messenger.timeout = opts.timeout
-
-    messenger.start()
-
-    # unpack addresses that were specified using comma-separated list
-
-    for x in opts.subscriptions:
-        z = x.split(",")
-        for y in z:
-            if y:
-                log.debug("Subscribing to %s", y)
-                messenger.subscribe(y)
-
-    forwarding_targets = []
-    if opts.forwarding_targets:
-        for x in opts.forwarding_targets:
-            z = x.split(",")
-            for y in z:
-                if y:
-                    forwarding_targets.append(y)
-
-    # hack to let test scripts know when the receivers are ready (so that the
-    # senders may be started)
-    if opts.ready_text:
-        print("%s" % opts.ready_text)
-        sys.stdout.flush()
-
-    while opts.msg_count == 0 or received < opts.msg_count:
-
-        log.debug("Calling pn_messenger_recv(%d)", opts.recv_count)
-        rc = messenger.recv(opts.recv_count)
-
-        # start the timer only after receiving the first msg
-        if received == 0:
-            stats.start()
-
-        log.debug("Messages on incoming queue: %d", messenger.incoming)
-        while messenger.incoming > 0:
-            messenger.get(message)
-            received += 1
-            # TODO: header decoding?
-            # uint64_t id = pn_message_get_correlation_id( message ).u.as_ulong;
-            stats.msg_received( message )
-
-            if opts.reply:
-                if message.reply_to:
-                    log.debug("Replying to: %s", message.reply_to )
-                    message.address = message.reply_to
-                    message.creation_time = long(time.time() * 1000)
-                    messenger.put( message )
-                    sent += 1
-
-            if forwarding_targets:
-                forward_addr = forwarding_targets[forwarding_index]
-                forwarding_index += 1
-                if forwarding_index == len(forwarding_targets):
-                    forwarding_index = 0
-                log.debug("Forwarding to: %s", forward_addr )
-                message.address = forward_addr
-                message.reply_to = None
-                message.creation_time = long(time.time() * 1000)
-                messenger.put( message )
-                sent += 1
-
-        log.debug("Messages received=%lu sent=%lu", received, sent)
-
-    # this will flush any pending sends
-    if messenger.outgoing > 0:
-        log.debug("Calling pn_messenger_send()")
-        messenger.send()
-
-    messenger.stop()
-
-    stats.report( sent, received )
-    return 0
-
-
-if __name__ == "__main__":
-  sys.exit(main())
diff --git a/tests/tools/apps/python/msgr-send.py b/tests/tools/apps/python/msgr-send.py
deleted file mode 100755
index 2e2583f..0000000
--- a/tests/tools/apps/python/msgr-send.py
+++ /dev/null
@@ -1,205 +0,0 @@
-#!/usr/bin/env python
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-from __future__ import print_function
-import sys, optparse, time
-import logging
-from proton import *
-
-# Hi python3!
-try:
-    long()
-except:
-    long = int
-
-
-usage = """
-Usage: msgr-send [OPTIONS]
- -a <addr>[,<addr>]* \tThe target address [amqp[s]://domain[/name]]
- -c # \tNumber of messages to send before exiting [0=forever]
- -b # \tSize of message body in bytes [1024]
- -p # \tSend batches of # messages (wait for replies before sending next batch if -R) [1024]
- -w # \t# outgoing window size [0]
- -e # \t# seconds to report statistics, 0 = end of test [0]
- -R \tWait for a reply to each sent message
- -t # \tInactivity timeout in seconds, -1 = no timeout [-1]
- -W # \tIncoming window size [0]
- -B # \tArgument to Messenger::recv(n) [-1]
- -N <name> \tSet the container name to <name>
- -V \tEnable debug logging"""
-
-
-def parse_options( argv ):
-    parser = optparse.OptionParser(usage=usage)
-    parser.add_option("-a", dest="targets", action="append", type="string")
-    parser.add_option("-c", dest="msg_count", type="int", default=0)
-    parser.add_option("-b", dest="msg_size", type="int", default=1024)
-    parser.add_option("-p", dest="send_batch", type="int", default=1024)
-    parser.add_option("-w", dest="outgoing_window", type="int")
-    parser.add_option("-e", dest="report_interval", type="int", default=0)
-    parser.add_option("-R", dest="get_replies", action="store_true")
-    parser.add_option("-t", dest="timeout", type="int", default=-1)
-    parser.add_option("-W", dest="incoming_window", type="int")
-    parser.add_option("-B", dest="recv_count", type="int", default=-1)
-    parser.add_option("-N", dest="name", type="string")
-    parser.add_option("-V", dest="verbose", action="store_true")
-
-    return parser.parse_args(args=argv)
-
-
-class Statistics(object):
-    def __init__(self):
-        self.start_time = 0.0
-        self.latency_samples = 0
-        self.latency_total = 0.0
-        self.latency_min = None
-        self.latency_max = None
-
-    def start(self):
-        self.start_time = time.time()
-
-    def msg_received(self, msg):
-        ts = msg.creation_time
-        if ts:
-            l = long(time.time() * 1000) - ts
-            if l > 0.0:
-                self.latency_total += l
-                self.latency_samples += 1
-                if self.latency_samples == 1:
-                    self.latency_min = self.latency_max = l
-                else:
-                    if self.latency_min > l:
-                        self.latency_min = l
-                    if self.latency_max < l:
-                        self.latency_max = l
-
-    def report(self, sent, received):
-        secs = time.time() - self.start_time
-        print("Messages sent: %d recv: %d" % (sent, received) )
-        print("Total time: %f sec" % secs )
-        if secs:
-            print("Throughput: %f msgs/sec" % (sent/secs) )
-        if self.latency_samples:
-            print("Latency (sec): %f min %f max %f avg" % (self.latency_min/1000.0,
-                                                           self.latency_max/1000.0,
-                                                           (self.latency_total/self.latency_samples)/1000.0))
-
-
-
-def process_replies( messenger, message, stats, max_count, log):
-    """
-    Return the # of reply messages received
-    """
-    received = 0
-    log.debug("Calling pn_messenger_recv(%d)", max_count)
-    messenger.recv( max_count )
-    log.debug("Messages on incoming queue: %d", messenger.incoming)
-    while messenger.incoming > 0:
-        messenger.get( message )
-        received += 1
-        # TODO: header decoding?
-        stats.msg_received( message )
-        # uint64_t id = pn_message_get_correlation_id( message ).u.as_ulong;
-    return received
-
-def main(argv=None):
-    opts = parse_options(argv)[0]
-    if opts.targets is None:
-        opts.targets = ["amqp://0.0.0.0"]
-    stats = Statistics()
-    sent = 0
-    received = 0
-    target_index = 0
-
-    log = logging.getLogger("msgr-send")
-    log.addHandler(logging.StreamHandler())
-    if opts.verbose:
-        log.setLevel(logging.DEBUG)
-    else:
-        log.setLevel(logging.INFO)
-
-
-    message = Message()
-    message.reply_to = "~"
-    message.body = "X" * opts.msg_size
-    reply_message = Message()
-    messenger = Messenger( opts.name )
-
-    if opts.outgoing_window is not None:
-        messenger.outgoing_window = opts.outgoing_window
-    if opts.timeout > 0:
-        opts.timeout *= 1000
-    messenger.timeout = opts.timeout
-
-    messenger.start()
-
-    # unpack targets that were specified using comma-separated list
-    #
-    targets = []
-    for x in opts.targets:
-        z = x.split(",")
-        for y in z:
-            if y:
-                targets.append(y)
-
-    stats.start()
-    while opts.msg_count == 0 or sent < opts.msg_count:
-        # send a message
-        message.address = targets[target_index]
-        if target_index == len(targets) - 1:
-            target_index = 0
-        else:
-            target_index += 1
-        message.correlation_id = sent
-        message.creation_time = long(time.time() * 1000)
-        messenger.put( message )
-        sent += 1
-
-        if opts.send_batch and (messenger.outgoing >= opts.send_batch):
-            if opts.get_replies:
-                while received < sent:
-                    # this will also transmit any pending sent messages
-                    received += process_replies( messenger, reply_message,
-                                                 stats, opts.recv_count, log )
-            else:
-                log.debug("Calling pn_messenger_send()")
-                messenger.send()
-
-    log.debug("Messages received=%d sent=%d", received, sent)
-
-    if opts.get_replies:
-        # wait for the last of the replies
-        while received < sent:
-            count = process_replies( messenger, reply_message, stats,
-                                     opts.recv_count, log )
-            received += count
-            log.debug("Messages received=%d sent=%d", received, sent)
-
-    elif messenger.outgoing > 0:
-        log.debug("Calling pn_messenger_send()")
-        messenger.send()
-
-    messenger.stop()
-
-    stats.report( sent, received )
-    return 0
-
-if __name__ == "__main__":
-    sys.exit(main())
diff --git a/tests/tools/apps/python/reactor-send.py b/tests/tools/apps/python/reactor-send.py
deleted file mode 100644
index 163015b..0000000
--- a/tests/tools/apps/python/reactor-send.py
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-from __future__ import print_function
-import optparse
-from proton import Message
-from proton.handlers import MessagingHandler
-from proton.reactor import Container
-
-class Send(MessagingHandler):
-    def __init__(self, url, messages, size, replying):
-        super(Send, self).__init__(prefetch=1024)
-        self.url = url
-        self.sent = 0
-        self.confirmed = 0
-        self.received = 0
-        self.received_bytes = 0
-        self.total = messages
-        self.message_size = size;
-        self.replying = replying;
-        self.message = Message(body="X" * self.message_size)
-        if replying:
-            self.message.reply_to = "localhost/test"
-
-    def on_start(self, event):
-        event.container.sasl_enabled = False
-        event.container.create_sender(self.url)
-
-    def on_sendable(self, event):
-        while event.sender.credit and self.sent < self.total:
-            self.message.correlation_id = self.sent + 1
-            event.sender.send(self.message)
-            self.sent += 1
-
-    def on_accepted(self, event):
-        self.confirmed += 1
-        if self.confirmed == self.total:
-            print("all messages confirmed")
-            if not self.replying:
-                event.connection.close()
-
-    def on_message(self, event):
-        msg = event.message;
-        if self.received < self.total:
-            self.received += 1
-            self.received_bytes += len(msg.body)
-        if self.received == self.total:
-            event.receiver.close()
-            event.connection.close()
-
-    def on_disconnected(self, event):
-        self.sent = self.confirmed
-
-parser = optparse.OptionParser(usage="usage: %prog [options]",
-                               description="Send messages to the supplied address.")
-parser.add_option("-a", "--address", default="localhost:5672/examples",
-                  help="address to which messages are sent (default %default)")
-parser.add_option("-c", "--messages", type="int", default=100,
-                  help="number of messages to send (default %default)")
-parser.add_option("-b", "--bytes", type="int", default=100,
-                  help="size of each message body in bytes (default %default)")
-parser.add_option("-R", action="store_true", dest="replying", help="process reply messages")
-
-opts, args = parser.parse_args()
-
-try:
-    Container(Send(opts.address, opts.messages, opts.bytes, opts.replying)).run()
-except KeyboardInterrupt: pass
diff --git a/tests/tools/soak-check b/tests/tools/soak-check
deleted file mode 100755
index bf5b147..0000000
--- a/tests/tools/soak-check
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-from __future__ import print_function
-import sys, optparse
-from subprocess import Popen,PIPE
-
-def run_test(cmd):
-    try:
-        process = Popen(cmd)
-    except OSError:
-        assert False, "Unable to execute command '%s', is it in your PATH?" % cmd[0]
-    return process.wait()
-
-
-def main(argv=None):
-    """
-    Run a subset of the Proton tests for an extended period of time.
-    """
-
-    # tests is a list of test configurations.  Each configuration is
-    # represented as a two-element tuple.  Tuple[0] is the pattern passed to
-    # proton-test that identifies the test case.  Tuple[1] is a list of maps.
-    # Each map contains the parameters for one test.  A test (of 'pattern') is
-    # executed for each map in Tuple[1]
-
-    parser = optparse.OptionParser()
-    parser.add_option("-i", "--iterations", action="store", type="int", default=1,
-                      help="# of times to repeat each test.")
-    parser.add_option("-v", "--verbose", action="store_true",
-                      help="print extra detail to stdout")
-    opts, extra = parser.parse_args(args=argv)
-
-    iterations = opts.iterations
-    verbose = opts.verbose
-
-    tests = [
-
-        ("proton_tests.soak.MessengerTests.test_oneway_*",
-         # 104,297 * 7 = 730,079 msgs transferred per iteration
-         [{ "iterations": iterations,
-            "send_count": 104297,
-            "target_count": 7 }]),
-
-        ("proton_tests.soak.MessengerTests.test_echo_*",
-         # 102,811 * 5 * 2 (send+reply) = 1,028,110 msgs transferred per iteration
-         [{"iterations": iterations,
-           "send_count": 102811,
-           "target_count": 5,
-           "send_batch": 3187}]),
-
-        ("proton_tests.soak.MessengerTests.test_relay_*",
-         # 102,197 * 4 * 3 (send+reply+forward)= 1,226,364 msgs transferred per iteration
-         [{"iterations": iterations,
-           "send_count": 102197,
-           "target_count": 4,
-           "send_batch": 829,
-           "forward_count": 7}]),
-
-        ("proton_tests.soak.MessengerTests.test_star_topology_*",
-         # 2 ports * 3 senders = 6 connections per iteration
-         # 6 connections * 7 targets = 42 links per iteration
-         # 42 links * 35419 msg * 2 (send/reply) = 2,975,196 msgs per iteration
-         [{"iterations": iterations,
-           "port_count": 2,
-           "sender_count": 3,
-           "target_count": 7,
-           "send_count": 35419,
-           "send_batch": 311}]),
-
-        #
-        # Scale up the number of connections and links
-        #
-
-        ("proton_tests.soak.MessengerTests.test_star_topology_C",
-         # 10 ports * 10 senders = 100 connections per iteration
-         # 100 connections * 11 targets = 1100 links per iteration
-         # 1100 links * 311 msg * 2 (send/reply) = 684,200 msgs per iteration
-         [{"iterations": iterations,
-           "port_count": 10,
-           "sender_count": 10,
-           "target_count": 11,
-           "send_count": 311,
-           "send_batch": 3}]),
-
-        ("proton_tests.soak.MessengerTests.test_star_topology_C_SSL",
-         # 10 ports * 10 senders = 100 connections per iteration
-         # 100 connections * 11 targets = 1100 links per iteration
-         # 1100 links * 30 msg * 2 (send/reply) = 66000 msgs per iteration
-         [{"iterations": iterations,
-           "port_count": 10,
-           "sender_count": 10,
-           "target_count": 11,
-           "send_count": 30,
-           "send_batch": 3}])
-        ]
-
-    for test in tests:
-        pattern = test[0]
-        param_list = test[1]
-        for test_params in param_list:
-            command = ["proton-test"]
-            for (k, v) in test_params.iteritems():
-                command.append( "-D%s=%s" % (k,v) )
-            if verbose:
-                command.append( "-Dverbose" )
-            command.append( pattern )
-            if verbose:
-                print("command='%s'" % str(command))
-            run_test(command)
-    return 0
-
-
-if __name__ == "__main__":
-    sys.exit(main())
diff --git a/tools/check_abi/README.md b/tools/check_abi/README.md
deleted file mode 100644
index d9865c3..0000000
--- a/tools/check_abi/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-This is a tool for looking at the ELF symbols exported by a C/C++ shared library.
-
-Currently it has some rough edges, but it will take a file of expected symbols and
-tell you the difference from what is ewxpected.
-
-Currently you also need to compile the C++ programs in the same directory to support the script
-
-Besides the compiled programs in this directory it also relies on GNU nm to extract the symbols
-and some standard POSIX utilities for text manipulation.
\ No newline at end of file
diff --git a/tools/check_abi/check-abi b/tools/check_abi/check-abi
deleted file mode 100755
index 72f5f97..0000000
--- a/tools/check_abi/check-abi
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/env bash
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-MKTEMP="mktemp /tmp/tmp.XXXXXXXXXX"
-
-rc=0
-syms_desired=$($MKTEMP)
-syms_library=$($MKTEMP)
-syms_missing=$($MKTEMP)
-syms_extra=$($MKTEMP)
-
-trap 'rm $syms_desired $syms_library $syms_missing $syms_extra' EXIT
-
-if [[ $# -lt 2 ]] ; then
-  echo "Usage:"
-  echo "check_abi object_file expected_symbols_file"
-  exit 1;
-fi
-
-LC_ALL=C
-export LC_ALL
-
-# Extract exported symbols from library
-nm -DC --defined-only -f s $1 | cut -f1 -d'|' -s | sed -e "$(./cppabi)" -e "s/ *$//" | sort -u > $syms_library
-
-# Process API syms (substitute in some typedefs etc.)
-sed -e "
-    $(./expand_types)
-    /^\$/d
-    /^#.*\$/d
-" $2 | sort -u > $syms_desired
-
-comm -23 $syms_desired $syms_library > $syms_missing
-comm -13 $syms_desired $syms_library > $syms_extra
-
-if [[ -n "$(cat $syms_missing)" ]] ; then
-  (echo "Not exported from library (should be)"
-   echo "====================================="
-   cat $syms_missing ) 1>&2
-   rc=1
-fi
-
-
-if [[ -n "$(cat $syms_extra)" ]]; then
-  (echo "Exported by library but not in spec"
-   echo "==================================="
-   cat $syms_extra ) 1>&2
-fi
-
-exit $rc
diff --git a/tools/check_abi/cppabi.cpp b/tools/check_abi/cppabi.cpp
deleted file mode 100644
index 5767d60..0000000
--- a/tools/check_abi/cppabi.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include <cxxabi.h>
-
-#include <iostream>
-
-int main() {
-#if _GLIBCXX_USE_CXX11_ABI
-  std::cout << "s/\\[abi:cxx11\\]//";
-  return 0;
-#else
-  return 1;
-#endif
-}
diff --git a/tools/check_abi/expand_types.cpp b/tools/check_abi/expand_types.cpp
deleted file mode 100644
index 220548b..0000000
--- a/tools/check_abi/expand_types.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include <stdint.h>
-#include <stdlib.h>
-#include <cxxabi.h>
-#include <iostream>
-#include <string>
-#include <vector>
-#include <typeinfo>
-
-void print_type(const char* type, const char* mangled_type)
-{
-  int status;
-  char* demangled_type =
-    abi::__cxa_demangle(mangled_type, 0, 0, &status);
-  if (demangled_type) {
-    std::cout << "s/" << type << "/" << demangled_type << "/g\n";
-  } 
-  ::free(demangled_type);
-}
-
-#define mangle_name(x) typeid(x).name()
-
-#define print_subst(x) print_type(#x, mangle_name(x))
-
-int main() {
-  print_subst(uint64_t);
-  print_subst(uint32_t);
-  print_subst(uint16_t);
-  print_subst(uint8_t);
-  print_subst(size_t);
-  print_subst(int64_t);
-  print_subst(int32_t);
-  print_subst(int16_t);
-  print_subst(int8_t);
-  print_subst(std::string);
-  print_subst(std::vector<char>);
-}
diff --git a/tools/cmake/Modules/FindEmscripten.cmake b/tools/cmake/Modules/FindEmscripten.cmake
deleted file mode 100644
index 7289731..0000000
--- a/tools/cmake/Modules/FindEmscripten.cmake
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# FindEmscripten
-# This module checks if Emscripten and its prerequisites are installed and if so
-# sets EMSCRIPTEN_FOUND Emscripten (https://github.com/kripken/emscripten) is a
-# C/C++ to JavaScript cross-compiler used to generate the JavaScript bindings.
-
-if (NOT EMSCRIPTEN_FOUND)
-    # First check that Node.js is installed as that is needed by Emscripten.
-    find_program(NODE node)
-    if (NOT NODE)
-        message(STATUS "Node.js (http://nodejs.org) is not installed: can't build JavaScript binding")
-    else (NOT NODE)
-        # Check that the Emscripten C/C++ to JavaScript cross-compiler is installed.
-        find_program(EMCC emcc)
-        if (NOT EMCC)
-            message(STATUS "Emscripten (https://github.com/kripken/emscripten) is not installed: can't build JavaScript binding")
-        else (NOT EMCC)
-            set(EMSCRIPTEN_FOUND ON)
-        endif (NOT EMCC)
-    endif (NOT NODE)
-endif (NOT EMSCRIPTEN_FOUND)
-
diff --git a/tools/cmake/Modules/FindJava.cmake b/tools/cmake/Modules/FindJava.cmake
deleted file mode 100644
index 1664fe1..0000000
--- a/tools/cmake/Modules/FindJava.cmake
+++ /dev/null
@@ -1,214 +0,0 @@
-# - Find Java
-# This module finds if Java is installed and determines where the
-# include files and libraries are. This code sets the following
-# variables:
-#
-#  Java_JAVA_EXECUTABLE    = the full path to the Java runtime
-#  Java_JAVAC_EXECUTABLE   = the full path to the Java compiler
-#  Java_JAVAH_EXECUTABLE   = the full path to the Java header generator
-#  Java_JAVADOC_EXECUTABLE = the full path to the Java documention generator
-#  Java_JAR_EXECUTABLE     = the full path to the Java archiver
-#  Java_VERSION_STRING     = Version of the package found (java version), eg. 1.6.0_12
-#  Java_VERSION_MAJOR      = The major version of the package found.
-#  Java_VERSION_MINOR      = The minor version of the package found.
-#  Java_VERSION_PATCH      = The patch version of the package found.
-#  Java_VERSION_TWEAK      = The tweak version of the package found (after '_')
-#  Java_VERSION            = This is set to: $major.$minor.$patch(.$tweak)
-#
-# The minimum required version of Java can be specified using the
-# standard CMake syntax, e.g. find_package(Java 1.5)
-#
-# NOTE: ${Java_VERSION} and ${Java_VERSION_STRING} are not guaranteed to be
-# identical. For example some java version may return:
-# Java_VERSION_STRING = 1.5.0_17
-# and
-# Java_VERSION        = 1.5.0.17
-#
-# another example is the Java OEM, with:
-# Java_VERSION_STRING = 1.6.0-oem
-# and
-# Java_VERSION        = 1.6.0
-#
-# For these components the following variables are set:
-#
-#  Java_FOUND                    - TRUE if all components are found.
-#  Java_INCLUDE_DIRS             - Full paths to all include dirs.
-#  Java_LIBRARIES                - Full paths to all libraries.
-#  Java_<component>_FOUND        - TRUE if <component> is found.
-#
-# Example Usages:
-#  find_package(Java)
-#  find_package(Java COMPONENTS Runtime)
-#  find_package(Java COMPONENTS Development)
-#
-
-#=============================================================================
-# Copyright 2002-2009 Kitware, Inc.
-# Copyright 2009-2011 Mathieu Malaterre <mathieu.malaterre@gmail.com>
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-# The HINTS option should only be used for values computed from the system.
-set(_JAVA_HINTS
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\2.0;JavaHome]/bin"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.9;JavaHome]/bin"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.8;JavaHome]/bin"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.7;JavaHome]/bin"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.6;JavaHome]/bin"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.5;JavaHome]/bin"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/bin"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/bin"
-  $ENV{JAVA_HOME}/bin
-  )
-# Hard-coded guesses should still go in PATHS. This ensures that the user
-# environment can always override hard guesses.
-set(_JAVA_PATHS
-  /usr/lib/java/bin
-  /usr/share/java/bin
-  /usr/local/java/bin
-  /usr/local/java/share/bin
-  /usr/java/j2sdk1.4.2_04
-  /usr/lib/j2sdk1.4-sun/bin
-  /usr/java/j2sdk1.4.2_09/bin
-  /usr/lib/j2sdk1.5-sun/bin
-  /opt/sun-jdk-1.5.0.04/bin
-  )
-find_program(Java_JAVA_EXECUTABLE
-  NAMES java
-  HINTS ${_JAVA_HINTS}
-  PATHS ${_JAVA_PATHS}
-)
-
-if(Java_JAVA_EXECUTABLE)
-    execute_process(COMMAND ${Java_JAVA_EXECUTABLE} -version
-      RESULT_VARIABLE res
-      OUTPUT_VARIABLE var
-      ERROR_VARIABLE var # sun-java output to stderr
-      OUTPUT_STRIP_TRAILING_WHITESPACE
-      ERROR_STRIP_TRAILING_WHITESPACE)
-    if( res )
-      if(${Java_FIND_REQUIRED})
-        message( FATAL_ERROR "Error executing java -version" )
-      else()
-        message( STATUS "Warning, could not run java --version")
-      endif()
-    else()
-      # extract major/minor version and patch level from "java -version" output
-      # Tested on linux using
-      # 1. Sun / Sun OEM
-      # 2. OpenJDK 1.6
-      # 3. GCJ 1.5
-      # 4. Kaffe 1.4.2
-      if(var MATCHES "(java|openjdk) version \"[0-9]+\\.[0-9]+\\.[0-9_.]+.*\".*")
-        # This is most likely Sun / OpenJDK, or maybe GCJ-java compat layer
-        string( REGEX REPLACE ".* version \"([0-9]+\\.[0-9]+\\.[0-9_.]+.*)\".*"
-                "\\1" Java_VERSION_STRING "${var}" )
-      elseif(var MATCHES "java full version \"kaffe-[0-9]+\\.[0-9]+\\.[0-9_]+\".*")
-        # Kaffe style
-        string( REGEX REPLACE "java full version \"kaffe-([0-9]+\\.[0-9]+\\.[0-9_]+).*"
-                "\\1" Java_VERSION_STRING "${var}" )
-      else()
-        if(NOT Java_FIND_QUIETLY)
-          message(WARNING "regex not supported: ${var}. Please report")
-        endif()
-      endif()
-      string( REGEX REPLACE "([0-9]+).*" "\\1" Java_VERSION_MAJOR "${Java_VERSION_STRING}" )
-      string( REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_MINOR "${Java_VERSION_STRING}" )
-      string( REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_PATCH "${Java_VERSION_STRING}" )
-      # warning tweak version can be empty:
-      string( REGEX REPLACE "[0-9]+\\.[0-9]+\\.[0-9]+[_\\.]?([0-9]*).*$" "\\1" Java_VERSION_TWEAK "${Java_VERSION_STRING}" )
-      if( Java_VERSION_TWEAK STREQUAL "" ) # check case where tweak is not defined
-        set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH})
-      else()
-        set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH}.${Java_VERSION_TWEAK})
-      endif()
-    endif()
-
-endif()
-
-
-find_program(Java_JAR_EXECUTABLE
-  NAMES jar
-  HINTS ${_JAVA_HINTS}
-  PATHS ${_JAVA_PATHS}
-)
-
-find_program(Java_JAVAC_EXECUTABLE
-  NAMES javac
-  HINTS ${_JAVA_HINTS}
-  PATHS ${_JAVA_PATHS}
-)
-
-find_program(Java_JAVAH_EXECUTABLE
-  NAMES javah
-  HINTS ${_JAVA_HINTS}
-  PATHS ${_JAVA_PATHS}
-)
-
-find_program(Java_JAVADOC_EXECUTABLE
-  NAMES javadoc
-  HINTS ${_JAVA_HINTS}
-  PATHS ${_JAVA_PATHS}
-)
-
-#include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-include(FindPackageHandleStandardArgs)
-if(Java_FIND_COMPONENTS)
-
-  # Apache Qpid Proton doesn't support this because of find_package_handle_standard_args
-  # differences (see comment below)
-  message(FATAL_ERROR "Apache Qpid Proton FindJava does not support Java_FIND_COMPONENTS")
-
-  foreach(component ${Java_FIND_COMPONENTS})
-    # User just want to execute some Java byte-compiled
-    if(component STREQUAL "Runtime")
-      find_package_handle_standard_args(Java
-        REQUIRED_VARS Java_JAVA_EXECUTABLE
-        VERSION_VAR Java_VERSION
-        )
-    elseif(component STREQUAL "Development")
-      find_package_handle_standard_args(Java
-        REQUIRED_VARS Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE
-                      Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE
-        VERSION_VAR Java_VERSION
-        )
-    else()
-      message(FATAL_ERROR "Comp: ${component} is not handled")
-    endif()
-    set(Java_${component}_FOUND TRUE)
-  endforeach()
-else()
-  # Check for everything
-
-  # Apache Qpid Proton local change: the line below has been tweaked because
-  # the signature of find_package_handle_standard_args in cmake 2.6 lacks the
-  # REQUIRED_VARS and VERSION_VAR parameters, and specifies the error message differently.
-
-  find_package_handle_standard_args(Java DEFAULT_MSG
-                  Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE
-                  Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE
-    )
-endif()
-
-
-mark_as_advanced(
-  Java_JAVA_EXECUTABLE
-  Java_JAR_EXECUTABLE
-  Java_JAVAC_EXECUTABLE
-  Java_JAVAH_EXECUTABLE
-  Java_JAVADOC_EXECUTABLE
-  )
-
-# LEGACY
-set(JAVA_RUNTIME ${Java_JAVA_EXECUTABLE})
-set(JAVA_ARCHIVE ${Java_JAR_EXECUTABLE})
-set(JAVA_COMPILE ${Java_JAVAC_EXECUTABLE})
-
diff --git a/tools/cmake/Modules/FindLibuv.cmake b/tools/cmake/Modules/FindLibuv.cmake
deleted file mode 100644
index ae3ab70..0000000
--- a/tools/cmake/Modules/FindLibuv.cmake
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Find libuv include dirs and libraries.
-#
-# Sets the following variables:
-#
-#   Libuv_FOUND            - True if headers and requested libraries were found
-#   Libuv_INCLUDE_DIRS     - Libuv include directories
-#   Libuv_LIBRARIES        - Link these to use libuv.
-#
-# This module reads hints about search locations from variables::
-#   LIBUV_ROOT             - Preferred installation prefix
-#   LIBUV_INCLUDEDIR       - Preferred include directory e.g. <prefix>/include
-#   LIBUV_LIBRARYDIR       - Preferred library directory e.g. <prefix>/lib
-
-find_library(Libuv_LIBRARIES Names uv libuv HINTS ${LIBUV_LIBRARYDIR} ${LIBUV_ROOT})
-find_path(Libuv_INCLUDE_DIRS NAMES uv.h HINTS ${LIBUV_INCLUDEDIR} ${LIBUV_ROOT} ${LIBUV_ROOT}/include ${CMAKE_INSTALL_PREFIX}/include PATHS /usr/include)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Libuv DEFAULT_MSG Libuv_LIBRARIES Libuv_INCLUDE_DIRS)
diff --git a/tools/cmake/Modules/FindNodePackages.cmake b/tools/cmake/Modules/FindNodePackages.cmake
deleted file mode 100644
index f6c0e49..0000000
--- a/tools/cmake/Modules/FindNodePackages.cmake
+++ /dev/null
@@ -1,72 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# FindNodePackages
-# This module finds and installs (using npm) node.js packages that are used by
-# the JavaScript binding. The binding should still compile if these packages
-# cannot be installed but certain features might not work as described below.
-#
-# * The ws package is the WebSocket library used by emscripten when the target is
-#   node.js, it isn't needed for applications hosted on a browser (where native 
-#   WebSockets will be used), but without it it won't work with node.js.
-#
-# * The jsdoc package is a JavaScript API document generator analogous to Doxygen
-#   or JavaDoc, it is used by the docs target in the JavaScript binding.
-
-if (NOT NODE_PACKAGES_FOUND)
-    # Check if the specified node.js package is already installed, if not install it.
-    macro(InstallPackage varname name)
-        execute_process(
-            COMMAND npm list --local ${name}
-            OUTPUT_VARIABLE check_package
-        )
-
-        set(${varname} OFF)
-
-        if (check_package MATCHES "${name}@.")
-            message(STATUS "Found node.js package: ${name}")
-            set(${varname} ON)
-        else()
-            message(STATUS "Installing node.js package: ${name}")
-
-            execute_process(
-                COMMAND npm install ${name}
-                WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
-                OUTPUT_VARIABLE var
-            )
-
-            if (var)
-                message(STATUS "Installed node.js package: ${name}")
-                set(${varname} ON)
-            endif (var)
-        endif()
-    endmacro()
-
-    # Check if ws WebSocket library https://github.com/websockets/ws is installed
-    # N.B. something changed between ws 0.5.0 and 0.6.0 that breaks proton js
-    # so explicitly pulling version 0.5.0
-    # TODO update javascript binding/emscripten/both to work with latest ws.
-    InstallPackage("NODE_WS_FOUND" "ws@0.5.0")
-
-    # Check if jsdoc3 API documentation generator https://github.com/jsdoc3/jsdoc is installed
-    InstallPackage("NODE_JSDOC_FOUND" "jsdoc")
-
-    set(NODE_PACKAGES_FOUND ON)
-endif (NOT NODE_PACKAGES_FOUND)
-
diff --git a/tools/cmake/Modules/ProtonFindPerl.cmake b/tools/cmake/Modules/ProtonFindPerl.cmake
deleted file mode 100644
index e2f3fef..0000000
--- a/tools/cmake/Modules/ProtonFindPerl.cmake
+++ /dev/null
@@ -1,81 +0,0 @@
-# - Find Perl Libraries
-# This module searches for Perl libraries in the event that those files aren't
-# found by the default Cmake module.
-
-# include(${CMAKE_CURRENT_LIST_DIR}/FindPerlLibs.cmake)
-
-include(FindPerl)
-include(FindPerlLibs)
-
-if(NOT PERLLIBS_FOUND)
-  MESSAGE ( STATUS "Trying alternative search for Perl" )
-
-  # taken from Cmake 2.8 FindPerlLibs.cmake
-  EXECUTE_PROCESS ( COMMAND ${PERL_EXECUTABLE}
-                     -V:installarchlib
-                     OUTPUT_VARIABLE PERL_ARCHLIB_OUTPUT_VARIABLE
-                     RESULT_VARIABLE PERL_ARCHLIB_RESULT_VARIABLE )
-
-  if (NOT PERL_ARCHLIB_RESULT_VARIABLE)
-    string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_ARCHLIB ${PERL_ARCHLIB_OUTPUT_VARIABLE})
-    file(TO_CMAKE_PATH "${PERL_ARCHLIB}" PERL_ARCHLIB)
-  endif ( NOT PERL_ARCHLIB_RESULT_VARIABLE )
-
-  EXECUTE_PROCESS ( COMMAND ${PERL_EXECUTABLE}
-                    -MConfig -e "print \$Config{archlibexp}"
-                    OUTPUT_VARIABLE PERL_OUTPUT
-                    RESULT_VARIABLE PERL_RETURN_VALUE )
-
-  IF ( NOT PERL_RETURN_VALUE )
-    FIND_PATH ( PERL_INCLUDE_PATH perl.h ${PERL_OUTPUT}/CORE )
-
-    IF (PERL_INCLUDE_PATH MATCHES .*-NOTFOUND OR NOT PERL_INCLUDE_PATH)
-        MESSAGE(STATUS "Could not find perl.h")
-    ENDIF ()
-
-  ENDIF ( NOT PERL_RETURN_VALUE )
-
-  # if either the library path is not found not set at all
-  # then do our own search
-  if ( NOT PERL_LIBRARY )
-    EXECUTE_PROCESS( COMMAND ${PERL_EXECUTABLE} -V:libperl
-                     OUTPUT_VARIABLE PERL_LIBRARY_OUTPUT
-                     RESULT_VARIABLE PERL_LIBRARY_RESULT )
-
-    IF ( NOT PERL_LIBRARY_RESULT )
-      string(REGEX REPLACE "libperl='([^']+)'.*" "\\1" PERL_POSSIBLE_LIBRARIES ${PERL_LIBRARY_OUTPUT})
-    ENDIF ( NOT PERL_LIBRARY_RESULT )
-
-    MESSAGE ( STATUS  "Looking for ${PERL_POSSIBLE_LIBRARIES}" )
-
-    find_file(PERL_LIBRARY
-      NAMES ${PERL_POSSIBLE_LIBRARIES}
-      PATHS /usr/lib
-            ${PERL_ARCHLIB}/CORE
-      )
-
-  endif ( NOT PERL_LIBRARY )
-
-  IF ( PERL_LIBRARY MATCHES .*-NOTFOUND OR NOT PERL_LIBRARY )
-      EXECUTE_PROCESS ( COMMAND ${PERL_EXECUTABLE}
-                        -MConfig -e "print \$Config{libperl}"
-                        OUTPUT_VARIABLE PERL_OUTPUT
-                        RESULT_VARIABLE PERL_RETURN_VALUE )
-
-      IF ( NOT PERL_RETURN_VALUE )
-        FIND_LIBRARY ( PERL_LIBRARY NAMES ${PERL_OUTPUT}
-                                    PATHS ${PERL_INCLUDE_PATH} )
-
-      ENDIF ( NOT PERL_RETURN_VALUE )
-  ENDIF ( PERL_LIBRARY MATCHES .*-NOTFOUND OR NOT PERL_LIBRARY )
-
-  IF(PERL_LIBRARY MATCHES .*-NOTFOUND OR NOT PERL_LIBRARY OR
-     PERL_INCLUDE_PATH MATCHES .*-NOTFOUND OR NOT PERL_INCLUDE_PATH)
-    MESSAGE (STATUS "No Perl devel environment found - skipping Perl bindings")
-    SET (DEFAULT_PERL OFF)
-  ELSE()
-    MESSAGE ( STATUS "Found PerlLibs: ${PERL_LIBRARY}" )
-    SET (DEFAULT_PERL ON)
-  ENDIF()
-
-endif(NOT PERLLIBS_FOUND)
diff --git a/tools/cmake/Modules/ProtonUseJava.cmake b/tools/cmake/Modules/ProtonUseJava.cmake
deleted file mode 100644
index 4b011ef..0000000
--- a/tools/cmake/Modules/ProtonUseJava.cmake
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Adds a custom command to rebuild the JAR to include resources and the
-# directory entries that are missed by add_jar()
-
-function (rebuild_jar upstream_target jar_name)
-  add_custom_command(TARGET ${upstream_target} POST_BUILD
-                     COMMAND ${Java_JAR_EXECUTABLE} cf ${jar_name}
-                                -C ${CMAKE_CURRENT_SOURCE_DIR}/src/main/resources .
-                                -C ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${upstream_target}.dir/ org
-                     COMMENT "Rebuilding ${jar_name} to include missing resources")
-endfunction ()
-
diff --git a/tools/cmake/Modules/ProtonUseJavaSourceFileList.cmake b/tools/cmake/Modules/ProtonUseJavaSourceFileList.cmake
deleted file mode 100644
index f1c106d..0000000
--- a/tools/cmake/Modules/ProtonUseJavaSourceFileList.cmake
+++ /dev/null
@@ -1,68 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-#
-# Produces a text file containing a list of java source files from one
-# or more java source directories.  Produces output suitable for use
-# with javac's @ source file argument.
-#
-# JAVA_SOURCE_DIR_PATHS - colon (:) separated string of java source directories
-# JAVA_SOURCE_FILE_LIST - name of text file to write
-#
-
-if (JAVA_SOURCE_DIR_PATHS)
-    string(REPLACE ":" ";" JAVA_SOURCE_DIR_PATHS_LIST ${JAVA_SOURCE_DIR_PATHS})
-    message(STATUS "Java source paths: ${JAVA_SOURCE_DIR_PATHS}")
-
-    set(_JAVA_GLOBBED_FILES)
-    foreach(JAVA_SOURCE_DIR_PATH ${JAVA_SOURCE_DIR_PATHS_LIST})
-        if (EXISTS "${JAVA_SOURCE_DIR_PATH}")
-            file(GLOB_RECURSE _JAVA_GLOBBED_TMP_FILES "${JAVA_SOURCE_DIR_PATH}/*.java")
-            if (_JAVA_GLOBBED_TMP_FILES)
-                list(APPEND _JAVA_GLOBBED_FILES ${_JAVA_GLOBBED_TMP_FILES})
-            endif ()
-        else ()
-            message(SEND_ERROR "FATAL: Java source path ${JAVA_SOURCE_DIR_PATH} doesn't exist")
-        endif ()
-    endforeach()
-
-    set (_CHECK_STALE OFF)
-    set(_GENERATE_FILE_LIST ON)
-    if (EXISTS ${JAVA_SOURCE_FILE_LIST})
-        set (_CHECK_STALE ON)
-        set(_GENERATE_FILE_LIST OFF)
-    endif ()
-
-    set(_JAVA_SOURCE_FILES_SEPARATED)
-    foreach(_JAVA_GLOBBED_FILE ${_JAVA_GLOBBED_FILES})
-        if (_CHECK_STALE)
-           if (${_JAVA_GLOBBED_FILE} IS_NEWER_THAN ${JAVA_SOURCE_FILE_LIST})
-               set(_GENERATE_FILE_LIST ON)
-           endif()
-        endif()
-        set(_JAVA_SOURCE_FILES_SEPARATED ${_JAVA_SOURCE_FILES_SEPARATED}${_JAVA_GLOBBED_FILE}\n)
-    endforeach()
-
-    if (_GENERATE_FILE_LIST)
-       message(STATUS "Writing Java source file list to ${JAVA_SOURCE_FILE_LIST}")
-       file(WRITE ${JAVA_SOURCE_FILE_LIST} ${_JAVA_SOURCE_FILES_SEPARATED})
-    endif()
-else ()
-    message(SEND_ERROR "FATAL: Can't find JAVA_SOURCE_DIR_PATHS")
-endif ()
diff --git a/tools/cmake/Modules/README b/tools/cmake/Modules/README
deleted file mode 100644
index 1c679c0..0000000
--- a/tools/cmake/Modules/README
+++ /dev/null
@@ -1,14 +0,0 @@
-CMake Modules
-=============
-
-Contents:
-
-UseJava, UseJavaSymLinks, UseJavaClassFilelist:
-
-These are Andreas Schneider's CMake Java Support.  We have our own local copy as all versions of
-CMake < 2.8.9 have defects in their Java support that affect us.  Local modifications are commented
-with "Apache Qpid Proton...".
-
-UseProtonJava:
-
-Custom support functions for the Proton Java modules
diff --git a/tools/cmake/Modules/UseJava.cmake b/tools/cmake/Modules/UseJava.cmake
deleted file mode 100644
index 444343e..0000000
--- a/tools/cmake/Modules/UseJava.cmake
+++ /dev/null
@@ -1,1015 +0,0 @@
-# - Use Module for Java
-# This file provides functions for Java. It is assumed that FindJava.cmake
-# has already been loaded.  See FindJava.cmake for information on how to
-# load Java into your CMake project.
-#
-# add_jar(TARGET_NAME SRC1 SRC2 .. SRCN RCS1 RCS2 .. RCSN)
-#
-# This command creates a <TARGET_NAME>.jar. It compiles the given source
-# files (SRC) and adds the given resource files (RCS) to the jar file.
-# If only resource files are given then just a jar file is created.
-#
-# Additional instructions:
-#   To add compile flags to the target you can set these flags with
-#   the following variable:
-#
-#       set(CMAKE_JAVA_COMPILE_FLAGS -nowarn)
-#
-#   To add a path or a jar file to the class path you can do this
-#   with the CMAKE_JAVA_INCLUDE_PATH variable.
-#
-#       set(CMAKE_JAVA_INCLUDE_PATH /usr/share/java/shibboleet.jar)
-#
-#   To use a different output name for the target you can set it with:
-#
-#       set(CMAKE_JAVA_TARGET_OUTPUT_NAME shibboleet.jar)
-#       add_jar(foobar foobar.java)
-#
-#   To use a different output directory than CMAKE_CURRENT_BINARY_DIR
-#   you can set it with:
-#
-#       set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin)
-#
-#   To define an entry point in your jar you can set it with:
-#
-#       set(CMAKE_JAVA_JAR_ENTRY_POINT com/examples/MyProject/Main)
-#
-#   To add a VERSION to the target output name you can set it using
-#   CMAKE_JAVA_TARGET_VERSION. This will create a jar file with the name
-#   shibboleet-1.0.0.jar and will create a symlink shibboleet.jar
-#   pointing to the jar with the version information.
-#
-#       set(CMAKE_JAVA_TARGET_VERSION 1.2.0)
-#       add_jar(shibboleet shibbotleet.java)
-#
-#    If the target is a JNI library, utilize the following commands to
-#    create a JNI symbolic link:
-#
-#       set(CMAKE_JNI_TARGET TRUE)
-#       set(CMAKE_JAVA_TARGET_VERSION 1.2.0)
-#       add_jar(shibboleet shibbotleet.java)
-#       install_jar(shibboleet ${LIB_INSTALL_DIR}/shibboleet)
-#       install_jni_symlink(shibboleet ${JAVA_LIB_INSTALL_DIR})
-#
-#    If a single target needs to produce more than one jar from its
-#    java source code, to prevent the accumulation of duplicate class
-#    files in subsequent jars, set/reset CMAKE_JAR_CLASSES_PREFIX prior
-#    to calling the add_jar() function:
-#
-#       set(CMAKE_JAR_CLASSES_PREFIX com/redhat/foo)
-#       add_jar(foo foo.java)
-#
-#       set(CMAKE_JAR_CLASSES_PREFIX com/redhat/bar)
-#       add_jar(bar bar.java)
-#
-# Target Properties:
-#   The add_jar() functions sets some target properties. You can get these
-#   properties with the
-#      get_property(TARGET <target_name> PROPERTY <propery_name>)
-#   command.
-#
-#   INSTALL_FILES      The files which should be installed. This is used by
-#                      install_jar().
-#   JNI_SYMLINK        The JNI symlink which should be installed.
-#                      This is used by install_jni_symlink().
-#   JAR_FILE           The location of the jar file so that you can include
-#                      it.
-#   CLASS_DIR          The directory where the class files can be found. For
-#                      example to use them with javah.
-#
-# find_jar(<VAR>
-#          name | NAMES name1 [name2 ...]
-#          [PATHS path1 [path2 ... ENV var]]
-#          [VERSIONS version1 [version2]]
-#          [DOC "cache documentation string"]
-#         )
-#
-# This command is used to find a full path to the named jar. A cache
-# entry named by <VAR> is created to stor the result of this command. If
-# the full path to a jar is found the result is stored in the variable
-# and the search will not repeated unless the variable is cleared. If
-# nothing is found, the result will be <VAR>-NOTFOUND, and the search
-# will be attempted again next time find_jar is invoked with the same
-# variable.
-# The name of the full path to a file that is searched for is specified
-# by the names listed after NAMES argument. Additional search locations
-# can be specified after the PATHS argument. If you require special a
-# version of a jar file you can specify it with the VERSIONS argument.
-# The argument after DOC will be used for the documentation string in
-# the cache.
-#
-# install_jar(TARGET_NAME DESTINATION)
-#
-# This command installs the TARGET_NAME files to the given DESTINATION.
-# It should be called in the same scope as add_jar() or it will fail.
-#
-# install_jni_symlink(TARGET_NAME DESTINATION)
-#
-# This command installs the TARGET_NAME JNI symlinks to the given
-# DESTINATION. It should be called in the same scope as add_jar()
-# or it will fail.
-#
-# create_javadoc(<VAR>
-#                PACKAGES pkg1 [pkg2 ...]
-#                [SOURCEPATH <sourcepath>]
-#                [CLASSPATH <classpath>]
-#                [INSTALLPATH <install path>]
-#                [DOCTITLE "the documentation title"]
-#                [WINDOWTITLE "the title of the document"]
-#                [AUTHOR TRUE|FALSE]
-#                [USE TRUE|FALSE]
-#                [VERSION TRUE|FALSE]
-#               )
-#
-# Create java documentation based on files or packages. For more
-# details please read the javadoc manpage.
-#
-# There are two main signatures for create_javadoc. The first
-# signature works with package names on a path with source files:
-#
-#   Example:
-#   create_javadoc(my_example_doc
-#     PACKAGES com.exmaple.foo com.example.bar
-#     SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}"
-#     CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
-#     WINDOWTITLE "My example"
-#     DOCTITLE "<h1>My example</h1>"
-#     AUTHOR TRUE
-#     USE TRUE
-#     VERSION TRUE
-#   )
-#
-# The second signature for create_javadoc works on a given list of
-# files.
-#
-#   create_javadoc(<VAR>
-#                  FILES file1 [file2 ...]
-#                  [CLASSPATH <classpath>]
-#                  [INSTALLPATH <install path>]
-#                  [DOCTITLE "the documentation title"]
-#                  [WINDOWTITLE "the title of the document"]
-#                  [AUTHOR TRUE|FALSE]
-#                  [USE TRUE|FALSE]
-#                  [VERSION TRUE|FALSE]
-#                 )
-#
-# Example:
-#   create_javadoc(my_example_doc
-#     FILES ${example_SRCS}
-#     CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
-#     WINDOWTITLE "My example"
-#     DOCTITLE "<h1>My example</h1>"
-#     AUTHOR TRUE
-#     USE TRUE
-#     VERSION TRUE
-#   )
-#
-# Both signatures share most of the options. These options are the
-# same as what you can find in the javadoc manpage. Please look at
-# the manpage for CLASSPATH, DOCTITLE, WINDOWTITLE, AUTHOR, USE and
-# VERSION.
-#
-# The documentation will be by default installed to
-#
-#   ${CMAKE_INSTALL_PREFIX}/share/javadoc/<VAR>
-#
-# if you don't set the INSTALLPATH.
-#
-
-#=============================================================================
-# Copyright 2010-2011 Andreas schneider <asn@redhat.com>
-# Copyright 2010 Ben Boeckel <ben.boeckel@kitware.com>
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-function (__java_copy_file src dest comment)
-    add_custom_command(
-        OUTPUT  ${dest}
-        COMMAND cmake -E copy_if_different
-        ARGS    ${src}
-                ${dest}
-        DEPENDS ${src}
-        COMMENT ${comment})
-endfunction ()
-
-# define helper scripts
-#set(_JAVA_CLASS_FILELIST_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaClassFilelist.cmake)
-#set(_JAVA_SYMLINK_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaSymlinks.cmake)
-set(_JAVA_CLASS_FILELIST_SCRIPT ${CMAKE_MODULE_PATH}/UseJavaClassFilelist.cmake)
-set(_JAVA_SYMLINK_SCRIPT ${CMAKE_MODULE_PATH}/UseJavaSymlinks.cmake)
-
-# Apache Qpid Proton: changed to write a source file list to avoid hitting
-# command line limits when processing many source files.
-function(add_jar _TARGET_NAME)
-    set(_JAVA_SOURCE_FILES ${ARGN})
-
-    if (NOT DEFINED CMAKE_JAVA_TARGET_OUTPUT_DIR)
-      set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
-    endif()
-
-    if (CMAKE_JAVA_JAR_ENTRY_POINT)
-      set(_ENTRY_POINT_OPTION e)
-      set(_ENTRY_POINT_VALUE ${CMAKE_JAVA_JAR_ENTRY_POINT})
-    endif ()
-
-    if (LIBRARY_OUTPUT_PATH)
-        set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_PATH})
-    else ()
-        set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${CMAKE_JAVA_TARGET_OUTPUT_DIR})
-    endif ()
-
-    set(CMAKE_JAVA_INCLUDE_PATH
-        ${CMAKE_JAVA_INCLUDE_PATH}
-        ${CMAKE_CURRENT_SOURCE_DIR}
-        ${CMAKE_JAVA_OBJECT_OUTPUT_PATH}
-        ${CMAKE_JAVA_LIBRARY_OUTPUT_PATH}
-    )
-
-    if (WIN32 AND NOT CYGWIN)
-        set(CMAKE_JAVA_INCLUDE_FLAG_SEP ";")
-    else ()
-        set(CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
-    endif()
-
-    foreach (JAVA_INCLUDE_DIR ${CMAKE_JAVA_INCLUDE_PATH})
-       set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}")
-    endforeach()
-
-    set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_JAVA_TARGET_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir")
-
-    set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}.jar")
-    if (CMAKE_JAVA_TARGET_OUTPUT_NAME AND CMAKE_JAVA_TARGET_VERSION)
-        set(_JAVA_TARGET_OUTPUT_NAME "${CMAKE_JAVA_TARGET_OUTPUT_NAME}-${CMAKE_JAVA_TARGET_VERSION}.jar")
-        set(_JAVA_TARGET_OUTPUT_LINK "${CMAKE_JAVA_TARGET_OUTPUT_NAME}.jar")
-    elseif (CMAKE_JAVA_TARGET_VERSION)
-        set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}-${CMAKE_JAVA_TARGET_VERSION}.jar")
-        set(_JAVA_TARGET_OUTPUT_LINK "${_TARGET_NAME}.jar")
-    elseif (CMAKE_JAVA_TARGET_OUTPUT_NAME)
-        set(_JAVA_TARGET_OUTPUT_NAME "${CMAKE_JAVA_TARGET_OUTPUT_NAME}.jar")
-    endif ()
-    # reset
-    set(CMAKE_JAVA_TARGET_OUTPUT_NAME)
-
-    set(_JAVA_CLASS_FILES)
-    set(_JAVA_COMPILE_FILES)
-    set(_JAVA_DEPENDS)
-    set(_JAVA_RESOURCE_FILES)
-    foreach(_JAVA_SOURCE_FILE ${_JAVA_SOURCE_FILES})
-        get_filename_component(_JAVA_EXT ${_JAVA_SOURCE_FILE} EXT)
-        get_filename_component(_JAVA_FILE ${_JAVA_SOURCE_FILE} NAME_WE)
-        get_filename_component(_JAVA_PATH ${_JAVA_SOURCE_FILE} PATH)
-        get_filename_component(_JAVA_FULL ${_JAVA_SOURCE_FILE} ABSOLUTE)
-
-        file(RELATIVE_PATH _JAVA_REL_BINARY_PATH ${CMAKE_JAVA_TARGET_OUTPUT_DIR} ${_JAVA_FULL})
-        file(RELATIVE_PATH _JAVA_REL_SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${_JAVA_FULL})
-        string(LENGTH ${_JAVA_REL_BINARY_PATH} _BIN_LEN)
-        string(LENGTH ${_JAVA_REL_SOURCE_PATH} _SRC_LEN)
-        if (${_BIN_LEN} LESS ${_SRC_LEN})
-            set(_JAVA_REL_PATH ${_JAVA_REL_BINARY_PATH})
-        else ()
-            set(_JAVA_REL_PATH ${_JAVA_REL_SOURCE_PATH})
-        endif ()
-        get_filename_component(_JAVA_REL_PATH ${_JAVA_REL_PATH} PATH)
-
-        if (_JAVA_EXT MATCHES ".java")
-            list(APPEND _JAVA_COMPILE_FILES ${_JAVA_SOURCE_FILE})
-            set(_JAVA_CLASS_FILE "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_JAVA_REL_PATH}/${_JAVA_FILE}.class")
-            set(_JAVA_CLASS_FILES ${_JAVA_CLASS_FILES} ${_JAVA_CLASS_FILE})
-
-        elseif (_JAVA_EXT MATCHES ".jar"
-                OR _JAVA_EXT MATCHES ".war"
-                OR _JAVA_EXT MATCHES ".ear"
-                OR _JAVA_EXT MATCHES ".sar")
-            list(APPEND CMAKE_JAVA_INCLUDE_PATH ${_JAVA_SOURCE_FILE})
-
-        elseif (_JAVA_EXT STREQUAL "")
-            list(APPEND CMAKE_JAVA_INCLUDE_PATH ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}} ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}_CLASSPATH})
-            list(APPEND _JAVA_DEPENDS ${JAVA_JAR_TARGET_${_JAVA_SOURCE_FILE}})
-
-        else ()
-            __java_copy_file(${CMAKE_CURRENT_SOURCE_DIR}/${_JAVA_SOURCE_FILE}
-                             ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${_JAVA_SOURCE_FILE}
-                             "Copying ${_JAVA_SOURCE_FILE} to the build directory")
-            list(APPEND _JAVA_RESOURCE_FILES ${_JAVA_SOURCE_FILE})
-        endif ()
-    endforeach()
-
-    set(CMAKE_JAVA_SOURCE_FILE_LIST ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_source_filelist)
-    string(REPLACE ";" "\n" _JAVA_COMPILE_FILES_NEWLINE_SEPARATED "${_JAVA_COMPILE_FILES}")
-    file(WRITE ${CMAKE_JAVA_SOURCE_FILE_LIST} "${_JAVA_COMPILE_FILES_NEWLINE_SEPARATED}")
-
-    # create an empty java_class_filelist
-    if (NOT EXISTS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist)
-        file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist "")
-    endif()
-
-    if (_JAVA_COMPILE_FILES)
-        # Compile the java files and create a list of class files
-        add_custom_command(
-            # NOTE: this command generates an artificial dependency file
-            OUTPUT ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME}
-            COMMAND ${Java_JAVAC_EXECUTABLE}
-                ${CMAKE_JAVA_COMPILE_FLAGS}
-                -classpath "${CMAKE_JAVA_INCLUDE_PATH_FINAL}"
-                -d ${CMAKE_JAVA_CLASS_OUTPUT_PATH}
-                @${CMAKE_JAVA_SOURCE_FILE_LIST}
-            COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME}
-            DEPENDS ${_JAVA_COMPILE_FILES}
-            WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-            COMMENT "Building Java objects for ${_TARGET_NAME}.jar"
-        )
-        add_custom_command(
-            OUTPUT ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist
-            COMMAND ${CMAKE_COMMAND}
-                -DCMAKE_JAVA_CLASS_OUTPUT_PATH=${CMAKE_JAVA_CLASS_OUTPUT_PATH}
-                -DCMAKE_JAR_CLASSES_PREFIX="${CMAKE_JAR_CLASSES_PREFIX}"
-                -P ${_JAVA_CLASS_FILELIST_SCRIPT}
-            DEPENDS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME}
-            WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-        )
-    endif ()
-
-    # create the jar file
-    set(_JAVA_JAR_OUTPUT_PATH
-      ${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_NAME})
-    if (CMAKE_JNI_TARGET)
-        add_custom_command(
-            OUTPUT ${_JAVA_JAR_OUTPUT_PATH}
-            COMMAND ${Java_JAR_EXECUTABLE}
-                -cf${_ENTRY_POINT_OPTION} ${_JAVA_JAR_OUTPUT_PATH} ${_ENTRY_POINT_VALUE}
-                ${_JAVA_RESOURCE_FILES} @java_class_filelist
-            COMMAND ${CMAKE_COMMAND}
-                -D_JAVA_TARGET_DIR=${CMAKE_JAVA_TARGET_OUTPUT_DIR}
-                -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME}
-                -D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK}
-                -P ${_JAVA_SYMLINK_SCRIPT}
-            COMMAND ${CMAKE_COMMAND}
-                -D_JAVA_TARGET_DIR=${CMAKE_JAVA_TARGET_OUTPUT_DIR}
-                -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_JAR_OUTPUT_PATH}
-                -D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK}
-                -P ${_JAVA_SYMLINK_SCRIPT}
-            DEPENDS ${_JAVA_RESOURCE_FILES} ${_JAVA_DEPENDS} ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist
-            WORKING_DIRECTORY ${CMAKE_JAVA_CLASS_OUTPUT_PATH}
-            COMMENT "Creating Java archive ${_JAVA_TARGET_OUTPUT_NAME}"
-        )
-    else ()
-        add_custom_command(
-            OUTPUT ${_JAVA_JAR_OUTPUT_PATH}
-            COMMAND ${Java_JAR_EXECUTABLE}
-                -cf${_ENTRY_POINT_OPTION} ${_JAVA_JAR_OUTPUT_PATH} ${_ENTRY_POINT_VALUE}
-                ${_JAVA_RESOURCE_FILES} @java_class_filelist
-            COMMAND ${CMAKE_COMMAND}
-                -D_JAVA_TARGET_DIR=${CMAKE_JAVA_TARGET_OUTPUT_DIR}
-                -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME}
-                -D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK}
-                -P ${_JAVA_SYMLINK_SCRIPT}
-            WORKING_DIRECTORY ${CMAKE_JAVA_CLASS_OUTPUT_PATH}
-            DEPENDS ${_JAVA_RESOURCE_FILES} ${_JAVA_DEPENDS} ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist
-            COMMENT "Creating Java archive ${_JAVA_TARGET_OUTPUT_NAME}"
-        )
-    endif ()
-
-    # Add the target and make sure we have the latest resource files.
-    add_custom_target(${_TARGET_NAME} ALL DEPENDS ${_JAVA_JAR_OUTPUT_PATH})
-
-    set_property(
-        TARGET
-            ${_TARGET_NAME}
-        PROPERTY
-            INSTALL_FILES
-                ${_JAVA_JAR_OUTPUT_PATH}
-    )
-
-    if (_JAVA_TARGET_OUTPUT_LINK)
-        set_property(
-            TARGET
-                ${_TARGET_NAME}
-            PROPERTY
-                INSTALL_FILES
-                    ${_JAVA_JAR_OUTPUT_PATH}
-                    ${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK}
-        )
-
-        if (CMAKE_JNI_TARGET)
-            set_property(
-                TARGET
-                    ${_TARGET_NAME}
-                PROPERTY
-                    JNI_SYMLINK
-                        ${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK}
-            )
-        endif ()
-    endif ()
-
-    set_property(
-        TARGET
-            ${_TARGET_NAME}
-        PROPERTY
-            JAR_FILE
-                ${_JAVA_JAR_OUTPUT_PATH}
-    )
-
-    set_property(
-        TARGET
-            ${_TARGET_NAME}
-        PROPERTY
-            CLASSDIR
-                ${CMAKE_JAVA_CLASS_OUTPUT_PATH}
-    )
-
-endfunction()
-
-# Apache Qpid Proton: new function that accepts a file containing the Java source
-# files. This is useful when the set of source files is only discovered at make-time,
-# and avoids passing a wildcard argument to javac (which fails on some platforms)
-function(add_jar_from_filelist _TARGET_NAME CMAKE_JAVA_SOURCE_FILE_LIST)
-
-    if (NOT DEFINED CMAKE_JAVA_TARGET_OUTPUT_DIR)
-      set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
-    endif()
-
-    set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_JAVA_TARGET_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir")
-
-    set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}.jar")
-    if (CMAKE_JAVA_TARGET_OUTPUT_NAME AND CMAKE_JAVA_TARGET_VERSION)
-        set(_JAVA_TARGET_OUTPUT_NAME "${CMAKE_JAVA_TARGET_OUTPUT_NAME}-${CMAKE_JAVA_TARGET_VERSION}.jar")
-        set(_JAVA_TARGET_OUTPUT_LINK "${CMAKE_JAVA_TARGET_OUTPUT_NAME}.jar")
-    elseif (CMAKE_JAVA_TARGET_VERSION)
-        set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}-${CMAKE_JAVA_TARGET_VERSION}.jar")
-        set(_JAVA_TARGET_OUTPUT_LINK "${_TARGET_NAME}.jar")
-    elseif (CMAKE_JAVA_TARGET_OUTPUT_NAME)
-        set(_JAVA_TARGET_OUTPUT_NAME "${CMAKE_JAVA_TARGET_OUTPUT_NAME}.jar")
-    endif ()
-    # reset
-    set(CMAKE_JAVA_TARGET_OUTPUT_NAME)
-
-    foreach (JAVA_INCLUDE_DIR ${CMAKE_JAVA_INCLUDE_PATH})
-       set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}")
-    endforeach()
-
-    # create an empty java_class_filelist
-    if (NOT EXISTS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist)
-        file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist "")
-    endif ()
-
-    # Compile the java files and create a list of class files
-    add_custom_command(
-	# NOTE: this command generates an artificial dependency file
-	OUTPUT ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME}
-	COMMAND ${Java_JAVAC_EXECUTABLE}
-	    ${CMAKE_JAVA_COMPILE_FLAGS}
-	    -classpath "${CMAKE_JAVA_INCLUDE_PATH_FINAL}"
-	    -d ${CMAKE_JAVA_CLASS_OUTPUT_PATH}
-	    @${CMAKE_JAVA_SOURCE_FILE_LIST}
-	COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME}
-	DEPENDS ${CMAKE_JAVA_SOURCE_FILE_LIST}
-	WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-	COMMENT "Building Java objects for ${_TARGET_NAME}.jar"
-    )
-    add_custom_command(
-	OUTPUT ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist
-	COMMAND ${CMAKE_COMMAND}
-	    -DCMAKE_JAVA_CLASS_OUTPUT_PATH=${CMAKE_JAVA_CLASS_OUTPUT_PATH}
-	    -DCMAKE_JAR_CLASSES_PREFIX="${CMAKE_JAR_CLASSES_PREFIX}"
-	    -P ${_JAVA_CLASS_FILELIST_SCRIPT}
-	DEPENDS ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_compiled_${_TARGET_NAME}
-	WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-    )
-
-    # create the jar file
-    set(_JAVA_JAR_OUTPUT_PATH
-      ${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_NAME})
-    add_custom_command(
-	OUTPUT ${_JAVA_JAR_OUTPUT_PATH}
-	COMMAND ${Java_JAR_EXECUTABLE}
-	    -cf ${_JAVA_JAR_OUTPUT_PATH}
-	    ${_JAVA_RESOURCE_FILES} @java_class_filelist
-	COMMAND ${CMAKE_COMMAND}
-	    -D_JAVA_TARGET_DIR=${CMAKE_JAVA_TARGET_OUTPUT_DIR}
-	    -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME}
-	    -D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK}
-	    -P ${_JAVA_SYMLINK_SCRIPT}
-	WORKING_DIRECTORY ${CMAKE_JAVA_CLASS_OUTPUT_PATH}
-	DEPENDS ${_JAVA_RESOURCE_FILES} ${_JAVA_DEPENDS} ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist
-	COMMENT "Creating Java archive ${_JAVA_TARGET_OUTPUT_NAME}"
-    )
-    # Add the target and make sure we have the latest resource files.
-    add_custom_target(${_TARGET_NAME} ALL DEPENDS ${_JAVA_JAR_OUTPUT_PATH})
-
-    set_property(
-        TARGET
-            ${_TARGET_NAME}
-        PROPERTY
-            INSTALL_FILES
-                ${_JAVA_JAR_OUTPUT_PATH}
-    )
-
-    if (_JAVA_TARGET_OUTPUT_LINK)
-        set_property(
-            TARGET
-                ${_TARGET_NAME}
-            PROPERTY
-                INSTALL_FILES
-                    ${_JAVA_JAR_OUTPUT_PATH}
-                    ${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK}
-        )
-
-        if (CMAKE_JNI_TARGET)
-            set_property(
-                TARGET
-                    ${_TARGET_NAME}
-                PROPERTY
-                    JNI_SYMLINK
-                        ${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK}
-            )
-        endif ()
-    endif ()
-
-    set_property(
-        TARGET
-            ${_TARGET_NAME}
-        PROPERTY
-            JAR_FILE
-                ${_JAVA_JAR_OUTPUT_PATH}
-    )
-
-    set_property(
-        TARGET
-            ${_TARGET_NAME}
-        PROPERTY
-            CLASSDIR
-                ${CMAKE_JAVA_CLASS_OUTPUT_PATH}
-    )
-
-endfunction()
-
-# Apache Qpid Proton: make the install files optional so as not to error if there is no symlink
-function(INSTALL_JAR _TARGET_NAME _DESTINATION)
-    get_property(__FILES
-        TARGET
-            ${_TARGET_NAME}
-        PROPERTY
-            INSTALL_FILES
-    )
-
-    if (__FILES)
-        install(
-            FILES
-                ${__FILES}
-            DESTINATION
-                ${_DESTINATION}
-            OPTIONAL
-        )
-    else ()
-        message(SEND_ERROR "The target ${_TARGET_NAME} is not known in this scope.")
-    endif ()
-endfunction()
-
-function(INSTALL_JNI_SYMLINK _TARGET_NAME _DESTINATION)
-    get_property(__SYMLINK
-        TARGET
-            ${_TARGET_NAME}
-        PROPERTY
-            JNI_SYMLINK
-    )
-
-    if (__SYMLINK)
-        install(
-            FILES
-                ${__SYMLINK}
-            DESTINATION
-                ${_DESTINATION}
-        )
-    else ()
-        message(SEND_ERROR "The target ${_TARGET_NAME} is not known in this scope.")
-    endif ()
-endfunction()
-
-function (find_jar VARIABLE)
-    set(_jar_names)
-    set(_jar_files)
-    set(_jar_versions)
-    set(_jar_paths
-        /usr/share/java/
-        /usr/local/share/java/
-        ${Java_JAR_PATHS})
-    set(_jar_doc "NOTSET")
-
-    set(_state "name")
-
-    foreach (arg ${ARGN})
-        if (${_state} STREQUAL "name")
-            if (${arg} STREQUAL "VERSIONS")
-                set(_state "versions")
-            elseif (${arg} STREQUAL "NAMES")
-                set(_state "names")
-            elseif (${arg} STREQUAL "PATHS")
-                set(_state "paths")
-            elseif (${arg} STREQUAL "DOC")
-                set(_state "doc")
-            else ()
-                set(_jar_names ${arg})
-                if (_jar_doc STREQUAL "NOTSET")
-                    set(_jar_doc "Finding ${arg} jar")
-                endif ()
-            endif ()
-        elseif (${_state} STREQUAL "versions")
-            if (${arg} STREQUAL "NAMES")
-                set(_state "names")
-            elseif (${arg} STREQUAL "PATHS")
-                set(_state "paths")
-            elseif (${arg} STREQUAL "DOC")
-                set(_state "doc")
-            else ()
-                set(_jar_versions ${_jar_versions} ${arg})
-            endif ()
-        elseif (${_state} STREQUAL "names")
-            if (${arg} STREQUAL "VERSIONS")
-                set(_state "versions")
-            elseif (${arg} STREQUAL "PATHS")
-                set(_state "paths")
-            elseif (${arg} STREQUAL "DOC")
-                set(_state "doc")
-            else ()
-                set(_jar_names ${_jar_names} ${arg})
-                if (_jar_doc STREQUAL "NOTSET")
-                    set(_jar_doc "Finding ${arg} jar")
-                endif ()
-            endif ()
-        elseif (${_state} STREQUAL "paths")
-            if (${arg} STREQUAL "VERSIONS")
-                set(_state "versions")
-            elseif (${arg} STREQUAL "NAMES")
-                set(_state "names")
-            elseif (${arg} STREQUAL "DOC")
-                set(_state "doc")
-            else ()
-                set(_jar_paths ${_jar_paths} ${arg})
-            endif ()
-        elseif (${_state} STREQUAL "doc")
-            if (${arg} STREQUAL "VERSIONS")
-                set(_state "versions")
-            elseif (${arg} STREQUAL "NAMES")
-                set(_state "names")
-            elseif (${arg} STREQUAL "PATHS")
-                set(_state "paths")
-            else ()
-                set(_jar_doc ${arg})
-            endif ()
-        endif ()
-    endforeach ()
-
-    if (NOT _jar_names)
-        message(FATAL_ERROR "find_jar: No name to search for given")
-    endif ()
-
-    foreach (jar_name ${_jar_names})
-        foreach (version ${_jar_versions})
-            set(_jar_files ${_jar_files} ${jar_name}-${version}.jar)
-        endforeach ()
-        set(_jar_files ${_jar_files} ${jar_name}.jar)
-    endforeach ()
-
-    find_file(${VARIABLE}
-        NAMES   ${_jar_files}
-        PATHS   ${_jar_paths}
-        DOC     ${_jar_doc}
-        NO_DEFAULT_PATH)
-endfunction ()
-
-function(create_javadoc _target)
-    set(_javadoc_packages)
-    set(_javadoc_files)
-    set(_javadoc_sourcepath)
-    set(_javadoc_classpath)
-    set(_javadoc_installpath "${CMAKE_INSTALL_PREFIX}/share/javadoc")
-    set(_javadoc_doctitle)
-    set(_javadoc_windowtitle)
-    set(_javadoc_author FALSE)
-    set(_javadoc_version FALSE)
-    set(_javadoc_use FALSE)
-
-    set(_state "package")
-
-    foreach (arg ${ARGN})
-        if (${_state} STREQUAL "package")
-            if (${arg} STREQUAL "PACKAGES")
-                set(_state "packages")
-            elseif (${arg} STREQUAL "FILES")
-                set(_state "files")
-            elseif (${arg} STREQUAL "SOURCEPATH")
-                set(_state "sourcepath")
-            elseif (${arg} STREQUAL "CLASSPATH")
-                set(_state "classpath")
-            elseif (${arg} STREQUAL "INSTALLPATH")
-                set(_state "installpath")
-            elseif (${arg} STREQUAL "DOCTITLE")
-                set(_state "doctitle")
-            elseif (${arg} STREQUAL "WINDOWTITLE")
-                set(_state "windowtitle")
-            elseif (${arg} STREQUAL "AUTHOR")
-                set(_state "author")
-            elseif (${arg} STREQUAL "USE")
-                set(_state "use")
-            elseif (${arg} STREQUAL "VERSION")
-                set(_state "version")
-            else ()
-                set(_javadoc_packages ${arg})
-                set(_state "packages")
-            endif ()
-        elseif (${_state} STREQUAL "packages")
-            if (${arg} STREQUAL "FILES")
-                set(_state "files")
-            elseif (${arg} STREQUAL "SOURCEPATH")
-                set(_state "sourcepath")
-            elseif (${arg} STREQUAL "CLASSPATH")
-                set(_state "classpath")
-            elseif (${arg} STREQUAL "INSTALLPATH")
-                set(_state "installpath")
-            elseif (${arg} STREQUAL "DOCTITLE")
-                set(_state "doctitle")
-            elseif (${arg} STREQUAL "WINDOWTITLE")
-                set(_state "windowtitle")
-            elseif (${arg} STREQUAL "AUTHOR")
-                set(_state "author")
-            elseif (${arg} STREQUAL "USE")
-                set(_state "use")
-            elseif (${arg} STREQUAL "VERSION")
-                set(_state "version")
-            else ()
-                list(APPEND _javadoc_packages ${arg})
-            endif ()
-        elseif (${_state} STREQUAL "files")
-            if (${arg} STREQUAL "PACKAGES")
-                set(_state "packages")
-            elseif (${arg} STREQUAL "SOURCEPATH")
-                set(_state "sourcepath")
-            elseif (${arg} STREQUAL "CLASSPATH")
-                set(_state "classpath")
-            elseif (${arg} STREQUAL "INSTALLPATH")
-                set(_state "installpath")
-            elseif (${arg} STREQUAL "DOCTITLE")
-                set(_state "doctitle")
-            elseif (${arg} STREQUAL "WINDOWTITLE")
-                set(_state "windowtitle")
-            elseif (${arg} STREQUAL "AUTHOR")
-                set(_state "author")
-            elseif (${arg} STREQUAL "USE")
-                set(_state "use")
-            elseif (${arg} STREQUAL "VERSION")
-                set(_state "version")
-            else ()
-                list(APPEND _javadoc_files ${arg})
-            endif ()
-        elseif (${_state} STREQUAL "sourcepath")
-            if (${arg} STREQUAL "PACKAGES")
-                set(_state "packages")
-            elseif (${arg} STREQUAL "FILES")
-                set(_state "files")
-            elseif (${arg} STREQUAL "CLASSPATH")
-                set(_state "classpath")
-            elseif (${arg} STREQUAL "INSTALLPATH")
-                set(_state "installpath")
-            elseif (${arg} STREQUAL "DOCTITLE")
-                set(_state "doctitle")
-            elseif (${arg} STREQUAL "WINDOWTITLE")
-                set(_state "windowtitle")
-            elseif (${arg} STREQUAL "AUTHOR")
-                set(_state "author")
-            elseif (${arg} STREQUAL "USE")
-                set(_state "use")
-            elseif (${arg} STREQUAL "VERSION")
-                set(_state "version")
-            else ()
-                list(APPEND _javadoc_sourcepath ${arg})
-            endif ()
-        elseif (${_state} STREQUAL "classpath")
-            if (${arg} STREQUAL "PACKAGES")
-                set(_state "packages")
-            elseif (${arg} STREQUAL "FILES")
-                set(_state "files")
-            elseif (${arg} STREQUAL "SOURCEPATH")
-                set(_state "sourcepath")
-            elseif (${arg} STREQUAL "INSTALLPATH")
-                set(_state "installpath")
-            elseif (${arg} STREQUAL "DOCTITLE")
-                set(_state "doctitle")
-            elseif (${arg} STREQUAL "WINDOWTITLE")
-                set(_state "windowtitle")
-            elseif (${arg} STREQUAL "AUTHOR")
-                set(_state "author")
-            elseif (${arg} STREQUAL "USE")
-                set(_state "use")
-            elseif (${arg} STREQUAL "VERSION")
-                set(_state "version")
-            else ()
-                list(APPEND _javadoc_classpath ${arg})
-            endif ()
-        elseif (${_state} STREQUAL "installpath")
-            if (${arg} STREQUAL "PACKAGES")
-                set(_state "packages")
-            elseif (${arg} STREQUAL "FILES")
-                set(_state "files")
-            elseif (${arg} STREQUAL "SOURCEPATH")
-                set(_state "sourcepath")
-            elseif (${arg} STREQUAL "DOCTITLE")
-                set(_state "doctitle")
-            elseif (${arg} STREQUAL "WINDOWTITLE")
-                set(_state "windowtitle")
-            elseif (${arg} STREQUAL "AUTHOR")
-                set(_state "author")
-            elseif (${arg} STREQUAL "USE")
-                set(_state "use")
-            elseif (${arg} STREQUAL "VERSION")
-                set(_state "version")
-            else ()
-                set(_javadoc_installpath ${arg})
-            endif ()
-        elseif (${_state} STREQUAL "doctitle")
-            if (${arg} STREQUAL "PACKAGES")
-                set(_state "packages")
-            elseif (${arg} STREQUAL "FILES")
-                set(_state "files")
-            elseif (${arg} STREQUAL "SOURCEPATH")
-                set(_state "sourcepath")
-            elseif (${arg} STREQUAL "INSTALLPATH")
-                set(_state "installpath")
-            elseif (${arg} STREQUAL "CLASSPATH")
-                set(_state "classpath")
-            elseif (${arg} STREQUAL "WINDOWTITLE")
-                set(_state "windowtitle")
-            elseif (${arg} STREQUAL "AUTHOR")
-                set(_state "author")
-            elseif (${arg} STREQUAL "USE")
-                set(_state "use")
-            elseif (${arg} STREQUAL "VERSION")
-                set(_state "version")
-            else ()
-                set(_javadoc_doctitle ${arg})
-            endif ()
-        elseif (${_state} STREQUAL "windowtitle")
-            if (${arg} STREQUAL "PACKAGES")
-                set(_state "packages")
-            elseif (${arg} STREQUAL "FILES")
-                set(_state "files")
-            elseif (${arg} STREQUAL "SOURCEPATH")
-                set(_state "sourcepath")
-            elseif (${arg} STREQUAL "CLASSPATH")
-                set(_state "classpath")
-            elseif (${arg} STREQUAL "INSTALLPATH")
-                set(_state "installpath")
-            elseif (${arg} STREQUAL "DOCTITLE")
-                set(_state "doctitle")
-            elseif (${arg} STREQUAL "AUTHOR")
-                set(_state "author")
-            elseif (${arg} STREQUAL "USE")
-                set(_state "use")
-            elseif (${arg} STREQUAL "VERSION")
-                set(_state "version")
-            else ()
-                set(_javadoc_windowtitle ${arg})
-            endif ()
-        elseif (${_state} STREQUAL "author")
-            if (${arg} STREQUAL "PACKAGES")
-                set(_state "packages")
-            elseif (${arg} STREQUAL "FILES")
-                set(_state "files")
-            elseif (${arg} STREQUAL "SOURCEPATH")
-                set(_state "sourcepath")
-            elseif (${arg} STREQUAL "CLASSPATH")
-                set(_state "classpath")
-            elseif (${arg} STREQUAL "INSTALLPATH")
-                set(_state "installpath")
-            elseif (${arg} STREQUAL "DOCTITLE")
-                set(_state "doctitle")
-            elseif (${arg} STREQUAL "WINDOWTITLE")
-                set(_state "windowtitle")
-            elseif (${arg} STREQUAL "AUTHOR")
-                set(_state "author")
-            elseif (${arg} STREQUAL "USE")
-                set(_state "use")
-            elseif (${arg} STREQUAL "VERSION")
-                set(_state "version")
-            else ()
-                set(_javadoc_author ${arg})
-            endif ()
-        elseif (${_state} STREQUAL "use")
-            if (${arg} STREQUAL "PACKAGES")
-                set(_state "packages")
-            elseif (${arg} STREQUAL "FILES")
-                set(_state "files")
-            elseif (${arg} STREQUAL "SOURCEPATH")
-                set(_state "sourcepath")
-            elseif (${arg} STREQUAL "CLASSPATH")
-                set(_state "classpath")
-            elseif (${arg} STREQUAL "INSTALLPATH")
-                set(_state "installpath")
-            elseif (${arg} STREQUAL "DOCTITLE")
-                set(_state "doctitle")
-            elseif (${arg} STREQUAL "WINDOWTITLE")
-                set(_state "windowtitle")
-            elseif (${arg} STREQUAL "AUTHOR")
-                set(_state "author")
-            elseif (${arg} STREQUAL "USE")
-                set(_state "use")
-            elseif (${arg} STREQUAL "VERSION")
-                set(_state "version")
-            else ()
-                set(_javadoc_use ${arg})
-            endif ()
-        elseif (${_state} STREQUAL "version")
-            if (${arg} STREQUAL "PACKAGES")
-                set(_state "packages")
-            elseif (${arg} STREQUAL "FILES")
-                set(_state "files")
-            elseif (${arg} STREQUAL "SOURCEPATH")
-                set(_state "sourcepath")
-            elseif (${arg} STREQUAL "CLASSPATH")
-                set(_state "classpath")
-            elseif (${arg} STREQUAL "INSTALLPATH")
-                set(_state "installpath")
-            elseif (${arg} STREQUAL "DOCTITLE")
-                set(_state "doctitle")
-            elseif (${arg} STREQUAL "WINDOWTITLE")
-                set(_state "windowtitle")
-            elseif (${arg} STREQUAL "AUTHOR")
-                set(_state "author")
-            elseif (${arg} STREQUAL "USE")
-                set(_state "use")
-            elseif (${arg} STREQUAL "VERSION")
-                set(_state "version")
-            else ()
-                set(_javadoc_version ${arg})
-            endif ()
-        endif ()
-    endforeach ()
-
-    set(_javadoc_builddir ${CMAKE_CURRENT_BINARY_DIR}/javadoc/${_target})
-    set(_javadoc_options -d ${_javadoc_builddir})
-
-    if (_javadoc_sourcepath)
-        set(_start TRUE)
-        foreach(_path ${_javadoc_sourcepath})
-            if (_start)
-                set(_sourcepath ${_path})
-                set(_start FALSE)
-            else ()
-                set(_sourcepath ${_sourcepath}:${_path})
-            endif ()
-        endforeach()
-        set(_javadoc_options ${_javadoc_options} -sourcepath ${_sourcepath})
-    endif ()
-
-    if (_javadoc_classpath)
-        set(_start TRUE)
-        foreach(_path ${_javadoc_classpath})
-            if (_start)
-                set(_classpath ${_path})
-                set(_start FALSE)
-            else ()
-                set(_classpath ${_classpath}:${_path})
-            endif ()
-        endforeach()
-        set(_javadoc_options ${_javadoc_options} -classpath "${_classpath}")
-    endif ()
-
-    if (_javadoc_doctitle)
-        set(_javadoc_options ${_javadoc_options} -doctitle '${_javadoc_doctitle}')
-    endif ()
-
-    if (_javadoc_windowtitle)
-        set(_javadoc_options ${_javadoc_options} -windowtitle '${_javadoc_windowtitle}')
-    endif ()
-
-    if (_javadoc_author)
-        set(_javadoc_options ${_javadoc_options} -author)
-    endif ()
-
-    if (_javadoc_use)
-        set(_javadoc_options ${_javadoc_options} -use)
-    endif ()
-
-    if (_javadoc_version)
-        set(_javadoc_options ${_javadoc_options} -version)
-    endif ()
-
-    add_custom_target(${_target}_javadoc ALL
-        COMMAND ${Java_JAVADOC_EXECUTABLE} ${_javadoc_options}
-                            ${_javadoc_files}
-                            ${_javadoc_packages}
-        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-    )
-
-    install(
-        DIRECTORY ${_javadoc_builddir}
-        DESTINATION ${_javadoc_installpath}
-    )
-endfunction()
diff --git a/tools/cmake/Modules/UseJavaClassFilelist.cmake b/tools/cmake/Modules/UseJavaClassFilelist.cmake
deleted file mode 100644
index 6f3a4e7..0000000
--- a/tools/cmake/Modules/UseJavaClassFilelist.cmake
+++ /dev/null
@@ -1,52 +0,0 @@
-#
-# This script create a list of compiled Java class files to be added to a
-# jar file. This avoids including cmake files which get created in the
-# binary directory.
-#
-
-#=============================================================================
-# Copyright 2010-2011 Andreas schneider <asn@redhat.com>
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-if (CMAKE_JAVA_CLASS_OUTPUT_PATH)
-    if (EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}")
-
-        set(_JAVA_GLOBBED_FILES)
-        if (CMAKE_JAR_CLASSES_PREFIX)
-            foreach(JAR_CLASS_PREFIX ${CMAKE_JAR_CLASSES_PREFIX})
-                message(STATUS "JAR_CLASS_PREFIX: ${JAR_CLASS_PREFIX}")
-
-                file(GLOB_RECURSE _JAVA_GLOBBED_TMP_FILES "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/${JAR_CLASS_PREFIX}/*.class")
-                if (_JAVA_GLOBBED_TMP_FILES)
-                    list(APPEND _JAVA_GLOBBED_FILES ${_JAVA_GLOBBED_TMP_FILES})
-                endif ()
-            endforeach()
-        else()
-            file(GLOB_RECURSE _JAVA_GLOBBED_FILES "${CMAKE_JAVA_CLASS_OUTPUT_PATH}/*.class")
-        endif ()
-
-        set(_JAVA_CLASS_FILES)
-        # file(GLOB_RECURSE foo RELATIVE) is broken so we need this.
-        foreach(_JAVA_GLOBBED_FILE ${_JAVA_GLOBBED_FILES})
-            file(RELATIVE_PATH _JAVA_CLASS_FILE ${CMAKE_JAVA_CLASS_OUTPUT_PATH} ${_JAVA_GLOBBED_FILE})
-            set(_JAVA_CLASS_FILES ${_JAVA_CLASS_FILES}${_JAVA_CLASS_FILE}\n)
-        endforeach()
-
-        # write to file
-        file(WRITE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist ${_JAVA_CLASS_FILES})
-
-    else ()
-        message(SEND_ERROR "FATAL: Java class output path doesn't exist")
-    endif ()
-else ()
-    message(SEND_ERROR "FATAL: Can't find CMAKE_JAVA_CLASS_OUTPUT_PATH")
-endif ()
diff --git a/tools/cmake/Modules/UseJavaSymlinks.cmake b/tools/cmake/Modules/UseJavaSymlinks.cmake
deleted file mode 100644
index 88dd768..0000000
--- a/tools/cmake/Modules/UseJavaSymlinks.cmake
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# Helper script for UseJava.cmake
-#
-
-#=============================================================================
-# Copyright 2010-2011 Andreas schneider <asn@redhat.com>
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-if (UNIX AND _JAVA_TARGET_OUTPUT_LINK)
-    if (_JAVA_TARGET_OUTPUT_NAME)
-        find_program(LN_EXECUTABLE
-            NAMES
-                ln
-        )
-
-        execute_process(
-            COMMAND ${LN_EXECUTABLE} -sf "${_JAVA_TARGET_OUTPUT_NAME}" "${_JAVA_TARGET_OUTPUT_LINK}"
-            WORKING_DIRECTORY ${_JAVA_TARGET_DIR}
-        )
-    else ()
-        message(SEND_ERROR "FATAL: Can't find _JAVA_TARGET_OUTPUT_NAME")
-    endif ()
-endif ()
diff --git a/tools/cmake/Modules/WindowsC99CheckDef.cmake b/tools/cmake/Modules/WindowsC99CheckDef.cmake
deleted file mode 100644
index 0855d93..0000000
--- a/tools/cmake/Modules/WindowsC99CheckDef.cmake
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-#
-# Check qpid-proton.dll after linking for dangerous calls to
-# Windows functions that suggest but deviate from C99 behavior:
-#   _snprintf, vsnprintf, _vsnprintf
-# See platform.h for safe wrapper calls.
-#
-
-set(obj_dir ${CMAKE_CURRENT_BINARY_DIR}/qpid-proton.dir/${CMAKE_CFG_INTDIR})
-
-add_custom_command(TARGET qpid-proton PRE_LINK COMMAND ${PYTHON_EXECUTABLE}
-        ${CMAKE_MODULE_PATH}WindowsC99SymbolCheck.py ${obj_dir}
-        COMMENT "Checking for dangerous use of C99-violating functions")
diff --git a/tools/cmake/Modules/WindowsC99SymbolCheck.py b/tools/cmake/Modules/WindowsC99SymbolCheck.py
deleted file mode 100644
index 7c2c9f2..0000000
--- a/tools/cmake/Modules/WindowsC99SymbolCheck.py
+++ /dev/null
@@ -1,66 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-#
-# Stop cmake build if pn_i_xxx substitute functions aren't used for
-# the dangererous non-complying [v]snprintf family.  A source of
-# painful bug-hunting.
-#
-# Each obj must be checked instead of just the dll since Visual Studio
-# sometimes inserts references to vsnprintf in DllMainCRTStartup,
-# causing false positives.
-#
-# bad: vsnprintf, __vsnprintf, _imp__vsnprintf, ...,  same for snprintf
-# OK:  vsnprintf_s, pn_i_vsnprintf
-#
-
-import sys
-import os
-import subprocess
-import glob
-import re
-
-def symcheck(objfile):
-
-    symfile = objfile.replace('.obj', '.sym')
-    cmd = ['dumpbin.exe', '/SYMBOLS', objfile, '/OUT:' + symfile]
-
-    # /dev/null standin
-    junk = open('junk', 'w')
-    p = subprocess.Popen(cmd, stdout=junk)
-    n = p.wait()
-    if n != 0 :
-        raise Exception("dumpbin call failure")
-
-    f = open(symfile, 'r')
-    for line in f :
-        m = re.search(r'UNDEF.*\b([a-zA-Z_]*snprintf)\b', line)
-        if m :
-            sym = m.group(1)
-            if re.match(r'_*pni_v?snprintf', sym) is None :
-                raise Exception('Unsafe use of C99 violating function in  ' + objfile + ' : ' + sym)
-
-def main():
-    os.chdir(sys.argv[1])
-    objs = glob.glob('*.obj')
-    for obj in glob.glob('*.obj'):
-        symcheck(obj)
-
-if __name__ == "__main__":
-    sys.exit(main())
diff --git a/version.txt b/version.txt
deleted file mode 100644
index 636e47c..0000000
--- a/version.txt
+++ /dev/null
@@ -1 +0,0 @@
-0.17.0-SNAPSHOT