Hi guys,
I cant connect my index.html with Lighstreamer Adapter
My current configs below:
Lightstreamer Server (192.168.247.13:8080) -->> Apache Server (192.168.247.14)
My index.html: (lightstreamer.js generated from generator.html, this index.html is on Apache Server)
<!DOCTYPE html>
<html>
<head>
<title>Hello World with Lightstreamer</title>
<script src="lightstreamer.js"></script>
</head>
<body>
<div data-source="lightstreamer" data-grid="hellogrid" data-item="greetings" data-field="message">loading...</div>
<div data-source="lightstreamer" data-grid="hellogrid" data-item="greetings" data-field="timestamp">loading...</div>
<script>
var myClient = new LightstreamerClient("http://192.168.247.13");
myClient.connect();
var grid = new StaticGrid("hellogrid",true);
var subscription = new Subscription("MERGE",grid.extractItemList(),grid.extractFieldList());
subscription.setDataAdapter("MYSOCKET");
subscription.addListener(grid);
myclient.subscribe(subscription);
</script>
</body>
</html>
adapters.xml:
<?xml version="1.0"?>
<adapters_conf id="MYSOCKET">
<metadata_provider>
<adapter_class>com.lightstreamer.adapters.metadata.LiteralBasedProvider</adapter_class>
</metadata_provider>
<data_provider>
<adapter_class>com.lightstreamer.adapters.remote.data.NetworkedDataProvider</adapter_class>
<param name="request_reply_port">7001</param>
<param name="notify_port">7002</param>
<param name="timeout">36000000</param>
</data_provider>
</adapters_conf>
push.php: (Im using this to push data)
<?php
$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);
?>
The browser shows "loading...". Can anyone help me this problem :Smile_Ac: Im completely stucked