Пример #1
0
 def shutdown(self):
     self.shutdown_flag = 1
     try:
         thread = coro.get_thread_by_id(self.thread_id)
         thread.shutdown()
     except KeyError:
         return
Пример #2
0
 def shutdown(self, timeout):
     """shutdown(timeout) -> None
     Shuts down the server and all the children within timeout seconds.
     Rudely terminates sessions if they don't exit within timeout
     seconds.
     """
     # Shut down the main accept loop
     if self.thread_id:
         try:
             my_thread = coro.get_thread_by_id (self.thread_id)
         except KeyError:
             # thread already exited
             return
         my_thread.shutdown()
     # Shut down all the children
     if self.clients:
         for c in self.clients:
             c.shutdown()
         # wait for all the children to finish
         try:
             coro.with_timeout(timeout, self.shutdown_cv.wait)
         except coro.TimeoutError:
             # kill hard
             for c in self.clients:
                 c.shutdown(rudely=1)
Пример #3
0
 def shutdown(self):
     self.shutdown_flag = 1
     try:
         thread = coro.get_thread_by_id(self.thread_id)
         thread.shutdown()
     except KeyError:
         return # already exited
Пример #4
0
 def shutdown (self):
     self.shutdown_flag = 1
     try:
         # XXX SMR is this really necessary?
         thread = coro.get_thread_by_id (self.thread_id)
         thread.shutdown()
     except KeyError:
         return # already exited
Пример #5
0
 def shutdown(self):
     self.shutdown_flag = 1
     try:
         # XXX SMR is this really necessary?
         thread = coro.get_thread_by_id(self.thread_id)
         thread.shutdown()
     except KeyError:
         return  # already exited
Пример #6
0
 def shutdown(self, rudely=0):
     """shutdown(rudely=0) -> None
     Shuts down this session.
     Set rudely to immediately shut it down.
     """
     # TODO: Hmm...the user will just spontaneously be disconnected
     # Can we give them a disconnected error?
     self.shutdown_flag = 1
     if rudely:
         try:
             my_thread = coro.get_thread_by_id (self.thread_id)
         except KeyError:
             # thread already exited
             return
         my_thread.shutdown()