diff options
author | Nao Pross <np@0hm.ch> | 2021-12-03 22:19:57 +0100 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2021-12-03 22:19:57 +0100 |
commit | 2d02a9787d3bbd7320f23a3c65ee8e8ed0369c1e (patch) | |
tree | daa5c17d4315f2660508d27202a156b215691084 /tests/sockets | |
parent | Remove frequency LPF and clean up (diff) | |
download | Fading-2d02a9787d3bbd7320f23a3c65ee8e8ed0369c1e.tar.gz Fading-2d02a9787d3bbd7320f23a3c65ee8e8ed0369c1e.zip |
Replace DearPyGui Sink with Network Sink
Diffstat (limited to '')
-rw-r--r-- | tests/sockets/send.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/sockets/send.py b/tests/sockets/send.py new file mode 100644 index 0000000..87faf5d --- /dev/null +++ b/tests/sockets/send.py @@ -0,0 +1,21 @@ +import socket +from urllib.parse import urlparse + +import numpy as np + +remote = "upd://localhost:31415" +url = urlparse(remote) + +print(url.hostname) +print(url.port) + +sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) +sock.connect((url.hostname, url.port)) + +# sent some text +sock.send(bytes("hello", "ascii")) + +arr = np.arange(0, 10) +print(arr) + +sock.send(arr.tobytes()) |