import socket


def port_is_open(host):
    """ Checks whether the port is open.

    Args:
        host: A string has format "ip:port".

    Returns: True if the port is open, False otherwise.
    """
    ip, port = host.strip().split(":")
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    try:
        s.connect((ip, int(port)))
        s.shutdown(2)
        # print '%d is open' % port
        return True
    except:
        # print '%d is down' % port
        return False