'Constructs a :class:`~stem.socket.ControlPort` based Controller.
:param str address: ip address of the controller
:param int port: port number of the controller
:returns: :class:`~stem.control.Controller` attached to the given port
:raises: :class:`stem.SocketError` if we\'re unable to establish a connection'

@staticmethod
def from_port(address='127.0.0.1', port=9051):

    if (not stem.util.connection.is_valid_ipv4_address(address)):
        raise ValueError(('Invalid    IP    address:    %s' % address))
    elif (not stem.util.connection.is_valid_port(port)):
        raise ValueError(('Invalid    port:    %s' % port))
    control_port = stem.socket.ControlPort(address, port)
    return Controller(control_port)
