'Create a new instance of the Connection object.
:param pika.connection.Parameters parameters: Connection parameters
:param method on_open_callback: Method to call on connection open
:param method on_open_error_callback: Called if the connection can\'t
be established: on_open_error_callback(connection, str|exception)
:param method on_close_callback: Called when the connection is closed:
on_close_callback(connection, reason_code, reason_text)
:param object ioloop: IOLoop object to use
:param bool stop_ioloop_on_close: Call ioloop.stop() if disconnected
:raises: RuntimeError
:raises: ValueError'

def __init__(self, parameters=None, on_open_callback=None, on_open_error_callback=None, on_close_callback=None, ioloop=None, stop_ioloop_on_close=True):

    if (parameters and (not isinstance(parameters, connection.Parameters))):
        raise ValueError(('Expected    instance    of    Parameters,    not    %r' % parameters))
    if (parameters and parameters.ssl and (not ssl)):
        raise RuntimeError('SSL    specified    but    it    is    not    available')
    self.base_events = (self.READ | self.ERROR)
    self.event_state = self.base_events
    self.ioloop = ioloop
    self.socket = None
    self.stop_ioloop_on_close = stop_ioloop_on_close
    self.write_buffer = None
    super(BaseConnection, self).__init__(parameters, on_open_callback, on_open_error_callback, on_close_callback)
