Updated to work with new NonblockingConnection class