本文整理匯總了PHP中connection::setTransTimeout方法的典型用法代碼示例。如果您正苦於以下問題:PHP connection::setTransTimeout方法的具體用法?PHP connection::setTransTimeout怎麽用?PHP connection::setTransTimeout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類connection
的用法示例。
在下文中一共展示了connection::setTransTimeout方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
public function init()
{
$this->error = false;
if ($this->loadConfig() === false) {
$this->error = true;
return;
}
$conn = new connection(null, $this->port, 0);
$conn->setSocketClass($this->socketClass);
$conn->setIrcClass($this->ircClass);
$conn->setCallbackClass($this);
$conn->setTimerClass($this->timerClass);
$conn->setTransTimeout(15);
$conn->init();
if ($conn->getError()) {
$this->error == true;
return;
}
$this->httpListener = $conn;
$this->html = $this;
}
示例2: init
public function init()
{
$this->error = false;
if ($this->loadConfig() === false) {
$this->error = true;
return;
}
$conn = new connection(null, $this->port, 0);
$conn->setSocketClass($this->socketClass);
$conn->setIrcClass($this->ircClass);
$conn->setCallbackClass($this);
$conn->setTimerClass($this->timerClass);
$conn->setTransTimeout(15);
$conn->init();
if ($conn->getError()) {
$this->error == true;
return;
}
$this->httpListener = $conn;
//$this->timerClass->addTimer("httpd_check_listeners", $this, "handleSessions", "", 0.25, false);
}
示例3: connect
public function connect()
{
if ($this->host == null || $this->port == null) {
return false;
}
if (!is_object($this->socketClass)) {
return false;
}
if (!is_object($this->ircClass)) {
return false;
}
$conn = new connection($this->host, $this->port, CONNECT_TIMEOUT);
$conn->setSocketClass($this->socketClass);
$conn->setIrcClass($this->ircClass);
$conn->setCallbackClass($this);
$conn->setTimerClass($this->timerClass);
/* Set Timeouts */
$conn->setTransTimeout($this->transTimeout);
$conn->init();
if ($conn->getError()) {
$this->setError("Could not allocate socket");
return false;
}
$this->sockInt = $conn->getSockInt();
$conn->connect();
$this->connection = $conn;
return true;
}
示例4: addFile
public function addFile($nick, $host, $port, $type, $filename, $size, $fromTimer = false)
{
$reverse = false;
if ($this->ircClass->getClientConf("mircdccreverse") != "" && $fromTimer == false && $type != DOWNLOAD) {
$port = intval($this->ircClass->getClientConf("mircdccreverse"));
if ($port == 0) {
return NULL;
}
$args = new argClass();
$args->arg1 = $nick;
$args->arg2 = $host;
$args->arg3 = $port;
$args->arg4 = $type;
$args->arg5 = $filename;
$args->arg6 = $size;
$args->arg7 = time();
$args->arg8 = FILE;
$this->ircClass->notice($nick, "DCC: NOTICE: This server is using the mIRC File Server Protocol. Please use ' /dccserver +s on " . $this->ircClass->getClientConf("mircdccreverse") . " ' to recieve files from me! Starting 6 second delay...", 0);
$this->ircClass->sendRaw("WHOIS " . $nick);
$this->timerClass->addTimer(irc::randomHash(), $this, "reverseTimer", $args, 6);
return;
}
if ($fromTimer == true) {
$reverse = DCC_REVERSE;
// using mIRC dcc reverse protocol
}
if ($host == NULL || $port == NULL) {
$conn = new connection(null, null, 0);
$listening = true;
$status = DCC_LISTENING;
} else {
$conn = new connection($host, $port, CONNECT_TIMEOUT);
$listening = false;
$status = DCC_CONNECTING;
}
$conn->setSocketClass($this->socketClass);
$conn->setIrcClass($this->ircClass);
$conn->setCallbackClass($this);
$conn->setTransTimeout(30);
$conn->setTimerClass($this->timerClass);
$port = $conn->init();
if ($conn->getError()) {
$this->ircClass->log("File transfer start error: " . $conn->getErrorMsg());
return false;
}
$sockInt = $conn->getSockInt();
$id = $this->highestId();
$file = new file($id, $nick, $sockInt, $host, $port, $type, $reverse);
if ($file->transferType == UPLOAD) {
$this->fileUlCount++;
} else {
$this->fileDlCount++;
}
$file->setIrcClass($this->ircClass);
$file->setDccClass($this);
$file->setSocketClass($this->socketClass);
$file->setProcQueue($this->procQueue);
$file->setTimerClass($this->timerClass);
$file->connection = $conn;
$file->status = $status;
$file->removed = false;
$this->dccList[$sockInt] = $file;
$file->initialize($filename, $size);
$conn->setCallbackClass($file);
if ($listening == true) {
$this->timerClass->addTimer(irc::randomHash(), $this, "checkDccTimeout", $file, 30, true);
}
if ($reverse == true) {
$conn->connect();
}
return $port;
}