How can I know all data has been received?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,
I'm using Socket and to send some data (3Mb, 4MB, or more than that). I
convert data to byte array and use Send method and data is successfully sent.
From other side, I use Receive method. I put data in a file and when all data
has been received, I have to close the file. The poblem is I don't know when
all data has been received. I use Available property, but it gives 0 although
data is still coming. Now I'm using blocking socket. Do I need to use
Asynchronous socket? If so, how can I do? On internet, I see some example, it
send total number of bytes to send before the data is send. If I do like
that, the problem is ok. But I don't want to send "total bytes to send" to
other side. How can I solve this problem.
Thanks,
Ant.
 
Back
Top