diff --git a/conf/dataManager.conf b/conf/dataManager.conf index dbf42920af97dbc6e04eafd6dc0f43810369be54..cebc78155d573c279a8832a5390833afd1d0769f 100644 --- a/conf/dataManager.conf +++ b/conf/dataManager.conf @@ -28,10 +28,13 @@ whitelist = ["localhost", "zitpcx19282", "zitpcx22614", "lsdma-lab04", # ZMQ port to get new requests requestPort = 50001 + # ZMQ port to forward requests +# (needed if running on Windows) requestFwPort = 50002 # ZMQ port to disribute control signals +# (needed if running on Windows) controlPort = 50005 ######################################### @@ -71,7 +74,8 @@ historySize = 0 # (needed if eventDetector is WatchdogDetector) timeTillClosed = 2 -# ZMQ port to get events from (only needed if eventDetectorType is ZmqDetector) +# ZMQ port to get events from +# (needed if eventDetectorType is ZmqDetector) eventPort = 50003 # Tango device proxy for the detector @@ -94,9 +98,9 @@ dataFetcherType = getFromFile #dataFetcherType = getFromHttp # If "getFromZmq" is specified as dataFetcherType it needs a port to listen to +# (needed if eventDetectorType is ZmqDetector) dataFetcherPort = 50010 - # Number of parallel data streams # if this number is modifified, the port numbers also have to be adjusted numberOfStreams = 1 @@ -113,6 +117,7 @@ chunkSize = 10485760 ; # = 1024*1024*10 #chunkSize = 1073741824 ; # = 1024*1024*1024 # ZMQ-router port which coordinates the load-balancing to the worker-processes +# (needed if running on Windows) routerPort = 50004 # Target to move the files into diff --git a/src/sender/DataManager.py b/src/sender/DataManager.py index a0f5cc71c1c8694caa33d142f20285b200cad589..c7cc89cfd49bf893659f173313e6f7ba30edf135 100644 --- a/src/sender/DataManager.py +++ b/src/sender/DataManager.py @@ -276,6 +276,8 @@ class DataManager(): verbose = arguments.verbose onScreen = arguments.onScreen + self.currentPID = os.getpid() + self.extLogQueue = False if logQueue: @@ -303,7 +305,7 @@ class DataManager(): # Create log and set handler to queue handle self.log = self.getLogger(self.logQueue) - self.log.info("DataManager started (PID " + str(os.getpid()) + ").") + self.log.info("DataManager started (PID " + str(self.currentPID) + ").") signal.signal(signal.SIGTERM, self.signal_term_handler) @@ -316,11 +318,20 @@ class DataManager(): self.requestFwPort = arguments.requestFwPort self.routerPort = arguments.routerPort - self.controlConId = "tcp://{ip}:{port}".format(ip=self.localhost, port=arguments.controlPort) self.comConId = "tcp://{ip}:{port}".format(ip=self.extIp, port=arguments.comPort) - self.requestFwConId = "tcp://{ip}:{port}".format(ip=self.localhost, port=arguments.requestFwPort) self.requestConId = "tcp://{ip}:{port}".format(ip=self.extIp, port=arguments.requestPort) - self.routerConId = "tcp://{ip}:{port}".format(ip=self.localhost, port=arguments.routerPort) + + if helpers.isWindows(): + self.log.info("Using tcp for internal communication.") + self.controlConId = "tcp://{ip}:{port}".format(ip=self.localhost, port=arguments.controlPort) + self.requestFwConId = "tcp://{ip}:{port}".format(ip=self.localhost, port=arguments.requestFwPort) + self.routerConId = "tcp://{ip}:{port}".format(ip=self.localhost, port=arguments.routerPort) + else: + self.log.info("Using ipc for internal communication.") + self.controlConId = "ipc://{pid}_{id}".format(pid=self.currentPID, id="control") + self.requestFwConId = "ipc://{pid}_{id}".format(pid=self.currentPID, id="requestFw") + self.routerConId = "ipc://{pid}_{id}".format(pid=self.currentPID, id="router") + self.whitelist = arguments.whitelist