refactor: removed hardcoded IP and port and moved video functions from main to the VideoSender class
ref: N25B-171
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user