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
When reading from an open socket how do you know if you read all the bits and pieces of the packed message so that you should return the data.
I am looking for a mechanism to replace streaming like this: msgpack-php extension
Here is what I tried, but it only ends in a loop that never returns, I need a stop, a way of knowing when the message is complete:
A non-empty result of the $unpacker->tryUnpack() call indicates that the entire msgpack message (or several) has been received and unpacked. If you expect only one message from a stream, you can just do:
if ($unpackedBlocks = $unpacker->tryUnpack()) {
return$unpackedBlocks[0];
}
If you receive an unknown number of msgpack messages from the stream, then I guess feof() is the right way to break the loop.
When reading from an open socket how do you know if you read all the bits and pieces of the packed message so that you should return the data.
I am looking for a mechanism to replace streaming like this: msgpack-php extension
Here is what I tried, but it only ends in a loop that never returns, I need a stop, a way of knowing when the message is complete:
The text was updated successfully, but these errors were encountered: