summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Hector Martin2009-08-14 01:51:17 +0200
committerGravatar Hector Martin2009-08-14 01:51:17 +0200
commit0f46b4f59fbcadd3a25cab75a1fc19fea07e02b0 (patch)
tree8de24dc1513d291754fdb80d8cd1c491aa8c082e
parent882543b1e42a960b714fa3aa9b05f9029513b5c1 (diff)
downloadusbmuxd-0f46b4f59fbcadd3a25cab75a1fc19fea07e02b0.tar.gz
usbmuxd-0f46b4f59fbcadd3a25cab75a1fc19fea07e02b0.tar.bz2
python stuff: default to /var/run/usbmuxd on linux and make it configurable
-rw-r--r--python-client/tcprelay.py3
-rw-r--r--python-client/usbmux.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/python-client/tcprelay.py b/python-client/tcprelay.py
index c49d708..2874ae1 100644
--- a/python-client/tcprelay.py
+++ b/python-client/tcprelay.py
@@ -68,7 +68,7 @@ class SocketRelay(object):
class TCPRelay(SocketServer.BaseRequestHandler):
def handle(self):
print "Incoming connection to %d"%self.server.server_address[1]
- mux = usbmux.USBMux()
+ mux = usbmux.USBMux(options.sockpath)
print "Waiting for devices..."
if not mux.devices:
mux.process(1.0)
@@ -100,6 +100,7 @@ HOST = "localhost"
parser = OptionParser(usage="usage: %prog [OPTIONS] RemotePort[:LocalPort] [RemotePort[:LocalPort]]...")
parser.add_option("-t", "--threaded", dest='threaded', action='store_true', default=False, help="use threading to handle multiple connections at once")
parser.add_option("-b", "--bufsize", dest='bufsize', action='store', metavar='KILOBYTES', type='int', default=128, help="specify buffer size for socket forwarding")
+parser.add_option("-s", "--socket", dest='sockpath', action='store', metavar='PATH', type='str', default=None, help="specify the path of the usbmuxd socket")
options, args = parser.parse_args()
diff --git a/python-client/usbmux.py b/python-client/usbmux.py
index 8b0270d..47112d3 100644
--- a/python-client/usbmux.py
+++ b/python-client/usbmux.py
@@ -214,7 +214,7 @@ class USBMux(object):
if sys.platform == 'darwin':
socketpath = "/var/run/usbmuxd"
else:
- socketpath = "/tmp/usbmuxd"
+ socketpath = "/var/run/usbmuxd"
self.socketpath = socketpath
self.listener = MuxConnection(socketpath, BinaryProtocol)
try: