def __init__(self, transferQueue, callbackObject): """ Initializes the thread's state Args: transferQueue: The incoming packages transferQueue callbackObject: The callback object that will process all the received packets. """ QueueProcessingThread.__init__(self, "Incoming data processing thread", transferQueue) self.__callbackObject = callbackObject self.__referenceCounter = MultithreadingCounter()
def __init__(self, diskImagesDirectory): """ Initializes the reactor's state Args: diskImagesDirectory: the FTP server's root directory """ self.__diskImagesDirectory = diskImagesDirectory self.__slotCounter = MultithreadingCounter() self.__retrieveQueue = GenericThreadSafeList() self.__storeQueue = GenericThreadSafeList() self.__finish = False self.__networkManager = None self.__ftpServer = None
def __init__(self, useSSL, certificatesDirectory, port, transferQueue, incomingDataThread, callbackObject): """ Initializes the connection. Args: useSSL: if True, all the traffic will be protectd by SSLv4. If false, certificatesDirectory: the directory where the certificates are stored port: the port assigned to the connection. transferQueue: the incoming data transferQueue assigned to the connection incomingDataThread: the incoming data thread assigned to the connection callbackObject: the callback object assigned to the connection """ self._status = ConnectionStatus(CONNECTION_STATUS.OPENING) self._useSSL = useSSL self._certificatesDirectory = certificatesDirectory self._port = port self._factory = None self._queue = transferQueue self._incomingDataThread = incomingDataThread self._callback = callbackObject self._packagesToSend = MultithreadingCounter() self._deferred = None self._unexpectedlyClosed = False self._error = None