<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def stop(self):
 """Stop the name server. """

        self.listener.setsockopt(LINGER, 1)
        self.loop = False
        with nslock:
            self.listener.close()