Sha256: fb40bbbed19cd7eb2936a3ead6806b36fab52668cab50449695adc1e9e85e808

Contents?: true

Size: 904 Bytes

Versions: 5

Compression:

Stored size: 904 Bytes

Contents

import sys

from javonet.core.interpreter.Interpreter import Interpreter
from javonet.core.protocol.CommandSerializer import CommandSerializer
from javonet.utils.RuntimeLogger import RuntimeLogger
from javonet.utils.connectionData.InMemoryConnectionData import InMemoryConnectionData


class Receiver:

    def __init__(self):
        RuntimeLogger.print_runtime_info()
        sys.stdout.flush()
        self.connection_data = InMemoryConnectionData()

    def SendCommand(self, message_byte_array, messageByteArrayLen):
        return bytearray(CommandSerializer().serialize(Interpreter().process(message_byte_array), self.connection_data))

    def HeartBeat(self, message_byte_array, messageByteArrayLen):
        response_byte_array = bytearray(2)
        response_byte_array[0] = message_byte_array[11]
        response_byte_array[1] = message_byte_array[12] - 2
        return response_byte_array

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
javonet-ruby-sdk-2.5.7 lib/javonet-ruby-sdk/Binaries/Python/javonet/core/receiver/Receiver.py
javonet-ruby-sdk-2.5.6 lib/javonet-ruby-sdk/Binaries/Python/javonet/core/receiver/Receiver.py
javonet-ruby-sdk-2.5.5 lib/javonet-ruby-sdk/Binaries/Python/javonet/core/receiver/Receiver.py
javonet-ruby-sdk-2.5.4 lib/javonet-ruby-sdk/Binaries/Python/javonet/core/receiver/Receiver.py
javonet-ruby-sdk-2.5.3 lib/javonet-ruby-sdk/Binaries/Python/javonet/core/receiver/Receiver.py