Namespaces | |
| test_constants | |
| test_control | |
| test_coverage | |
Functions | |
| def | bound_socket (bind_address='localhost', port=0, listen=True, sock_options=_DEFAULT_SOCK_OPTIONS) |
| def | get_socket (bind_address='localhost', port=0, listen=True, sock_options=_DEFAULT_SOCK_OPTIONS) |
Variables | |
| tuple | _DEFAULT_SOCK_OPTIONS |
| tuple | _UNRECOVERABLE_ERRNOS = (errno.EADDRINUSE, errno.ENOSR) |
| def tests.unit.framework.common.bound_socket | ( | bind_address = 'localhost', |
|
port = 0, |
|||
listen = True, |
|||
sock_options = _DEFAULT_SOCK_OPTIONS |
|||
| ) |
Opens a socket bound to an arbitrary port.
Useful for reserving a port for a system-under-test.
Args:
bind_address: The host to which to bind.
port: The port to which to bind.
listen: A boolean value indicating whether or not to listen on the socket.
sock_options: A sequence of socket options to apply to the socket.
Yields:
A tuple containing:
- the address to which the socket is bound
- the port to which the socket is bound
Definition at line 76 of file src/python/grpcio_tests/tests/unit/framework/common/__init__.py.
| def tests.unit.framework.common.get_socket | ( | bind_address = 'localhost', |
|
port = 0, |
|||
listen = True, |
|||
sock_options = _DEFAULT_SOCK_OPTIONS |
|||
| ) |
Opens a socket.
Useful for reserving a port for a system-under-test.
Args:
bind_address: The host to which to bind.
port: The port to which to bind.
listen: A boolean value indicating whether or not to listen on the socket.
sock_options: A sequence of socket options to apply to the socket.
Returns:
A tuple containing:
- the address to which the socket is bound
- the port to which the socket is bound
- the socket object itself
Definition at line 26 of file src/python/grpcio_tests/tests/unit/framework/common/__init__.py.
|
private |
Definition at line 20 of file src/python/grpcio_tests/tests/unit/framework/common/__init__.py.
|
private |
Definition at line 23 of file src/python/grpcio_tests/tests/unit/framework/common/__init__.py.