diff options
Diffstat (limited to 'tests/circuitpython-manual/socketpool/server/cpy-server.py')
| -rw-r--r-- | tests/circuitpython-manual/socketpool/server/cpy-server.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/circuitpython-manual/socketpool/server/cpy-server.py b/tests/circuitpython-manual/socketpool/server/cpy-server.py index d865156bc..bce1f9d6a 100644 --- a/tests/circuitpython-manual/socketpool/server/cpy-server.py +++ b/tests/circuitpython-manual/socketpool/server/cpy-server.py @@ -11,21 +11,21 @@ pool = socketpool.SocketPool(wifi.radio) print("Finding IP address") print(wifi.radio.ipv4_address) HOST = str(wifi.radio.ipv4_address) -PORT = 80 # Port to listen on +PORT = 80 # Port to listen on print("Creating socket") -sock = pool.socket(pool.AF_INET,pool.SOCK_STREAM) +sock = pool.socket(pool.AF_INET, pool.SOCK_STREAM) sock.bind((HOST, PORT)) sock.listen(1) print("Accepting connections") conn, addr = sock.accept() with conn: - print('Connected by', addr) + print("Connected by", addr) buff = bytearray(128) print("Receiving") numbytes = conn.recvfrom_into(buff) - print(buff[:numbytes[0]]) + print(buff[: numbytes[0]]) if numbytes: print("Sending") - conn.send(buff[:numbytes[0]]) + conn.send(buff[: numbytes[0]]) |
