Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions file_transfer/send_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def send_file(filename: str = "mytext.txt", testing: bool = False) -> None:
conn, addr = sock.accept() # Establish connection with client.
print(f"Got connection from {addr}")
data = conn.recv(1024)
if not data:
break # IF NOT data received,the Client has closed the Connection.
print(f"Server received: {data = }")

with open(filename, "rb") as in_file:
Expand Down