MCPcopy Create free account
hub / github.com/ARM-software/AVH / connectToServer

Method connectToServer

interface/vstream/python/vsi_audio.py:66–85  ·  view source on GitHub ↗

Attempt to connect to the VSI audio server at the given address with the provided authkey. Args: address: The (IP, port) tuple for the server to connect to. authkey: The authorization key for server connection. Returns: None

(self, address, authkey)

Source from the content-addressed store, hash-verified

64 self.conn = None
65
66 def connectToServer(self, address, authkey):
67 """
68 Attempt to connect to the VSI audio server at the given address with the provided authkey.
69
70 Args:
71 address: The (IP, port) tuple for the server to connect to.
72 authkey: The authorization key for server connection.
73 Returns:
74 None
75 """
76 for _ in range(40):
77 try:
78 self.conn = Client(address, authkey=authkey.encode('utf-8'))
79 if isinstance(self.conn, Connection):
80 break
81 else:
82 self.conn = None
83 except Exception:
84 self.conn = None
85 time.sleep(0.05)
86
87 def setMode(self, mode):
88 """

Callers 1

initFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected