Skip to content
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

Restrict how many packet callbacks can be called #29

Open
harlowja opened this issue Nov 26, 2015 · 2 comments
Open

Restrict how many packet callbacks can be called #29

harlowja opened this issue Nov 26, 2015 · 2 comments

Comments

@harlowja
Copy link

Sometimes you only want to unpack 3 (for example) objects from a stream and stop unpacking after that many, it appears the current StreamProtocolHandler will continue unpacking forever, vs unpacking 3 and then stopping. It'd be nice to be able to restrict it to a given amount of unpacks (and default to infinite to retain the existing behavior)

@posborne
Copy link
Contributor

Interesting. I wonder if this might be better handled outside of Suitcase? Presumably, once you have received N packet callbacks, you could just stop feeding in bytes to feed().

What would "stopping" after 3 frames look like? How would the behavior of feed() change?

@harlowja
Copy link
Author

Ah, good point, might not be needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants