refactor: removed hardcoded IP and port and moved video functions from main to the VideoSender class

ref: N25B-171
This commit is contained in:
Storm
2025-10-16 14:57:53 +02:00
parent a408fafc7c
commit 0c5b47ae16
3 changed files with 64 additions and 58 deletions

View File

@@ -15,7 +15,7 @@ class SocketBase(object):
self.name = name
self.socket = None
def create_socket(self, zmq_context, socket_type, port):
def create_socket(self, zmq_context, socket_type, port, options=[]):
"""
Create a ZeroMQ socket.
@@ -27,8 +27,16 @@ class SocketBase(object):
:param port: The port to use.
:type port: int
:param options: A list of options to be set on the socket. The list contains tuples where the first element contains the option
and the second the value, for example (zmq.CONFLATE, 1).
:type options: [(zmq socket option, option value)]
"""
self.socket = zmq_context.socket(socket_type)
for option, arg in options:
self.socket.setsockopt(option,arg)
self.socket.connect("tcp://localhost:{}".format(port))
def close(self):