Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import atexit | 5 import atexit |
| 6 import datetime | 6 import datetime |
| 7 import email.utils | 7 import email.utils |
| 8 import errno | 8 import errno |
| 9 import gzip | 9 import gzip |
| 10 import hashlib | 10 import hashlib |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 215 | 215 |
| 216 http_thread = threading.Thread(target=httpd.serve_forever) | 216 http_thread = threading.Thread(target=httpd.serve_forever) |
| 217 http_thread.daemon = True | 217 http_thread.daemon = True |
| 218 http_thread.start() | 218 http_thread.start() |
| 219 return httpd.server_address | 219 return httpd.server_address |
| 220 except socket.error as v: | 220 except socket.error as v: |
| 221 error_code = v[0] | 221 error_code = v[0] |
| 222 print 'Failed to start http server for %s on port %d: %s.' % ( | 222 print 'Failed to start http server for %s on port %d: %s.' % ( |
| 223 str(mappings), host_port, os.strerror(error_code)) | 223 str(mappings), host_port, os.strerror(error_code)) |
| 224 if error_code == errno.EADDRINUSE: | 224 if error_code == errno.EADDRINUSE: |
| 225 print (' Run `fuser %d/tcp` to find out which process is using the port.' | 225 print (' Run `fuser %d/tcp` to find out which process is using the port;' |
|
ppi
2015/08/12 09:24:16
it's just fuser -k %d/tcp, no need for xargs and k
etiennej
2015/08/12 09:25:46
Done.
| |
| 226 % host_port) | 226 % host_port) |
| 227 print (' or use `fuser %d/tcp|xargs kill` terminate it.' % host_port) | |
| 227 print '---' | 228 print '---' |
| 228 raise | 229 raise |
| OLD | NEW |