File Reading/Writing Problems [Socket Programming]
First off I'm new here so sorry if my posts arn't so good. Second I'm from Belgian so sorry for my english!
- Are there any alternatives to fread and fwrite that doesn't require you specifing a buffer size? That directy write output/input
- Receiving files
int count =0;
numbytes = recv(sockfd, buffer, sizeof(buffer), 0);
count = count + numbytes;
if (count >= 33801216 )
fwrite(buffer, sizeof(buffer), 1, fp);
}while(numbytes > 0);
- I receive the file but I don't know how to close it, the file is always corrupt.
- I don't know how to send a file transfer complete to the sender; so what happends is that he keeps sending & the connection stays open.
- Binary files are corrupted when receiving
- Binary files smaller then the buffer size are corrupted
- Can't send file completed over DCC
THank you to any who can help me!