1 year ago

#327920

test-img

Grant

Out of order packet recombination in C

I'm trying to make a C program that receives a file broken up into 64-bit segments and recombines them. The packets will be arriving out of order but have an ID with them (to re-order them)

I've made the file transfer part, but it needs to arrive in order right now.

Not really sure how to approach this. Was thinking of using an array to store the future IDs until needed, but that seems cumbersome and complex with all the dynamic memory allocation.

EDITs: thanks Barmar for the response. That makes sense, but this is happening inside a function that will go out of scope after each packet is sent and I cant save the data to a higher level.

thanks

c

file-transfer

0 Answers

Your Answer

Accepted video resources