(self, address, authkey)
| 54 | self.conn = None |
| 55 | |
| 56 | def connectToServer(self, address, authkey): |
| 57 | for _ in range(50): |
| 58 | try: |
| 59 | self.conn = Client(address, authkey=authkey.encode('utf-8')) |
| 60 | if isinstance(self.conn, Connection): |
| 61 | break |
| 62 | else: |
| 63 | self.conn = None |
| 64 | except Exception: |
| 65 | self.conn = None |
| 66 | time.sleep(0.01) |
| 67 | |
| 68 | def setFilename(self, filename, mode): |
| 69 | self.conn.send([self.SET_FILENAME, getcwd(), filename, mode]) |