I have code that uses a blocking socket to receive data via a call to recv. Everything works just fine. However there is no way to report to the user the number of bytes downloaded at any point in the process. I’m assuming that to be able to do this I would need to make multiple calls to recv, and report after each call? Or is there a better, more efficient way to do this?
Share
per MSDN,
recvdoes the following:So you could create an
int receivedand accumulate the bytes received that are returned byrecvuntilrecvthere is no more to receive, then report the total accumulated in yourreceivedvariable.