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

Tracking state in Affixes #25

Open
aaaaalbert opened this issue Dec 23, 2013 · 1 comment
Open

Tracking state in Affixes #25

aaaaalbert opened this issue Dec 23, 2013 · 1 comment
Labels

Comments

@aaaaalbert
Copy link
Contributor

What is The Official Way to track connection/flow state using an Affix?

I have tried a few options for a UDP Affix I am writing (add item to the affix_context dict, store attribute with Affix object instance, store as class attribute), but none worked -- class attributes are read-only due to safety restrictions in Repy; for instance attributes, the problem is that each UDP send causes a new Affix object to be created, and so the previously assigned attributes are not available.

Of course I can use a non-Affix related global variable for storing stuff, but this hurts by design.

@monzum
Copy link
Contributor

monzum commented Dec 23, 2013

You should be able to store the information in a class specific dictionary. You can take a look at our FECAffix which stores information from multiple sendmessage() calls and uses to send out extra packets: https://github.com/monzum/affix-repo/blob/beta/affix/affix_components/fecaffix.repy

Note that this method in itself may have some downside.

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

No branches or pull requests

2 participants