V
V
VitiaKotik2020-06-16 17:09:39
C++ / C#
VitiaKotik, 2020-06-16 17:09:39

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

2 answer(s)
S
Saboteur, 2020-06-16
@VitiaKotik

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.

L
LiptonOlolo, 2020-06-16
@LiptonOlolo

It is possible as an option to make your own data package.
For example, with this structure:

  • Packet length
  • Operation code (depending on it, you do different actions)
  • Package body

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question