cplusplus socketwrapper with threads