Answer the question
In order to leave comments, you need to log in
TCP - what is the best way to transfer data?
Good afternoon! What is the best way to transfer data over TCP protocol? Maybe JSON, or maybe something else.
PS The game is not realtime, rather turn-based. Server in C++
Answer the question
In order to leave comments, you need to log in
Speaking about TCP, they mean more a socket, where you simply transfer data as a binary packet, you come up with a format, a packer and a parser yourself, while the packet size can be much smaller than JSON or other text.
JSON is commonly used in text-based protocols such as http,
but you can also send plain text.
It is possible as an option to make your own data package.
For example, with this structure:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question