mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 13:36:31 +00:00
move zmq port to config file for C# and python
This commit is contained in:
@@ -3,7 +3,7 @@ import zmq
|
||||
from threading import Thread, Event
|
||||
from remote_command cimport RemoteCommand
|
||||
cimport constants
|
||||
|
||||
import yaml
|
||||
|
||||
cdef class RemoteCommandHandler:
|
||||
def __init__(self, object on_command):
|
||||
@@ -12,7 +12,9 @@ cdef class RemoteCommandHandler:
|
||||
|
||||
self._router = self._context.socket(zmq.ROUTER)
|
||||
self._router.setsockopt(zmq.LINGER, 0)
|
||||
self._router.bind(f'tcp://*:{constants.ZMQ_PORT}')
|
||||
with open(<str>constants.CONFIG_FILE, "r") as f:
|
||||
config = yaml.safe_load(f)
|
||||
self._router.bind(f'tcp://*:{config["zmq_port"]}')
|
||||
|
||||
self._dealer = self._context.socket(zmq.DEALER)
|
||||
self._dealer.setsockopt(zmq.LINGER, 0)
|
||||
|
||||
Reference in New Issue
Block a user