diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2021-02-25 16:59:15 -0800 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2021-02-25 16:59:15 -0800 |
| commit | 3f08cb47b846fff41ef9a45d49758f0cef61e723 (patch) | |
| tree | 66d5093b24d127a1fb60cc70f5087b39e87fbff5 /tests/circuitpython-manual/socketpool/server/host-client.py | |
| parent | 52bc935fa7aa9e5c94f75fec8b2fa746c83f0be7 (diff) | |
| parent | b69cb0144ca0d54011be540213d1e25e673a63de (diff) | |
Merge remote-tracking branch 'adafruit/main' into busio-uart-rp
Diffstat (limited to 'tests/circuitpython-manual/socketpool/server/host-client.py')
| -rw-r--r-- | tests/circuitpython-manual/socketpool/server/host-client.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/circuitpython-manual/socketpool/server/host-client.py b/tests/circuitpython-manual/socketpool/server/host-client.py new file mode 100644 index 000000000..b482755d8 --- /dev/null +++ b/tests/circuitpython-manual/socketpool/server/host-client.py @@ -0,0 +1,17 @@ +import socket + +HOST = '192.168.10.128' # The server's hostname or IP address +PORT = 80 # The port used by the server + +with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: + s.settimeout(None) + + print("Connecting") + s.connect((HOST, PORT)) + + print("Sending") + s.send(b'Hello, world') + + print("Receiving") + data = s.recv(1024) + print('Received', repr(data)) |
