Home > Back-end >  Linux Epoll receive large files
Linux Epoll receive large files

Time:11-01

Recently wrote a document version management server, server Linux system, use epoll + multithreading receive large files found that when the file will be divided into several packets sent and received, please leaders should be how to put the file on the server side together,
 

CodePudding user response:

Pieces of writing bai ~ ~ ~

CodePudding user response:

Define your own data in baotou bai, is a structure, on line before your file content data, file name, file information such as length,
Then according to the length and the header information is received, can all after collect the data of a file into the write file queue,
Or a little to write a little, writes the corresponding files,
According to the actual situation, send the file size, quantity, how often, network quality to choose, such as

Subcontract the data link layer protocol is certain, change, each packet maximum 1500 bytes, it also includes the layer protocol of baotou,

  • Related