Skip to content
Snippets Groups Projects
Commit 8a65d1f1 authored by Manuela Kuhn's avatar Manuela Kuhn
Browse files

Fixed context in dataTransferAPI

parent 99471405
No related branches found
No related tags found
No related merge requests found
......@@ -38,8 +38,11 @@ class dataTransfer():
# and then using that for creating sockets
# (source: ZeroMQ, Messaging for Many Applications by Pieter Hintjens)
if context:
self.context = context
self.externalContext = True
self.context = context
self.extContext = True
else:
self.context = zmq.Context()
self.extContext = False
self.signalHost = signalHost
......@@ -78,8 +81,8 @@ class dataTransfer():
raise Excepition("Argument 'targets' must be list.")
if not self.context:
self.context = zmq.Context()
self.externalContext = False
self.context = zmq.Context()
self.extContext = False
signal = None
# Signal exchange
......@@ -540,7 +543,7 @@ class dataTransfer():
# if the context was created inside this class,
# it has to be destroyed also within the class
if not self.externalContext and self.context:
if not self.extContext and self.context:
try:
self.log.info("Closing ZMQ context...")
self.context.destroy(0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment