0

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
    }
}
3
Contributors
2
Replies
18
Views
4 Years
Discussion Span
Last Post by rubberman
0

Your code is not indicative of what you are trying to do. I'm unclear on the problem you are having. Are you suggesting that the file size is incorrect on the client side or that the file is never properly sent?

Can you elaborate and perhaps provide examples of the actual code you are using?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.