File Transfer Over TCP/IP

G

Guest

HI ALL,
I HAVE GOT A VERY STRANGE PROBLEM WHILE TRANSFERRING DATA OVER INTERNET.
ACTUALLY I AM SENDING AND RECEIVING DATA BETWEEN TWO APPLICATIONS USING
TCP. WHILE SENDING OR RECEIVING DATA, I WRITE THE DATA TO NETWORK STREAM AND
THEN READ IT
FROM NETWORK STREAM.
BY DOING SO I AM ABLE TO SEND AND RECIEVE DATA OVER LAN. BUT WHEN I USE
INTERNET
CONNECTION OF SPEED AROUND 56 KBPS, THE DATA WHICH I RECEIVE IS CORRUPTED
OR IT IS NOT IN THE SEQUENCE IN WHICH IT WAS SENT. ALSO
THIS PROBLEM OCURS FOR LARGE SIZE OF DATA. FOR SMALLER DATA SIZE LIKE A
STRING, IT WORKS FINE.

ON LAN EVERYTHING WORKS FINE. THE PROBLEM OCCURS ONLY ON INTERNET.

PLEASE HELP ?
 
G

Guest

It sounds like you are using UDP and not TCP as the TCP protocol is designed
to ensure that messages arrives in sequence. If you're using TCP the
underlying network protocol would not allow that to happen.

It really does sound like you are using UDP because you would notice most
problems over the internet with UDP as packets get lost the whole time.

Brian Delahunty
Ireland
 
G

Guest

DONT QUOTE ME ON THIS
But:

I seem to remember that TCP guarantees to deliver all the packets you send
but they can be received in any order. So you could send 3 packets 1 - 2 - 3
and receive then as 2 - 3 - 1.

See http://mike.passwall.com/networking/tcppacket.html
there is a 32bit sequence number in the header

You may need to rebuild the data manually after checking the packet headers
for an order indicator or something
 

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