Skip to content

Commit 43dd21c

Browse files
authored
Update SimpleServer example to accept >1 connection
This moves the `accept()` call into the `while True` loop, leaving the server accepting connections as long as the `server` socket is valid.
1 parent 1b8ff4e commit 43dd21c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/wiznet5k_simpleserver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
server.bind((server_ip, server_port)) # Bind to IP and Port
2929
server.listen() # Begin listening for incoming clients
3030

31-
conn, addr = server.accept() # Wait for a connection from a client.
3231
while True:
32+
conn, addr = server.accept() # Wait for a connection from a client.
3333
with conn:
3434
data = conn.recv(1024)
3535
if data: # Wait for receiving data

0 commit comments

Comments
 (0)