some fixes for release from shared library;
implemented connectEventCloseCallback ;