示例#1
0
class Main:

    host = "192.168.0.11"
    port = 8081
    observer = ''
    client = ''

    def __init__(self):
        self.client = ClientSocket(self.host, self.port)
        self.client.make_configuration()
        self.client.make_connection()
        self.observer = FSHandler(self.client.client_socket, self.host,
                                  self.port)

    def process(self):
        threading.Thread(target=self.observer.start_observer).start()
        threading.Thread(target=self.client.listen_to_server).start()
示例#2
0
class Main:

    host = os.getenv("HOST")
    port = int(os.getenv("PORT"))
    observer = ''
    client = ''

    def __init__(self):
        self.client = ClientSocket(self.host, self.port)
        self.client.make_configuration()
        self.client.make_connection()
        self.observer = FSHandler(self.client.client_socket, self.host,
                                  self.port)

    def process(self):
        threading.Thread(target=self.observer.start_observer).start()
        threading.Thread(target=self.client.listen_to_server).start()