Click here to Skip to main content
15,890,043 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,

I would like to know how to read multiple files using fopen and send it to the server and how should the server receive all the files without data loss using tcp/ip protocol?
Posted
Updated 13-Dec-15 18:16pm
v2
Comments
Sergey Alexandrovich Kryukov 14-Dec-15 0:16am    
You will know it by implementing it all. You have to develop both client and sever parts. Any specific concerns?
And note, your question in the title makes no sense. fopen has nothing to do with "multiple" (it opens exactly one file) or "select" (what is that?)...
—SA
Suvendu Shekhar Giri 14-Dec-15 0:17am    
Anything you have tried so far?
venkat28vk 14-Dec-15 0:35am    
@ Giri. I am able to read a single text file using fopen and send it to the server. Now i need to try with multiple files.
Richard MacCutchan 14-Dec-15 3:30am    
What is the problem? You just need to read each file in turn and send it to the server, until all files are complete.
venkat28vk 14-Dec-15 4:08am    
@ richard. How can i read multiple files at concurrent time and send it to server in tcp/ip?

1 solution

The easiest way would be like that pseudocode

C++
while( isFileTransferToServerPending() )
{
   SendNextFileToServer();
}


It is also the normal solution because file transfer will be the bottleneck, so multiple file transfer wont speed up your solution.

You can think about complex scenarios, as implementing some client/server logic in which you get a identifier from the server which is identifying the file and the client is packing multiple file data with that identifier and packet stamp to send it to the server.
 
Share this answer
 
Comments
CPallini 14-Dec-15 2:48am    
5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900