Add helper method to ServerUplinkConnector for EH -> EH communication

This commit is contained in:
Kristóf Tóth 2018-03-14 14:09:30 +01:00
parent 69f03f7615
commit a5d0359ab8

View File

@ -25,6 +25,10 @@ class ServerUplinkConnector(ZMQConnectorBase):
self._zmq_push_socket = self._zmq_context.socket(zmq.PUSH)
self._zmq_push_socket.connect('tcp://localhost:{}'.format(tfwenv.RECEIVER_PORT))
def send_to_eventhandler(self, key, response):
response['data']['key'] = key
self.send('mirror', response)
def send(self, key, response):
response['key'] = key
self._zmq_push_socket.send_multipart(serialize_all(key, response))