server.py
def stop(self):
		"""
		joins all threads
		stops server, then returns 1
		"""
		#dont accept any new requests
		self.status = 0
		print("Waiting for all pending requests to complete...")
		#serve pending requests
		#timeout of 10s for the first hanging thread found
		#all others should have completed by then so 0 timeout for them
		initialWait = self.requestTimeout
		for thread in self.threads:
			try:
				thread.join(initialWait)
				if(thread.is_alive()):
					initialWait=0
			except:
				pass
			finally:
				if(thread.is_alive()):
					logging.warning(f"{utils.logDate()}: A thread refused to join, may indicate a hanging thread or too small timeout")
		print("All pending requests served.")
		self.loggerStatus=0
		print("Waiting for logger to finish logging...")
		self.loggerThread.join()
		print("Server has stopped.")

		joins all threads
		stops server, then returns 1
		
joins all threads
stops server, then returns 1
joins all threads stops server then returns 1
def stop(self):
		self.status = 0
		print("Waiting for all pending requests to complete...")
		initialWait = self.requestTimeout
		for thread in self.threads:
			try:
				thread.join(initialWait)
				if(thread.is_alive()):
					initialWait=0
			except:
				pass
			finally:
				if(thread.is_alive()):
					logging.warning(f"{utils.logDate()}: A thread refused to join, may indicate a hanging thread or too small timeout")
		print("All pending requests served.")
		self.loggerStatus=0
		print("Waiting for logger to finish logging...")
		self.loggerThread.join()
		print("Server has stopped.")
def stop ( self ) : self . status = 0 print ( "Waiting for all pending requests to complete..." ) initialWait = self . requestTimeout for thread in self . threads : try : thread . join ( initialWait ) if ( thread . is_alive ( ) ) : initialWait = 0 except : pass finally : if ( thread . is_alive ( ) ) : logging . warning ( f"{utils.logDate()}: A thread refused to join, may indicate a hanging thread or too small timeout" ) print ( "All pending requests served." ) self . loggerStatus = 0 print ( "Waiting for logger to finish logging..." ) self . loggerThread . join ( ) print ( "Server has stopped." )
joins all threads
stops server, then returns 1
joins all threads stops server then returns 1
"""
		joins all threads
		stops server, then returns 1
		""" #dont accept any new requests #serve pending requests #timeout of 10s for the first hanging thread found #all others should have completed by then so 0 timeout for them
self