def __init__(self, certificatesDirectory = None): """ Initializes the NetworkManager's state. Args: certificatesDirectory: the directory where the certificates are """ self.__connectionPool = GenericThreadSafeDictionary() self.__outgoingDataQueue = GenericThreadSafePriorityQueue() self.__networkThread = _TwistedReactorThread() self.__outgoingDataThread = _OutgoingDataThread(self.__outgoingDataQueue) self.__connectionThread = _ConnectionMonitoringThread(self.__connectionPool) self.__certificatesDirectory = certificatesDirectory
def __init__(self, certificatesDirectory = None, createReactorThread = True): """ Initializes the NetworkManager's state. Args: certificatesDirectory: the directory where the files server.crt and server.key are. createReactorThread: if True, a dedicated reactor thread will be created. If false, this thread won't be created. """ createReactorThread = not reactor.running self.__connectionPool = GenericThreadSafeDictionary() self.__outgoingDataQueue = GenericThreadSafePriorityQueue() if (createReactorThread) : self.__networkThread = _TwistedReactorThread() else : self.__networkThread = None self.__outgoingDataThread = _OutgoingDataThread(self.__outgoingDataQueue) self.__connectionThread = _ConnectionMonitoringThread(self.__connectionPool) self.__certificatesDirectory = certificatesDirectory
def __init__(self, certificatesDirectory=None, createReactorThread=True): """ Initializes the NetworkManager's state. Args: certificatesDirectory: the directory where the files server.crt and server.key are. createReactorThread: if True, a dedicated reactor thread will be created. If false, this thread won't be created. """ createReactorThread = not reactor.running self.__connectionPool = GenericThreadSafeDictionary() self.__outgoingDataQueue = GenericThreadSafePriorityQueue() if (createReactorThread): self.__networkThread = _TwistedReactorThread() else: self.__networkThread = None self.__outgoingDataThread = _OutgoingDataThread( self.__outgoingDataQueue) self.__connectionThread = _ConnectionMonitoringThread( self.__connectionPool) self.__certificatesDirectory = certificatesDirectory