I have referred LightStreamer Demo and i have written the adapter in c#.
In StandaloneLauncher.cs(in main function) file i have modified as
string host = "localhost";
int rrPortMD = 6650;
int rrPortD = 6651;
int notifPortD = 6652;
string name = null;
and i have modified the code in ExternalfeedSimulater.cs file with my real time data.
And also i have created the adapters.xml file as
<adapters_conf id="GARGTEST">
<metadata_provider>
<adapter_class>com.lightstreamer.adapters.remote.metadata.NetworkedMetadataProvider</adapter_class>
<param name="request_reply_port">6652</param>
<param name="connection_recovery_timeout_millis">10000</param>
<param name="first_connection_timeout_millis">10000</param>
<param name="close_notifications_recovery">unneeded</param>
</metadata_provider>
<data_provider name="GARGADAPTER">
<adapter_class>com.lightstreamer.adapters.remote.data.NetworkedDataProvider</adapter_class>
<param name="request_reply_port">6650</param>
<param name="notify_port">6651</param>
<param name="connection_recovery_timeout_millis">10000</param>
<param name="events_recovery">use_snapshot</param>
</data_provider>
</adapters_conf>
My client file looking like,
<script>
var hostToUse = document.location.protocol == "file:" ? "
http://localhost:8080/" : document.location.protocol+"//"+document.location.hostname+(document.location.port?":"+document.location.port:"");
define("lsClient",["LightstreamerClient","StatusWidget"],function(LightstreamerClient,StatusWidget) {
var lsClient = new LightstreamerClient("
http://localhost:8880/","GARGTEST");
lsClient.connectionSharing.enableSharing("RemoteStockListConnection", "ATTACH", "CREATE");
lsClient.addListener(new StatusWidget("left", "0px", true));
lsClient.connect();
return lsClient;
});
</script>
<script type="text/javascript">
require(["lsClient","Subscription","StaticGrid"],
function(lsClient,Subscription,StaticGrid) {
var stocksGrid = new StaticGrid("stocks",true);
stocksGrid.setAutoCleanBehavior(true,false);
stocksGrid.addListener({
onVisualUpdate: function(key,info) {
if (info == null) {
return;
}
var cold = (key.substring(4) % 2 == 1) ? "#eeeeee" : "#ddddee";
info.setAttribute("yellow", cold, "backgroundColor");
}
});
var stockSubscription = new Subscription("MERGE",stocksGrid.extractItemList(),stocksGrid.extractFieldList());
stockSubscription.addListener(stocksGrid);
stockSubscription.setDataAdapter("GARGADAPTER");
stockSubscription.setRequestedSnapshot("yes");
lsClient.subscribe(stockSubscription);
});
</script>
In Lightstreamer/adapters/gargtest/lib i had put the file ls-proxy-adapters.jar
But when i run this code getting error
http://localhost:8880/lightstreamer/create_session.js creation failed(continuously trying to connect session but getting error)