Home > other >  Turn a great god, and I need to send a set of location information from the client to the server, us
Turn a great god, and I need to send a set of location information from the client to the server, us

Time:09-18

Coordinates in the list of the list, how to use the Socket send to the server, the server how to parse the coordinate information?

CodePudding user response:

Using json preach (a custom class, contains the position information and rotation, using litjson conversion), or simply, converted to strings, server forwarding, after again in other clients in a specific format,

CodePudding user response:

General serialized byte [] transfer

CodePudding user response:

The Socket is a kind of mode, you need to format the data, and then at the other end of the format! What specific form Json, serialization, or their definition is ok!

CodePudding user response:

See your server and C end data interactive way, if the city json, then direct serialization can, if the city byte [] then serialized into a byte [], the specific format

CodePudding user response:

Using json can be converted to string
There are some plugins such as supersocket TCP socket also
  • Related