Skip to content

Sockets are not closed when DHCPClient object is deleted #14

Description

@osresearch

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()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions