Home > other >  The socket send large amounts of data will occupy relatively more time
The socket send large amounts of data will occupy relatively more time

Time:10-18

Client connect to the server, the client is a player that can play video files from the server, the specific process: the client request, the server open video file, reads the specified the size of the send data to the client, continue to send, until the file is read, the actual measurement result, a 10 minute PuQing video file, if not call socket send interface, direct continued until after reading, reads the specified size just two seconds, but after calling the send into it takes more than ten seconds, the whole process is done and single thread blocking, by playing time LOG, time is spent on the interface of the send, send me this with asynchronous is actually it takes a long time, almost one player can have optimized solutions, or no way out on one side of the socket and has reached the bottleneck...
  • Related