Esempio n. 1
0
    def on_message_received(self, message):
        """ This is the callback from the protocol.
        """
        log_message(self._logger.info, self.name, message, 'message received')

        # forward the message to the queue only if not a
        # heartbeat/testrequest
        if message.msg_type() not in {FIX.HEARTBEAT, FIX.TEST_REQUEST}:
            self.queue.add(message)
Esempio n. 2
0
    def on_message_received(self, message):
        """ This is the callback from the protocol.
        """
        log_message(self._logger.info, self.name, message, "message received")

        # forward the message to the queue only if not a
        # heartbeat/testrequest
        if message.msg_type() not in {FIX.HEARTBEAT, FIX.TEST_REQUEST}:
            self.queue.add(message)
Esempio n. 3
0
    def send_message(self, message):
        """ This is the callback from the protocol.  Send the
            message onto through the transport.
        """
        self.protocol.prepare_send_message(message)
        data = message.to_binary()
        log_message(self._logger.info, self.name, message, 'message sent')

        if self.transport is not None:
            reactor.callFromThread(self.transport.write, data)
Esempio n. 4
0
    def send_message(self, message):
        """ This is the callback from the protocol.  Send the
            message onto through the transport.
        """
        self.protocol.prepare_send_message(message)
        data = message.to_binary()
        log_message(self._logger.info, self.name, message, "message sent")

        if self.transport is not None:
            reactor.callFromThread(self.transport.write, data)