I am trying to write code that reads data off a socket and processes
that request. This is a proprietary protocol data on UDP. However, the
packet data that is read contains multiple optional TLVs all of which
may not exist in all the packets that are read off the socket. The
existence or non-existence of the TLV in a given data packet is
indicated by the TLV-type and length in the TLV itself.
Is there a good mechanism available in Ruby to read and handle such
data. I can do this easily enough in C/C++ but this seems specially hard
in Ruby. Is the only option pack/unpack methods? I tried to see if
bindata works but the documentation is unclear on whether it can handle
multiple TLVS that may exist in different combination in each packet?