Trying to develop a reliable UDP protocol for my game (made in GameMaker: Studio) that connects to a Java server. I need to ensure packets arrive and that they arrive in the correct order.
I'm trying to model off of the TCP protocol to do this, and one thing that's confusing me is the 3-way handshake: when does it occur?
Is the handshake basically when you first connect to something? It's only ever done once? (until the connection is dropped)
If that's the case, then what data am I attaching to regular packets?
Say I have my initial 3 packets for the connection: SYN -> SYN-ACK -> ACK
Let's assume this all went smoothly, boom we're connected.
And then let's say I want to send the server a message: "Hello". Am I basically doing SYN -> SYN-ACK -> ACK
for this message? What exactly am I attaching to this message packet/datagram to ensure it arrives and arrives in order?