Ok, I am trying to make a small server for a RPG. Not really going to be a game, Im just trying to learn about Network Programming and such. However I wrote a small server and client app. THey can communicate fine. However, They only can send string as far as I know. What If I wanted to send and recieve packets.
Client to Server:
1 byte - 0
2 bytes - Length of data
1 byte - Length of data
String - Username
Something that has somesort of structure and can have like a password and username and stuff in it. Instead of just sending and recieving one string.
And if I am able to make a client that sends data in a packet form like thus, how do I recieve the packet and take the specific info out of it.
If my question is confusing let me know and Ill try to reword it.
Thanks a lot