fix mempry leak due to repeated unnecesary connect() calls on setting up a subscription
fixed c++ std version to build on older linuxes
fixed leak and high cpu usage during setup phase