from multiprocessing import Process from new_client import * from watchDir import OneDir_Observer from sendingClient import LocalMachine HOST, PORT = str(sys.argv[1]), 9999 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.connect((HOST, PORT)) syncState = 'on' filePath = 'False' userName = '******' watchMachine = LocalMachine('TestUser', 'TestDirectory', HOST) OneDog = OneDir_Observer(watchMachine) listenMachine = ListenerMachine('TestDirectory', listen_port=1235) watch_process = Process(target=OneDog.startWatching) def sendData(userType, username, password): #sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Connect to server and send data #sock.connect((HOST, PORT)) global filePath global userName
from sendingClient import LocalMachine #HOST needs to be changed to whatever the server address is (command line argument) HOST, PORT = str(sys.argv[0]), 9999 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.connect((HOST, PORT)) syncState = 'on' filePath = 'False' userName = '******' watchMachine = LocalMachine('TestUser', 'TestDirectory', HOST) OneDog = OneDir_Observer(watchMachine) listenMachine = ListenerMachine('TestDirectory', listen_port=1235) def sendData(userType, username, password): #sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Connect to server and send data #sock.connect((HOST, PORT)) global filePath global userName sock.sendall(usertype + "\n") response1 = sock.recv(1024)