Good afternoon, I used the code at your address
Transmitting a file over a network through sockets "Transmitting a file over a network through sockets":
FILE *in = fopen("SocketServer.exe","rb"); while(!feof(in)) { b=fread(bufer,1,sizeof(bufer),in); size=ftell(in); printf("bytes read: %d, part:%d, pos: %ld \n",b,i,size); if(b!=0) send(current,bufer,b,0); i++; }
but when I transmit, the jpeg is somehow distorted, it turns green, the pixels are shifted ... probably the carrier information is lost, as in the article by reference, they stint on it, is it possible here? Please help understand.
http://bytes.com/topic/c/answers/606052-socket-send-binary-jpeg
characterization finds 0 0 or ascii 0. Binary data, including jpegs, can be NULL much data to send (look at the return value of file.read for example) ... "