Esempio n. 1
0
 def __init__(self, transferQueue):
     """
     Initializes the protocol factory
     Args:
         transferQueue: the incoming data transferQueue to use by all protocol instances
     """
     self.protocol = CygnusCloudProtocol
     self._queue = transferQueue        
     self.__protocolPool = GenericThreadSafeDictionary()
Esempio n. 2
0
 def __init__(self, certificatesDirectory=None):
     """
     Initializes the NetworkManager's state.
     Args:
         certificatesDirectory: the directory where the files server.crt and server.key are.
     """
     self.__connectionPool = GenericThreadSafeDictionary()
     self.__outgoingDataQueue = GenericThreadSafePriorityQueue()
     if (not reactor.running):
         self.__networkThread = TwistedReactorThread()
     else:
         self.__networkThread = None
     self.__outgoingDataThread = OutgoingDataThread(
         self.__outgoingDataQueue)
     self.__connectionThread = ConnectionMonitoringThread(
         self.__connectionPool)
     self.__certificatesDirectory = certificatesDirectory