YaHoo
In the internet I can't find an example of PHP application in lightstreamer hence I write it. Just save as in the file and type "php filename.php".
PHP Code:
<?
$server = '127.0.0.1';
$syncPort = 7001;
$asyncPort = 7002;
$control = fsockopen($server, $syncPort, $errno, $errstr, 5) or die($errno." : ".$errstr."\n");
$feed = fsockopen($server, $asyncPort, $errno, $errstr, 5) or die($errno." : ".$errstr."\n");
$greeting = fscanf($control, "%s\n");
$sid = explode('|', $greeting[0]);
$sid = $sid[0];
fwrite($control, $sid."|SUB|V\n");
$cnt = 0;
while (true) {
$qry = "0|UD3|S|greetings|S|".$sid."|B|0|S|message|S|Do you count the following?|S|timestamp|S|Count: ".$cnt."\n";
fwrite($feed, $qry);
$cnt++;
sleep(2);
}
fclose($feed);
fclose($control);
?>
Bookmarks