import socket


def port_check(address, port, timeout=5):
    """Check if `address`:`port` can be reached within `timeout`

    Parameters
    ----------
    address : str
        * hostname/ip address to check `port` on
    port : int
        * port to check on `address`
    timeout : int, optional
        * timeout after N seconds of not being able to connect

    Returns
    -------
    :mod:`socket` or False :
        * if connection succeeds, the socket object is returned, else False is returned
    """
    try:
        return socket.create_connection((address, port), timeout)
    except socket.error:
        return False