Quote:
Stop trying to use a C-style string and figure out another way to determine the length. For example, send the size of the string first, then the string itself, and don't try to use functions that expect a null terminated string.
Beyond this, that's all we can tell you, because to find a complete solution and tell you what functions / APIs to use, we'd need to know the whole situation, and you're unlikely to find someone willing to take the time to do this. Can you contact the server administrator?