2011年(264)
分类: Python/Ruby
2011-05-21 21:26:22
Status:
";
try
{
if($have_ssl)
{
$p = $ICE->stringToProxy("hello:tcp -p 10000:udp -p 10000:ssl -p 10001");
}
else
{
$p = $ICE->stringToProxy("hello:tcp -p 60012:udp -p 60012");
}
if(isset($_POST["mode"]))
{
if($_POST["mode"] == "oneway")
{
$p = $p->ice_oneway();
}
elseif($_POST["mode"] == "datagram")
{
$p = $p->ice_datagram();
}
}
$delay = 0;
if(isset($_POST["secure"]) and $_POST["secure"] == "yes")
{
$p = $p->ice_secure(true);
}
if(isset($_POST["timeout"]) and $_POST["timeout"] == "yes")
{
$p = $p->ice_timeout(2000);
}
if(isset($_POST["delay"]) and $_POST["delay"] == "yes")
{
$delay = 2500;
}
if($p->ice_isTwoway())
{
$hello = $p->ice_checkedCast("::Demo::Hello");
}
else
{
$hello = $p->ice_uncheckedCast("::Demo::Hello");
}
if(isset($_POST["sayHello"]))
{
$hello->sayHello($delay);
$res=$hello->test(“this string return from python”); //我Eng很烂
}
elseif(isset($_POST["shutdown"]))
{
$hello->shutdown();
}
echo "OK
";
}
catch(Ice_LocalException $ex)
{
echo "
";
print_r($ex);
echo "
";
}
echo "
=$res;?>