예제 #1
0
 def __init__(self):
     """
     Constructs a CommunicationHandler object and its AESCipher object which
     allows it to encrypt and decrypt messages.
     """
     super(Common_Elements.BasicCommunicator, self).__init__()
     self.cipher = Common_Elements.AESCipher()  # prevent crash
예제 #2
0
    def __init__(self):
        """
        client_socket - socket, the socket that connects the server and the client.
        the socket is automatically connecting to the constant server on initiation.

        the function also starts the AESCipher which allows the CommunicationHandler to encrypt/decrypt messages.
        """
        super(Common_Elements.BasicCommunicator, self).__init__()
        self.client_socket = socket.socket()
        self.client_socket.connect((SERVER_IP, PORT))
        self.cipher = Common_Elements.AESCipher()  # prevent crash