Updated C++ socket for ios/android