def destroy(self):
        # Protocols should be implicitly destroyed by the Network
        # Interfaces should be implicitly destroyed by the Namespaces

        if self._loopback:
            self._loopback.destroy()
            self._loopback = None

        for namespace in self._namespaces.copy():
            namespace.destroy()

        self._network.unregisterEndpoint(self)
        self._network = None

        assert len(self._protocols) == 0
        assert len(self._interfaces) == 0
        assert len(self._namespaces) == 0

        super(Endpoint, self).destroy()
Method should be called to destroy the endpoint and will take care
dataset/ETHPy150Open rapyuta/rce/rce-core/rce/core/network.py/Endpoint.destroy