rem: {   /* no nspr event queues in this environment, we can't use async calls, * so set up the streams. */ this._outputStream = this._transport.openOutputStream(0, -1, 0); 
add: { /* use new necko interfaces */ this._transport = this._sockService.createTransport(null, 0, host, port, info); if (!this._transport) throw ("Error creating transport.");  /* if we don't have an event queue, then all i/o must be blocking */ var openFlags; if (jsenv.HAS_NSPR_EVENTQ) openFlags = 0; else openFlags = Components.interfaces.nsITransport.OPEN_BLOCKING;  /* no limit on the output stream buffer */ this._outputStream = this._transport.openOutputStream(openFlags, 4096, -1); 
context: function bc_connect(host, port, bind, tcp_flag, observer){    if (typeof tcp_flag == "undefined")		tcp_flag = false;        this.host = host.toLowerCase();    this.port = port;    this.bind = bind;    this.tcp_flag = tcp_flag;    // Lets get a transportInfo for this    var pps = Components.classes["@mozilla.org/network/protocol-proxy-service;1"].        getService().        QueryInterface(Components.interfaces.nsIProtocolProxyService);    if (!pps)        throw ("Couldn't get protocol proxy service");    var ios = Components.classes["@mozilla.org/network/io-service;1"].      getService(Components.interfaces.nsIIOService);    var spec = "irc://" + host + ':' + port;    var uri = ios.newURI(spec,null,null);    var info = pps.examineForProxy(uri);    this._transport = this._sockService.createTransport (host, port, info,                                                         0, 0);    if (!this._transport)        throw ("Error creating transport.");    if (jsenv.HAS_NSPR_EVENTQ)     {   /* we've got an event queue, so start up an async write */        this._streamProvider = new StreamProvider (observer);        this._write_req =            this._transport.asyncWrite (this._streamProvider, this,                                        0, -1, 0);    }    else    {   /* no nspr event queues in this environment, we can't use async calls,         * so set up the streams. */        this._outputStream = this._transport.openOutputStream(0, -1, 0);        if (!this._outputStream)            throw "Error getting output stream.";        this._inputStream =            toScriptableInputStream(this._transport.openInputStream (0, -1, 0));        if (!this._inputStream)            throw "Error getting input stream.";    }        this.connectDate = new Date();    this.isConnected = true;    return this.isConnected;  }
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/8f284ed9848d6db142a5798c9d731ec02e0492e2/connection-xpcom.js/buggy/extensions/irc/js/lib/connection-xpcom.js