If I stop the dhcp server task with _task_destroy() the listener seems to be left open. How can I make sure ALL resources are released when killing a listener task?
This is a bad design, the server is not supposed to quit.
The right way is to add the functionality into the server task - as a reaction on some message or event, shutdown the socket, release resources and return.