OLD | NEW |
1 # Copyright 2016 The LUCI Authors. All rights reserved. | 1 # Copyright 2016 The LUCI Authors. All rights reserved. |
2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
4 | 4 |
5 import collections | 5 import collections |
6 import contextlib | 6 import contextlib |
7 import json | 7 import json |
8 import os | 8 import os |
9 import socket | 9 import socket |
10 import sys | 10 import sys |
11 import threading | 11 import threading |
12 import types | 12 import types |
13 | 13 |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 if not os.path.exists(value): | 425 if not os.path.exists(value): |
426 raise ValueError('UNIX domain socket [%s] does not exist.' % (value,)) | 426 raise ValueError('UNIX domain socket [%s] does not exist.' % (value,)) |
427 return cls(value) | 427 return cls(value) |
428 | 428 |
429 def _connect_raw(self): | 429 def _connect_raw(self): |
430 sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) | 430 sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) |
431 sock.connect(self._path) | 431 sock.connect(self._path) |
432 return sock | 432 return sock |
433 | 433 |
434 _default_registry.register_protocol('unix', _UnixDomainSocketStreamClient) | 434 _default_registry.register_protocol('unix', _UnixDomainSocketStreamClient) |
OLD | NEW |