continue networking code
This commit is contained in:
@ -17,17 +17,16 @@ def main():
|
||||
while True:
|
||||
server_socket.listen()
|
||||
(conn_socket, conn_addr) = server_socket.accept()
|
||||
print("TCP client {} connected", conn_addr)
|
||||
print(f"TCP client {conn_addr} connected")
|
||||
while True:
|
||||
bytes_recvd = conn_socket.recv(4096)
|
||||
if len(bytes_recvd) > 0:
|
||||
print(f"Received bytes from TCP client: {bytes_recvd.decode()}")
|
||||
print(f"Received bytes from TCP client: {bytes_recvd}")
|
||||
elif len(bytes_recvd) == 0:
|
||||
break
|
||||
else:
|
||||
print("error receiving data from TCP client")
|
||||
if SEND_PING_ONCE:
|
||||
print("sending back ping")
|
||||
ping_tc = PusTelecommand(service=17, subservice=1, seq_count=0, apid=APID)
|
||||
conn_socket.sendall(ping_tc.pack())
|
||||
SEND_PING_ONCE = False
|
||||
|
Reference in New Issue
Block a user