'get_listeners(listener_type, default = UNDEFINED)
Provides the addresses and ports where tor is listening for connections of
the given type. This is similar to
:func:`~stem.control.Controller.get_ports` but includes listener addresses
and non-local endpoints.
.. versionadded:: 1.2.0
:param stem.control.Listener listener_type: connection type being handled
by the listeners we return
:param object default: response if the query fails
:returns: **list** of **(address, port)** tuples for the available
listeners
:raises: :class:`stem.ControllerError` if unable to determine the listeners
and no default was provided'

@with_default()
def get_listeners(self, listener_type, default=UNDEFINED):

    proxy_addrs = []
    query = ('net/listeners/%s' % listener_type.lower())
    try:
        for listener in self.get_info(query).split():
            if (not (listener.startswith('"') and listener.endswith('"'))):
                raise stem.ProtocolError(("'GETINFO    %s'    responses    are    expected    to    be    quoted:    %s" % (query, listener)))
            elif (':' not in listener):
                raise stem.ProtocolError(("'GETINFO    %s'    had    a    listener    without    a    colon:    %s" % (query, listener)))
            listener = listener[1:(-1)]
            (addr, port) = listener.split(':')
            if (addr == 'unix'):
                continue
            proxy_addrs.append((addr, port))
    except stem.InvalidArguments:
        port_option = {Listener.OR: 'ORPort', Listener.DIR: 'DirPort', Listener.SOCKS: 'SocksPort', Listener.TRANS: 'TransPort', Listener.NATD: 'NatdPort', Listener.DNS: 'DNSPort', Listener.CONTROL: 'ControlPort'}[listener_type]
        listener_option = {Listener.OR: 'ORListenAddress', Listener.DIR: 'DirListenAddress', Listener.SOCKS: 'SocksListenAddress', Listener.TRANS: 'TransListenAddress', Listener.NATD: 'NatdListenAddress', Listener.DNS: 'DNSListenAddress', Listener.CONTROL: 'ControlListenAddress'}[listener_type]
        port_value = self.get_conf(port_option).split()[0]
        for listener in self.get_conf(listener_option, multiple=True):
            if (':' in listener):
                (addr, port) = listener.split(':')
                proxy_addrs.append((addr, port))
            else:
                proxy_addrs.append((listener, port_value))
    for (addr, port) in proxy_addrs:
        if (not stem.util.connection.is_valid_ipv4_address(addr)):
            raise stem.ProtocolError(('Invalid    address    for    a    %s    listener:    %s' % (listener_type, addr)))
        elif (not stem.util.connection.is_valid_port(port)):
            raise stem.ProtocolError(('Invalid    port    for    a    %s    listener:    %s' % (listener_type, port)))
    return [(addr, int(port)) for (addr, port) in proxy_addrs]
