I fixed the protocol code. The protocol now sends messages. It still needs to be cleaned up.
The messages are now sent in packets. To test multiple packets sending.
Basic protocol ready.