how to connect from Flash Media Server 3.5 to Zend_Amf
i want to be able to connect from flash media server 3.5 to Zend_Amf (latest ZendFramework version). i tried doing the following:
function amfresponder ( ) {
this.onResult = function (result) {
trace("Success: " + String(result));
};
this.onStatus = function (fault) {
trace("Error: "+ fault.description);
};
};
application.onConnect = function(client) {
myResponder = new amfresponder();
connection = new NetConnection();
connection.connect("http://localhost/AmfServer.php");
trace("checking connection");
connection.call("isConnected",myResponder);
return true;
}
i see in the apache access log that a request for AmfServer.php was made but nothing is returned, not even an error message. on the fms admin log i only see 'checking connection'.
update
A different approach:
application.isFine_Status = function(info) {
for(var item in info) {
trace(item + " " + info[item]);
}
}
application.isFine_Result = function(res) {
trace(res);
}
application.onAppStart = function() {
trace("application started");
NetServices.setD开发者_开发技巧efaultGatewayUrl("http://localhost/AmfServer.php");
this.gatewayconn = NetServices.createGatewayConnection();
this.pservice = this.gatewayconn.getService('PrivateFunc',this);
this.pservice.isFine();
}
The Zend_Amf class is:
set_include_path(get_include_path().PATH_SEPARATOR.realpath(__DIR__.'/../').PATH_SEPARATOR.realpath(__DIR__.'/../../include/PEAR-R2'));
require_once('Zend/Amf/Server.php');
require_once('PrivateFunc.php');
$server = new Zend_Amf_Server();
$server->setClass('PrivateFunc','PrivateFunc');
$response = $server->handle();
echo $response;
on both cases i have no results what so ever. any ideas?
You may want to try this code below
setClass("PrivateFunc"); // needed to start the server $handle = $server->handle(); echo($handle); //echo($server->handle()); ?>ok so after a lot of research it seems that currently it is not possible to do a proper connection from adobe flash media server to zend_amf.
i solved the issue by moving from adobe flash media server to it's free solution red5. red5 is java based which provides a very strong programming language, so i converted the relevant code from php to java, and everything (db manipulation) is done in red5 and php is not needed all.
精彩评论