Hi, i'm having the same problem here... I have to send a xml file from a server and receive 16 bin files for answer..
I know how to send string and etc.. and tried to use sendfile() to send at least the xml file.. but it didn't work out... here's the code to send

/*part of my client program*/
FILE *fil = fopen("test.xml","r");
 sendfile(s1, fil, NULL, 255);

and here is what I receive in server

FILE *f;	
      rval = recv(s0, f, NULL, 255) ;
	  while (!feof(f)) {
		fscanf (f, "%s", msg) ;
		printf("Teste: %s \n",msg);	  
		}

hope you can hel me whit ANYTHING!

thanks anyway.

EDIT: never mind, this has been moved to a new thread.

.

Split into a new thread.

you havent given much for us to go on here, as far as trying to help you debug your code.

i suspect you need to review the fundamentals of socket programming.

review Beej's Guide, review your code, and try again.

Sure I do! that's why I'm asking for help... I've never used sockets before.. so I'm learning how to.

I got how to switch messages, to work whit a slave and master and etc.. but I couldn't do thw files thing to work ok!
But thanks for the help.

OK I got how to send files to a server e it's doing everything that it's supposed to do!

But how can I get the results of it!?

Like a send to client from server now....

i've lost track of your original question, if i ever understood it to begin with.

post your client and your server program files and tell us what's not working the way you expect it to.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.