D
David Glover
Hi,
I posted a question a while back relating to sending data over a
network, and was told to go and look into how networks send data.
I know that TCP can not guarentee the order in which data is delivered
to a device. In light of this, I have a problem which I can not find a
way out of:
I need to send a file of around 4-5Mb over a network. To prevent
communicaiton thread being locked, I was attempting to segment the
data into 8k segments of data to be sent. In the header of each
segment, I was attaching a 4byte integer representing the segment
number, which will allow the reciever to place the data in the
relevant position in the output file. Occasionally the client decodes
the segment identifier into a bizzare value (last time I tried this, I
was expecting to see segment number 234, and recieved -432352 or
similar).
However, this is not working,and the data being written out to a file
at the reciever is not the same as the input data at the server. Why
would this be?
Please can anyone shed any light on this matter, or show me an example
of how I should send the data/ensure that the data at the client end
is pieced together correctly?
Many thanks for any help - I am very confused by this matter.
David
I posted a question a while back relating to sending data over a
network, and was told to go and look into how networks send data.
I know that TCP can not guarentee the order in which data is delivered
to a device. In light of this, I have a problem which I can not find a
way out of:
I need to send a file of around 4-5Mb over a network. To prevent
communicaiton thread being locked, I was attempting to segment the
data into 8k segments of data to be sent. In the header of each
segment, I was attaching a 4byte integer representing the segment
number, which will allow the reciever to place the data in the
relevant position in the output file. Occasionally the client decodes
the segment identifier into a bizzare value (last time I tried this, I
was expecting to see segment number 234, and recieved -432352 or
similar).
However, this is not working,and the data being written out to a file
at the reciever is not the same as the input data at the server. Why
would this be?
Please can anyone shed any light on this matter, or show me an example
of how I should send the data/ensure that the data at the client end
is pieced together correctly?
Many thanks for any help - I am very confused by this matter.
David