Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1079)

Side by Side Diff: build/android/adb_reverse_forwarder.py

Issue 12640006: [android] Improve reverse forwarder error handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Command line tool for forwarding ports from a device to the host. 7 """Command line tool for forwarding ports from a device to the host.
8 8
9 Allows an Android device to connect to services running on the host machine, 9 Allows an Android device to connect to services running on the host machine,
10 i.e., "adb forward" in reverse. Requires |host_forwarder| and |device_forwarder| 10 i.e., "adb forward" in reverse. Requires |host_forwarder| and |device_forwarder|
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 adb = android_commands.AndroidCommands(options.device) 56 adb = android_commands.AndroidCommands(options.device)
57 tool = CreateTool(None, adb) 57 tool = CreateTool(None, adb)
58 forwarder_instance = forwarder.Forwarder(adb, options.build_type) 58 forwarder_instance = forwarder.Forwarder(adb, options.build_type)
59 try: 59 try:
60 forwarder_instance.Run(port_pairs, tool, options.host) 60 forwarder_instance.Run(port_pairs, tool, options.host)
61 while True: 61 while True:
62 time.sleep(60) 62 time.sleep(60)
63 except KeyboardInterrupt: 63 except KeyboardInterrupt:
64 sys.exit(0) 64 sys.exit(0)
65 except OSError as e:
66 if e.errno == 2:
67 print 'Unable to start. Make sure you have built host_forwarder.'
bulach 2013/03/08 15:15:33 maybe push this down to forwarder.py Run itself?
68 sys.exit(1)
69 else: raise
65 finally: 70 finally:
66 forwarder_instance.Close() 71 forwarder_instance.Close()
67 72
68 73
69 if __name__ == '__main__': 74 if __name__ == '__main__':
70 main(sys.argv) 75 main(sys.argv)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698