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

Sockets are not closed when DHCPClient object is deleted #14

Open
osresearch opened this issue Jan 27, 2023 · 0 comments
Open

Sockets are not closed when DHCPClient object is deleted #14

osresearch opened this issue Jan 27, 2023 · 0 comments

Comments

@osresearch
Copy link

The various sockets are not closed when the dhcppython.client.DHCPClient is deleted, which leads to future DCHPClient objects not being able to obtain leases since the replies are delivered to the older sockets instead. I added a __del__ method to the class that closes them and now I can create new client objects:

    def __del__(self):
        for sock in self.listening_sockets:
            sock.close()
        for sock in self.writing_sockets:
            sock.close()
        for sock in self.except_sockets:
            sock.close()
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

1 participant