Пример #1
0
def establishClientTunnelConnection(clientId, destPort):
    newProgram = Program(destPort)
    if(newProgram.connect()):
        newClient = Client(clientId, newProgram)
        return newClient
    else:
        sys.stderr.write("\nCouldn't connect to local port at: " + str(int(destPort, 2)))
        return None
Пример #2
0
def addNewClientAndOpenConnection(client_ID, portNumber):
    global __ACTIVE_CLIENTS_IDS
    __ACTIVE_CLIENTS_IDS.append(client_ID)
    newLocalProgram = Program(portNumber)
    if(not newLocalProgram.connect()):
        print("\nError connecting to port: "+str(portNumber))
    else:
        print("\nConnection opened port#: "+str(portNumber))