context: function net_doconnect(e){    var c;        if ("primServ" in this && this.primServ.connection.isConnected)        return true;    var ev;    if (this.connectAttempt++ >= this.MAX_CONNECT_ATTEMPTS)    {        ev = new CEvent ("network", "error", this, "onError");        ev.server = this;        ev.debug = "Connection attempts exhausted, giving up.";        ev.errorCode = JSIRC_ERR_EXHAUSTED;        this.eventPump.addEvent (ev);                return false;    }    this.connecting = true; /* connection is considered "made" when serve                             * sends a 001 message (see server.on001) */    try    {        c = new CBSConnection();    }    catch (ex)    {        ev = new CEvent ("network", "error", this, "onError");        ev.server = this;        ev.debug = "Couldn't create socket :" + ex;        ev.errorCode = JSIRC_ERR_NO_SOCKET;        ev.exception = ex;        this.eventPump.addEvent (ev);        return false;    }    var host = this.nextHost++;    if (host >= this.serverList.length)    {        this.nextHost = 1;        host = 0;    }    ev = new CEvent ("network", "startconnect", this, "onStartConnect");    ev.debug = "Connecting to " + this.serverList[host].name + ":" +                   this.serverList[host].port + ", attempt " + this.connectAttempt +               " of " + this.MAX_CONNECT_ATTEMPTS + "...";    ev.host = this.serverList[host].name;    ev.port = this.serverList[host].port;    ev.connectAttempt = this.connectAttempt;    this.eventPump.addEvent (ev);    var connected = false;        if (c.connect (this.serverList[host].name, this.serverList[host].port,                   (void 0), true, null))    {        var ex;        ev = new CEvent ("network", "connect", this, "onConnect");        try        {            var password = ("password" in this.serverList[host]) ?                this.serverList[host].password : "";                            ev.server = this.primServ = new CIRCServer (this, c, password);            this.eventPump.addEvent (ev);            connected = true;        }        catch (ex)        {            dd ("Caught following exception creating new CIRCServer in " +                "CIRCNetwork::onDoConnect().\n" + dumpObjectTree(ex));        }    }        if (!connected)    { /* connect failed, try again  */        ev = new CEvent ("network", "do-connect", this, "onDoConnect");        this.eventPump.addEvent (ev);    }    return true;}
meta: 3298	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3298/377dd328ba12f71ca976ba1a877bf8881dae0beb/irc.js/buggy/js/lib/irc.js