To use the CVI TCP library, you must process events. The read might work sometimes without processing events because it may be possible to read all the data without processing window messages, but this is not reliable. So, you need the TCP callback and your thread must process events by calling RunUserInterface, ProcessSystemEvents, or ProcessTCPEvents.
Best regards,
Mohan