Updating socket consumer to retry with fwrite