当前位置: 首页>>代码示例>>PHP>>正文


PHP Net_SSH2::isConnected方法代码示例

本文整理汇总了PHP中Net_SSH2::isConnected方法的典型用法代码示例。如果您正苦于以下问题:PHP Net_SSH2::isConnected方法的具体用法?PHP Net_SSH2::isConnected怎么用?PHP Net_SSH2::isConnected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Net_SSH2的用法示例。


在下文中一共展示了Net_SSH2::isConnected方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: isConnected

 /**
  * @return bool
  */
 public function isConnected()
 {
     return $this->ssh->isConnected();
 }
开发者ID:sayiho,项目名称:Jumper,代码行数:7,代码来源:Ssh.php

示例2: time

}
//send input file to cr2g server
$sftp->mkdir('/code/spopt-stable/tests/' . $session);
$sftp->put($remoteInputFile, $localInputFile, NET_SFTP_LOCAL_FILE);
$sftp->chmod(0777, $remoteInputFile);
//execute python script in this order to run the Solver:
//1. change to directory where solver script is located
$ssh->write("cd /code/spopt-stable\n");
//2. 'read' command to ensure script is called from the proper directory
$ssh->read('rlgruver@cr2g01:/code/spopt-stable$');
//3. run the solver script with the test from the current session
$ssh->write("python SpOpt.py tests/" . $session . "/input.txt\n");
//start timerin case anything gets stuck, will break within 120 minutes (7200 sec)
$starttime = time();
//ssh will break within 120 minutes (7200 sec) regardless of execution status
while ($ssh->isConnected()) {
    $now = time() - $starttime;
    if ($now > 7200) {
        break;
    }
    sleep(3);
    //retrieve all solutions/discarded from cr2g and store in local
    $sftp->get($remoteSolutionsFile, $localSolutionsFile);
    $sftp->get($remoteDiscardedFile, $localDiscardedFile);
    //function to provide discarded solutions during session
    parseDiscarded($session);
    //if final output file gets created from the cr2g sever, store it in local and complete
    if ($sftp->get($remoteOutputFile, $localOutputFile)) {
        $done = "true";
        break;
    }
开发者ID:rlgruver,项目名称:practicum,代码行数:31,代码来源:processOutput.php


注:本文中的Net_SSH2::isConnected方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。