如何在c程序中使用fopen读取多个文件? [英] How to read multiple files using fopen in c program?

查看:159
本文介绍了如何在c程序中使用fopen读取多个文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想知道如何使用fopen读取多个文件并将其发送到服务器以及服务器如何接收没有数据的所有文件使用tcp / ip协议丢失?

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?

推荐答案

最简单的方法就是那个伪代码



The easiest way would be like that pseudocode

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.


这篇关于如何在c程序中使用fopen读取多个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆