File Transfer Over Internet Using TCP/IP
Hi all,
I am using TCP/IP for transferring files over internet. For that,
I am first converting all files into byte array and then writing them to
memory stream. Then I am reading this memeory stream on the other end.
Now when I am using this technique on LAN it runs absolutely perfect.
But when I use it on internet with speed of 56 KBPS the data received on other side is
corrupted.
Also this happens only in case of large amount of data. While transferring strings
it works fine.
What can be the problem ?
Please help ?
I am using TCP/IP for transferring files over internet. For that,
I am first converting all files into byte array and then writing them to
memory stream. Then I am reading this memeory stream on the other end.
Now when I am using this technique on LAN it runs absolutely perfect.
But when I use it on internet with speed of 56 KBPS the data received on other side is
corrupted.
Also this happens only in case of large amount of data. While transferring strings
it works fine.
What can be the problem ?
Please help ?
|
#2
| ||||
| ||||
|
Re: File Transfer Over Internet Using TCP/IP
This is most likely the result of data being dropped or being received out of sequence. Try implementing any combination of these: 1) Break your data into smaller packets. 2) Add a sequence number to your packets so you know how to rebuild the data. 3) Add a checksum to the packet so you know exactly how much data is in the packet and final payload. 4) Send all of the packets twice. For instance: if you add sequence numbers (and other techniques), you can verify that you have received all the packets, and if not, you can ask your server to send a specific packet again. You can also then rebuild the data in the correct sequence. |


浙公网安备 33010602011771号