本文整理匯總了PHP中connection::bind方法的典型用法代碼示例。如果您正苦於以下問題:PHP connection::bind方法的具體用法?PHP connection::bind怎麽用?PHP connection::bind使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類connection
的用法示例。
在下文中一共展示了connection::bind方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: reconnect
public function reconnect()
{
$this->updateContext();
try {
$this->connectStartTime = time();
$conn = new connection($this->getClientConf('server'), $this->getClientConf('port'), CONNECT_TIMEOUT);
$this->conn = $conn;
$conn->setSocketClass($this->socketClass);
$conn->setIrcClass($this);
$conn->setCallbackClass($this);
$conn->setTimerClass($this->timerClass);
$conn->init();
if ($conn->getError()) {
throw new ConnectException($conn->getErrorMsg());
}
//Bind socket...
if ($this->getClientConf('bind') != "") {
$conn->bind($this->getClientConf('bind'));
}
$this->sockInt = $conn->getSockInt();
$conn->connect();
} catch (ConnectException $e) {
$this->beginReconnectTimer();
$this->status = STATUS_ERROR;
$this->exception = $e;
return;
}
$this->status = STATUS_CONNECTING;
$this->updateContext();
return;
}