Post your modified code please. And please indent it this time.
Post your modified code please. And please indent it this time.
What do you mean by ident it? I don't see a c code tag if you mean that...?
I haven't changed the select thing, and when I execute the client, it should, on connect, ask me for a file path, but it doesn't and it disconnects from the server
If you mean with ident, making it more easy to read, I've pasted it in pastebin, so it's a little more colored and i won't be such a pain like reading this =P
File server
http://pastebin.com/m38107086
File client
http://pastebin.com/m7ff255f2
Thanks for taking so much care about my doubts =P
ident is a program that indents. But you didn't indent your code. Luckily, I know how to make my editor indent code. Compare and contrast: http://pastebin.com/m16f63647
Ohh I see.. you tided the code a little xD, I'm using just gedit for editing, a simple notepad, that's why it's a mess xD
Well.. what about my questions? =P
Well.. the main problem now is that it doesn't requests me for the filename and the client disconnects
You need to assume that send and recv will not send or recv all the bytes you want to. You have to send or recv it again then. So you have to get the return value of all the sends and recvs and do something with it. Read the man pages for send and recv.
To do that, go to a shell prompt and type:
man 2 send
and then
man 2 recv
> char buff[1048576]; // ?? memaloc
Yes, you should malloc it; it might be too large for the stack.
I have typed what you said but it says the manual doesn't exist, what are you saying that is my main problem here? the program is not sending and recieving anything?
Maybe you mean a loop until it get a response
Last edited by lautarox; 09-10-2008 at 02:13 PM.
What OS are you running this under?
Try just
man send
and
man recv
Last edited by robwhit; 09-10-2008 at 04:13 PM.
I'm under linux, and that command doesn't work neither
We mean to type this at the terminal, not put it in your program? Can you do "man man"? I've never seen a linux that didn't have man pages.
You can do custom installations without man installed. Though, if you know how to accomplish the task of omitting the man pages at installation, you probably are familiar enough with linux to put them back or use them... or go online to use them, for that matter.
What specific OS?
I'm using ubuntu 8.04, and man man works, but what can I get from doing that? man refers to manual? do I have something wrong in my code?
Open synaptic and make sure you have all the libraries and man pages for your C standard libraries and linux standard libraries installed too.