You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that this decoder does not validate the fixed header, so for example when I receive a message XXXX0008AAAA, I would like to evaluate this as an invalid message, ignore it, and wait for the proper message starting with the prefix AABB. I am not sure how to implement this properly. Should I make a second decoder or inherit some functionality from LengthFieldBasedFrameDecoder? Is there some "concept" in Netty that can help me achieve this?
Here is a working example for my current implementation. I would appreciate any help.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello. I am implementing Netty server for some proprietary TCP protocol. Each message in this protocol is in ASCII and has the following structure:
AABB
)For example,
55AA000512345
is valid message that the server can receive and it has a body12345
.I have implemented this decoder based on the standard LengthFieldBasedFrameDecoder and it works fine:
The problem is that this decoder does not validate the fixed header, so for example when I receive a message
XXXX0008AAAA
, I would like to evaluate this as an invalid message, ignore it, and wait for the proper message starting with the prefixAABB
. I am not sure how to implement this properly. Should I make a second decoder or inherit some functionality fromLengthFieldBasedFrameDecoder
? Is there some "concept" in Netty that can help me achieve this?Here is a working example for my current implementation. I would appreciate any help.
Beta Was this translation helpful? Give feedback.
All reactions