basic implementation of client/server for AERPAW, whole lot of mess included
This commit is contained in:
13
aerpaw/basic_demo/uav.py
Executable file
13
aerpaw/basic_demo/uav.py
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/python3
|
||||
import socket
|
||||
|
||||
SERVER_IP = "127.0.0.1"
|
||||
SERVER_PORT = 5000
|
||||
|
||||
for client_id in range(2): # match numClients
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.connect((SERVER_IP, SERVER_PORT))
|
||||
data = s.recv(1024) # receive message from server
|
||||
print(f"Client {client_id+1} received: {data.decode()}")
|
||||
s.sendall(b"ACK") # send acknowledgment
|
||||
s.close()
|
||||
Reference in New Issue
Block a user