Problem solving using TCP for continuous file transfer
Today, when doing the project, we need the server to send a different number of pictures to the client according to the user's information. So want to do a continuous transmission file, but encountered in the process of a problem is that the client does not recognize the data flow of different files, resulting in the transmission of most files in the end of the client only one file in the acceptance of data, Everything is passed into a data inside.
This problem bothered me one day, and finally on the Internet to find the corresponding solution, before passing each person, the file to be transmitted to the size of the past, when the client to accept the data at all times to compare the size of the accepted file, equal to or greater than the size of the file transmitted, it means that the file has been transmitted.