def reproket(transmitIP,transmitPort,clientIP,clientPort):
    serverAddr = (transmitIP,int(transmitPort))
    clientAddr = (clientIP,int(clientPort))

    serverLink = []
    clientLink = []

    socketServer = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
    socketServer.connect(serverAddr)
    socketClient = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
    try:
        socketClient.connect(clientAddr)
    except:
        print "Cannot connect to reprocks server.Please run it fisrt or check the network!"
        time.sleep(1)
        sys.exit()
    print "Connect to reprocks server...success!!!"

    serverLink.append(socketServer)
    clientLink.append(socketClient)
    controlThreads = []
    clientNum = 0

    while True:
        try:
            newLinkFlag = clientLink[clientNum].recv(bufLen)
        except:
            print (clientNum+1) % "[link %s] Connection reset by peer,program exit."
            break

        if newLinkFlag == '__newLink__':
            nextClientLink = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
            nextClientLink.connect(clientAddr)
            print "[Link %s] Make a new connection to reprocks_server ok!" % (clientNum+1)
            nextServerLink = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
            nextServerLink.connect(serverAddr)
            print "[link %s] Make a new connection to socks5 proxy ok!" % (clientNum+1)
            temp = control(serverLink[clientNum],clientLink[clientNum],serverAddr,clientAddr,clientNum)
            temp.setDaemon(True)
            controlThreads.append(temp)
            controlThreads[clientNum].start()
            clientLink.append(nextClientLink)
            serverLink.append(nextServerLink)
            clientNum += 1
dataset/ETHPy150Open RicterZ/reprocks/client/reprocks_client.py/reproket/swapped operands of `%`