Exemplo n.º 1
0
def endpoint(text):
    addr, port = splitaddress(text.strip())
    host = addr if ishost(addr) else ip_to_host(addr)
    if port is not None and not isport(port):
        raise ValueError(port)
    return host, port
Exemplo n.º 2
0
def is_endpoint(value):
    host, port = splitaddress(value)
    return is_host(host) and is_port(port)
Exemplo n.º 3
0
def socket(text):
    addr, port = splitaddress(text.strip())
    ip = addr if isip(addr) else host_to_ip(addr)
    if port is not None and not isport(port):
        raise ValueError(port)
    return ip, port
Exemplo n.º 4
0
def is_socket(value):
    ip, port = splitaddress(value)
    return isip(ip) and is_port(port)
Exemplo n.º 5
0
def endpoint(text):
    addr, port = splitaddress(text.strip())
    host = addr if ishost(addr) else ip_to_host(addr)
    if port is not None and not isport(port):
        raise ValueError(port)
    return host, port
Exemplo n.º 6
0
def socket(text):
    addr, port = splitaddress(text.strip())
    ip = addr if isip(addr) else host_to_ip(addr)
    if port is not None and not isport(port):
        raise ValueError(port)
    return ip, port
Exemplo n.º 7
0
def isendpoint(value):
    host, port = splitaddress(value)
    return ishost(host) and isport(port)
Exemplo n.º 8
0
def issocket(value):
    ip, port = splitaddress(value)
    return isip(ip) and isport(port)