Hello all,
im quite new to network programming,im writing c code which dealt with transferring files using TCP over Sockets,
In my code,client sends the header information(information about the file ) to the server ,the code works fine
but received file size is sporadically a small than the file that is sent...
can anybody explain????????????????
typedef struct
{
int i;
int j;
char buff[16384] //16k
}BUFFER;
for(i = 0 ;i < m ;i++)
{
for(j = 0 ;j <n;j++)
{
if(send(sd,recvbuff,sizeof(BUFFER),0) == -1)
{
perror("send");
exit(1);
}
//recv ack
}
}