Beispiel #1
0
	def start(self,inThread=False):
		time.sleep(2)
		
		mainThreadPool.callInThread(self.theardCloseManger)
# 		thread.start_new_thread(self.theardCloseManger, tuple())  
		if inThread:
			mainThreadPool.callInThread(self.serverListenStart)
# 			thread.start_new_thread(self.serverListenStart, tuple())
		else:
			self.serverListenStart()
Beispiel #2
0
	def serverListenStart(self):
		self.log(2, "Server Proess start!")
		threading.currentThread().name = "socketServerThread"
		threadid = 0
		while True:
			try:
				conn, addr = self.server.accept()  
				threadid += 1
				mainThreadPool.callInThread(self.startNewThread, conn, addr, threadid)
# 				thread.start_new_thread(self.startNewThread, (conn, addr, threadid))  
			except KeyboardInterrupt:
				break
			except:
				self.log(3)
				time.sleep(1)
		self.log(2, "proess end!")
	def run(self):
		if not self.AgreeConnIp(self.addr):
			baseServer.log(2, self.threadid, "not agree ip %s connect!" % (self.addr))
			return;

		baseServer.log(1, self.threadid, "..... threadid start")
		host,port,auth = setting[settingConfig.remoteServerKey]
		self.connRemoteProxyServer(host,port,auth)
		mark = "[%s,%s]" % (self.addr,self.threadid)
		DDDProxySocketMessage.sendOne(self.remoteSocket,mark )
		baseServer.log(1, self.threadid, "threadid mark")
		
		mainThreadPool.callInThread(self.sourceToServer)
# 		thread.start_new_thread(self.sourceToServer, tuple())
		
		self.serverToSource()
		baseServer.log(1, self.threadid, "!!!!! threadid end")
Beispiel #4
0
	def get(self):
		mainThreadPool.callInThread(self.getInThread)
Beispiel #5
0
def AutoFetchGFWList():
    mainThreadPool.callInThread(AutoGFWListThread)