I'm implementing a server that receives a stream of bytes from the client.
The stream is serialized using msgpack, (and the first thing that is serialized is the length of the remaining stream).
My question is, What's the correct way of receiving this stream in C?
In python I can do this as follows:
# Feed each byte into the Unpacker
unpacker.feed(client.recv(1))
# Unpack whatever we can from the bytes we have received
for value in unpacker:
print(value)
Is there a way I can do this in C?
I solved it, all I had to do is the following:
This is how you can read a stream using msgpack (This is almost equivalent to the python script in my question)