The network_utils.py
module#
Summary#
Check for valid IP address. |
|
Check for valid port number. |
|
Create an insecure gRPC channel. |
Description#
Provides network connection utility functions.
Module detail#
- network_utils.check_valid_ip(ip)#
Check for valid IP address.
- network_utils.check_valid_port(port, lower_bound=1024, high_bound=65535)#
Check for valid port number.
- network_utils.create_channel(target: str, max_rcv_msg_len: int = MAX_RCV_MSG_LEN)#
Create an insecure gRPC channel.
- Parameters:
- target: str
IP address of the host to connect to, of the form
host:port
.- max_rcv_msg_len: int
Size, in bytes, of the buffer used to receive messages. Default is
MAX_RCV_MSG_LEN
.
- Returns:
- channel:
grpc.Channel
Insecure gRPC channel.
- channel:
- network_utils.MAX_RCV_MSG_LEN#