When UI closes, it will close the sockets and filter will gracefully close its sockets