summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python-client/tcprelay.py2
-rw-r--r--python-client/usbmux.py7
2 files changed, 7 insertions, 2 deletions
diff --git a/python-client/tcprelay.py b/python-client/tcprelay.py
index 3075fcb..c49d708 100644
--- a/python-client/tcprelay.py
+++ b/python-client/tcprelay.py
@@ -68,7 +68,7 @@ class SocketRelay(object):
68class TCPRelay(SocketServer.BaseRequestHandler): 68class TCPRelay(SocketServer.BaseRequestHandler):
69 def handle(self): 69 def handle(self):
70 print "Incoming connection to %d"%self.server.server_address[1] 70 print "Incoming connection to %d"%self.server.server_address[1]
71 mux = usbmux.USBMux("/tmp/usbmuxd") 71 mux = usbmux.USBMux()
72 print "Waiting for devices..." 72 print "Waiting for devices..."
73 if not mux.devices: 73 if not mux.devices:
74 mux.process(1.0) 74 mux.process(1.0)
diff --git a/python-client/usbmux.py b/python-client/usbmux.py
index 172f326..8b0270d 100644
--- a/python-client/usbmux.py
+++ b/python-client/usbmux.py
@@ -209,7 +209,12 @@ class MuxConnection(object):
209 self.socket.sock.close() 209 self.socket.sock.close()
210 210
211class USBMux(object): 211class USBMux(object):
212 def __init__(self, socketpath="/tmp/usbmuxd"): 212 def __init__(self, socketpath=None):
213 if socketpath is None:
214 if sys.platform == 'darwin':
215 socketpath = "/var/run/usbmuxd"
216 else:
217 socketpath = "/tmp/usbmuxd"
213 self.socketpath = socketpath 218 self.socketpath = socketpath
214 self.listener = MuxConnection(socketpath, BinaryProtocol) 219 self.listener = MuxConnection(socketpath, BinaryProtocol)
215 try: 220 try: