import socket


def test_connection(server, port):
    """Test connection with url server. Return True is its ok."""
    _return = False
    try:
        _s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        _s.settimeout(3.0)
        _s.connect((server, port))
        _return = True
    except Exception as error:
        pass
    return _return