Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Member
    Join Date
    Apr 2007
    Location
    Stoke-on-Trent
    Posts
    18

    Web client not receiving any data?

    I have my Lighstreamer server set up to have a single data adapter, which is actually using the supplied Adapter Proxy. I then also have a Remote Server which is using the .NET components to connect to this Adapter Proxy, and this works fine. I also have a .NET client which can connect to the same data adapter and on subscribing it gets a snapshot of the data sent to it and updates/deletes to the data from the Remote Server app are also received by the client. No problems there then

    Now, I've moved on to setting up a web client and followed the instructions in the "Web Client Tutorial" PDF document to do this. I've put together a simple single HTML page which is hosted on a web server which the Lightstreamer server is not running on,, I have entries in my hosts file to make the webserver and LS server appear to be in the same domain. My page contains a single HTML table which I am using as an OverWriteTable as the tutorial describes.

    When I display the page I can see from the LS server's log file that it is accepting the connection from the push page and within my page itself I am displaying the status of the LightStreamerEngine object and I can see that this changes to "STREAMING" very shortly after the page loads and stays at that status. If I close the browser with my page in it I can see that LS server logging the fact that an HTTP connection from my PC got closed and a PUMP POOLED THREAD also closes as connection to the same PC. So I believe that my pushpage is succesfully connecting to the LS server.

    However, I set up an event handler for my OverWriteTable's "onStart" event and this never gets fired. The documentation says this event gets fired when the table object is subscribed to the data adapter, so this says to me that my page is not subscribing correctly. The contents of my HTML table also never get updated. I'm using Firefox 2 with the "View Source Chart" Add-in which shows that the contents of attributes of the <div source="lightstreamer"> elements in the <TD> elements of my table have been modified, presumably by the call to my PushPage objects addTable() method.

    My question is, how do the table, item and field attributes of the <div> elements relate to the field names of the data that my Remote Server feeds into the data adapter? Also, given that the Remote Server and my .NET client specify a table name when they connect to the data adapter where would I use this in my web client?

    I guess what I'm asking is how exactly do I relate what's in my data adapter's data tables to what I have in my push page.

  2. #2
    Member
    Join Date
    Apr 2007
    Location
    Stoke-on-Trent
    Posts
    18
    OK, I've sorted this out. My remote server is a VB6 app, which I've mentioned in threads in other forums. It uses a .NET interop component of ours to utilise the .NET .DLL file which is supplied with the SDK in order to connect to the Adapter Proxy. Turns our that this component only ever creates data adapter tables which are in COMMAND mode. The tutorial uses an OverwriteTable() which is only really good for merge mode. I've just spent the last few minutes converting my prototype web client to use a DynaMetapush table instead and this worked first time.

  3. #3
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    Good. As your questions were expressed in general terms, we assume that you also don't need a general answer anymore.
    Dario

  4. #4
    Member
    Join Date
    Apr 2007
    Location
    Stoke-on-Trent
    Posts
    18
    Quote Originally Posted by DarioCrivelli
    Good. As your questions were expressed in general terms, we assume that you also don't need a general answer anymore.
    Dario
    Correct. I still don't get the event being fired that I described originally, though.

    Also, my web client subscribes to the table asking for a snapshot but it only gets a snapshot delivered to it if some other client is already connected. What I mean is, I start up my remote server, add a few items to the table, then start my web client and it gets nothing delivered to it. However, if I do what I just described but have a .NET client subscribed to the table while the items are being added and THEN connect the web client then I get all the items delivered to it in a snapshot as I expect. Is this behaviour by design or do we have something not quite right in our remote server application?

  5. #5
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    Quote Originally Posted by TonyRoberts
    I still don't get the event being fired that I described originally, though.
    As a first step, may you please check that you are not referring to a later jsdoc?
    Note that "onStart" was introduced in Web Client Library quite recently (version 4.1 build 1261).

    About the snapshot, note that, indeed, any update event for an item (let's call it ITEM) sent by the Data Adapter before ITEM is ever subscribed to (i.e. before the first client subscribes to ITEM) is ignored.

    All updates for ITEM coming from the feed before the subscription should be kept by the Data Adapter; then, upon the subscription, they can be sent by the Data Adapter to the Server as the item snapshot.
    Alternatively, the Data Adapter should, in turn, ask its feed for updates for ITEM only upon the subscription; at that moment, it could also ask the feed for the current item state and send it as the snapshot.
    In both cases, the Server forwards this snapshot to the first client; then it takes care of managing the snapshot for the subsequent clients.

    This requirement may complicate the Data Adapter somewhat. However, your tests already include a workaround for this. If you can subscribe to ITEM from a dummy client when the item state is still empty, then your Data Adapter can always send an empty snapshot and just forward the updates to the Server, which will produce suitable snapshots for ITEM for the real clients.

    Dario

  6. #6
    Member
    Join Date
    Apr 2007
    Location
    Stoke-on-Trent
    Posts
    18
    Quote Originally Posted by DarioCrivelli
    As a first step, may you please check that you are not referring to a later jsdoc?
    Note that "onStart" was introduced in Web Client Library quite recently (version 4.1 build 1261).
    I'll check, but as far as I am aware I'm using the jsdoc for the actual version I'm using

    Quote Originally Posted by DarioCrivelli
    About the snapshot, note that, indeed, any update event for an item (let's call it ITEM) sent by the Data Adapter before ITEM is ever subscribed to (i.e. before the first client subscribes to ITEM) is ignored.
    Right, I'd worked out that this is what's going on. Good to have it confirmed though.


    Quote Originally Posted by DarioCrivelli
    If you can subscribe to ITEM from a dummy client when the item state is still empty, then your Data Adapter can always send an empty snapshot and just forward the updates to the Server, which will produce suitable snapshots for ITEM for the real clients.
    Dario
    Yes, this does do exactly that.

  7. #7
    Member
    Join Date
    Apr 2007
    Location
    Stoke-on-Trent
    Posts
    18
    Quote Originally Posted by DarioCrivelli
    As a first step, may you please check that you are not referring to a later jsdoc?
    Note that "onStart" was introduced in Web Client Library quite recently (version 4.1 build 1261).
    Dario
    The version.txt in my sdk_client_web folder says:

    Lightstreamer Web Client Library version 4.1 build 1275

    So I assume this means I have a version which should fire these events, then?

  8. #8
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    Yes
    and I could see "onStart" working, both with 1275 and with the current library version.
    For a further check, please ensure that the code in your lspushpage.js starts with:
    var LS_pushpageSrcRev=" 405 $"
    If you still have problems, may you please send us any code for a check?

  9. #9
    Member
    Join Date
    Apr 2007
    Location
    Stoke-on-Trent
    Posts
    18
    Quote Originally Posted by DarioCrivelli
    Yes
    For a further check, please ensure that the code in your lspushpage.js starts with:
    It does start with that.

  10. #10
    Member
    Join Date
    Apr 2007
    Location
    Stoke-on-Trent
    Posts
    18
    Quote Originally Posted by DarioCrivelli
    Yes
    and I could see "onStart" working, both with 1275 and with the current library version.
    For a further check, please ensure that the code in your lspushpage.js starts with:

    var LS_pushpageSrcRev=" 405 $";
    My lspushpage.js does start with that, but the code in that javascript source file makes no reference to onStart. I recently downloaded from your website a new Lightstreamer.zip file and the lspushpage.js in there starts with:

    var LS_pushpageSrcRev=" 481 $";

    And this sourcecode DOES contain references to an onStart property of the Table() object and will call the function associated with it. I therefore conclude that my original javascript simply doesn't support onStart. I haven't switched over to the newer version and tried it yet.

 

 

Similar Threads

  1. Replies: 5
    Last Post: December 23rd, 2010, 09:34 AM
  2. Please help to fetch data to client
    By phancongphuoc in forum Adapter APIs
    Replies: 1
    Last Post: December 16th, 2010, 08:57 AM
  3. Client receive old data after some time.
    By mnenchev in forum General
    Replies: 3
    Last Post: November 25th, 2009, 03:27 PM
  4. data not coming to web client
    By rd2008 in forum Client APIs
    Replies: 8
    Last Post: February 11th, 2009, 01:13 PM
  5. Replies: 2
    Last Post: May 15th, 2008, 10:25 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 06:52 AM.