get length of cstring instead of nsstring when publishing a message