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


PHP jsonRPCClient::message方法代码示例

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


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

示例1: microtime

 if (strcasecmp($theProblem[$clientID], "kt1apart") == 0 || strcasecmp($theProblem[$clientID], "kt1asolved") == 0) {
     continue;
 }
 // If load has failed don't attempt any solution steps.
 if (array_key_exists($clientID, $loadFailed) && $loadFailed[$clientID] && in_array($method, $methods) && strcmp($method, "close-problem") != 0) {
     continue;
 }
 // Remove Done button from some problems, ignore
 // associated button events.
 // problems commit 6376f20fd808, Nov 19 2011
 if (strcmp($method, "solution-step") == 0 && doneButtonProblem($theProblem[$clientID]) && isset($a->params) && isset($a->params->id) && strpos($a->params->id, "doneButton") !== false) {
     continue;
 }
 // Send query to help server.
 $queryStart = microtime(true);
 $newResponse = $server->message($action, $thisClientID);
 $dt = microtime(true) - $queryStart;
 $serverTime += $dt;
 // See if this is the last turn in a session
 // Or if the server has closed the session and
 // the problem has not already been closed.
 // Then close the session.
 if (($lastID[$clientID] == $ttID || strpos($response, "Your session is no longer active.") !== false) && !(array_key_exists($clientID, $lastTime) && $lastTime[$clientID] == -2)) {
     // Close the session "by hand" and record
     $closeID = $a->id + 1;
     $closeAction = "{\"id\":{$closeID},\"method\":\"close-problem\",\"params\":{},\"jsonrpc\":\"2.0\"}";
     $closeResponse = $server->message($closeAction, $thisClientID);
     $closeTime = $sessionStartTime[$clientID];
     $closeSession[$clientID] = "<td>{$closeTime}</td>" . $sessionLink1 . "&amp;cid=" . $clientID . $sessionLink2 . "<td>{$closeResponse}</td>";
 }
 // Determine if problem load failed, set variable
开发者ID:bvds,项目名称:andes,代码行数:31,代码来源:steps.php

示例2: microtime

         continue;
     }
 }
 $a = $json->decode($action);
 // Drop turns without method.
 if (!isset($a->method)) {
     continue;
 }
 $method = $a->method;
 // If load has failed don't attempt any solution steps.
 if ($loadFailed && in_array($method, $methods) && strcmp($method, "close-problem") != 0) {
     continue;
 }
 // Send query to help server.
 $queryStart = microtime(true);
 $newResponse = $server->message($action, $sessionIdBase . $sessionId);
 $dt = microtime(true) - $queryStart;
 $serverTime += $dt;
 // Determine if problem load failed, set variable
 if (strcmp($method, "open-problem") == 0 && preg_match('/PROBLEM-LOAD-FAILED/', $newResponse) != 0) {
     $loadFailed = true;
 }
 // Problem might be closed later by server.
 // No attempt here to remove "out of focus" since we
 // don't have that working yet.
 if (isset($a->params->time) && strcmp($method, "close-problem") != 0) {
     $ttime = $a->params->time;
 }
 if (isset($methodTime[$method])) {
     $methodTime[$method] += $dt;
 } else {
开发者ID:bvds,项目名称:andes,代码行数:31,代码来源:sessions.php


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