コード例 #1
0
    def buildFrame(self):
        """
        Attempts to get a frame from the data in the stream.
        """

        frame = Frame.readFrom(self.stream)

        return frame
コード例 #2
0
ファイル: frame.py プロジェクト: 0xr0ot/drozer
    def buildFrame(self):
        """
        Attempts to get a frame from the data in the stream.
        """

        frame = Frame.readFrom(self.stream)
        
        return frame
コード例 #3
0
ファイル: socket_transport.py プロジェクト: Andlab/andsploit
    def receive(self):
        """
        Receive a Message from the Server.

        If not frame is available, None is returned.
        """

        try:
            frame = Frame.readFromSocket(self.__socket)
    
            if frame is not None:
                return frame.message()
            else:
                return None
        except socket.timeout as e:
            raise ConnectionError(e)
        except ssl.SSLError as e:
            raise ConnectionError(e)
コード例 #4
0
    def receive(self):
        """
        Receive a Message from the Server.

        If not frame is available, None is returned.
        """

        try:
            frame = Frame.readFromSocket(self.__socket)
    
            if frame is not None:
                return frame.message()
            else:
                return None
        except socket.timeout as e:
            raise ConnectionError(e)
        except ssl.SSLError as e:
            raise ConnectionError(e)
コード例 #5
0
ファイル: socket_transport.py プロジェクト: Andlab/andsploit
    def send(self, message):
        """
        Send a Message to the Server.

        The Message is automatically assigned an identifier, and this is
        returned.
        """

        try:
            message_id = self.nextId()
    
            frame = Frame.fromMessage(message.setId(message_id).build())
    
            self.__socket.sendall(str(frame))
    
            return message_id
        except socket.timeout as e:
            raise ConnectionError(e)
        except ssl.SSLError as e:
            raise ConnectionError(e)
コード例 #6
0
    def send(self, message):
        """
        Send a Message to the Server.

        The Message is automatically assigned an identifier, and this is
        returned.
        """

        try:
            message_id = self.nextId()
    
            frame = Frame.fromMessage(message.setId(message_id).build())
    
            self.__socket.sendall(str(frame))
    
            return message_id
        except socket.timeout as e:
            raise ConnectionError(e)
        except ssl.SSLError as e:
            raise ConnectionError(e)
コード例 #7
0
    def write(self, message):
        """
        Writes a message to a client, encapsulating it in a Frame first.
        """

        self.__write(Frame.fromMessage(message))
コード例 #8
0
ファイル: andsploitp.py プロジェクト: Andlab/andsploit
    def write(self, message):
        """
        Writes a message to a client, encapsulating it in a Frame first.
        """

        self.__write(Frame.fromMessage(message))