Ejemplo n.º 1
0
from client import Client

client = Client()
client.PORT = 4445

client.HOST_ADDRESS = input("Enter Server IP: ")


def start_client_and_talk_to_server():
    client.connect_to_server()
    print("Successfully connected")

    while True:

        client.refresh_current_hiararcy()

        print("Refreshed_Hierarchy")
        print(f"Port Id after refreshed hierarchy : {client.PORT}")
        print("1:Request a file")
        print("2:Upload a file")
        print("3:Remove a file")
        print("4:Rename a file")
        print("5:Back")
        print("6:Forward")
        print("7:Enter in a folder")
        print("8:Search a file")

        action = int(input())

        if action == 1:
Ejemplo n.º 2
0
from client import Client
import signal
import time
import sys

client = Client()
client.HOST_ADDRESS = input("Enter Server IP: ")

for i in range(1, len(sys.argv)):
    #--PORT=
    #--IP=
    #--CONNECTIONS=

    if sys.argv[i][:5] == "--IP=":
        client.HOST_ADDRESS = sys.argv[i][5:]
    elif sys.argv[i][:7] == "--PORT=":
        client.PORT = int(sys.argv[i][7:])
    else:
        print("Invalid Argument")


def Start_client_and_talk_to_server():

    client.Connect_to_server()
    print("Succesfully connected")

    while True:

        client.refresh_current_hiararcy()
        print("Refreshed_Hiararcy")
        print(f"Port Id after refreshed hiararcy : {client.PORT}")