-
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(); }
-
March 11th, 2022, 11:23 AM
#2
Hi rvkvino,
Could you get more details on the reason for the refusal to open a new session for the client?
You could go through the server log, lightstreamer.log, looking for any refusal message, or you could add to the ClientListener of to the client code to log onServerError events to the console as well (https://sdk.lightstreamer.com/ls-web...#onServerError).
In fact, a possible problem could be that the remote adapters are not actually connected and therefore not available.
Regards,
Giuseppe
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 03:25 AM.
Bookmarks