C Sockets - Split message into packets?
Posted on 2005-04-06
We are attempting to create a pair of programs (client & server) - one of which will send a message (server) and one of which will recieve (client). This works, with the user providing the ip of the client and a message to send.
However, we would like to break the message down into packets so that we can send longer messages. We have searched everywhere and cannot find any hints or tutorials on how to achieve this.
Basically we would like to know, given that the message (for example) is stored in a variable called "message", how would one break "message" down into individual packets? We have got as far as creating a struct called "packet" with variables for buffer, sequence_no and flag, but are unsure how to continue and how to use this to break down the message.
Any assistance gratefully recieved,