C socket on C++ class library imitated by Java Socket