CIRCServer.connect Member
Syntax
object.connect(password);
Arguments
Argument | Summary |
---|---|
password |
Returns
Remarks
See Also
Source Code
function serv_connect (password)
{
try
{
this.connection = new CBSConnection();
}
catch (ex)
{
ev = new CEvent ("server", "error", this, "onError");
ev.server = this;
ev.debug = "Couldn't create socket :" + ex;
ev.errorCode = JSIRC_ERR_NO_SOCKET;
ev.exception = ex;
this.parent.eventPump.addEvent (ev);
return false;
}
var config = { isSecure: this.isSecure };
if (this.parent.PROXY_TYPE_OVERRIDE)
config.proxy = this.parent.PROXY_TYPE_OVERRIDE;
if (this.connection.connect(this.hostname, this.port, config))
{
var ev = new CEvent("server", "connect", this, "onConnect");
if (password)
this.password = password;
ev.server = this;
this.parent.eventPump.addEvent (ev);
this.isConnected = true;
if (jsenv.HAS_NSPR_EVENTQ)
this.connection.startAsyncRead(this);
else
this.parent.eventPump.addEvent(new CEvent("server", "poll", this,
"onPoll"));
}
return true;
}