I am trying to read a file from a socket. I use select with timeout to exit after reading.
select(maxfdp1, &rset, NULL, NULL, &timeout);
But if I knew the size of the file being sent right away, I could exit instantly after getting the right amount of bytes.
Сan i get the full file size before transferring it?
Or what should I use to exit instantly after the transfer is complete?