Change to udp with the sockets

This commit is contained in:
Daniel 2021-04-19 14:46:23 +01:00
parent 365162de06
commit 815061e2f0
4 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,7 @@ BUFFER_SIZE = 128
SEPARATOR = "<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

View File

@ -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.")

View File

@ -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.")

View File

@ -10,7 +10,7 @@ BUFFER_SIZE = 4096
SEPARATOR = "<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