> Let me add my code snippet and try explaining things. the code works
> perfectly on a windows machine but not on Linux.

Sorry, but that didn't explain much it just showed your code. The
CURLE_RECV_ERROR return code is a failed recv() call (or similar) and your
application code cannot show us why that happened. It was more likely
something in your network or related environment that caused it.