How can I close X's port listening without having to save or restart each time?

What is the command?