-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return extra bytes from iterate and/or load #91
Comments
This sounds reasonable at the surface, but I'm unsure as to what people would use it for. Can you help me understand the use case for this? |
I imagine that this would be a useful part of a socket listener system for the cases where the socket has part of a packet available to be read. In |
This sounds reasonable. How do you think this compares to having One thing we could do for file_obj = open("something.tlm")
iter_obj= utils.iter_packets_bytes(file_obj)
for byte_stream in iter_obj:
do_something(byte_stream)
print("These were the bytes left:", iter_obj.extra_bytes) |
Related to earlier issue: #83 (comment)
Would be handy to be able to parse mostly well-formed but unfinished streams of packets and report or return the extra bytes at the end. This does not need to handle broken packets in the middle of the stream, just partial packets at the current end (where the last packet may or may not even have a length value).
The text was updated successfully, but these errors were encountered: