Home > Back-end >  Mina framework how to decode a complex object
Mina framework how to decode a complex object

Time:09-19

As shown in figure, give me a TCP protocol message document:

See the meaning of the document stDeviceStatus is a similar List object array data, then use the mina IoBuffer how to parse the data? Have no idea, please pass by big help, thank you first!

CodePudding user response:

This is not the first interface document TCP interface can't define, ambiguity is very much, such as the length of the int, big endian or small endian

Mina is not updated for many years, the main process to do netty, in netty, about this we can see

https://blog.csdn.net/qq_33314107/article/details/81292589

CodePudding user response:

This seems to API, call methods directly, and the suitable parameters, don't need you to unpack the set of packages, the things you said to use less than, if the agreement to message format specification, then you just need to care about what you said,

CodePudding user response:

refer to slip into a man of all ages 2 floor response:
this seems to API, call methods directly, and the suitable parameters, don't need you to unpack the set of packages, the things you said to use less than, if the agreement to message format specification, then you just need to care about what you said,

This is the message format specification, the other simple I parse the message object, but the message contains a complex object, I really don't know why

CodePudding user response:

reference 1st floor tianfang response:
, first of all, this is not the interface document TCP interface can't define, ambiguity is very much, such as the length of the int, big endian or small endian

Mina is not updated for many years, the main process to do netty, in netty, about this we can see

https://blog.csdn.net/qq_33314107/article/details/81292589

That is not TCP interface protocols, that is TCP interface protocol message format specification, now can't use netty, project with the original

CodePudding user response:

Don't press object processing, because C and Java object serialization methods, do the two methods, one is the object - "byte array, send this array, is a byte array -" object, used to receive decoding

CodePudding user response:

Or you will send all documents, according to what you mentioned above, no confirmation message format, can't set package,
reference gathered numerous big BUG reply: 3/f
Quote: refer to the second floor stumble into a man of all ages reply:

This seems to API, call methods directly, and the suitable parameters, don't need you to unpack the set of packages, the things you said to use less than, if the agreement to message format specification, then you just need to care about what you said,

This is the message format specification, the other simple I parse the message object, but the message contains a complex object, I really don't know how parsing

CodePudding user response:

Don't know how it is serialized, is unlikely to be padding bytes in sequence?
Such as before 8 bytes for ucZNBoxID (device ID), the next step is the device number 4 bytes, then 4 * (1 + 1 + 32 + 1 + 4 + 4 + 4) is the equipment list?
As for 32-bit and 64 - bit size end and C some basic types such as bytes long length of the other said,,,
  • Related