标签:style http io color ar sp on art cti
分为客户端和服务端
1.服务端:
class ProfitserverAction extends Action {
public function index(){
Vendor(‘phpRPC.phprpc_server‘); //服务器 这是重点要导入这个包
function tranOrders($num=50){
//省略这一打段代码
}
return $data;
}
set_time_limit(0);
$server = new PHPRPC_Server();//实例化
$server->add(‘tranOrders‘);//
$server->add(‘updateState‘);
$server->start();
}
2客户端:
<?php
include ("php/phprpc_client.php");
$client = new PHPRPC_Client(‘http://127.0.0.1/server.php‘);
echo $client->tranOrders();
?>
标签:style http io color ar sp on art cti
原文地址:http://www.cnblogs.com/kobigood/p/4088230.html