Connect to the Unix socket
(path: str)
| 60 | |
| 61 | |
| 62 | def connect_to_socket(path: str) -> Optional[socket.socket]: |
| 63 | """Connect to the Unix socket""" |
| 64 | try: |
| 65 | sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) |
| 66 | sock.connect(path) |
| 67 | sock.setblocking(False) |
| 68 | return sock |
| 69 | except Exception as e: |
| 70 | return None |
| 71 | |
| 72 | |
| 73 | def send_request(sock: socket.socket, request: dict) -> bool: |