-
March 11th, 2022, 07:02 AM
#1
Remote adapter not connecting with my LS client in React native
I have used below code to connect the LS client with LS server, but this always saying connection status as disconnected , this I have tried by using react native as client and java remote adapter,
title: chenge URL and add confige to lightStreamer with react native / my lightStreamer status is DISCONNECTED after change URL and add user name confige Although i did change in (stockList,ADAPTER_SET,DATA_ADAPTER,FIELDS) and i chenged setupLightstreamerItemsSubscription function to
setupLightstreamerItemsSubscription() { constmyClient = newLightstreamerClient(Constant.SERVER_ADDRESS, Constant.ADAPTER_SET) myClient.connectionOptions.setHttpExtraHeaders({"username" :"lmxwinbullliteapp"}) myClient.connectionOptions.setHttpExtraHeadersOnSessionCreationOnly(true) /* React class instance reference */constthat = this; myClient.addListener({ onStatusChange:function(newStatus) { console.log(newStatus); varsplittedStatus = newStatus.split(':'); that.setState({ status:splittedStatus.length === 2 ? Constant.STATUS_DECODE[splittedStatus[1]] : splittedStatus[0] }); } }); myClient.connect(); // return myClient-+constmySubscription = newSubscription("MERGE", Constant.ITEMS, Constant.FIELDS); mySubscription.setDataAdapter(Constant.DATA_ADAPTER); mySubscription.setRequestedSnapshot("yes"); mySubscription.addListener({ onSubscription:function() { console.log("SUBSCRIBED"); }, onUnsubscription:function() { console.log("UNSUBSCRIBED"); }, onItemUpdate:function(obj) { console.log("UPDATE FOR " + obj.getValue("stock_name")); that.updateState(obj) } }); myClient.subscribe(mySubscription); } componentDidMount() { this.eventEmitter = new EventEmitter(); this.setupLightstreamerItemsSubscription(); }
Similar Threads
-
By rvkvino in forum General
Replies: 12
Last Post: July 2nd, 2020, 05:01 PM
-
By kgstefan88 in forum Client SDKs
Replies: 2
Last Post: October 19th, 2017, 01:54 PM
-
By kgstefan88 in forum Client SDKs
Replies: 3
Last Post: July 25th, 2017, 09:14 AM
-
By thanie2001 in forum Client SDKs
Replies: 5
Last Post: August 20th, 2009, 10:38 AM
-
Replies: 1
Last Post: March 15th, 2007, 02:44 PM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 08:06 PM.
Bookmarks