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