Following is my client code....I am receiving data of equal size of JPG file... so if anyone can help me out with reading buffer properly and writing it in to jpg file at client side
================================================
do
{
memset(buffer,0x0,BUFFER_SIZE); // init line
rc = read(sd, buffer, BUFFER_SIZE);
if( rc > 0)
{
printf("%s",buffer);
size +=rc;
}
// printf(" %d ",size);
}while(rc>0);
pFile = fopen ( "new.jpg" , "wb" );
fwrite (buffer, 1 , size , pFile );
fclose (pFile);
printf("\n Total received response bytes: %d\n",size);
// return
close(sd);