コード例 #1
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