From 815061e2f0fd7f9bb753b908dda08b004a73e9a5 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 19 Apr 2021 14:46:23 +0100 Subject: [PATCH] Change to udp with the sockets --- Controlled/controlled-keymouse.py | 2 +- Controlled/controlled-screen.py | 2 +- Controller/controller-keymouse.py | 2 +- Controller/controller-screen.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Controlled/controlled-keymouse.py b/Controlled/controlled-keymouse.py index 9f317f0..c085069 100644 --- a/Controlled/controlled-keymouse.py +++ b/Controlled/controlled-keymouse.py @@ -17,7 +17,7 @@ BUFFER_SIZE = 128 SEPARATOR = "" # create the server socket # TCP socket -s = socket.socket() +s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # bind the socket to our local address s.bind((SERVER_HOST, SERVER_PORT)) # enabling our server to accept connections diff --git a/Controlled/controlled-screen.py b/Controlled/controlled-screen.py index 4650a0e..46433f6 100644 --- a/Controlled/controlled-screen.py +++ b/Controlled/controlled-screen.py @@ -24,7 +24,7 @@ filename = "screen.jpg" filesize = os.path.getsize(filename) # create the client socket -s = socket.socket() +s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) print(f"[+] Connecting to {host}:{port}") s.connect((host, port)) print("[+] Connected.") diff --git a/Controller/controller-keymouse.py b/Controller/controller-keymouse.py index f2eb4af..286c1e6 100644 --- a/Controller/controller-keymouse.py +++ b/Controller/controller-keymouse.py @@ -30,7 +30,7 @@ host = "123.123.123.123" port = 5001 # create the client socket -s = socket.socket() +s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) print(f"[+] Connecting to {host}:{port}") s.connect((host, port)) print("[+] Connected.") diff --git a/Controller/controller-screen.py b/Controller/controller-screen.py index 24192be..6a061e1 100644 --- a/Controller/controller-screen.py +++ b/Controller/controller-screen.py @@ -10,7 +10,7 @@ BUFFER_SIZE = 4096 SEPARATOR = "" # create the server socket # TCP socket -s = socket.socket() +s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # bind the socket to our local address s.bind((SERVER_HOST, SERVER_PORT)) # enabling our server to accept connections