How can I know all data has been received?

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top