示例#1
0
    def __init__(self,channel,startThread=False,portNumber=POLLING_SERVER_DEFAULT_PORT,hostname='localhost') :
	Router.__init__(self,channel)


        if (SocketRouter.acceptIncomingConnections) :
            from comm import Comm
            self.myComm = Comm()


	self.incomingTCP = Queue()
	
	#  Variables for the state of the polling process
	self.setRunning(startThread)
	self.socketServer = None


	#  Variables used to keep track of the data.
	self.incomingDataList = Queue()
	self.dataLock = threading.Lock()


	#  Initialize the port number to use
	self.setPort(portNumber);
	self.setHostname(hostname) #socket.gethostname())

	if(startThread) :
	    if(SocketRouter.DEBUG) :
		print("Starting socket server")
	    self.createAndInitializeSocket()
示例#2
0
文件: DNS.py 项目: mgold/Packets
    def __init__ (self, screen, x, y):
        Router.__init__(self, screen, x, y)

        self.color = (191, 96, 96) 
        self.packetColor = (191, 128, 128)
        self.font = pygame.font.Font(None, 24)

        self.names = {}
示例#3
0
文件: Subnet.py 项目: mgold/Packets
 def __init__ (self, screen, x, y):
     Router.__init__(self, screen, x, y)
     self.selectable = False