Crate solana_net_utils

Source
Expand description

The net_utils module assists with networking

Structs§

SocketConfig
UdpSocketPair
A data type representing a public Udp socket

Constants§

DEFAULT_IP_ECHO_SERVER_THREADS
MAX_PORT_COUNT_PER_MESSAGE
MINIMUM_IP_ECHO_SERVER_THREADS
MINIMUM_VALIDATOR_PORT_RANGE_WIDTH
VALIDATOR_PORT_RANGE

Functions§

bind_common
binds both a UdpSocket and a TcpListener
bind_common_in_rangeDeprecated
bind_common_in_range_with_config
bind_common_with_config
binds both a UdpSocket and a TcpListener on the same port
bind_in_range
bind_in_range_with_config
bind_more_with_config
bind_to
bind_to_localhost
bind_to_unspecified
bind_to_with_config
bind_to_with_config_non_blocking
bind_two_in_range_with_offset
bind_two_in_range_with_offset_and_config
bind_with_any_portDeprecated
bind_with_any_port_with_config
find_available_port_in_range
Searches for an open port on a given binding ip_addr in the provided range.
get_cluster_shred_version
Retrieves cluster shred version from Entrypoint address provided.
get_cluster_shred_version_with_binding
Retrieves cluster shred version from Entrypoint address provided, binds client-side socket to the IP provided.
get_public_ip_addr
Determine the public IP address of this machine by asking an ip_echo_server at the given address.
get_public_ip_addr_with_binding
Determine the public IP address of this machine by asking an ip_echo_server at the given address. This function will bind to the provided bind_addreess.
ip_echo_server
Starts a simple TCP server that echos the IP address of any peer that connects Used by functions like |get_public_ip_addr| and |get_cluster_shred_version|
is_host
is_host_port
multi_bind_in_rangeDeprecated
multi_bind_in_range_with_config
binds num sockets to the same port in a range with config
parse_host
parse_host_port
parse_port_or_addr
parse_port_range
verify_all_reachable_tcp
Checks if all of the provided TCP ports are reachable by the machine at ip_echo_server_addr. Tests must complete within timeout provided. Tests will run concurrently when possible, using up to 64 threads for IO. This function assumes that all sockets are bound to the same IP, and will panic otherwise.
verify_all_reachable_udp
Checks if all of the provided UDP ports are reachable by the machine at ip_echo_server_addr. Tests must complete within timeout provided. Tests will run concurrently when possible, using up to 64 threads for IO. This function assumes that all sockets are bound to the same IP, and will panic otherwise
verify_reachable_portsDeprecated
Checks if all of the provided TCP/UDP ports are reachable by the machine at ip_echo_server_addr. Tests must complete within timeout provided. Tests will run concurrently when possible, using up to 64 threads for IO. This function assumes that all sockets are bound to the same IP, and will panic otherwise

Type Aliases§

IpEchoServer
PortRange