We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e59d819 commit 4a52467Copy full SHA for 4a52467
file_transfer/send_file.py
@@ -13,6 +13,8 @@ def send_file(filename: str = "mytext.txt", testing: bool = False) -> None:
13
conn, addr = sock.accept() # Establish connection with client.
14
print(f"Got connection from {addr}")
15
data = conn.recv(1024)
16
+ if not data:
17
+ break #IF NOT data received,the Client has closed the Connection.
18
print(f"Server received: {data = }")
19
20
with open(filename, "rb") as in_file:
0 commit comments