- def connect(self, host, port):
- if self._sock:
- raise ConnectionError("Already connected")
- msg = "getaddrinfo returns an empty list"
+ def _unix_connect(self, path):
+ if not hasattr(socket, "AF_UNIX"):
+ raise ConnectionError("Unix domain sockets not supported "
+ "on this platform")
+ sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+ sock.connect(path)
+ return sock
+
+ def _tcp_connect(self, host, port):