This commit is contained in:
John Lancaster
2024-06-14 23:34:27 -05:00
parent ca7f62afe3
commit 1cae18670a
7 changed files with 75 additions and 11 deletions

24
test_socket.py Executable file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env python
import socket
from time import sleep
from rich.console import Console
console = Console()
print = console.print
with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as sock:
try:
sock.connect('/run/example.sock')
except Exception:
raise
else:
with console.status('Connected...'):
while True:
try:
sleep(0.1)
except KeyboardInterrupt:
break
finally:
print('Exiting')