Use of tcp protocol in C to exchange files