Skip to content

octoprint.util.net#

address_for_client(host, port, timeout=3.05, addresses=None, interfaces=None, ignored=None) #

Determines the address of the network interface on this host needed to connect to the indicated client host and port.

interface_addresses(family=None, interfaces=None, ignored=None) #

Retrieves all of the host's network interface addresses.

server_reachable(host, port, timeout=3.05, proto='tcp', source=None) #

Checks if a server is reachable

Parameters:

Name Type Description Default
host str

host to check against

required
port int

port to check against

required
timeout float

timeout for check

3.05
proto str

tcp or udp

'tcp'
source str

optional, socket used for check will be bound against this address if provided

None

Returns:

Name Type Description
boolean

True if a connection to the server could be opened, False otherwise

Back to top