Method code for $daemon.start_listening()

[Turn on line numbering]
arg @ports;
var p, last, l;

(> .perms(sender()) <);
(| .stop_listening() |);
ports ?= listen;
current_ports = [];
for p in (ports) {
    catch any {
        last = p;
        bind_port(@p);
        current_ports += [p];
        $sys.slog("** Starting " + this() + " on " + .format_listen([p], 1));
    } with {
        p = p.reverse().join(":");
        $sys.slog("** Unable to bind " + this() + " to " + p);
        if (error() != ~bind)
            $sys.log_traceback(traceback(), "LISTEN: " + this() + " " + p);
    }
}
if (!current_ports)
    throw(~daemon, "** " + this() + " NOT LISTENING **");
next_connection = connection.new_connection();

// Created 22-Aug-1995 as a part of ColdCore, see: @help Credit

Tlon