More flexible quitting.
Oops, forgot to change to non-blocking socket