This line is wrong:
if ((bytesRcvd = recv(sock, echoBuffer, RCVBUFSIZE - 1, 0)) <= 0)
The socket is in blocking mode, and the above line is attempting to read too much data as it nears the end of the message, so it will block if it does not receive as much as it is expecting.
Try this instead:
if ((bytesRcvd = recv(sock, echoBuffer, min(echoStringLen - totalBytesRcvd, RCVBUFSIZE), 0)) <= 0)
And then change this:
echoBuffer[bytesRcvd] = '\0'; /* Add \0 so printf knows where to stop */
printf("%s", echoBuffer); /* Print the echo buffer */
To thus instead:
/* Specify bytes read so printf knows where to stop */
printf("%*s", bytesRcvd, echoBuffer); /* Print the echo buffer */