+ 3
Socket C++
I want to write game with lan multiplayer. I use bsd-socket for chat, but I don't know how to pass player class through socket.
1 Answer
+ 3
There are many ways, i gonna mention two.
1-easy) put your relevant object information into a bytearray and just send it like you did with the text messages.
2-elegant) pass a reference of your object to send and use sizeof(...) for your length. Take a look into boost alignment stuff if you are interested in this way.