954,480 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

sendfile not working

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.

lipee36
Newbie Poster
3 posts since May 2009
Reputation Points: 10
Solved Threads: 0
 

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

.

jephthah
Posting Maven
2,587 posts since Feb 2008
Reputation Points: 2,143
Solved Threads: 179
 

Split into a new thread.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

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.

jephthah
Posting Maven
2,587 posts since Feb 2008
Reputation Points: 2,143
Solved Threads: 179
 

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.

lipee36
Newbie Poster
3 posts since May 2009
Reputation Points: 10
Solved Threads: 0
 

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....

lipee36
Newbie Poster
3 posts since May 2009
Reputation Points: 10
Solved Threads: 0
 

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.

jephthah
Posting Maven
2,587 posts since Feb 2008
Reputation Points: 2,143
Solved Threads: 179
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You