rem: } 
add: this._sInputStream = toSInputStream(this._inputStream, this.binaryMode); } 
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 cls =        Components.classes["@mozilla.org/network/protocol-proxy-service;1"];    var pps = cls.getService(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);    if (jsenv.HAS_STREAM_PROVIDER)    {        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.";        }        }    else    {        /* 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);        if (!this._outputStream)            throw "Error getting output stream.";        this._inputStream = this._transport.openInputStream(openFlags, 0, 0);        if (!this._inputStream)            throw "Error getting input stream.";    }    this.connectDate = new Date();    this.isConnected = true;    return this.isConnected;  }
meta: 1622	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1622/93cb913fccf4589413ab30a8b78021af11c7dffa/connection-xpcom.js/buggy/js/lib/connection-xpcom.js