An IPv4 packet has a header of 20bytes
A TCP message adds 20 moreUDP adds 8What is the point of saving a byte when you have such an overhead?That is why I've created a plan. To buffer the data to an array and then send it as a single message. Well, two. TCP and UDP. This requires a replace for buffsize. For this, I will donate 3bits to the amount of bytes in the message and then leave the other 5 for the MsgID. But what of the bitstream? For that, I will make it the first message sent. This will save 28 byte per message(I don't use TCP much, so there aren't any messages to string together. Oh, and there will always be the dreaded 28. To think, that'll be 40 with IPv6)Looking over the send code, it seems I also set it to send every UDP with a TCP duplicate? Oh well, fixed
I always use tcp, and never udp.
TCP is slow for things. People go on about not being reliable, but they don't get that you are updating something every 30th of a frame. To simply send a blank message TCP is 12bytes more than UDP. And that doesn't include requiring ACKs and resends if some data you've already resent since a frame has gone by didn't get through
Ouch, that's an overhead.
I've no experience with online things, so I don't know… anything about it.Simple enough, pack bytes to buffer and send. When received, react
Hmmm I always thought that UDP was the slow one :O