Skip to content

Commit c5208fb

Browse files
committed
Adding some print messages inside server loop
1 parent 43dd21c commit c5208fb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

examples/wiznet5k_simpleserver.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@
2929
server.listen() # Begin listening for incoming clients
3030

3131
while True:
32+
print(f"Accepting connections on {server_ip}:{server_port}")
3233
conn, addr = server.accept() # Wait for a connection from a client.
34+
print(f"Connection accepted from {addr}, reading exactly 1024 bytes from client")
3335
with conn:
3436
data = conn.recv(1024)
3537
if data: # Wait for receiving data
3638
print(data)
3739
conn.send(data) # Echo message back to client
40+
print("Connection closed")

0 commit comments

Comments
 (0)