Removed session.close() in error listener (the framework will close it appropriately), sanity check connection status before attempting to send information, better logging of session object